From 7ebe1f1ea3c3622354f88637c475c4fb27f49070 Mon Sep 17 00:00:00 2001 From: MasterPtato <23087326+MasterPtato@users.noreply.github.com> Date: Wed, 26 Jun 2024 21:39:11 +0000 Subject: [PATCH] chore: remove duplicate smithy code (#946) ## Changes --- .../rust-server/rust-server/Cargo.toml | 16 - .../rust-server/rust-server/src/lib.rs | 1 - .../rust-server/rust-server/src/models.rs | 151 - .../api-auth/rust/rust/Cargo.toml | 33 - .../api-auth/rust/rust/src/client.rs | 507 - .../api-auth/rust/rust/src/config.rs | 64 - .../api-auth/rust/rust/src/error.rs | 1238 --- .../api-auth/rust/rust/src/error_meta.rs | 142 - .../api-auth/rust/rust/src/http_serde.rs | 38 - .../api-auth/rust/rust/src/input.rs | 508 - .../api-auth/rust/rust/src/json_deser.rs | 559 - .../api-auth/rust/rust/src/json_errors.rs | 220 - .../api-auth/rust/rust/src/json_ser.rs | 91 - .../api-auth/rust/rust/src/lib.rs | 58 - .../api-auth/rust/rust/src/model.rs | 245 - .../api-auth/rust/rust/src/operation.rs | 102 - .../api-auth/rust/rust/src/operation_deser.rs | 483 - .../api-auth/rust/rust/src/operation_ser.rs | 39 - .../api-auth/rust/rust/src/output.rs | 234 - .../rust-server/rust-server/Cargo.toml | 16 - .../rust-server/rust-server/src/lib.rs | 1 - .../rust-server/rust-server/src/models.rs | 16 - .../api-cf-verification/rust/rust/Cargo.toml | 33 - .../rust/rust/src/client.rs | 292 - .../rust/rust/src/config.rs | 64 - .../rust/rust/src/error.rs | 926 -- .../rust/rust/src/error_meta.rs | 70 - .../rust/rust/src/http_serde.rs | 15 - .../rust/rust/src/input.rs | 141 - .../rust/rust/src/json_deser.rs | 404 - .../rust/rust/src/json_errors.rs | 220 - .../api-cf-verification/rust/rust/src/lib.rs | 54 - .../rust/rust/src/operation.rs | 34 - .../rust/rust/src/operation_deser.rs | 155 - .../rust/rust/src/output.rs | 52 - .../rust-server/rust-server/Cargo.toml | 16 - .../rust-server/rust-server/src/lib.rs | 1 - .../rust-server/rust-server/src/models.rs | 2015 ---- .../api-cloud/rust/rust/Cargo.toml | 33 - .../api-cloud/rust/rust/src/client.rs | 5187 --------- .../api-cloud/rust/rust/src/config.rs | 64 - .../api-cloud/rust/rust/src/error.rs | 8479 --------------- .../api-cloud/rust/rust/src/error_meta.rs | 1895 ---- .../api-cloud/rust/rust/src/input.rs | 9583 ----------------- .../api-cloud/rust/rust/src/json_deser.rs | 7789 -------------- .../api-cloud/rust/rust/src/json_errors.rs | 220 - .../api-cloud/rust/rust/src/json_ser.rs | 912 -- .../api-cloud/rust/rust/src/lib.rs | 57 - .../api-cloud/rust/rust/src/model.rs | 7465 ------------- .../api-cloud/rust/rust/src/operation.rs | 1778 --- .../rust/rust/src/operation_deser.rs | 8209 -------------- .../api-cloud/rust/rust/src/operation_ser.rs | 288 - .../api-cloud/rust/rust/src/output.rs | 3243 ------ .../rust-server/rust-server/Cargo.toml | 16 - .../rust-server/rust-server/src/lib.rs | 1 - .../rust-server/rust-server/src/models.rs | 634 -- .../api-group/rust/rust/Cargo.toml | 33 - .../api-group/rust/rust/src/client.rs | 2224 ---- .../api-group/rust/rust/src/config.rs | 64 - .../api-group/rust/rust/src/error.rs | 3894 ------- .../api-group/rust/rust/src/error_meta.rs | 775 -- .../api-group/rust/rust/src/input.rs | 3806 ------- .../api-group/rust/rust/src/json_deser.rs | 2660 ----- .../api-group/rust/rust/src/json_errors.rs | 220 - .../api-group/rust/rust/src/json_ser.rs | 100 - .../api-group/rust/rust/src/lib.rs | 57 - .../api-group/rust/rust/src/model.rs | 2381 ---- .../api-group/rust/rust/src/operation.rs | 738 -- .../rust/rust/src/operation_deser.rs | 3367 ------ .../api-group/rust/rust/src/operation_ser.rs | 85 - .../api-group/rust/rust/src/output.rs | 1230 --- .../rust-server/rust-server/Cargo.toml | 16 - .../rust-server/rust-server/src/lib.rs | 1 - .../rust-server/rust-server/src/models.rs | 1633 --- .../api-identity/rust/rust/Cargo.toml | 33 - .../api-identity/rust/rust/src/client.rs | 2894 ----- .../api-identity/rust/rust/src/config.rs | 64 - .../api-identity/rust/rust/src/error.rs | 5141 --------- .../api-identity/rust/rust/src/error_meta.rs | 1073 -- .../api-identity/rust/rust/src/input.rs | 4767 -------- .../api-identity/rust/rust/src/json_deser.rs | 6063 ----------- .../api-identity/rust/rust/src/json_errors.rs | 220 - .../api-identity/rust/rust/src/json_ser.rs | 160 - .../api-identity/rust/rust/src/lib.rs | 57 - .../api-identity/rust/rust/src/model.rs | 7247 ------------- .../api-identity/rust/rust/src/operation.rs | 1028 -- .../rust/rust/src/operation_deser.rs | 4721 -------- .../rust/rust/src/operation_ser.rs | 115 - .../api-identity/rust/rust/src/output.rs | 2069 ---- .../rust-server/rust-server/Cargo.toml | 16 - .../rust-server/rust-server/src/lib.rs | 1 - .../rust-server/rust-server/src/models.rs | 13 - .../api-job/rust/rust/Cargo.toml | 33 - .../api-job/rust/rust/src/client.rs | 282 - .../api-job/rust/rust/src/config.rs | 64 - .../api-job/rust/rust/src/error.rs | 916 -- .../api-job/rust/rust/src/error_meta.rs | 61 - .../api-job/rust/rust/src/input.rs | 94 - .../api-job/rust/rust/src/json_deser.rs | 404 - .../api-job/rust/rust/src/json_errors.rs | 220 - .../api-job/rust/rust/src/lib.rs | 53 - .../api-job/rust/rust/src/operation.rs | 31 - .../api-job/rust/rust/src/operation_deser.rs | 146 - .../api-job/rust/rust/src/output.rs | 30 - .../api-kv/rust-server/rust-server/Cargo.toml | 16 - .../api-kv/rust-server/rust-server/src/lib.rs | 1 - .../rust-server/rust-server/src/models.rs | 104 - lib/smithy-output/api-kv/rust/rust/Cargo.toml | 33 - .../api-kv/rust/rust/src/client.rs | 796 -- .../api-kv/rust/rust/src/config.rs | 64 - .../api-kv/rust/rust/src/error.rs | 1586 --- .../api-kv/rust/rust/src/error_meta.rs | 196 - .../api-kv/rust/rust/src/input.rs | 1010 -- .../api-kv/rust/rust/src/json_deser.rs | 672 -- .../api-kv/rust/rust/src/json_errors.rs | 220 - .../api-kv/rust/rust/src/json_ser.rs | 50 - lib/smithy-output/api-kv/rust/rust/src/lib.rs | 57 - .../api-kv/rust/rust/src/model.rs | 226 - .../api-kv/rust/rust/src/operation.rs | 187 - .../api-kv/rust/rust/src/operation_deser.rs | 886 -- .../api-kv/rust/rust/src/operation_ser.rs | 20 - .../api-kv/rust/rust/src/output.rs | 300 - .../rust-server/rust-server/Cargo.toml | 16 - .../rust-server/rust-server/src/lib.rs | 1 - .../rust-server/rust-server/src/models.rs | 288 - .../api-matchmaker/rust/rust/Cargo.toml | 33 - .../api-matchmaker/rust/rust/src/client.rs | 961 -- .../api-matchmaker/rust/rust/src/config.rs | 64 - .../api-matchmaker/rust/rust/src/error.rs | 1997 ---- .../rust/rust/src/error_meta.rs | 321 - .../rust/rust/src/http_serde.rs | 41 - .../api-matchmaker/rust/rust/src/input.rs | 1234 --- .../rust/rust/src/json_deser.rs | 1675 --- .../rust/rust/src/json_errors.rs | 220 - .../api-matchmaker/rust/rust/src/json_ser.rs | 128 - .../api-matchmaker/rust/rust/src/lib.rs | 58 - .../api-matchmaker/rust/rust/src/model.rs | 1403 --- .../api-matchmaker/rust/rust/src/operation.rs | 292 - .../rust/rust/src/operation_deser.rs | 1347 --- .../rust/rust/src/operation_ser.rs | 50 - .../api-matchmaker/rust/rust/src/output.rs | 544 - .../rust-server/rust-server/Cargo.toml | 16 - .../rust-server/rust-server/src/lib.rs | 1 - .../rust-server/rust-server/src/models.rs | 666 -- .../api-party/rust/rust/Cargo.toml | 33 - .../api-party/rust/rust/src/client.rs | 1847 ---- .../api-party/rust/rust/src/config.rs | 64 - .../api-party/rust/rust/src/error.rs | 3434 ------ .../api-party/rust/rust/src/error_meta.rs | 666 -- .../api-party/rust/rust/src/http_serde.rs | 24 - .../api-party/rust/rust/src/input.rs | 2806 ----- .../api-party/rust/rust/src/json_deser.rs | 2372 ---- .../api-party/rust/rust/src/json_errors.rs | 220 - .../api-party/rust/rust/src/json_ser.rs | 233 - .../api-party/rust/rust/src/lib.rs | 58 - .../api-party/rust/rust/src/model.rs | 2881 ----- .../api-party/rust/rust/src/operation.rs | 635 -- .../rust/rust/src/operation_deser.rs | 2874 ----- .../api-party/rust/rust/src/operation_ser.rs | 66 - .../api-party/rust/rust/src/output.rs | 878 -- .../rust-server/rust-server/Cargo.toml | 16 - .../rust-server/rust-server/src/lib.rs | 1 - .../rust-server/rust-server/src/models.rs | 290 - .../api-portal/rust/rust/Cargo.toml | 33 - .../api-portal/rust/rust/src/client.rs | 627 -- .../api-portal/rust/rust/src/config.rs | 64 - .../api-portal/rust/rust/src/error.rs | 1514 --- .../api-portal/rust/rust/src/error_meta.rs | 208 - .../api-portal/rust/rust/src/input.rs | 754 -- .../api-portal/rust/rust/src/json_deser.rs | 1321 --- .../api-portal/rust/rust/src/json_errors.rs | 220 - .../api-portal/rust/rust/src/json_ser.rs | 56 - .../api-portal/rust/rust/src/lib.rs | 57 - .../api-portal/rust/rust/src/model.rs | 1371 --- .../api-portal/rust/rust/src/operation.rs | 168 - .../rust/rust/src/operation_deser.rs | 768 -- .../api-portal/rust/rust/src/operation_ser.rs | 26 - .../api-portal/rust/rust/src/output.rs | 251 - .../rust-server/rust-server/Cargo.toml | 16 - .../rust-server/rust-server/src/lib.rs | 1 - .../rust-server/rust-server/src/models.rs | 13 - .../api-status/rust/rust/Cargo.toml | 33 - .../api-status/rust/rust/src/client.rs | 293 - .../api-status/rust/rust/src/config.rs | 64 - .../api-status/rust/rust/src/error.rs | 916 -- .../api-status/rust/rust/src/error_meta.rs | 65 - .../api-status/rust/rust/src/input.rs | 133 - .../api-status/rust/rust/src/json_deser.rs | 404 - .../api-status/rust/rust/src/json_errors.rs | 220 - .../api-status/rust/rust/src/lib.rs | 53 - .../api-status/rust/rust/src/operation.rs | 32 - .../rust/rust/src/operation_deser.rs | 146 - .../api-status/rust/rust/src/output.rs | 30 - .../rust-server/rust-server/Cargo.toml | 16 - .../rust-server/rust-server/src/lib.rs | 1 - .../rust-server/rust-server/src/models.rs | 267 - .../api-traefik-provider/rust/rust/Cargo.toml | 33 - .../rust/rust/src/client.rs | 315 - .../rust/rust/src/config.rs | 64 - .../rust/rust/src/error.rs | 916 -- .../rust/rust/src/error_meta.rs | 65 - .../rust/rust/src/input.rs | 177 - .../rust/rust/src/json_deser.rs | 2318 ---- .../rust/rust/src/json_errors.rs | 220 - .../api-traefik-provider/rust/rust/src/lib.rs | 55 - .../rust/rust/src/model.rs | 2140 ---- .../rust/rust/src/operation.rs | 32 - .../rust/rust/src/operation_deser.rs | 151 - .../rust/rust/src/output.rs | 55 - 209 files changed, 180267 deletions(-) delete mode 100644 lib/smithy-output/api-auth/rust-server/rust-server/Cargo.toml delete mode 100644 lib/smithy-output/api-auth/rust-server/rust-server/src/lib.rs delete mode 100644 lib/smithy-output/api-auth/rust-server/rust-server/src/models.rs delete mode 100644 lib/smithy-output/api-auth/rust/rust/Cargo.toml delete mode 100644 lib/smithy-output/api-auth/rust/rust/src/client.rs delete mode 100644 lib/smithy-output/api-auth/rust/rust/src/config.rs delete mode 100644 lib/smithy-output/api-auth/rust/rust/src/error.rs delete mode 100644 lib/smithy-output/api-auth/rust/rust/src/error_meta.rs delete mode 100644 lib/smithy-output/api-auth/rust/rust/src/http_serde.rs delete mode 100644 lib/smithy-output/api-auth/rust/rust/src/input.rs delete mode 100644 lib/smithy-output/api-auth/rust/rust/src/json_deser.rs delete mode 100644 lib/smithy-output/api-auth/rust/rust/src/json_errors.rs delete mode 100644 lib/smithy-output/api-auth/rust/rust/src/json_ser.rs delete mode 100644 lib/smithy-output/api-auth/rust/rust/src/lib.rs delete mode 100644 lib/smithy-output/api-auth/rust/rust/src/model.rs delete mode 100644 lib/smithy-output/api-auth/rust/rust/src/operation.rs delete mode 100644 lib/smithy-output/api-auth/rust/rust/src/operation_deser.rs delete mode 100644 lib/smithy-output/api-auth/rust/rust/src/operation_ser.rs delete mode 100644 lib/smithy-output/api-auth/rust/rust/src/output.rs delete mode 100644 lib/smithy-output/api-cf-verification/rust-server/rust-server/Cargo.toml delete mode 100644 lib/smithy-output/api-cf-verification/rust-server/rust-server/src/lib.rs delete mode 100644 lib/smithy-output/api-cf-verification/rust-server/rust-server/src/models.rs delete mode 100644 lib/smithy-output/api-cf-verification/rust/rust/Cargo.toml delete mode 100644 lib/smithy-output/api-cf-verification/rust/rust/src/client.rs delete mode 100644 lib/smithy-output/api-cf-verification/rust/rust/src/config.rs delete mode 100644 lib/smithy-output/api-cf-verification/rust/rust/src/error.rs delete mode 100644 lib/smithy-output/api-cf-verification/rust/rust/src/error_meta.rs delete mode 100644 lib/smithy-output/api-cf-verification/rust/rust/src/http_serde.rs delete mode 100644 lib/smithy-output/api-cf-verification/rust/rust/src/input.rs delete mode 100644 lib/smithy-output/api-cf-verification/rust/rust/src/json_deser.rs delete mode 100644 lib/smithy-output/api-cf-verification/rust/rust/src/json_errors.rs delete mode 100644 lib/smithy-output/api-cf-verification/rust/rust/src/lib.rs delete mode 100644 lib/smithy-output/api-cf-verification/rust/rust/src/operation.rs delete mode 100644 lib/smithy-output/api-cf-verification/rust/rust/src/operation_deser.rs delete mode 100644 lib/smithy-output/api-cf-verification/rust/rust/src/output.rs delete mode 100644 lib/smithy-output/api-cloud/rust-server/rust-server/Cargo.toml delete mode 100644 lib/smithy-output/api-cloud/rust-server/rust-server/src/lib.rs delete mode 100644 lib/smithy-output/api-cloud/rust-server/rust-server/src/models.rs delete mode 100644 lib/smithy-output/api-cloud/rust/rust/Cargo.toml delete mode 100644 lib/smithy-output/api-cloud/rust/rust/src/client.rs delete mode 100644 lib/smithy-output/api-cloud/rust/rust/src/config.rs delete mode 100644 lib/smithy-output/api-cloud/rust/rust/src/error.rs delete mode 100644 lib/smithy-output/api-cloud/rust/rust/src/error_meta.rs delete mode 100644 lib/smithy-output/api-cloud/rust/rust/src/input.rs delete mode 100644 lib/smithy-output/api-cloud/rust/rust/src/json_deser.rs delete mode 100644 lib/smithy-output/api-cloud/rust/rust/src/json_errors.rs delete mode 100644 lib/smithy-output/api-cloud/rust/rust/src/json_ser.rs delete mode 100644 lib/smithy-output/api-cloud/rust/rust/src/lib.rs delete mode 100644 lib/smithy-output/api-cloud/rust/rust/src/model.rs delete mode 100644 lib/smithy-output/api-cloud/rust/rust/src/operation.rs delete mode 100644 lib/smithy-output/api-cloud/rust/rust/src/operation_deser.rs delete mode 100644 lib/smithy-output/api-cloud/rust/rust/src/operation_ser.rs delete mode 100644 lib/smithy-output/api-cloud/rust/rust/src/output.rs delete mode 100644 lib/smithy-output/api-group/rust-server/rust-server/Cargo.toml delete mode 100644 lib/smithy-output/api-group/rust-server/rust-server/src/lib.rs delete mode 100644 lib/smithy-output/api-group/rust-server/rust-server/src/models.rs delete mode 100644 lib/smithy-output/api-group/rust/rust/Cargo.toml delete mode 100644 lib/smithy-output/api-group/rust/rust/src/client.rs delete mode 100644 lib/smithy-output/api-group/rust/rust/src/config.rs delete mode 100644 lib/smithy-output/api-group/rust/rust/src/error.rs delete mode 100644 lib/smithy-output/api-group/rust/rust/src/error_meta.rs delete mode 100644 lib/smithy-output/api-group/rust/rust/src/input.rs delete mode 100644 lib/smithy-output/api-group/rust/rust/src/json_deser.rs delete mode 100644 lib/smithy-output/api-group/rust/rust/src/json_errors.rs delete mode 100644 lib/smithy-output/api-group/rust/rust/src/json_ser.rs delete mode 100644 lib/smithy-output/api-group/rust/rust/src/lib.rs delete mode 100644 lib/smithy-output/api-group/rust/rust/src/model.rs delete mode 100644 lib/smithy-output/api-group/rust/rust/src/operation.rs delete mode 100644 lib/smithy-output/api-group/rust/rust/src/operation_deser.rs delete mode 100644 lib/smithy-output/api-group/rust/rust/src/operation_ser.rs delete mode 100644 lib/smithy-output/api-group/rust/rust/src/output.rs delete mode 100644 lib/smithy-output/api-identity/rust-server/rust-server/Cargo.toml delete mode 100644 lib/smithy-output/api-identity/rust-server/rust-server/src/lib.rs delete mode 100644 lib/smithy-output/api-identity/rust-server/rust-server/src/models.rs delete mode 100644 lib/smithy-output/api-identity/rust/rust/Cargo.toml delete mode 100644 lib/smithy-output/api-identity/rust/rust/src/client.rs delete mode 100644 lib/smithy-output/api-identity/rust/rust/src/config.rs delete mode 100644 lib/smithy-output/api-identity/rust/rust/src/error.rs delete mode 100644 lib/smithy-output/api-identity/rust/rust/src/error_meta.rs delete mode 100644 lib/smithy-output/api-identity/rust/rust/src/input.rs delete mode 100644 lib/smithy-output/api-identity/rust/rust/src/json_deser.rs delete mode 100644 lib/smithy-output/api-identity/rust/rust/src/json_errors.rs delete mode 100644 lib/smithy-output/api-identity/rust/rust/src/json_ser.rs delete mode 100644 lib/smithy-output/api-identity/rust/rust/src/lib.rs delete mode 100644 lib/smithy-output/api-identity/rust/rust/src/model.rs delete mode 100644 lib/smithy-output/api-identity/rust/rust/src/operation.rs delete mode 100644 lib/smithy-output/api-identity/rust/rust/src/operation_deser.rs delete mode 100644 lib/smithy-output/api-identity/rust/rust/src/operation_ser.rs delete mode 100644 lib/smithy-output/api-identity/rust/rust/src/output.rs delete mode 100644 lib/smithy-output/api-job/rust-server/rust-server/Cargo.toml delete mode 100644 lib/smithy-output/api-job/rust-server/rust-server/src/lib.rs delete mode 100644 lib/smithy-output/api-job/rust-server/rust-server/src/models.rs delete mode 100644 lib/smithy-output/api-job/rust/rust/Cargo.toml delete mode 100644 lib/smithy-output/api-job/rust/rust/src/client.rs delete mode 100644 lib/smithy-output/api-job/rust/rust/src/config.rs delete mode 100644 lib/smithy-output/api-job/rust/rust/src/error.rs delete mode 100644 lib/smithy-output/api-job/rust/rust/src/error_meta.rs delete mode 100644 lib/smithy-output/api-job/rust/rust/src/input.rs delete mode 100644 lib/smithy-output/api-job/rust/rust/src/json_deser.rs delete mode 100644 lib/smithy-output/api-job/rust/rust/src/json_errors.rs delete mode 100644 lib/smithy-output/api-job/rust/rust/src/lib.rs delete mode 100644 lib/smithy-output/api-job/rust/rust/src/operation.rs delete mode 100644 lib/smithy-output/api-job/rust/rust/src/operation_deser.rs delete mode 100644 lib/smithy-output/api-job/rust/rust/src/output.rs delete mode 100644 lib/smithy-output/api-kv/rust-server/rust-server/Cargo.toml delete mode 100644 lib/smithy-output/api-kv/rust-server/rust-server/src/lib.rs delete mode 100644 lib/smithy-output/api-kv/rust-server/rust-server/src/models.rs delete mode 100644 lib/smithy-output/api-kv/rust/rust/Cargo.toml delete mode 100644 lib/smithy-output/api-kv/rust/rust/src/client.rs delete mode 100644 lib/smithy-output/api-kv/rust/rust/src/config.rs delete mode 100644 lib/smithy-output/api-kv/rust/rust/src/error.rs delete mode 100644 lib/smithy-output/api-kv/rust/rust/src/error_meta.rs delete mode 100644 lib/smithy-output/api-kv/rust/rust/src/input.rs delete mode 100644 lib/smithy-output/api-kv/rust/rust/src/json_deser.rs delete mode 100644 lib/smithy-output/api-kv/rust/rust/src/json_errors.rs delete mode 100644 lib/smithy-output/api-kv/rust/rust/src/json_ser.rs delete mode 100644 lib/smithy-output/api-kv/rust/rust/src/lib.rs delete mode 100644 lib/smithy-output/api-kv/rust/rust/src/model.rs delete mode 100644 lib/smithy-output/api-kv/rust/rust/src/operation.rs delete mode 100644 lib/smithy-output/api-kv/rust/rust/src/operation_deser.rs delete mode 100644 lib/smithy-output/api-kv/rust/rust/src/operation_ser.rs delete mode 100644 lib/smithy-output/api-kv/rust/rust/src/output.rs delete mode 100644 lib/smithy-output/api-matchmaker/rust-server/rust-server/Cargo.toml delete mode 100644 lib/smithy-output/api-matchmaker/rust-server/rust-server/src/lib.rs delete mode 100644 lib/smithy-output/api-matchmaker/rust-server/rust-server/src/models.rs delete mode 100644 lib/smithy-output/api-matchmaker/rust/rust/Cargo.toml delete mode 100644 lib/smithy-output/api-matchmaker/rust/rust/src/client.rs delete mode 100644 lib/smithy-output/api-matchmaker/rust/rust/src/config.rs delete mode 100644 lib/smithy-output/api-matchmaker/rust/rust/src/error.rs delete mode 100644 lib/smithy-output/api-matchmaker/rust/rust/src/error_meta.rs delete mode 100644 lib/smithy-output/api-matchmaker/rust/rust/src/http_serde.rs delete mode 100644 lib/smithy-output/api-matchmaker/rust/rust/src/input.rs delete mode 100644 lib/smithy-output/api-matchmaker/rust/rust/src/json_deser.rs delete mode 100644 lib/smithy-output/api-matchmaker/rust/rust/src/json_errors.rs delete mode 100644 lib/smithy-output/api-matchmaker/rust/rust/src/json_ser.rs delete mode 100644 lib/smithy-output/api-matchmaker/rust/rust/src/lib.rs delete mode 100644 lib/smithy-output/api-matchmaker/rust/rust/src/model.rs delete mode 100644 lib/smithy-output/api-matchmaker/rust/rust/src/operation.rs delete mode 100644 lib/smithy-output/api-matchmaker/rust/rust/src/operation_deser.rs delete mode 100644 lib/smithy-output/api-matchmaker/rust/rust/src/operation_ser.rs delete mode 100644 lib/smithy-output/api-matchmaker/rust/rust/src/output.rs delete mode 100644 lib/smithy-output/api-party/rust-server/rust-server/Cargo.toml delete mode 100644 lib/smithy-output/api-party/rust-server/rust-server/src/lib.rs delete mode 100644 lib/smithy-output/api-party/rust-server/rust-server/src/models.rs delete mode 100644 lib/smithy-output/api-party/rust/rust/Cargo.toml delete mode 100644 lib/smithy-output/api-party/rust/rust/src/client.rs delete mode 100644 lib/smithy-output/api-party/rust/rust/src/config.rs delete mode 100644 lib/smithy-output/api-party/rust/rust/src/error.rs delete mode 100644 lib/smithy-output/api-party/rust/rust/src/error_meta.rs delete mode 100644 lib/smithy-output/api-party/rust/rust/src/http_serde.rs delete mode 100644 lib/smithy-output/api-party/rust/rust/src/input.rs delete mode 100644 lib/smithy-output/api-party/rust/rust/src/json_deser.rs delete mode 100644 lib/smithy-output/api-party/rust/rust/src/json_errors.rs delete mode 100644 lib/smithy-output/api-party/rust/rust/src/json_ser.rs delete mode 100644 lib/smithy-output/api-party/rust/rust/src/lib.rs delete mode 100644 lib/smithy-output/api-party/rust/rust/src/model.rs delete mode 100644 lib/smithy-output/api-party/rust/rust/src/operation.rs delete mode 100644 lib/smithy-output/api-party/rust/rust/src/operation_deser.rs delete mode 100644 lib/smithy-output/api-party/rust/rust/src/operation_ser.rs delete mode 100644 lib/smithy-output/api-party/rust/rust/src/output.rs delete mode 100644 lib/smithy-output/api-portal/rust-server/rust-server/Cargo.toml delete mode 100644 lib/smithy-output/api-portal/rust-server/rust-server/src/lib.rs delete mode 100644 lib/smithy-output/api-portal/rust-server/rust-server/src/models.rs delete mode 100644 lib/smithy-output/api-portal/rust/rust/Cargo.toml delete mode 100644 lib/smithy-output/api-portal/rust/rust/src/client.rs delete mode 100644 lib/smithy-output/api-portal/rust/rust/src/config.rs delete mode 100644 lib/smithy-output/api-portal/rust/rust/src/error.rs delete mode 100644 lib/smithy-output/api-portal/rust/rust/src/error_meta.rs delete mode 100644 lib/smithy-output/api-portal/rust/rust/src/input.rs delete mode 100644 lib/smithy-output/api-portal/rust/rust/src/json_deser.rs delete mode 100644 lib/smithy-output/api-portal/rust/rust/src/json_errors.rs delete mode 100644 lib/smithy-output/api-portal/rust/rust/src/json_ser.rs delete mode 100644 lib/smithy-output/api-portal/rust/rust/src/lib.rs delete mode 100644 lib/smithy-output/api-portal/rust/rust/src/model.rs delete mode 100644 lib/smithy-output/api-portal/rust/rust/src/operation.rs delete mode 100644 lib/smithy-output/api-portal/rust/rust/src/operation_deser.rs delete mode 100644 lib/smithy-output/api-portal/rust/rust/src/operation_ser.rs delete mode 100644 lib/smithy-output/api-portal/rust/rust/src/output.rs delete mode 100644 lib/smithy-output/api-status/rust-server/rust-server/Cargo.toml delete mode 100644 lib/smithy-output/api-status/rust-server/rust-server/src/lib.rs delete mode 100644 lib/smithy-output/api-status/rust-server/rust-server/src/models.rs delete mode 100644 lib/smithy-output/api-status/rust/rust/Cargo.toml delete mode 100644 lib/smithy-output/api-status/rust/rust/src/client.rs delete mode 100644 lib/smithy-output/api-status/rust/rust/src/config.rs delete mode 100644 lib/smithy-output/api-status/rust/rust/src/error.rs delete mode 100644 lib/smithy-output/api-status/rust/rust/src/error_meta.rs delete mode 100644 lib/smithy-output/api-status/rust/rust/src/input.rs delete mode 100644 lib/smithy-output/api-status/rust/rust/src/json_deser.rs delete mode 100644 lib/smithy-output/api-status/rust/rust/src/json_errors.rs delete mode 100644 lib/smithy-output/api-status/rust/rust/src/lib.rs delete mode 100644 lib/smithy-output/api-status/rust/rust/src/operation.rs delete mode 100644 lib/smithy-output/api-status/rust/rust/src/operation_deser.rs delete mode 100644 lib/smithy-output/api-status/rust/rust/src/output.rs delete mode 100644 lib/smithy-output/api-traefik-provider/rust-server/rust-server/Cargo.toml delete mode 100644 lib/smithy-output/api-traefik-provider/rust-server/rust-server/src/lib.rs delete mode 100644 lib/smithy-output/api-traefik-provider/rust-server/rust-server/src/models.rs delete mode 100644 lib/smithy-output/api-traefik-provider/rust/rust/Cargo.toml delete mode 100644 lib/smithy-output/api-traefik-provider/rust/rust/src/client.rs delete mode 100644 lib/smithy-output/api-traefik-provider/rust/rust/src/config.rs delete mode 100644 lib/smithy-output/api-traefik-provider/rust/rust/src/error.rs delete mode 100644 lib/smithy-output/api-traefik-provider/rust/rust/src/error_meta.rs delete mode 100644 lib/smithy-output/api-traefik-provider/rust/rust/src/input.rs delete mode 100644 lib/smithy-output/api-traefik-provider/rust/rust/src/json_deser.rs delete mode 100644 lib/smithy-output/api-traefik-provider/rust/rust/src/json_errors.rs delete mode 100644 lib/smithy-output/api-traefik-provider/rust/rust/src/lib.rs delete mode 100644 lib/smithy-output/api-traefik-provider/rust/rust/src/model.rs delete mode 100644 lib/smithy-output/api-traefik-provider/rust/rust/src/operation.rs delete mode 100644 lib/smithy-output/api-traefik-provider/rust/rust/src/operation_deser.rs delete mode 100644 lib/smithy-output/api-traefik-provider/rust/rust/src/output.rs diff --git a/lib/smithy-output/api-auth/rust-server/rust-server/Cargo.toml b/lib/smithy-output/api-auth/rust-server/rust-server/Cargo.toml deleted file mode 100644 index d7587c7ba..000000000 --- a/lib/smithy-output/api-auth/rust-server/rust-server/Cargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -[package] -name = "rivet-auth-server" -version = "0.0.1" -authors = ["Rivet "] -edition = "2021" -license = "Apache-2.0" - -[package.metadata.docs.rs] -all-features = true -targets = ["x86_64-unknown-linux-gnu"] - -[dependencies] -serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" -chrono = { version = "0.4", features = ["serde"] } diff --git a/lib/smithy-output/api-auth/rust-server/rust-server/src/lib.rs b/lib/smithy-output/api-auth/rust-server/rust-server/src/lib.rs deleted file mode 100644 index ff9294697..000000000 --- a/lib/smithy-output/api-auth/rust-server/rust-server/src/lib.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod models; \ No newline at end of file diff --git a/lib/smithy-output/api-auth/rust-server/rust-server/src/models.rs b/lib/smithy-output/api-auth/rust-server/rust-server/src/models.rs deleted file mode 100644 index 13ceebfba..000000000 --- a/lib/smithy-output/api-auth/rust-server/rust-server/src/models.rs +++ /dev/null @@ -1,151 +0,0 @@ -#[allow(unused_imports)] -use chrono; -#[allow(unused_imports)] -use serde::{Deserialize, Serialize}; - -/// Represents the state of an external account linking process. -#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd, Hash, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum CompleteStatus { - /// The current linking process has already completed. - AlreadyComplete, - /// The current linking process has expired. - Expired, - /// The code given to the current linking process is incorrect. - Incorrect, - /// The linking process succeeded and the new account is now added. - LinkedAccountAdded, - /// The linking process succeeded and will now switch identities. - SwitchIdentity, - /// The current linking process has been tried too many times. - TooManyAttempts, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for CompleteStatus { - fn from(s: &str) -> Self { - match s { - "already_complete" => CompleteStatus::AlreadyComplete, - "expired" => CompleteStatus::Expired, - "incorrect" => CompleteStatus::Incorrect, - "linked_account_added" => CompleteStatus::LinkedAccountAdded, - "switch_identity" => CompleteStatus::SwitchIdentity, - "too_many_attempts" => CompleteStatus::TooManyAttempts, - other => CompleteStatus::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for CompleteStatus { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(CompleteStatus::from(s)) - } -} -impl CompleteStatus { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - CompleteStatus::AlreadyComplete => "already_complete", - CompleteStatus::Expired => "expired", - CompleteStatus::Incorrect => "incorrect", - CompleteStatus::LinkedAccountAdded => "linked_account_added", - CompleteStatus::SwitchIdentity => "switch_identity", - CompleteStatus::TooManyAttempts => "too_many_attempts", - CompleteStatus::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &[ - "already_complete", - "expired", - "incorrect", - "linked_account_added", - "switch_identity", - "too_many_attempts", - ] - } -} -impl AsRef for CompleteStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// Methods to verify a captcha. -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum CaptchaConfig { - /// hCaptcha configuration. - Hcaptcha(CaptchaConfigHcaptcha), - /// Cloudflare Turnstile configuration. - Turnstile(CaptchaConfigTurnstile), -} - -/// Cloudflare Turnstile configuration. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CaptchaConfigTurnstile { - #[allow(missing_docs)] // documentation missing in model - pub client_response: std::string::String, -} - -/// hCaptcha configuration. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CaptchaConfigHcaptcha { - #[allow(missing_docs)] // documentation missing in model - pub client_response: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CompleteEmailVerificationRequest { - /// A universally unique identifier. - pub verification_id: std::string::String, - /// The code sent to the requestee's email. - pub code: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct StartEmailVerificationRequest { - #[allow(missing_docs)] // documentation missing in model - pub email: std::string::String, - /// Methods to verify a captcha. - pub captcha: CaptchaConfig, - /// A universally unique identifier. - pub game_id: std::option::Option, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct RefreshIdentityTokenRequest { - /// When `true`, the current identity for the provided cookie will be logged out and a new identity will be returned. - pub logout: bool, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CompleteEmailVerificationResponse { - /// Represents the state of an external account linking process. - pub status: CompleteStatus, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct StartEmailVerificationResponse { - /// A universally unique identifier. - pub verification_id: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct RefreshIdentityTokenResponse { - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub token: std::string::String, - /// Token expiration time (in milliseconds). - pub exp: chrono::DateTime, - /// A universally unique identifier. - pub identity_id: std::string::String, -} - diff --git a/lib/smithy-output/api-auth/rust/rust/Cargo.toml b/lib/smithy-output/api-auth/rust/rust/Cargo.toml deleted file mode 100644 index 4b67ef059..000000000 --- a/lib/smithy-output/api-auth/rust/rust/Cargo.toml +++ /dev/null @@ -1,33 +0,0 @@ -# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -[package] -name = "rivet-auth" -version = "0.0.1" -authors = ["Rivet Gaming, LLC "] -description = "" -edition = "2021" -license = "Apache-2.0" - -[package.metadata.docs.rs] -all-features = true -targets = ["x86_64-unknown-linux-gnu"] -[dependencies.aws-smithy-client] -version = "^0.41.0" -[dependencies.aws-smithy-http] -version = "^0.41.0" -[dependencies.aws-smithy-json] -version = "^0.41.0" -[dependencies.aws-smithy-types] -version = "^0.41.0" -[dependencies.bytes] -version = "1" -[dependencies.http] -version = "0.2" -[dependencies.tower] -version = "0.4" -[features] -rt-tokio = ["aws-smithy-http/rt-tokio"] -rustls = ["aws-smithy-client/rustls"] -native-tls = ["aws-smithy-client/native-tls"] -default = ["rt-tokio", "rustls"] - - diff --git a/lib/smithy-output/api-auth/rust/rust/src/client.rs b/lib/smithy-output/api-auth/rust/rust/src/client.rs deleted file mode 100644 index 6664c7567..000000000 --- a/lib/smithy-output/api-auth/rust/rust/src/client.rs +++ /dev/null @@ -1,507 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[derive(Debug)] -pub(crate) struct Handle { - pub(crate) client: aws_smithy_client::Client, - pub(crate) conf: crate::Config, -} - -/// An ergonomic service client for `AuthService`. -/// -/// This client allows ergonomic access to a `AuthService`-shaped service. -/// Each method corresponds to an endpoint defined in the service's Smithy model, -/// and the request and response shapes are auto-generated from that same model. -/// -/// # Constructing a Client -/// -/// To construct a client, you need a few different things: -/// -/// - A [`Config`](crate::Config) that specifies additional configuration -/// required by the service. -/// - A connector (`C`) that specifies how HTTP requests are translated -/// into HTTP responses. This will typically be an HTTP client (like -/// `hyper`), though you can also substitute in your own, like a mock -/// mock connector for testing. -/// - A "middleware" (`M`) that modifies requests prior to them being -/// sent to the request. Most commonly, middleware will decide what -/// endpoint the requests should be sent to, as well as perform -/// authentication and authorization of requests (such as SigV4). -/// You can also have middleware that performs request/response -/// tracing, throttling, or other middleware-like tasks. -/// - A retry policy (`R`) that dictates the behavior for requests that -/// fail and should (potentially) be retried. The default type is -/// generally what you want, as it implements a well-vetted retry -/// policy implemented in [`RetryMode::Standard`](aws_smithy_types::retry::RetryMode::Standard). -/// -/// To construct a client, you will generally want to call -/// [`Client::with_config`], which takes a [`aws_smithy_client::Client`] (a -/// Smithy client that isn't specialized to a particular service), -/// and a [`Config`](crate::Config). Both of these are constructed using -/// the [builder pattern] where you first construct a `Builder` type, -/// then configure it with the necessary parameters, and then call -/// `build` to construct the finalized output type. The -/// [`aws_smithy_client::Client`] builder is re-exported in this crate as -/// [`Builder`] for convenience. -/// -/// In _most_ circumstances, you will want to use the following pattern -/// to construct a client: -/// -/// ``` -/// use rivet_auth::{Builder, Client, Config}; -/// let raw_client = -/// Builder::dyn_https() -/// # /* -/// .middleware(/* discussed below */) -/// # */ -/// # .middleware_fn(|r| r) -/// .build(); -/// let config = Config::builder().build(); -/// let client = Client::with_config(raw_client, config); -/// ``` -/// -/// For the middleware, you'll want to use whatever matches the -/// routing, authentication and authorization required by the target -/// service. For example, for the standard AWS SDK which uses -/// [SigV4-signed requests], the middleware looks like this: -/// -// Ignored as otherwise we'd need to pull in all these dev-dependencies. -/// ```rust,ignore -/// use aws_endpoint::AwsEndpointStage; -/// use aws_http::auth::CredentialsStage; -/// use aws_http::recursion_detection::RecursionDetectionStage; -/// use aws_http::user_agent::UserAgentStage; -/// use aws_sig_auth::middleware::SigV4SigningStage; -/// use aws_sig_auth::signer::SigV4Signer; -/// use aws_smithy_client::retry::Config as RetryConfig; -/// use aws_smithy_http_tower::map_request::{AsyncMapRequestLayer, MapRequestLayer}; -/// use std::fmt::Debug; -/// use tower::layer::util::{Identity, Stack}; -/// use tower::ServiceBuilder; -/// -/// type AwsMiddlewareStack = Stack< -/// MapRequestLayer, -/// Stack< -/// MapRequestLayer, -/// Stack< -/// AsyncMapRequestLayer, -/// Stack< -/// MapRequestLayer, -/// Stack, Identity>, -/// >, -/// >, -/// >, -/// >; -/// -/// /// AWS Middleware Stack -/// /// -/// /// This implements the middleware stack for this service. It will: -/// /// 1. Load credentials asynchronously into the property bag -/// /// 2. Sign the request with SigV4 -/// /// 3. Resolve an Endpoint for the request -/// /// 4. Add a user agent to the request -/// #[derive(Debug, Default, Clone)] -/// #[non_exhaustive] -/// pub struct AwsMiddleware; -/// -/// impl AwsMiddleware { -/// /// Create a new `AwsMiddleware` stack -/// /// -/// /// Note: `AwsMiddleware` holds no state. -/// pub fn new() -> Self { -/// AwsMiddleware::default() -/// } -/// } -/// -/// // define the middleware stack in a non-generic location to reduce code bloat. -/// fn base() -> ServiceBuilder { -/// let credential_provider = AsyncMapRequestLayer::for_mapper(CredentialsStage::new()); -/// let signer = MapRequestLayer::for_mapper(SigV4SigningStage::new(SigV4Signer::new())); -/// let endpoint_resolver = MapRequestLayer::for_mapper(AwsEndpointStage); -/// let user_agent = MapRequestLayer::for_mapper(UserAgentStage::new()); -/// let recursion_detection = MapRequestLayer::for_mapper(RecursionDetectionStage::new()); -/// // These layers can be considered as occurring in order, that is: -/// // 1. Resolve an endpoint -/// // 2. Add a user agent -/// // 3. Acquire credentials -/// // 4. Sign with credentials -/// // (5. Dispatch over the wire) -/// ServiceBuilder::new() -/// .layer(endpoint_resolver) -/// .layer(user_agent) -/// .layer(credential_provider) -/// .layer(signer) -/// .layer(recursion_detection) -/// } -/// -/// impl tower::Layer for AwsMiddleware { -/// type Service = >::Service; -/// -/// fn layer(&self, inner: S) -> Self::Service { -/// base().service(inner) -/// } -/// } -/// ``` -/// -/// # Using a Client -/// -/// Once you have a client set up, you can access the service's endpoints -/// by calling the appropriate method on [`Client`]. Each such method -/// returns a request builder for that endpoint, with methods for setting -/// the various fields of the request. Once your request is complete, use -/// the `send` method to send the request. `send` returns a future, which -/// you then have to `.await` to get the service's response. -/// -/// [builder pattern]: https://rust-lang.github.io/api-guidelines/type-safety.html#c-builder -/// [SigV4-signed requests]: https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html -#[derive(std::fmt::Debug)] -pub struct Client { - handle: std::sync::Arc>, -} - -impl std::clone::Clone for Client { - fn clone(&self) -> Self { - Self { - handle: self.handle.clone(), - } - } -} - -#[doc(inline)] -pub use aws_smithy_client::Builder; - -impl From> for Client { - fn from(client: aws_smithy_client::Client) -> Self { - Self::with_config(client, crate::Config::builder().build()) - } -} - -impl Client { - /// Creates a client with the given service configuration. - pub fn with_config(client: aws_smithy_client::Client, conf: crate::Config) -> Self { - Self { - handle: std::sync::Arc::new(Handle { client, conf }), - } - } - - /// Returns the client's configuration. - pub fn conf(&self) -> &crate::Config { - &self.handle.conf - } -} -impl Client -where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, -{ - /// Constructs a fluent builder for the [`CompleteEmailVerification`](crate::client::fluent_builders::CompleteEmailVerification) operation. - /// - /// - The fluent builder is configurable: - /// - [`verification_id(impl Into)`](crate::client::fluent_builders::CompleteEmailVerification::verification_id) / [`set_verification_id(Option)`](crate::client::fluent_builders::CompleteEmailVerification::set_verification_id): A universally unique identifier. - /// - [`code(impl Into)`](crate::client::fluent_builders::CompleteEmailVerification::code) / [`set_code(Option)`](crate::client::fluent_builders::CompleteEmailVerification::set_code): The code sent to the requestee's email. - /// - On success, responds with [`CompleteEmailVerificationOutput`](crate::output::CompleteEmailVerificationOutput) with field(s): - /// - [`status(Option)`](crate::output::CompleteEmailVerificationOutput::status): Represents the state of an external account linking process. - /// - On failure, responds with [`SdkError`](crate::error::CompleteEmailVerificationError) - pub fn complete_email_verification( - &self, - ) -> fluent_builders::CompleteEmailVerification { - fluent_builders::CompleteEmailVerification::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`RefreshIdentityToken`](crate::client::fluent_builders::RefreshIdentityToken) operation. - /// - /// - The fluent builder is configurable: - /// - [`cookie(Vec)`](crate::client::fluent_builders::RefreshIdentityToken::cookie) / [`set_cookie(Option>)`](crate::client::fluent_builders::RefreshIdentityToken::set_cookie): Cookie values. Usually does not need to be manually set. - /// - [`logout(bool)`](crate::client::fluent_builders::RefreshIdentityToken::logout) / [`set_logout(Option)`](crate::client::fluent_builders::RefreshIdentityToken::set_logout): When `true`, the current identity for the provided cookie will be logged out and a new identity will be returned. - /// - On success, responds with [`RefreshIdentityTokenOutput`](crate::output::RefreshIdentityTokenOutput) with field(s): - /// - [`set_cookie(Option>)`](crate::output::RefreshIdentityTokenOutput::set_cookie): Server-set cookie values. - /// - [`token(Option)`](crate::output::RefreshIdentityTokenOutput::token): A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - /// - [`exp(Option)`](crate::output::RefreshIdentityTokenOutput::exp): Token expiration time (in milliseconds). - /// - [`identity_id(Option)`](crate::output::RefreshIdentityTokenOutput::identity_id): A universally unique identifier. - /// - On failure, responds with [`SdkError`](crate::error::RefreshIdentityTokenError) - pub fn refresh_identity_token(&self) -> fluent_builders::RefreshIdentityToken { - fluent_builders::RefreshIdentityToken::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`StartEmailVerification`](crate::client::fluent_builders::StartEmailVerification) operation. - /// - /// - The fluent builder is configurable: - /// - [`email(impl Into)`](crate::client::fluent_builders::StartEmailVerification::email) / [`set_email(Option)`](crate::client::fluent_builders::StartEmailVerification::set_email): (undocumented) - /// - [`captcha(CaptchaConfig)`](crate::client::fluent_builders::StartEmailVerification::captcha) / [`set_captcha(Option)`](crate::client::fluent_builders::StartEmailVerification::set_captcha): Methods to verify a captcha. - /// - [`game_id(impl Into)`](crate::client::fluent_builders::StartEmailVerification::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::StartEmailVerification::set_game_id): A universally unique identifier. - /// - On success, responds with [`StartEmailVerificationOutput`](crate::output::StartEmailVerificationOutput) with field(s): - /// - [`verification_id(Option)`](crate::output::StartEmailVerificationOutput::verification_id): A universally unique identifier. - /// - On failure, responds with [`SdkError`](crate::error::StartEmailVerificationError) - pub fn start_email_verification(&self) -> fluent_builders::StartEmailVerification { - fluent_builders::StartEmailVerification::new(self.handle.clone()) - } -} -pub mod fluent_builders { - //! - //! Utilities to ergonomically construct a request to the service. - //! - //! Fluent builders are created through the [`Client`](crate::client::Client) by calling - //! one if its operation methods. After parameters are set using the builder methods, - //! the `send` method can be called to initiate the request. - //! - /// Fluent builder constructing a request to `CompleteEmailVerification`. - /// - /// Completes the email verification process. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct CompleteEmailVerification { - handle: std::sync::Arc>, - inner: crate::input::complete_email_verification_input::Builder, - } - impl CompleteEmailVerification - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `CompleteEmailVerification`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::CompleteEmailVerificationOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::CompleteEmailVerificationInputOperationOutputAlias, - crate::output::CompleteEmailVerificationOutput, - crate::error::CompleteEmailVerificationError, - crate::input::CompleteEmailVerificationInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn verification_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.verification_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_verification_id( - mut self, - input: std::option::Option, - ) -> Self { - self.inner = self.inner.set_verification_id(input); - self - } - /// The code sent to the requestee's email. - pub fn code(mut self, input: impl Into) -> Self { - self.inner = self.inner.code(input.into()); - self - } - /// The code sent to the requestee's email. - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_code(input); - self - } - } - /// Fluent builder constructing a request to `RefreshIdentityToken`. - /// - /// Refreshes the current identity's token and sets authentication headers. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct RefreshIdentityToken { - handle: std::sync::Arc>, - inner: crate::input::refresh_identity_token_input::Builder, - } - impl RefreshIdentityToken - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `RefreshIdentityToken`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::RefreshIdentityTokenOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::RefreshIdentityTokenInputOperationOutputAlias, - crate::output::RefreshIdentityTokenOutput, - crate::error::RefreshIdentityTokenError, - crate::input::RefreshIdentityTokenInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// Appends an item to `cookie`. - /// - /// To override the contents of this collection use [`set_cookie`](Self::set_cookie). - /// - /// Cookie values. Usually does not need to be manually set. - pub fn cookie(mut self, input: impl Into) -> Self { - self.inner = self.inner.cookie(input.into()); - self - } - /// Cookie values. Usually does not need to be manually set. - pub fn set_cookie( - mut self, - input: std::option::Option>, - ) -> Self { - self.inner = self.inner.set_cookie(input); - self - } - /// When `true`, the current identity for the provided cookie will be logged out and a new identity will be returned. - pub fn logout(mut self, input: bool) -> Self { - self.inner = self.inner.logout(input); - self - } - /// When `true`, the current identity for the provided cookie will be logged out and a new identity will be returned. - pub fn set_logout(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_logout(input); - self - } - } - /// Fluent builder constructing a request to `StartEmailVerification`. - /// - /// Starts the verification process for linking an emal to your identity. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct StartEmailVerification { - handle: std::sync::Arc>, - inner: crate::input::start_email_verification_input::Builder, - } - impl StartEmailVerification - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `StartEmailVerification`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::StartEmailVerificationOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::StartEmailVerificationInputOperationOutputAlias, - crate::output::StartEmailVerificationOutput, - crate::error::StartEmailVerificationError, - crate::input::StartEmailVerificationInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - #[allow(missing_docs)] // documentation missing in model - pub fn email(mut self, input: impl Into) -> Self { - self.inner = self.inner.email(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_email(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_email(input); - self - } - /// Methods to verify a captcha. - pub fn captcha(mut self, input: crate::model::CaptchaConfig) -> Self { - self.inner = self.inner.captcha(input); - self - } - /// Methods to verify a captcha. - pub fn set_captcha( - mut self, - input: std::option::Option, - ) -> Self { - self.inner = self.inner.set_captcha(input); - self - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - } -} -/// A wrapper around [`Client`]. Helps reduce external imports. -pub struct ClientWrapper { - pub(crate) client: Client, -} - -impl std::ops::Deref for ClientWrapper { - type Target = Client; - - fn deref(&self) -> &Self::Target { - &self.client - } -} diff --git a/lib/smithy-output/api-auth/rust/rust/src/config.rs b/lib/smithy-output/api-auth/rust/rust/src/config.rs deleted file mode 100644 index 4aba1de17..000000000 --- a/lib/smithy-output/api-auth/rust/rust/src/config.rs +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Service config. -/// -pub struct Config { - pub(crate) auth: Option, - pub(crate) uri: String, -} -impl std::fmt::Debug for Config { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut config = f.debug_struct("Config"); - config.finish() - } -} -impl Config { - /// Constructs a config builder. - pub fn builder() -> Builder { - Builder::default() - } -} -/// Builder for creating a `Config`. -#[derive(Default)] -pub struct Builder { - pub(crate) auth: Option, - pub(crate) uri: Option, -} -impl Builder { - /// Constructs a config builder. - pub fn new() -> Self { - Self::default() - } - /// Sets the bearer token to be used with the Smithy client. - pub fn set_bearer_token(mut self, bearer_token: impl std::fmt::Display) -> Self { - self.auth = Some(format!("Bearer {}", bearer_token)); - self - } - /// Sets the base URI to be used with the Smithy client. - pub fn set_uri(mut self, uri: impl ToString) -> Self { - self.uri = Some(uri.to_string()); - self - } - /// Builds a [`Config`]. - pub fn build(self) -> Config { - Config { - auth: self - .auth - .or_else(|| std::env::var("RIVET_LOBBY_TOKEN").ok()) - .or_else(|| std::env::var("RIVET_CLIENT_TOKEN").ok()), - uri: self - .uri - .or_else(|| std::env::var("RIVET_AUTH_API_URL").ok()) - .unwrap_or_else(|| "https://auth.api.rivet.gg/v1".to_string()), - } - } - /// Builds a default [`Client`] from the given config. - pub fn build_client(self) -> crate::client::ClientWrapper { - let raw_client = aws_smithy_client::Builder::dyn_https() - .middleware(tower::layer::util::Identity::new()) - .sleep_impl(None) - .build(); - crate::client::ClientWrapper { - client: crate::Client::with_config(raw_client, self.build()), - } - } -} diff --git a/lib/smithy-output/api-auth/rust/rust/src/error.rs b/lib/smithy-output/api-auth/rust/rust/src/error.rs deleted file mode 100644 index 37ea297e0..000000000 --- a/lib/smithy-output/api-auth/rust/rust/src/error.rs +++ /dev/null @@ -1,1238 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Error type for the `CompleteEmailVerification` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct CompleteEmailVerificationError { - /// Kind of error that occurred. - pub kind: CompleteEmailVerificationErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `CompleteEmailVerification` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum CompleteEmailVerificationErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for CompleteEmailVerificationError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - CompleteEmailVerificationErrorKind::InternalError(_inner) => _inner.fmt(f), - CompleteEmailVerificationErrorKind::RateLimitError(_inner) => _inner.fmt(f), - CompleteEmailVerificationErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - CompleteEmailVerificationErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - CompleteEmailVerificationErrorKind::NotFoundError(_inner) => _inner.fmt(f), - CompleteEmailVerificationErrorKind::BadRequestError(_inner) => _inner.fmt(f), - CompleteEmailVerificationErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for CompleteEmailVerificationError { - fn code(&self) -> Option<&str> { - CompleteEmailVerificationError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - CompleteEmailVerificationErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - CompleteEmailVerificationErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl CompleteEmailVerificationError { - /// Creates a new `CompleteEmailVerificationError`. - pub fn new(kind: CompleteEmailVerificationErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `CompleteEmailVerificationError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: CompleteEmailVerificationErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `CompleteEmailVerificationError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: CompleteEmailVerificationErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `CompleteEmailVerificationErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!( - &self.kind, - CompleteEmailVerificationErrorKind::InternalError(_) - ) - } - /// Returns `true` if the error kind is `CompleteEmailVerificationErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - CompleteEmailVerificationErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `CompleteEmailVerificationErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - CompleteEmailVerificationErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `CompleteEmailVerificationErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - CompleteEmailVerificationErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `CompleteEmailVerificationErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!( - &self.kind, - CompleteEmailVerificationErrorKind::NotFoundError(_) - ) - } - /// Returns `true` if the error kind is `CompleteEmailVerificationErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - CompleteEmailVerificationErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for CompleteEmailVerificationError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - CompleteEmailVerificationErrorKind::InternalError(_inner) => Some(_inner), - CompleteEmailVerificationErrorKind::RateLimitError(_inner) => Some(_inner), - CompleteEmailVerificationErrorKind::ForbiddenError(_inner) => Some(_inner), - CompleteEmailVerificationErrorKind::UnauthorizedError(_inner) => Some(_inner), - CompleteEmailVerificationErrorKind::NotFoundError(_inner) => Some(_inner), - CompleteEmailVerificationErrorKind::BadRequestError(_inner) => Some(_inner), - CompleteEmailVerificationErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `RefreshIdentityToken` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct RefreshIdentityTokenError { - /// Kind of error that occurred. - pub kind: RefreshIdentityTokenErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `RefreshIdentityToken` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum RefreshIdentityTokenErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for RefreshIdentityTokenError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - RefreshIdentityTokenErrorKind::InternalError(_inner) => _inner.fmt(f), - RefreshIdentityTokenErrorKind::RateLimitError(_inner) => _inner.fmt(f), - RefreshIdentityTokenErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - RefreshIdentityTokenErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - RefreshIdentityTokenErrorKind::NotFoundError(_inner) => _inner.fmt(f), - RefreshIdentityTokenErrorKind::BadRequestError(_inner) => _inner.fmt(f), - RefreshIdentityTokenErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for RefreshIdentityTokenError { - fn code(&self) -> Option<&str> { - RefreshIdentityTokenError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - RefreshIdentityTokenErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - RefreshIdentityTokenErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl RefreshIdentityTokenError { - /// Creates a new `RefreshIdentityTokenError`. - pub fn new(kind: RefreshIdentityTokenErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `RefreshIdentityTokenError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: RefreshIdentityTokenErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `RefreshIdentityTokenError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: RefreshIdentityTokenErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `RefreshIdentityTokenErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, RefreshIdentityTokenErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `RefreshIdentityTokenErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, RefreshIdentityTokenErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `RefreshIdentityTokenErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, RefreshIdentityTokenErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `RefreshIdentityTokenErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - RefreshIdentityTokenErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `RefreshIdentityTokenErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, RefreshIdentityTokenErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `RefreshIdentityTokenErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - RefreshIdentityTokenErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for RefreshIdentityTokenError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - RefreshIdentityTokenErrorKind::InternalError(_inner) => Some(_inner), - RefreshIdentityTokenErrorKind::RateLimitError(_inner) => Some(_inner), - RefreshIdentityTokenErrorKind::ForbiddenError(_inner) => Some(_inner), - RefreshIdentityTokenErrorKind::UnauthorizedError(_inner) => Some(_inner), - RefreshIdentityTokenErrorKind::NotFoundError(_inner) => Some(_inner), - RefreshIdentityTokenErrorKind::BadRequestError(_inner) => Some(_inner), - RefreshIdentityTokenErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `StartEmailVerification` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct StartEmailVerificationError { - /// Kind of error that occurred. - pub kind: StartEmailVerificationErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `StartEmailVerification` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum StartEmailVerificationErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for StartEmailVerificationError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - StartEmailVerificationErrorKind::InternalError(_inner) => _inner.fmt(f), - StartEmailVerificationErrorKind::RateLimitError(_inner) => _inner.fmt(f), - StartEmailVerificationErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - StartEmailVerificationErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - StartEmailVerificationErrorKind::NotFoundError(_inner) => _inner.fmt(f), - StartEmailVerificationErrorKind::BadRequestError(_inner) => _inner.fmt(f), - StartEmailVerificationErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for StartEmailVerificationError { - fn code(&self) -> Option<&str> { - StartEmailVerificationError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - StartEmailVerificationErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - StartEmailVerificationErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl StartEmailVerificationError { - /// Creates a new `StartEmailVerificationError`. - pub fn new(kind: StartEmailVerificationErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `StartEmailVerificationError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: StartEmailVerificationErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `StartEmailVerificationError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: StartEmailVerificationErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `StartEmailVerificationErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!( - &self.kind, - StartEmailVerificationErrorKind::InternalError(_) - ) - } - /// Returns `true` if the error kind is `StartEmailVerificationErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - StartEmailVerificationErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `StartEmailVerificationErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - StartEmailVerificationErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `StartEmailVerificationErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - StartEmailVerificationErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `StartEmailVerificationErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!( - &self.kind, - StartEmailVerificationErrorKind::NotFoundError(_) - ) - } - /// Returns `true` if the error kind is `StartEmailVerificationErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - StartEmailVerificationErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for StartEmailVerificationError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - StartEmailVerificationErrorKind::InternalError(_inner) => Some(_inner), - StartEmailVerificationErrorKind::RateLimitError(_inner) => Some(_inner), - StartEmailVerificationErrorKind::ForbiddenError(_inner) => Some(_inner), - StartEmailVerificationErrorKind::UnauthorizedError(_inner) => Some(_inner), - StartEmailVerificationErrorKind::NotFoundError(_inner) => Some(_inner), - StartEmailVerificationErrorKind::BadRequestError(_inner) => Some(_inner), - StartEmailVerificationErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// An error thrown when the requestee has sent an invalid or malformed request. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct BadRequestError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl BadRequestError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for BadRequestError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("BadRequestError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl BadRequestError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for BadRequestError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "BadRequestError")?; - if let Some(inner_1) = &self.message { - write!(f, ": {}", inner_1)?; - } - Ok(()) - } -} -impl std::error::Error for BadRequestError {} -/// See [`BadRequestError`](crate::error::BadRequestError) -pub mod bad_request_error { - /// A builder for [`BadRequestError`](crate::error::BadRequestError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`BadRequestError`](crate::error::BadRequestError) - pub fn build(self) -> crate::error::BadRequestError { - crate::error::BadRequestError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl BadRequestError { - /// Creates a new builder-style object to manufacture [`BadRequestError`](crate::error::BadRequestError) - pub fn builder() -> crate::error::bad_request_error::Builder { - crate::error::bad_request_error::Builder::default() - } -} - -/// An error thrown when the requestee requests a non existent resource. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct NotFoundError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl NotFoundError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for NotFoundError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("NotFoundError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl NotFoundError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for NotFoundError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "NotFoundError")?; - if let Some(inner_2) = &self.message { - write!(f, ": {}", inner_2)?; - } - Ok(()) - } -} -impl std::error::Error for NotFoundError {} -/// See [`NotFoundError`](crate::error::NotFoundError) -pub mod not_found_error { - /// A builder for [`NotFoundError`](crate::error::NotFoundError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`NotFoundError`](crate::error::NotFoundError) - pub fn build(self) -> crate::error::NotFoundError { - crate::error::NotFoundError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl NotFoundError { - /// Creates a new builder-style object to manufacture [`NotFoundError`](crate::error::NotFoundError) - pub fn builder() -> crate::error::not_found_error::Builder { - crate::error::not_found_error::Builder::default() - } -} - -/// An error thrown when the requestee is not authenticated. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UnauthorizedError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl UnauthorizedError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for UnauthorizedError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UnauthorizedError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl UnauthorizedError { - /// Returns `Some(ErrorKind)` if the error is retryable. Otherwise, returns `None`. - pub fn retryable_error_kind(&self) -> aws_smithy_types::retry::ErrorKind { - aws_smithy_types::retry::ErrorKind::ClientError - } - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for UnauthorizedError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "UnauthorizedError")?; - if let Some(inner_3) = &self.message { - write!(f, ": {}", inner_3)?; - } - Ok(()) - } -} -impl std::error::Error for UnauthorizedError {} -/// See [`UnauthorizedError`](crate::error::UnauthorizedError) -pub mod unauthorized_error { - /// A builder for [`UnauthorizedError`](crate::error::UnauthorizedError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`UnauthorizedError`](crate::error::UnauthorizedError) - pub fn build(self) -> crate::error::UnauthorizedError { - crate::error::UnauthorizedError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl UnauthorizedError { - /// Creates a new builder-style object to manufacture [`UnauthorizedError`](crate::error::UnauthorizedError) - pub fn builder() -> crate::error::unauthorized_error::Builder { - crate::error::unauthorized_error::Builder::default() - } -} - -/// An error thrown when the requestee requests a resource they do not have access to. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ForbiddenError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl ForbiddenError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for ForbiddenError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ForbiddenError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl ForbiddenError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for ForbiddenError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "ForbiddenError")?; - if let Some(inner_4) = &self.message { - write!(f, ": {}", inner_4)?; - } - Ok(()) - } -} -impl std::error::Error for ForbiddenError {} -/// See [`ForbiddenError`](crate::error::ForbiddenError) -pub mod forbidden_error { - /// A builder for [`ForbiddenError`](crate::error::ForbiddenError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`ForbiddenError`](crate::error::ForbiddenError) - pub fn build(self) -> crate::error::ForbiddenError { - crate::error::ForbiddenError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl ForbiddenError { - /// Creates a new builder-style object to manufacture [`ForbiddenError`](crate::error::ForbiddenError) - pub fn builder() -> crate::error::forbidden_error::Builder { - crate::error::forbidden_error::Builder::default() - } -} - -/// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct RateLimitError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl RateLimitError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for RateLimitError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("RateLimitError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl RateLimitError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for RateLimitError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "RateLimitError")?; - if let Some(inner_5) = &self.message { - write!(f, ": {}", inner_5)?; - } - Ok(()) - } -} -impl std::error::Error for RateLimitError {} -/// See [`RateLimitError`](crate::error::RateLimitError) -pub mod rate_limit_error { - /// A builder for [`RateLimitError`](crate::error::RateLimitError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`RateLimitError`](crate::error::RateLimitError) - pub fn build(self) -> crate::error::RateLimitError { - crate::error::RateLimitError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl RateLimitError { - /// Creates a new builder-style object to manufacture [`RateLimitError`](crate::error::RateLimitError) - pub fn builder() -> crate::error::rate_limit_error::Builder { - crate::error::rate_limit_error::Builder::default() - } -} - -/// An error caused by internal server problems. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct InternalError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl InternalError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for InternalError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("InternalError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl InternalError { - /// Returns `Some(ErrorKind)` if the error is retryable. Otherwise, returns `None`. - pub fn retryable_error_kind(&self) -> aws_smithy_types::retry::ErrorKind { - aws_smithy_types::retry::ErrorKind::ServerError - } - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for InternalError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "InternalError")?; - if let Some(inner_6) = &self.message { - write!(f, ": {}", inner_6)?; - } - Ok(()) - } -} -impl std::error::Error for InternalError {} -/// See [`InternalError`](crate::error::InternalError) -pub mod internal_error { - /// A builder for [`InternalError`](crate::error::InternalError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`InternalError`](crate::error::InternalError) - pub fn build(self) -> crate::error::InternalError { - crate::error::InternalError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl InternalError { - /// Creates a new builder-style object to manufacture [`InternalError`](crate::error::InternalError) - pub fn builder() -> crate::error::internal_error::Builder { - crate::error::internal_error::Builder::default() - } -} diff --git a/lib/smithy-output/api-auth/rust/rust/src/error_meta.rs b/lib/smithy-output/api-auth/rust/rust/src/error_meta.rs deleted file mode 100644 index 1a66a6c51..000000000 --- a/lib/smithy-output/api-auth/rust/rust/src/error_meta.rs +++ /dev/null @@ -1,142 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// All possible error types for this service. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum Error { - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An unhandled error occurred. - Unhandled(Box), -} -impl std::fmt::Display for Error { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Error::BadRequestError(inner) => inner.fmt(f), - Error::ForbiddenError(inner) => inner.fmt(f), - Error::InternalError(inner) => inner.fmt(f), - Error::NotFoundError(inner) => inner.fmt(f), - Error::RateLimitError(inner) => inner.fmt(f), - Error::UnauthorizedError(inner) => inner.fmt(f), - Error::Unhandled(inner) => inner.fmt(f), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::CompleteEmailVerificationErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::CompleteEmailVerificationErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::CompleteEmailVerificationErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::CompleteEmailVerificationErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::CompleteEmailVerificationErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::CompleteEmailVerificationErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::CompleteEmailVerificationErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::RefreshIdentityTokenErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::RefreshIdentityTokenErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::RefreshIdentityTokenErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::RefreshIdentityTokenErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::RefreshIdentityTokenErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::RefreshIdentityTokenErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::RefreshIdentityTokenErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::StartEmailVerificationErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::StartEmailVerificationErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::StartEmailVerificationErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::StartEmailVerificationErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::StartEmailVerificationErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::StartEmailVerificationErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::StartEmailVerificationErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl std::error::Error for Error {} diff --git a/lib/smithy-output/api-auth/rust/rust/src/http_serde.rs b/lib/smithy-output/api-auth/rust/rust/src/http_serde.rs deleted file mode 100644 index d03559847..000000000 --- a/lib/smithy-output/api-auth/rust/rust/src/http_serde.rs +++ /dev/null @@ -1,38 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub fn add_headers_refresh_identity_token( - input: &crate::input::RefreshIdentityTokenInput, - mut builder: http::request::Builder, -) -> std::result::Result { - if let Some(inner_1) = &input.cookie { - for inner_2 in inner_1 { - let formatted_3 = - aws_smithy_http::header::quote_header_value(AsRef::::as_ref(inner_2)); - if !formatted_3.is_empty() { - let header_value = formatted_3; - let header_value = - http::header::HeaderValue::try_from(&*header_value).map_err(|err| { - aws_smithy_http::operation::BuildError::InvalidField { - field: "cookie", - details: format!( - "`{}` cannot be used as a header value: {}", - &header_value, err - ), - } - })?; - builder = builder.header("cookie", header_value); - } - } - } - Ok(builder) -} - -pub fn deser_header_refresh_identity_token_refresh_identity_token_output_set_cookie( - header_map: &http::HeaderMap, -) -> std::result::Result< - std::option::Option>, - aws_smithy_http::header::ParseError, -> { - let headers = header_map.get_all("set-cookie").iter(); - let var_4: Vec = aws_smithy_http::header::read_many_from_str(headers)?; - Ok(if !var_4.is_empty() { Some(var_4) } else { None }) -} diff --git a/lib/smithy-output/api-auth/rust/rust/src/input.rs b/lib/smithy-output/api-auth/rust/rust/src/input.rs deleted file mode 100644 index 4f3dce2f2..000000000 --- a/lib/smithy-output/api-auth/rust/rust/src/input.rs +++ /dev/null @@ -1,508 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -use std::fmt::Write; -/// See [`CompleteEmailVerificationInput`](crate::input::CompleteEmailVerificationInput) -pub mod complete_email_verification_input { - /// A builder for [`CompleteEmailVerificationInput`](crate::input::CompleteEmailVerificationInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) verification_id: std::option::Option, - pub(crate) code: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn verification_id(mut self, input: impl Into) -> Self { - self.verification_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_verification_id( - mut self, - input: std::option::Option, - ) -> Self { - self.verification_id = input; - self - } - /// The code sent to the requestee's email. - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - /// The code sent to the requestee's email. - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - /// Consumes the builder and constructs a [`CompleteEmailVerificationInput`](crate::input::CompleteEmailVerificationInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::CompleteEmailVerificationInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::CompleteEmailVerificationInput { - verification_id: self.verification_id, - code: self.code, - }) - } - } -} -#[doc(hidden)] -pub type CompleteEmailVerificationInputOperationOutputAlias = - crate::operation::CompleteEmailVerification; -#[doc(hidden)] -pub type CompleteEmailVerificationInputOperationRetryAlias = (); -impl CompleteEmailVerificationInput { - /// Consumes the builder and constructs an Operation<[`CompleteEmailVerification`](crate::operation::CompleteEmailVerification)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::CompleteEmailVerificationInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/identity/email/complete-verification") - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::CompleteEmailVerificationInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_complete_email_verification( - &self, - )?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::CompleteEmailVerification::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "CompleteEmailVerification", - "AuthService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`CompleteEmailVerificationInput`](crate::input::CompleteEmailVerificationInput) - pub fn builder() -> crate::input::complete_email_verification_input::Builder { - crate::input::complete_email_verification_input::Builder::default() - } -} - -/// See [`RefreshIdentityTokenInput`](crate::input::RefreshIdentityTokenInput) -pub mod refresh_identity_token_input { - /// A builder for [`RefreshIdentityTokenInput`](crate::input::RefreshIdentityTokenInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) cookie: std::option::Option>, - pub(crate) logout: std::option::Option, - } - impl Builder { - /// Appends an item to `cookie`. - /// - /// To override the contents of this collection use [`set_cookie`](Self::set_cookie). - /// - /// Cookie values. Usually does not need to be manually set. - pub fn cookie(mut self, input: impl Into) -> Self { - let mut v = self.cookie.unwrap_or_default(); - v.push(input.into()); - self.cookie = Some(v); - self - } - /// Cookie values. Usually does not need to be manually set. - pub fn set_cookie( - mut self, - input: std::option::Option>, - ) -> Self { - self.cookie = input; - self - } - /// When `true`, the current identity for the provided cookie will be logged out and a new identity will be returned. - pub fn logout(mut self, input: bool) -> Self { - self.logout = Some(input); - self - } - /// When `true`, the current identity for the provided cookie will be logged out and a new identity will be returned. - pub fn set_logout(mut self, input: std::option::Option) -> Self { - self.logout = input; - self - } - /// Consumes the builder and constructs a [`RefreshIdentityTokenInput`](crate::input::RefreshIdentityTokenInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::RefreshIdentityTokenInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::RefreshIdentityTokenInput { - cookie: self.cookie, - logout: self.logout, - }) - } - } -} -#[doc(hidden)] -pub type RefreshIdentityTokenInputOperationOutputAlias = crate::operation::RefreshIdentityToken; -#[doc(hidden)] -pub type RefreshIdentityTokenInputOperationRetryAlias = (); -impl RefreshIdentityTokenInput { - /// Consumes the builder and constructs an Operation<[`RefreshIdentityToken`](crate::operation::RefreshIdentityToken)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::RefreshIdentityTokenInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/tokens/identity").expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::RefreshIdentityTokenInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - let builder = - crate::http_serde::add_headers_refresh_identity_token(input, builder)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_refresh_identity_token( - &self, - )?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::RefreshIdentityToken::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "RefreshIdentityToken", - "AuthService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`RefreshIdentityTokenInput`](crate::input::RefreshIdentityTokenInput) - pub fn builder() -> crate::input::refresh_identity_token_input::Builder { - crate::input::refresh_identity_token_input::Builder::default() - } -} - -/// See [`StartEmailVerificationInput`](crate::input::StartEmailVerificationInput) -pub mod start_email_verification_input { - /// A builder for [`StartEmailVerificationInput`](crate::input::StartEmailVerificationInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) email: std::option::Option, - pub(crate) captcha: std::option::Option, - pub(crate) game_id: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn email(mut self, input: impl Into) -> Self { - self.email = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_email(mut self, input: std::option::Option) -> Self { - self.email = input; - self - } - /// Methods to verify a captcha. - pub fn captcha(mut self, input: crate::model::CaptchaConfig) -> Self { - self.captcha = Some(input); - self - } - /// Methods to verify a captcha. - pub fn set_captcha( - mut self, - input: std::option::Option, - ) -> Self { - self.captcha = input; - self - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// Consumes the builder and constructs a [`StartEmailVerificationInput`](crate::input::StartEmailVerificationInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::StartEmailVerificationInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::StartEmailVerificationInput { - email: self.email, - captcha: self.captcha, - game_id: self.game_id, - }) - } - } -} -#[doc(hidden)] -pub type StartEmailVerificationInputOperationOutputAlias = crate::operation::StartEmailVerification; -#[doc(hidden)] -pub type StartEmailVerificationInputOperationRetryAlias = (); -impl StartEmailVerificationInput { - /// Consumes the builder and constructs an Operation<[`StartEmailVerification`](crate::operation::StartEmailVerification)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::StartEmailVerificationInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/identity/email/start-verification") - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::StartEmailVerificationInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_start_email_verification( - &self, - )?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::StartEmailVerification::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "StartEmailVerification", - "AuthService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`StartEmailVerificationInput`](crate::input::StartEmailVerificationInput) - pub fn builder() -> crate::input::start_email_verification_input::Builder { - crate::input::start_email_verification_input::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CompleteEmailVerificationInput { - /// A universally unique identifier. - pub verification_id: std::option::Option, - /// The code sent to the requestee's email. - pub code: std::option::Option, -} -impl CompleteEmailVerificationInput { - /// A universally unique identifier. - pub fn verification_id(&self) -> std::option::Option<&str> { - self.verification_id.as_deref() - } - /// The code sent to the requestee's email. - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } -} -impl std::fmt::Debug for CompleteEmailVerificationInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CompleteEmailVerificationInput"); - formatter.field("verification_id", &self.verification_id); - formatter.field("code", &self.code); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct StartEmailVerificationInput { - #[allow(missing_docs)] // documentation missing in model - pub email: std::option::Option, - /// Methods to verify a captcha. - pub captcha: std::option::Option, - /// A universally unique identifier. - pub game_id: std::option::Option, -} -impl StartEmailVerificationInput { - #[allow(missing_docs)] // documentation missing in model - pub fn email(&self) -> std::option::Option<&str> { - self.email.as_deref() - } - /// Methods to verify a captcha. - pub fn captcha(&self) -> std::option::Option<&crate::model::CaptchaConfig> { - self.captcha.as_ref() - } - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } -} -impl std::fmt::Debug for StartEmailVerificationInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("StartEmailVerificationInput"); - formatter.field("email", &self.email); - formatter.field("captcha", &self.captcha); - formatter.field("game_id", &self.game_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct RefreshIdentityTokenInput { - /// Cookie values. Usually does not need to be manually set. - pub cookie: std::option::Option>, - /// When `true`, the current identity for the provided cookie will be logged out and a new identity will be returned. - pub logout: std::option::Option, -} -impl RefreshIdentityTokenInput { - /// Cookie values. Usually does not need to be manually set. - pub fn cookie(&self) -> std::option::Option<&[std::string::String]> { - self.cookie.as_deref() - } - /// When `true`, the current identity for the provided cookie will be logged out and a new identity will be returned. - pub fn logout(&self) -> std::option::Option { - self.logout - } -} -impl std::fmt::Debug for RefreshIdentityTokenInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("RefreshIdentityTokenInput"); - formatter.field("cookie", &self.cookie); - formatter.field("logout", &self.logout); - formatter.finish() - } -} diff --git a/lib/smithy-output/api-auth/rust/rust/src/json_deser.rs b/lib/smithy-output/api-auth/rust/rust/src/json_deser.rs deleted file mode 100644 index 467a86d41..000000000 --- a/lib/smithy-output/api-auth/rust/rust/src/json_deser.rs +++ /dev/null @@ -1,559 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub fn parse_http_generic_error( - response: &http::Response, -) -> Result { - crate::json_errors::parse_generic_error(response.body(), response.headers()) -} - -pub fn deser_structure_crate_error_internal_error_json_err( - value: &[u8], - mut builder: crate::error::internal_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_rate_limit_error_json_err( - value: &[u8], - mut builder: crate::error::rate_limit_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_forbidden_error_json_err( - value: &[u8], - mut builder: crate::error::forbidden_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_unauthorized_error_json_err( - value: &[u8], - mut builder: crate::error::unauthorized_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_not_found_error_json_err( - value: &[u8], - mut builder: crate::error::not_found_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_bad_request_error_json_err( - value: &[u8], - mut builder: crate::error::bad_request_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_complete_email_verification( - value: &[u8], - mut builder: crate::output::complete_email_verification_output::Builder, -) -> Result< - crate::output::complete_email_verification_output::Builder, - aws_smithy_json::deserialize::Error, -> { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "status" => { - builder = builder.set_status( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| { - s.to_unescaped() - .map(|u| crate::model::CompleteStatus::from(u.as_ref())) - }) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_refresh_identity_token( - value: &[u8], - mut builder: crate::output::refresh_identity_token_output::Builder, -) -> Result< - crate::output::refresh_identity_token_output::Builder, - aws_smithy_json::deserialize::Error, -> { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "exp" => { - builder = builder.set_exp( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "identity_id" => { - builder = builder.set_identity_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "token" => { - builder = builder.set_token( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_start_email_verification( - value: &[u8], - mut builder: crate::output::start_email_verification_output::Builder, -) -> Result< - crate::output::start_email_verification_output::Builder, - aws_smithy_json::deserialize::Error, -> { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "verification_id" => { - builder = builder.set_verification_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn or_empty_doc(data: &[u8]) -> &[u8] { - if data.is_empty() { - b"{}" - } else { - data - } -} diff --git a/lib/smithy-output/api-auth/rust/rust/src/json_errors.rs b/lib/smithy-output/api-auth/rust/rust/src/json_errors.rs deleted file mode 100644 index 7b7574319..000000000 --- a/lib/smithy-output/api-auth/rust/rust/src/json_errors.rs +++ /dev/null @@ -1,220 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -use aws_smithy_json::deserialize::token::skip_value; -use aws_smithy_json::deserialize::{json_token_iter, Error as DeserializeError, Token}; -use aws_smithy_types::Error as SmithyError; -use bytes::Bytes; -use http::header::ToStrError; -use http::{HeaderMap, HeaderValue}; -use std::borrow::Cow; - -// currently only used by AwsJson -#[allow(unused)] -pub fn is_error(response: &http::Response) -> bool { - !response.status().is_success() -} - -fn sanitize_error_code(error_code: &str) -> &str { - // Trim a trailing URL from the error code, beginning with a `:` - let error_code = match error_code.find(':') { - Some(idx) => &error_code[..idx], - None => error_code, - }; - - // Trim a prefixing namespace from the error code, beginning with a `#` - match error_code.find('#') { - Some(idx) => &error_code[idx + 1..], - None => error_code, - } -} - -struct ErrorBody<'a> { - code: Option>, - message: Option>, -} - -fn parse_error_body(bytes: &[u8]) -> Result { - let mut tokens = json_token_iter(bytes).peekable(); - let (mut typ, mut code, mut message) = (None, None, None); - if let Some(Token::StartObject { .. }) = tokens.next().transpose()? { - loop { - match tokens.next().transpose()? { - Some(Token::EndObject { .. }) => break, - Some(Token::ObjectKey { key, .. }) => { - if let Some(Ok(Token::ValueString { value, .. })) = tokens.peek() { - match key.as_escaped_str() { - "code" => code = Some(value.to_unescaped()?), - "__type" => typ = Some(value.to_unescaped()?), - "message" | "Message" | "errorMessage" => { - message = Some(value.to_unescaped()?) - } - _ => {} - } - } - skip_value(&mut tokens)?; - } - _ => { - return Err(DeserializeError::custom( - "expected object key or end object", - )) - } - } - } - if tokens.next().is_some() { - return Err(DeserializeError::custom( - "found more JSON tokens after completing parsing", - )); - } - } - Ok(ErrorBody { - code: code.or(typ), - message, - }) -} - -fn error_type_from_header(headers: &HeaderMap) -> Result, ToStrError> { - headers - .get("X-Amzn-Errortype") - .map(|v| v.to_str()) - .transpose() -} - -fn request_id(headers: &HeaderMap) -> Option<&str> { - headers - .get("X-Amzn-Requestid") - .and_then(|v| v.to_str().ok()) -} - -pub fn parse_generic_error( - payload: &Bytes, - headers: &HeaderMap, -) -> Result { - let ErrorBody { code, message } = parse_error_body(payload.as_ref())?; - - let mut err_builder = SmithyError::builder(); - if let Some(code) = error_type_from_header(headers) - .map_err(|_| DeserializeError::custom("X-Amzn-Errortype header was not valid UTF-8"))? - .or_else(|| code.as_deref()) - .map(sanitize_error_code) - { - err_builder.code(code); - } - if let Some(message) = message { - err_builder.message(message); - } - if let Some(request_id) = request_id(headers) { - err_builder.request_id(request_id); - } - Ok(err_builder.build()) -} - -#[cfg(test)] -mod test { - use crate::json_errors::{parse_error_body, parse_generic_error, sanitize_error_code}; - use aws_smithy_types::Error; - use bytes::Bytes; - use std::borrow::Cow; - - #[test] - fn generic_error() { - let response = http::Response::builder() - .header("X-Amzn-Requestid", "1234") - .body(Bytes::from_static( - br#"{ "__type": "FooError", "message": "Go to foo" }"#, - )) - .unwrap(); - assert_eq!( - parse_generic_error(response.body(), response.headers()).unwrap(), - Error::builder() - .code("FooError") - .message("Go to foo") - .request_id("1234") - .build() - ) - } - - #[test] - fn error_type() { - assert_eq!( - Some(Cow::Borrowed("FooError")), - parse_error_body(br#"{ "__type": "FooError" }"#) - .unwrap() - .code - ); - } - - #[test] - fn code_takes_priority() { - assert_eq!( - Some(Cow::Borrowed("BarError")), - parse_error_body(br#"{ "code": "BarError", "__type": "FooError" }"#) - .unwrap() - .code - ); - } - - #[test] - fn ignore_unrecognized_fields() { - assert_eq!( - Some(Cow::Borrowed("FooError")), - parse_error_body(br#"{ "__type": "FooError", "asdf": 5, "fdsa": {}, "foo": "1" }"#) - .unwrap() - .code - ); - } - - #[test] - fn sanitize_namespace_and_url() { - assert_eq!( - sanitize_error_code("aws.protocoltests.restjson#FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/"), - "FooError"); - } - - #[test] - fn sanitize_noop() { - assert_eq!(sanitize_error_code("FooError"), "FooError"); - } - - #[test] - fn sanitize_url() { - assert_eq!( - sanitize_error_code( - "FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/" - ), - "FooError" - ); - } - - #[test] - fn sanitize_namespace() { - assert_eq!( - sanitize_error_code("aws.protocoltests.restjson#FooError"), - "FooError" - ); - } - - // services like lambda use an alternate `Message` instead of `message` - #[test] - fn alternative_error_message_names() { - let response = http::Response::builder() - .header("x-amzn-errortype", "ResourceNotFoundException") - .body(Bytes::from_static( - br#"{ - "Type": "User", - "Message": "Functions from 'us-west-2' are not reachable from us-east-1" - }"#, - )) - .unwrap(); - assert_eq!( - parse_generic_error(response.body(), response.headers()).unwrap(), - Error::builder() - .code("ResourceNotFoundException") - .message("Functions from 'us-west-2' are not reachable from us-east-1") - .build() - ); - } -} diff --git a/lib/smithy-output/api-auth/rust/rust/src/json_ser.rs b/lib/smithy-output/api-auth/rust/rust/src/json_ser.rs deleted file mode 100644 index aa295dd44..000000000 --- a/lib/smithy-output/api-auth/rust/rust/src/json_ser.rs +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub fn serialize_structure_crate_input_complete_email_verification_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::CompleteEmailVerificationInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_1) = &input.code { - object.key("code").string(var_1.as_str()); - } - if let Some(var_2) = &input.verification_id { - object.key("verification_id").string(var_2.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_refresh_identity_token_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::RefreshIdentityTokenInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_3) = &input.logout { - object.key("logout").boolean(*var_3); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_start_email_verification_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::StartEmailVerificationInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_4) = &input.captcha { - let mut object_5 = object.key("captcha").start_object(); - crate::json_ser::serialize_union_crate_model_captcha_config(&mut object_5, var_4)?; - object_5.finish(); - } - if let Some(var_6) = &input.email { - object.key("email").string(var_6.as_str()); - } - if let Some(var_7) = &input.game_id { - object.key("game_id").string(var_7.as_str()); - } - Ok(()) -} - -pub fn serialize_union_crate_model_captcha_config( - object_5: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::CaptchaConfig, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - match input { - crate::model::CaptchaConfig::Hcaptcha(inner) => { - let mut object_8 = object_5.key("hcaptcha").start_object(); - crate::json_ser::serialize_structure_crate_model_captcha_config_hcaptcha( - &mut object_8, - inner, - )?; - object_8.finish(); - } - crate::model::CaptchaConfig::Turnstile(inner) => { - let mut object_9 = object_5.key("turnstile").start_object(); - crate::json_ser::serialize_structure_crate_model_captcha_config_turnstile( - &mut object_9, - inner, - )?; - object_9.finish(); - } - crate::model::CaptchaConfig::Unknown => { - return Err( - aws_smithy_http::operation::SerializationError::unknown_variant("CaptchaConfig"), - ) - } - } - Ok(()) -} - -pub fn serialize_structure_crate_model_captcha_config_hcaptcha( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::CaptchaConfigHcaptcha, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_10) = &input.client_response { - object.key("client_response").string(var_10.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_model_captcha_config_turnstile( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::CaptchaConfigTurnstile, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_11) = &input.client_response { - object.key("client_response").string(var_11.as_str()); - } - Ok(()) -} diff --git a/lib/smithy-output/api-auth/rust/rust/src/lib.rs b/lib/smithy-output/api-auth/rust/rust/src/lib.rs deleted file mode 100644 index 86421da02..000000000 --- a/lib/smithy-output/api-auth/rust/rust/src/lib.rs +++ /dev/null @@ -1,58 +0,0 @@ -#![allow(clippy::module_inception)] -#![allow(clippy::upper_case_acronyms)] -#![allow(clippy::large_enum_variant)] -#![allow(clippy::wrong_self_convention)] -#![allow(clippy::should_implement_trait)] -#![allow(clippy::blacklisted_name)] -#![allow(clippy::vec_init_then_push)] -#![allow(rustdoc::bare_urls)] -#![warn(missing_docs)] -//! rivet-auth -//! -//! # Crate Organization -//! -//! The entry point for most customers will be [`Client`]. [`Client`] exposes one method for each API offered -//! by the service. -//! -//! Some APIs require complex or nested arguments. These exist in [`model`](crate::model). -//! -//! Lastly, errors that can be returned by the service are contained within [`error`]. [`Error`] defines a meta -//! error encompassing all possible errors that can be returned by the service. -//! -//! The other modules within this crate are not required for normal usage. - -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use error_meta::Error; - -#[doc(inline)] -pub use config::Config; - -/// Client and fluent builders for calling the service. -pub mod client; -/// Configuration for the service. -pub mod config; -/// Errors that can occur when calling the service. -pub mod error; -mod error_meta; -mod http_serde; -/// Input structures for operations. -pub mod input; -mod json_deser; -mod json_errors; -mod json_ser; -/// Data structures used by operation inputs/outputs. -pub mod model; -/// All operations that this crate can perform. -pub mod operation; -mod operation_deser; -mod operation_ser; -/// Output structures for operations. -pub mod output; -pub use client::{Builder, Client, ClientWrapper}; -/// Crate version number. -pub static PKG_VERSION: &str = env!("CARGO_PKG_VERSION"); -/// Re-exported types from supporting crates. -pub mod types { - pub use aws_smithy_http::result::SdkError; - pub use aws_smithy_types::DateTime; -} diff --git a/lib/smithy-output/api-auth/rust/rust/src/model.rs b/lib/smithy-output/api-auth/rust/rust/src/model.rs deleted file mode 100644 index ec938e89c..000000000 --- a/lib/smithy-output/api-auth/rust/rust/src/model.rs +++ /dev/null @@ -1,245 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Represents the state of an external account linking process. -#[non_exhaustive] -#[derive( - std::clone::Clone, - std::cmp::Eq, - std::cmp::Ord, - std::cmp::PartialEq, - std::cmp::PartialOrd, - std::fmt::Debug, - std::hash::Hash, -)] -pub enum CompleteStatus { - /// The current linking process has already completed. - AlreadyComplete, - /// The current linking process has expired. - Expired, - /// The code given to the current linking process is incorrect. - Incorrect, - /// The linking process succeeded and the new account is now added. - LinkedAccountAdded, - /// The linking process succeeded and will now switch identities. - SwitchIdentity, - /// The current linking process has been tried too many times. - TooManyAttempts, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for CompleteStatus { - fn from(s: &str) -> Self { - match s { - "already_complete" => CompleteStatus::AlreadyComplete, - "expired" => CompleteStatus::Expired, - "incorrect" => CompleteStatus::Incorrect, - "linked_account_added" => CompleteStatus::LinkedAccountAdded, - "switch_identity" => CompleteStatus::SwitchIdentity, - "too_many_attempts" => CompleteStatus::TooManyAttempts, - other => CompleteStatus::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for CompleteStatus { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(CompleteStatus::from(s)) - } -} -impl CompleteStatus { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - CompleteStatus::AlreadyComplete => "already_complete", - CompleteStatus::Expired => "expired", - CompleteStatus::Incorrect => "incorrect", - CompleteStatus::LinkedAccountAdded => "linked_account_added", - CompleteStatus::SwitchIdentity => "switch_identity", - CompleteStatus::TooManyAttempts => "too_many_attempts", - CompleteStatus::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &[ - "already_complete", - "expired", - "incorrect", - "linked_account_added", - "switch_identity", - "too_many_attempts", - ] - } -} -impl AsRef for CompleteStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// Methods to verify a captcha. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] -pub enum CaptchaConfig { - /// hCaptcha configuration. - Hcaptcha(crate::model::CaptchaConfigHcaptcha), - /// Cloudflare Turnstile configuration. - Turnstile(crate::model::CaptchaConfigTurnstile), - /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version. - /// An unknown enum variant - /// - /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._ - /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized - /// by the client. This can happen when the server adds new functionality, but the client has not been updated. - /// To investigate this, consider turning on debug logging to print the raw HTTP response. - #[non_exhaustive] - Unknown, -} -impl CaptchaConfig { - /// Tries to convert the enum instance into [`Hcaptcha`](crate::model::CaptchaConfig::Hcaptcha), extracting the inner [`CaptchaConfigHcaptcha`](crate::model::CaptchaConfigHcaptcha). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_hcaptcha(&self) -> std::result::Result<&crate::model::CaptchaConfigHcaptcha, &Self> { - if let CaptchaConfig::Hcaptcha(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`Hcaptcha`](crate::model::CaptchaConfig::Hcaptcha). - pub fn is_hcaptcha(&self) -> bool { - self.as_hcaptcha().is_ok() - } - /// Tries to convert the enum instance into [`Turnstile`](crate::model::CaptchaConfig::Turnstile), extracting the inner [`CaptchaConfigTurnstile`](crate::model::CaptchaConfigTurnstile). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_turnstile( - &self, - ) -> std::result::Result<&crate::model::CaptchaConfigTurnstile, &Self> { - if let CaptchaConfig::Turnstile(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`Turnstile`](crate::model::CaptchaConfig::Turnstile). - pub fn is_turnstile(&self) -> bool { - self.as_turnstile().is_ok() - } - /// Returns true if the enum instance is the `Unknown` variant. - pub fn is_unknown(&self) -> bool { - matches!(self, Self::Unknown) - } -} - -/// Cloudflare Turnstile configuration. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CaptchaConfigTurnstile { - #[allow(missing_docs)] // documentation missing in model - pub client_response: std::option::Option, -} -impl CaptchaConfigTurnstile { - #[allow(missing_docs)] // documentation missing in model - pub fn client_response(&self) -> std::option::Option<&str> { - self.client_response.as_deref() - } -} -impl std::fmt::Debug for CaptchaConfigTurnstile { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CaptchaConfigTurnstile"); - formatter.field("client_response", &self.client_response); - formatter.finish() - } -} -/// See [`CaptchaConfigTurnstile`](crate::model::CaptchaConfigTurnstile) -pub mod captcha_config_turnstile { - /// A builder for [`CaptchaConfigTurnstile`](crate::model::CaptchaConfigTurnstile) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) client_response: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn client_response(mut self, input: impl Into) -> Self { - self.client_response = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_client_response( - mut self, - input: std::option::Option, - ) -> Self { - self.client_response = input; - self - } - /// Consumes the builder and constructs a [`CaptchaConfigTurnstile`](crate::model::CaptchaConfigTurnstile) - pub fn build(self) -> crate::model::CaptchaConfigTurnstile { - crate::model::CaptchaConfigTurnstile { - client_response: self.client_response, - } - } - } -} -impl CaptchaConfigTurnstile { - /// Creates a new builder-style object to manufacture [`CaptchaConfigTurnstile`](crate::model::CaptchaConfigTurnstile) - pub fn builder() -> crate::model::captcha_config_turnstile::Builder { - crate::model::captcha_config_turnstile::Builder::default() - } -} - -/// hCaptcha configuration. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CaptchaConfigHcaptcha { - #[allow(missing_docs)] // documentation missing in model - pub client_response: std::option::Option, -} -impl CaptchaConfigHcaptcha { - #[allow(missing_docs)] // documentation missing in model - pub fn client_response(&self) -> std::option::Option<&str> { - self.client_response.as_deref() - } -} -impl std::fmt::Debug for CaptchaConfigHcaptcha { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CaptchaConfigHcaptcha"); - formatter.field("client_response", &self.client_response); - formatter.finish() - } -} -/// See [`CaptchaConfigHcaptcha`](crate::model::CaptchaConfigHcaptcha) -pub mod captcha_config_hcaptcha { - /// A builder for [`CaptchaConfigHcaptcha`](crate::model::CaptchaConfigHcaptcha) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) client_response: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn client_response(mut self, input: impl Into) -> Self { - self.client_response = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_client_response( - mut self, - input: std::option::Option, - ) -> Self { - self.client_response = input; - self - } - /// Consumes the builder and constructs a [`CaptchaConfigHcaptcha`](crate::model::CaptchaConfigHcaptcha) - pub fn build(self) -> crate::model::CaptchaConfigHcaptcha { - crate::model::CaptchaConfigHcaptcha { - client_response: self.client_response, - } - } - } -} -impl CaptchaConfigHcaptcha { - /// Creates a new builder-style object to manufacture [`CaptchaConfigHcaptcha`](crate::model::CaptchaConfigHcaptcha) - pub fn builder() -> crate::model::captcha_config_hcaptcha::Builder { - crate::model::captcha_config_hcaptcha::Builder::default() - } -} diff --git a/lib/smithy-output/api-auth/rust/rust/src/operation.rs b/lib/smithy-output/api-auth/rust/rust/src/operation.rs deleted file mode 100644 index e380f67ef..000000000 --- a/lib/smithy-output/api-auth/rust/rust/src/operation.rs +++ /dev/null @@ -1,102 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Operation shape for `CompleteEmailVerification`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`complete_email_verification`](crate::client::Client::complete_email_verification). -/// -/// See [`crate::client::fluent_builders::CompleteEmailVerification`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct CompleteEmailVerification { - _private: (), -} -impl CompleteEmailVerification { - /// Creates a new builder-style object to manufacture [`CompleteEmailVerificationInput`](crate::input::CompleteEmailVerificationInput) - pub fn builder() -> crate::input::complete_email_verification_input::Builder { - crate::input::complete_email_verification_input::Builder::default() - } - /// Creates a new `CompleteEmailVerification` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for CompleteEmailVerification { - type Output = std::result::Result< - crate::output::CompleteEmailVerificationOutput, - crate::error::CompleteEmailVerificationError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_complete_email_verification_error(response) - } else { - crate::operation_deser::parse_complete_email_verification_response(response) - } - } -} - -/// Operation shape for `RefreshIdentityToken`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`refresh_identity_token`](crate::client::Client::refresh_identity_token). -/// -/// See [`crate::client::fluent_builders::RefreshIdentityToken`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct RefreshIdentityToken { - _private: (), -} -impl RefreshIdentityToken { - /// Creates a new builder-style object to manufacture [`RefreshIdentityTokenInput`](crate::input::RefreshIdentityTokenInput) - pub fn builder() -> crate::input::refresh_identity_token_input::Builder { - crate::input::refresh_identity_token_input::Builder::default() - } - /// Creates a new `RefreshIdentityToken` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for RefreshIdentityToken { - type Output = std::result::Result< - crate::output::RefreshIdentityTokenOutput, - crate::error::RefreshIdentityTokenError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_refresh_identity_token_error(response) - } else { - crate::operation_deser::parse_refresh_identity_token_response(response) - } - } -} - -/// Operation shape for `StartEmailVerification`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`start_email_verification`](crate::client::Client::start_email_verification). -/// -/// See [`crate::client::fluent_builders::StartEmailVerification`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct StartEmailVerification { - _private: (), -} -impl StartEmailVerification { - /// Creates a new builder-style object to manufacture [`StartEmailVerificationInput`](crate::input::StartEmailVerificationInput) - pub fn builder() -> crate::input::start_email_verification_input::Builder { - crate::input::start_email_verification_input::Builder::default() - } - /// Creates a new `StartEmailVerification` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for StartEmailVerification { - type Output = std::result::Result< - crate::output::StartEmailVerificationOutput, - crate::error::StartEmailVerificationError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_start_email_verification_error(response) - } else { - crate::operation_deser::parse_start_email_verification_response(response) - } - } -} diff --git a/lib/smithy-output/api-auth/rust/rust/src/operation_deser.rs b/lib/smithy-output/api-auth/rust/rust/src/operation_deser.rs deleted file mode 100644 index 7a4e13305..000000000 --- a/lib/smithy-output/api-auth/rust/rust/src/operation_deser.rs +++ /dev/null @@ -1,483 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[allow(clippy::unnecessary_wraps)] -pub fn parse_complete_email_verification_error( - response: &http::Response, -) -> std::result::Result< - crate::output::CompleteEmailVerificationOutput, - crate::error::CompleteEmailVerificationError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::CompleteEmailVerificationError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => { - return Err(crate::error::CompleteEmailVerificationError::unhandled( - generic, - )) - } - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::CompleteEmailVerificationError { - meta: generic, - kind: crate::error::CompleteEmailVerificationErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::CompleteEmailVerificationError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::CompleteEmailVerificationError { - meta: generic, - kind: crate::error::CompleteEmailVerificationErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::CompleteEmailVerificationError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::CompleteEmailVerificationError { - meta: generic, - kind: crate::error::CompleteEmailVerificationErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::CompleteEmailVerificationError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::CompleteEmailVerificationError { - meta: generic, - kind: crate::error::CompleteEmailVerificationErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::CompleteEmailVerificationError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::CompleteEmailVerificationError { - meta: generic, - kind: crate::error::CompleteEmailVerificationErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::CompleteEmailVerificationError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::CompleteEmailVerificationError { - meta: generic, - kind: crate::error::CompleteEmailVerificationErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::CompleteEmailVerificationError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::CompleteEmailVerificationError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_complete_email_verification_response( - response: &http::Response, -) -> std::result::Result< - crate::output::CompleteEmailVerificationOutput, - crate::error::CompleteEmailVerificationError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::complete_email_verification_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_complete_email_verification( - response.body().as_ref(), - output, - ) - .map_err(crate::error::CompleteEmailVerificationError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_refresh_identity_token_error( - response: &http::Response, -) -> std::result::Result< - crate::output::RefreshIdentityTokenOutput, - crate::error::RefreshIdentityTokenError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::RefreshIdentityTokenError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::RefreshIdentityTokenError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::RefreshIdentityTokenError { - meta: generic, - kind: crate::error::RefreshIdentityTokenErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::RefreshIdentityTokenError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::RefreshIdentityTokenError { - meta: generic, - kind: crate::error::RefreshIdentityTokenErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::RefreshIdentityTokenError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::RefreshIdentityTokenError { - meta: generic, - kind: crate::error::RefreshIdentityTokenErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::RefreshIdentityTokenError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::RefreshIdentityTokenError { - meta: generic, - kind: crate::error::RefreshIdentityTokenErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::RefreshIdentityTokenError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::RefreshIdentityTokenError { - meta: generic, - kind: crate::error::RefreshIdentityTokenErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::RefreshIdentityTokenError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::RefreshIdentityTokenError { - meta: generic, - kind: crate::error::RefreshIdentityTokenErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::RefreshIdentityTokenError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::RefreshIdentityTokenError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_refresh_identity_token_response( - response: &http::Response, -) -> std::result::Result< - crate::output::RefreshIdentityTokenOutput, - crate::error::RefreshIdentityTokenError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::refresh_identity_token_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_refresh_identity_token( - response.body().as_ref(), - output, - ) - .map_err(crate::error::RefreshIdentityTokenError::unhandled)?; - output = output.set_set_cookie( - crate::http_serde::deser_header_refresh_identity_token_refresh_identity_token_output_set_cookie(response.headers()) - .map_err(|_|crate::error::RefreshIdentityTokenError::unhandled("Failed to parse set_cookie from header `set-cookie"))? - ); - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_start_email_verification_error( - response: &http::Response, -) -> std::result::Result< - crate::output::StartEmailVerificationOutput, - crate::error::StartEmailVerificationError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::StartEmailVerificationError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => { - return Err(crate::error::StartEmailVerificationError::unhandled( - generic, - )) - } - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::StartEmailVerificationError { - meta: generic, - kind: crate::error::StartEmailVerificationErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::StartEmailVerificationError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::StartEmailVerificationError { - meta: generic, - kind: crate::error::StartEmailVerificationErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::StartEmailVerificationError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::StartEmailVerificationError { - meta: generic, - kind: crate::error::StartEmailVerificationErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::StartEmailVerificationError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::StartEmailVerificationError { - meta: generic, - kind: crate::error::StartEmailVerificationErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::StartEmailVerificationError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::StartEmailVerificationError { - meta: generic, - kind: crate::error::StartEmailVerificationErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::StartEmailVerificationError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::StartEmailVerificationError { - meta: generic, - kind: crate::error::StartEmailVerificationErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::StartEmailVerificationError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::StartEmailVerificationError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_start_email_verification_response( - response: &http::Response, -) -> std::result::Result< - crate::output::StartEmailVerificationOutput, - crate::error::StartEmailVerificationError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::start_email_verification_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_start_email_verification( - response.body().as_ref(), - output, - ) - .map_err(crate::error::StartEmailVerificationError::unhandled)?; - output.build() - }) -} diff --git a/lib/smithy-output/api-auth/rust/rust/src/operation_ser.rs b/lib/smithy-output/api-auth/rust/rust/src/operation_ser.rs deleted file mode 100644 index e3a1a3190..000000000 --- a/lib/smithy-output/api-auth/rust/rust/src/operation_ser.rs +++ /dev/null @@ -1,39 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub fn serialize_operation_crate_operation_complete_email_verification( - input: &crate::input::CompleteEmailVerificationInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_complete_email_verification_input( - &mut object, - input, - )?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_refresh_identity_token( - input: &crate::input::RefreshIdentityTokenInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_refresh_identity_token_input( - &mut object, - input, - )?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_start_email_verification( - input: &crate::input::StartEmailVerificationInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_start_email_verification_input( - &mut object, - input, - )?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} diff --git a/lib/smithy-output/api-auth/rust/rust/src/output.rs b/lib/smithy-output/api-auth/rust/rust/src/output.rs deleted file mode 100644 index aff3f3402..000000000 --- a/lib/smithy-output/api-auth/rust/rust/src/output.rs +++ /dev/null @@ -1,234 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CompleteEmailVerificationOutput { - /// Represents the state of an external account linking process. - pub status: std::option::Option, -} -impl CompleteEmailVerificationOutput { - /// Represents the state of an external account linking process. - pub fn status(&self) -> std::option::Option<&crate::model::CompleteStatus> { - self.status.as_ref() - } -} -impl std::fmt::Debug for CompleteEmailVerificationOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CompleteEmailVerificationOutput"); - formatter.field("status", &self.status); - formatter.finish() - } -} -/// See [`CompleteEmailVerificationOutput`](crate::output::CompleteEmailVerificationOutput) -pub mod complete_email_verification_output { - /// A builder for [`CompleteEmailVerificationOutput`](crate::output::CompleteEmailVerificationOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) status: std::option::Option, - } - impl Builder { - /// Represents the state of an external account linking process. - pub fn status(mut self, input: crate::model::CompleteStatus) -> Self { - self.status = Some(input); - self - } - /// Represents the state of an external account linking process. - pub fn set_status( - mut self, - input: std::option::Option, - ) -> Self { - self.status = input; - self - } - /// Consumes the builder and constructs a [`CompleteEmailVerificationOutput`](crate::output::CompleteEmailVerificationOutput) - pub fn build(self) -> crate::output::CompleteEmailVerificationOutput { - crate::output::CompleteEmailVerificationOutput { - status: self.status, - } - } - } -} -impl CompleteEmailVerificationOutput { - /// Creates a new builder-style object to manufacture [`CompleteEmailVerificationOutput`](crate::output::CompleteEmailVerificationOutput) - pub fn builder() -> crate::output::complete_email_verification_output::Builder { - crate::output::complete_email_verification_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct StartEmailVerificationOutput { - /// A universally unique identifier. - pub verification_id: std::option::Option, -} -impl StartEmailVerificationOutput { - /// A universally unique identifier. - pub fn verification_id(&self) -> std::option::Option<&str> { - self.verification_id.as_deref() - } -} -impl std::fmt::Debug for StartEmailVerificationOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("StartEmailVerificationOutput"); - formatter.field("verification_id", &self.verification_id); - formatter.finish() - } -} -/// See [`StartEmailVerificationOutput`](crate::output::StartEmailVerificationOutput) -pub mod start_email_verification_output { - /// A builder for [`StartEmailVerificationOutput`](crate::output::StartEmailVerificationOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) verification_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn verification_id(mut self, input: impl Into) -> Self { - self.verification_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_verification_id( - mut self, - input: std::option::Option, - ) -> Self { - self.verification_id = input; - self - } - /// Consumes the builder and constructs a [`StartEmailVerificationOutput`](crate::output::StartEmailVerificationOutput) - pub fn build(self) -> crate::output::StartEmailVerificationOutput { - crate::output::StartEmailVerificationOutput { - verification_id: self.verification_id, - } - } - } -} -impl StartEmailVerificationOutput { - /// Creates a new builder-style object to manufacture [`StartEmailVerificationOutput`](crate::output::StartEmailVerificationOutput) - pub fn builder() -> crate::output::start_email_verification_output::Builder { - crate::output::start_email_verification_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct RefreshIdentityTokenOutput { - /// Server-set cookie values. - pub set_cookie: std::option::Option>, - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub token: std::option::Option, - /// Token expiration time (in milliseconds). - pub exp: std::option::Option, - /// A universally unique identifier. - pub identity_id: std::option::Option, -} -impl RefreshIdentityTokenOutput { - /// Server-set cookie values. - pub fn set_cookie(&self) -> std::option::Option<&[std::string::String]> { - self.set_cookie.as_deref() - } - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn token(&self) -> std::option::Option<&str> { - self.token.as_deref() - } - /// Token expiration time (in milliseconds). - pub fn exp(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.exp.as_ref() - } - /// A universally unique identifier. - pub fn identity_id(&self) -> std::option::Option<&str> { - self.identity_id.as_deref() - } -} -impl std::fmt::Debug for RefreshIdentityTokenOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("RefreshIdentityTokenOutput"); - formatter.field("set_cookie", &self.set_cookie); - formatter.field("token", &"*** Sensitive Data Redacted ***"); - formatter.field("exp", &self.exp); - formatter.field("identity_id", &self.identity_id); - formatter.finish() - } -} -/// See [`RefreshIdentityTokenOutput`](crate::output::RefreshIdentityTokenOutput) -pub mod refresh_identity_token_output { - /// A builder for [`RefreshIdentityTokenOutput`](crate::output::RefreshIdentityTokenOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) set_cookie: std::option::Option>, - pub(crate) token: std::option::Option, - pub(crate) exp: std::option::Option, - pub(crate) identity_id: std::option::Option, - } - impl Builder { - /// Appends an item to `set_cookie`. - /// - /// To override the contents of this collection use [`set_set_cookie`](Self::set_set_cookie). - /// - /// Server-set cookie values. - pub fn set_cookie(mut self, input: impl Into) -> Self { - let mut v = self.set_cookie.unwrap_or_default(); - v.push(input.into()); - self.set_cookie = Some(v); - self - } - /// Server-set cookie values. - pub fn set_set_cookie( - mut self, - input: std::option::Option>, - ) -> Self { - self.set_cookie = input; - self - } - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn token(mut self, input: impl Into) -> Self { - self.token = Some(input.into()); - self - } - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn set_token(mut self, input: std::option::Option) -> Self { - self.token = input; - self - } - /// Token expiration time (in milliseconds). - pub fn exp(mut self, input: aws_smithy_types::DateTime) -> Self { - self.exp = Some(input); - self - } - /// Token expiration time (in milliseconds). - pub fn set_exp(mut self, input: std::option::Option) -> Self { - self.exp = input; - self - } - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.identity_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.identity_id = input; - self - } - /// Consumes the builder and constructs a [`RefreshIdentityTokenOutput`](crate::output::RefreshIdentityTokenOutput) - pub fn build(self) -> crate::output::RefreshIdentityTokenOutput { - crate::output::RefreshIdentityTokenOutput { - set_cookie: self.set_cookie, - token: self.token, - exp: self.exp, - identity_id: self.identity_id, - } - } - } -} -impl RefreshIdentityTokenOutput { - /// Creates a new builder-style object to manufacture [`RefreshIdentityTokenOutput`](crate::output::RefreshIdentityTokenOutput) - pub fn builder() -> crate::output::refresh_identity_token_output::Builder { - crate::output::refresh_identity_token_output::Builder::default() - } -} diff --git a/lib/smithy-output/api-cf-verification/rust-server/rust-server/Cargo.toml b/lib/smithy-output/api-cf-verification/rust-server/rust-server/Cargo.toml deleted file mode 100644 index d31177f34..000000000 --- a/lib/smithy-output/api-cf-verification/rust-server/rust-server/Cargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -[package] -name = "rivet-cf-verification-server" -version = "0.0.1" -authors = ["Rivet "] -edition = "2021" -license = "Apache-2.0" - -[package.metadata.docs.rs] -all-features = true -targets = ["x86_64-unknown-linux-gnu"] - -[dependencies] -serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" -chrono = { version = "0.4", features = ["serde"] } diff --git a/lib/smithy-output/api-cf-verification/rust-server/rust-server/src/lib.rs b/lib/smithy-output/api-cf-verification/rust-server/rust-server/src/lib.rs deleted file mode 100644 index ff9294697..000000000 --- a/lib/smithy-output/api-cf-verification/rust-server/rust-server/src/lib.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod models; \ No newline at end of file diff --git a/lib/smithy-output/api-cf-verification/rust-server/rust-server/src/models.rs b/lib/smithy-output/api-cf-verification/rust-server/rust-server/src/models.rs deleted file mode 100644 index cb92f83b6..000000000 --- a/lib/smithy-output/api-cf-verification/rust-server/rust-server/src/models.rs +++ /dev/null @@ -1,16 +0,0 @@ -#[allow(unused_imports)] -use chrono; -#[allow(unused_imports)] -use serde::{Deserialize, Serialize}; - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct VerifyCustomHostnameRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct VerifyCustomHostnameResponse { - #[allow(missing_docs)] // documentation missing in model - pub body: std::string::String, -} - diff --git a/lib/smithy-output/api-cf-verification/rust/rust/Cargo.toml b/lib/smithy-output/api-cf-verification/rust/rust/Cargo.toml deleted file mode 100644 index 139a47b65..000000000 --- a/lib/smithy-output/api-cf-verification/rust/rust/Cargo.toml +++ /dev/null @@ -1,33 +0,0 @@ -# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -[package] -name = "rivet-cf-verification" -version = "0.0.1" -authors = ["Rivet Gaming, LLC "] -description = "" -edition = "2021" -license = "Apache-2.0" - -[package.metadata.docs.rs] -all-features = true -targets = ["x86_64-unknown-linux-gnu"] -[dependencies.aws-smithy-client] -version = "^0.41.0" -[dependencies.aws-smithy-http] -version = "^0.41.0" -[dependencies.aws-smithy-json] -version = "^0.41.0" -[dependencies.aws-smithy-types] -version = "^0.41.0" -[dependencies.bytes] -version = "1" -[dependencies.http] -version = "0.2" -[dependencies.tower] -version = "0.4" -[features] -rt-tokio = ["aws-smithy-http/rt-tokio"] -rustls = ["aws-smithy-client/rustls"] -native-tls = ["aws-smithy-client/native-tls"] -default = ["rt-tokio", "rustls"] - - diff --git a/lib/smithy-output/api-cf-verification/rust/rust/src/client.rs b/lib/smithy-output/api-cf-verification/rust/rust/src/client.rs deleted file mode 100644 index ffba29f37..000000000 --- a/lib/smithy-output/api-cf-verification/rust/rust/src/client.rs +++ /dev/null @@ -1,292 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[derive(Debug)] -pub(crate) struct Handle { - pub(crate) client: aws_smithy_client::Client, - pub(crate) conf: crate::Config, -} - -/// An ergonomic service client for `CfVerificationService`. -/// -/// This client allows ergonomic access to a `CfVerificationService`-shaped service. -/// Each method corresponds to an endpoint defined in the service's Smithy model, -/// and the request and response shapes are auto-generated from that same model. -/// -/// # Constructing a Client -/// -/// To construct a client, you need a few different things: -/// -/// - A [`Config`](crate::Config) that specifies additional configuration -/// required by the service. -/// - A connector (`C`) that specifies how HTTP requests are translated -/// into HTTP responses. This will typically be an HTTP client (like -/// `hyper`), though you can also substitute in your own, like a mock -/// mock connector for testing. -/// - A "middleware" (`M`) that modifies requests prior to them being -/// sent to the request. Most commonly, middleware will decide what -/// endpoint the requests should be sent to, as well as perform -/// authentication and authorization of requests (such as SigV4). -/// You can also have middleware that performs request/response -/// tracing, throttling, or other middleware-like tasks. -/// - A retry policy (`R`) that dictates the behavior for requests that -/// fail and should (potentially) be retried. The default type is -/// generally what you want, as it implements a well-vetted retry -/// policy implemented in [`RetryMode::Standard`](aws_smithy_types::retry::RetryMode::Standard). -/// -/// To construct a client, you will generally want to call -/// [`Client::with_config`], which takes a [`aws_smithy_client::Client`] (a -/// Smithy client that isn't specialized to a particular service), -/// and a [`Config`](crate::Config). Both of these are constructed using -/// the [builder pattern] where you first construct a `Builder` type, -/// then configure it with the necessary parameters, and then call -/// `build` to construct the finalized output type. The -/// [`aws_smithy_client::Client`] builder is re-exported in this crate as -/// [`Builder`] for convenience. -/// -/// In _most_ circumstances, you will want to use the following pattern -/// to construct a client: -/// -/// ``` -/// use rivet_cf_verification::{Builder, Client, Config}; -/// let raw_client = -/// Builder::dyn_https() -/// # /* -/// .middleware(/* discussed below */) -/// # */ -/// # .middleware_fn(|r| r) -/// .build(); -/// let config = Config::builder().build(); -/// let client = Client::with_config(raw_client, config); -/// ``` -/// -/// For the middleware, you'll want to use whatever matches the -/// routing, authentication and authorization required by the target -/// service. For example, for the standard AWS SDK which uses -/// [SigV4-signed requests], the middleware looks like this: -/// -// Ignored as otherwise we'd need to pull in all these dev-dependencies. -/// ```rust,ignore -/// use aws_endpoint::AwsEndpointStage; -/// use aws_http::auth::CredentialsStage; -/// use aws_http::recursion_detection::RecursionDetectionStage; -/// use aws_http::user_agent::UserAgentStage; -/// use aws_sig_auth::middleware::SigV4SigningStage; -/// use aws_sig_auth::signer::SigV4Signer; -/// use aws_smithy_client::retry::Config as RetryConfig; -/// use aws_smithy_http_tower::map_request::{AsyncMapRequestLayer, MapRequestLayer}; -/// use std::fmt::Debug; -/// use tower::layer::util::{Identity, Stack}; -/// use tower::ServiceBuilder; -/// -/// type AwsMiddlewareStack = Stack< -/// MapRequestLayer, -/// Stack< -/// MapRequestLayer, -/// Stack< -/// AsyncMapRequestLayer, -/// Stack< -/// MapRequestLayer, -/// Stack, Identity>, -/// >, -/// >, -/// >, -/// >; -/// -/// /// AWS Middleware Stack -/// /// -/// /// This implements the middleware stack for this service. It will: -/// /// 1. Load credentials asynchronously into the property bag -/// /// 2. Sign the request with SigV4 -/// /// 3. Resolve an Endpoint for the request -/// /// 4. Add a user agent to the request -/// #[derive(Debug, Default, Clone)] -/// #[non_exhaustive] -/// pub struct AwsMiddleware; -/// -/// impl AwsMiddleware { -/// /// Create a new `AwsMiddleware` stack -/// /// -/// /// Note: `AwsMiddleware` holds no state. -/// pub fn new() -> Self { -/// AwsMiddleware::default() -/// } -/// } -/// -/// // define the middleware stack in a non-generic location to reduce code bloat. -/// fn base() -> ServiceBuilder { -/// let credential_provider = AsyncMapRequestLayer::for_mapper(CredentialsStage::new()); -/// let signer = MapRequestLayer::for_mapper(SigV4SigningStage::new(SigV4Signer::new())); -/// let endpoint_resolver = MapRequestLayer::for_mapper(AwsEndpointStage); -/// let user_agent = MapRequestLayer::for_mapper(UserAgentStage::new()); -/// let recursion_detection = MapRequestLayer::for_mapper(RecursionDetectionStage::new()); -/// // These layers can be considered as occurring in order, that is: -/// // 1. Resolve an endpoint -/// // 2. Add a user agent -/// // 3. Acquire credentials -/// // 4. Sign with credentials -/// // (5. Dispatch over the wire) -/// ServiceBuilder::new() -/// .layer(endpoint_resolver) -/// .layer(user_agent) -/// .layer(credential_provider) -/// .layer(signer) -/// .layer(recursion_detection) -/// } -/// -/// impl tower::Layer for AwsMiddleware { -/// type Service = >::Service; -/// -/// fn layer(&self, inner: S) -> Self::Service { -/// base().service(inner) -/// } -/// } -/// ``` -/// -/// # Using a Client -/// -/// Once you have a client set up, you can access the service's endpoints -/// by calling the appropriate method on [`Client`]. Each such method -/// returns a request builder for that endpoint, with methods for setting -/// the various fields of the request. Once your request is complete, use -/// the `send` method to send the request. `send` returns a future, which -/// you then have to `.await` to get the service's response. -/// -/// [builder pattern]: https://rust-lang.github.io/api-guidelines/type-safety.html#c-builder -/// [SigV4-signed requests]: https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html -#[derive(std::fmt::Debug)] -pub struct Client { - handle: std::sync::Arc>, -} - -impl std::clone::Clone for Client { - fn clone(&self) -> Self { - Self { - handle: self.handle.clone(), - } - } -} - -#[doc(inline)] -pub use aws_smithy_client::Builder; - -impl From> for Client { - fn from(client: aws_smithy_client::Client) -> Self { - Self::with_config(client, crate::Config::builder().build()) - } -} - -impl Client { - /// Creates a client with the given service configuration. - pub fn with_config(client: aws_smithy_client::Client, conf: crate::Config) -> Self { - Self { - handle: std::sync::Arc::new(Handle { client, conf }), - } - } - - /// Returns the client's configuration. - pub fn conf(&self) -> &crate::Config { - &self.handle.conf - } -} -impl Client -where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, -{ - /// Constructs a fluent builder for the [`VerifyCustomHostname`](crate::client::fluent_builders::VerifyCustomHostname) operation. - /// - /// - The fluent builder is configurable: - /// - [`identifier(impl Into)`](crate::client::fluent_builders::VerifyCustomHostname::identifier) / [`set_identifier(Option)`](crate::client::fluent_builders::VerifyCustomHostname::set_identifier): (undocumented) - /// - On success, responds with [`VerifyCustomHostnameOutput`](crate::output::VerifyCustomHostnameOutput) with field(s): - /// - [`body(Option)`](crate::output::VerifyCustomHostnameOutput::body): (undocumented) - /// - On failure, responds with [`SdkError`](crate::error::VerifyCustomHostnameError) - pub fn verify_custom_hostname(&self) -> fluent_builders::VerifyCustomHostname { - fluent_builders::VerifyCustomHostname::new(self.handle.clone()) - } -} -pub mod fluent_builders { - //! - //! Utilities to ergonomically construct a request to the service. - //! - //! Fluent builders are created through the [`Client`](crate::client::Client) by calling - //! one if its operation methods. After parameters are set using the builder methods, - //! the `send` method can be called to initiate the request. - //! - /// Fluent builder constructing a request to `VerifyCustomHostname`. - /// - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct VerifyCustomHostname { - handle: std::sync::Arc>, - inner: crate::input::verify_custom_hostname_input::Builder, - } - impl VerifyCustomHostname - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `VerifyCustomHostname`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::VerifyCustomHostnameOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::VerifyCustomHostnameInputOperationOutputAlias, - crate::output::VerifyCustomHostnameOutput, - crate::error::VerifyCustomHostnameError, - crate::input::VerifyCustomHostnameInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - #[allow(missing_docs)] // documentation missing in model - pub fn identifier(mut self, input: impl Into) -> Self { - self.inner = self.inner.identifier(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_identifier(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_identifier(input); - self - } - } -} -/// A wrapper around [`Client`]. Helps reduce external imports. -pub struct ClientWrapper { - pub(crate) client: Client, -} - -impl std::ops::Deref for ClientWrapper { - type Target = Client; - - fn deref(&self) -> &Self::Target { - &self.client - } -} diff --git a/lib/smithy-output/api-cf-verification/rust/rust/src/config.rs b/lib/smithy-output/api-cf-verification/rust/rust/src/config.rs deleted file mode 100644 index 4c5abf4c8..000000000 --- a/lib/smithy-output/api-cf-verification/rust/rust/src/config.rs +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Service config. -/// -pub struct Config { - pub(crate) auth: Option, - pub(crate) uri: String, -} -impl std::fmt::Debug for Config { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut config = f.debug_struct("Config"); - config.finish() - } -} -impl Config { - /// Constructs a config builder. - pub fn builder() -> Builder { - Builder::default() - } -} -/// Builder for creating a `Config`. -#[derive(Default)] -pub struct Builder { - pub(crate) auth: Option, - pub(crate) uri: Option, -} -impl Builder { - /// Constructs a config builder. - pub fn new() -> Self { - Self::default() - } - /// Sets the bearer token to be used with the Smithy client. - pub fn set_bearer_token(mut self, bearer_token: impl std::fmt::Display) -> Self { - self.auth = Some(format!("Bearer {}", bearer_token)); - self - } - /// Sets the base URI to be used with the Smithy client. - pub fn set_uri(mut self, uri: impl ToString) -> Self { - self.uri = Some(uri.to_string()); - self - } - /// Builds a [`Config`]. - pub fn build(self) -> Config { - Config { - auth: self - .auth - .or_else(|| std::env::var("RIVET_LOBBY_TOKEN").ok()) - .or_else(|| std::env::var("RIVET_CLIENT_TOKEN").ok()), - uri: self - .uri - .or_else(|| std::env::var("RIVET_CF_VERIFICATION_API_URL").ok()) - .unwrap_or_else(|| "https://cf-verification.api.rivet.gg/v1".to_string()), - } - } - /// Builds a default [`Client`] from the given config. - pub fn build_client(self) -> crate::client::ClientWrapper { - let raw_client = aws_smithy_client::Builder::dyn_https() - .middleware(tower::layer::util::Identity::new()) - .sleep_impl(None) - .build(); - crate::client::ClientWrapper { - client: crate::Client::with_config(raw_client, self.build()), - } - } -} diff --git a/lib/smithy-output/api-cf-verification/rust/rust/src/error.rs b/lib/smithy-output/api-cf-verification/rust/rust/src/error.rs deleted file mode 100644 index 6bd88bd85..000000000 --- a/lib/smithy-output/api-cf-verification/rust/rust/src/error.rs +++ /dev/null @@ -1,926 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Error type for the `VerifyCustomHostname` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct VerifyCustomHostnameError { - /// Kind of error that occurred. - pub kind: VerifyCustomHostnameErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `VerifyCustomHostname` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum VerifyCustomHostnameErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for VerifyCustomHostnameError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - VerifyCustomHostnameErrorKind::InternalError(_inner) => _inner.fmt(f), - VerifyCustomHostnameErrorKind::RateLimitError(_inner) => _inner.fmt(f), - VerifyCustomHostnameErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - VerifyCustomHostnameErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - VerifyCustomHostnameErrorKind::NotFoundError(_inner) => _inner.fmt(f), - VerifyCustomHostnameErrorKind::BadRequestError(_inner) => _inner.fmt(f), - VerifyCustomHostnameErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for VerifyCustomHostnameError { - fn code(&self) -> Option<&str> { - VerifyCustomHostnameError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - VerifyCustomHostnameErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - VerifyCustomHostnameErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl VerifyCustomHostnameError { - /// Creates a new `VerifyCustomHostnameError`. - pub fn new(kind: VerifyCustomHostnameErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `VerifyCustomHostnameError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: VerifyCustomHostnameErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `VerifyCustomHostnameError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: VerifyCustomHostnameErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `VerifyCustomHostnameErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, VerifyCustomHostnameErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `VerifyCustomHostnameErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, VerifyCustomHostnameErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `VerifyCustomHostnameErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, VerifyCustomHostnameErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `VerifyCustomHostnameErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - VerifyCustomHostnameErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `VerifyCustomHostnameErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, VerifyCustomHostnameErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `VerifyCustomHostnameErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - VerifyCustomHostnameErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for VerifyCustomHostnameError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - VerifyCustomHostnameErrorKind::InternalError(_inner) => Some(_inner), - VerifyCustomHostnameErrorKind::RateLimitError(_inner) => Some(_inner), - VerifyCustomHostnameErrorKind::ForbiddenError(_inner) => Some(_inner), - VerifyCustomHostnameErrorKind::UnauthorizedError(_inner) => Some(_inner), - VerifyCustomHostnameErrorKind::NotFoundError(_inner) => Some(_inner), - VerifyCustomHostnameErrorKind::BadRequestError(_inner) => Some(_inner), - VerifyCustomHostnameErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// An error thrown when the requestee has sent an invalid or malformed request. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct BadRequestError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl BadRequestError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for BadRequestError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("BadRequestError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl BadRequestError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for BadRequestError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "BadRequestError")?; - if let Some(inner_1) = &self.message { - write!(f, ": {}", inner_1)?; - } - Ok(()) - } -} -impl std::error::Error for BadRequestError {} -/// See [`BadRequestError`](crate::error::BadRequestError) -pub mod bad_request_error { - /// A builder for [`BadRequestError`](crate::error::BadRequestError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`BadRequestError`](crate::error::BadRequestError) - pub fn build(self) -> crate::error::BadRequestError { - crate::error::BadRequestError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl BadRequestError { - /// Creates a new builder-style object to manufacture [`BadRequestError`](crate::error::BadRequestError) - pub fn builder() -> crate::error::bad_request_error::Builder { - crate::error::bad_request_error::Builder::default() - } -} - -/// An error thrown when the requestee requests a non existent resource. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct NotFoundError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl NotFoundError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for NotFoundError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("NotFoundError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl NotFoundError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for NotFoundError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "NotFoundError")?; - if let Some(inner_2) = &self.message { - write!(f, ": {}", inner_2)?; - } - Ok(()) - } -} -impl std::error::Error for NotFoundError {} -/// See [`NotFoundError`](crate::error::NotFoundError) -pub mod not_found_error { - /// A builder for [`NotFoundError`](crate::error::NotFoundError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`NotFoundError`](crate::error::NotFoundError) - pub fn build(self) -> crate::error::NotFoundError { - crate::error::NotFoundError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl NotFoundError { - /// Creates a new builder-style object to manufacture [`NotFoundError`](crate::error::NotFoundError) - pub fn builder() -> crate::error::not_found_error::Builder { - crate::error::not_found_error::Builder::default() - } -} - -/// An error thrown when the requestee is not authenticated. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UnauthorizedError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl UnauthorizedError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for UnauthorizedError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UnauthorizedError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl UnauthorizedError { - /// Returns `Some(ErrorKind)` if the error is retryable. Otherwise, returns `None`. - pub fn retryable_error_kind(&self) -> aws_smithy_types::retry::ErrorKind { - aws_smithy_types::retry::ErrorKind::ClientError - } - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for UnauthorizedError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "UnauthorizedError")?; - if let Some(inner_3) = &self.message { - write!(f, ": {}", inner_3)?; - } - Ok(()) - } -} -impl std::error::Error for UnauthorizedError {} -/// See [`UnauthorizedError`](crate::error::UnauthorizedError) -pub mod unauthorized_error { - /// A builder for [`UnauthorizedError`](crate::error::UnauthorizedError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`UnauthorizedError`](crate::error::UnauthorizedError) - pub fn build(self) -> crate::error::UnauthorizedError { - crate::error::UnauthorizedError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl UnauthorizedError { - /// Creates a new builder-style object to manufacture [`UnauthorizedError`](crate::error::UnauthorizedError) - pub fn builder() -> crate::error::unauthorized_error::Builder { - crate::error::unauthorized_error::Builder::default() - } -} - -/// An error thrown when the requestee requests a resource they do not have access to. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ForbiddenError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl ForbiddenError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for ForbiddenError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ForbiddenError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl ForbiddenError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for ForbiddenError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "ForbiddenError")?; - if let Some(inner_4) = &self.message { - write!(f, ": {}", inner_4)?; - } - Ok(()) - } -} -impl std::error::Error for ForbiddenError {} -/// See [`ForbiddenError`](crate::error::ForbiddenError) -pub mod forbidden_error { - /// A builder for [`ForbiddenError`](crate::error::ForbiddenError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`ForbiddenError`](crate::error::ForbiddenError) - pub fn build(self) -> crate::error::ForbiddenError { - crate::error::ForbiddenError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl ForbiddenError { - /// Creates a new builder-style object to manufacture [`ForbiddenError`](crate::error::ForbiddenError) - pub fn builder() -> crate::error::forbidden_error::Builder { - crate::error::forbidden_error::Builder::default() - } -} - -/// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct RateLimitError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl RateLimitError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for RateLimitError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("RateLimitError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl RateLimitError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for RateLimitError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "RateLimitError")?; - if let Some(inner_5) = &self.message { - write!(f, ": {}", inner_5)?; - } - Ok(()) - } -} -impl std::error::Error for RateLimitError {} -/// See [`RateLimitError`](crate::error::RateLimitError) -pub mod rate_limit_error { - /// A builder for [`RateLimitError`](crate::error::RateLimitError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`RateLimitError`](crate::error::RateLimitError) - pub fn build(self) -> crate::error::RateLimitError { - crate::error::RateLimitError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl RateLimitError { - /// Creates a new builder-style object to manufacture [`RateLimitError`](crate::error::RateLimitError) - pub fn builder() -> crate::error::rate_limit_error::Builder { - crate::error::rate_limit_error::Builder::default() - } -} - -/// An error caused by internal server problems. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct InternalError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl InternalError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for InternalError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("InternalError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl InternalError { - /// Returns `Some(ErrorKind)` if the error is retryable. Otherwise, returns `None`. - pub fn retryable_error_kind(&self) -> aws_smithy_types::retry::ErrorKind { - aws_smithy_types::retry::ErrorKind::ServerError - } - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for InternalError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "InternalError")?; - if let Some(inner_6) = &self.message { - write!(f, ": {}", inner_6)?; - } - Ok(()) - } -} -impl std::error::Error for InternalError {} -/// See [`InternalError`](crate::error::InternalError) -pub mod internal_error { - /// A builder for [`InternalError`](crate::error::InternalError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`InternalError`](crate::error::InternalError) - pub fn build(self) -> crate::error::InternalError { - crate::error::InternalError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl InternalError { - /// Creates a new builder-style object to manufacture [`InternalError`](crate::error::InternalError) - pub fn builder() -> crate::error::internal_error::Builder { - crate::error::internal_error::Builder::default() - } -} diff --git a/lib/smithy-output/api-cf-verification/rust/rust/src/error_meta.rs b/lib/smithy-output/api-cf-verification/rust/rust/src/error_meta.rs deleted file mode 100644 index 8c3b0f83c..000000000 --- a/lib/smithy-output/api-cf-verification/rust/rust/src/error_meta.rs +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// All possible error types for this service. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum Error { - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An unhandled error occurred. - Unhandled(Box), -} -impl std::fmt::Display for Error { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Error::BadRequestError(inner) => inner.fmt(f), - Error::ForbiddenError(inner) => inner.fmt(f), - Error::InternalError(inner) => inner.fmt(f), - Error::NotFoundError(inner) => inner.fmt(f), - Error::RateLimitError(inner) => inner.fmt(f), - Error::UnauthorizedError(inner) => inner.fmt(f), - Error::Unhandled(inner) => inner.fmt(f), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::VerifyCustomHostnameErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::VerifyCustomHostnameErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::VerifyCustomHostnameErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::VerifyCustomHostnameErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::VerifyCustomHostnameErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::VerifyCustomHostnameErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::VerifyCustomHostnameErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl std::error::Error for Error {} diff --git a/lib/smithy-output/api-cf-verification/rust/rust/src/http_serde.rs b/lib/smithy-output/api-cf-verification/rust/rust/src/http_serde.rs deleted file mode 100644 index 7bee9f736..000000000 --- a/lib/smithy-output/api-cf-verification/rust/rust/src/http_serde.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub fn deser_payload_verify_custom_hostname_verify_custom_hostname_output_body( - body: &[u8], -) -> std::result::Result< - std::option::Option, - crate::error::VerifyCustomHostnameError, -> { - (!body.is_empty()) - .then(|| { - let body_str = std::str::from_utf8(body) - .map_err(crate::error::VerifyCustomHostnameError::unhandled)?; - Ok(body_str.to_string()) - }) - .transpose() -} diff --git a/lib/smithy-output/api-cf-verification/rust/rust/src/input.rs b/lib/smithy-output/api-cf-verification/rust/rust/src/input.rs deleted file mode 100644 index d35fb2986..000000000 --- a/lib/smithy-output/api-cf-verification/rust/rust/src/input.rs +++ /dev/null @@ -1,141 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -use std::fmt::Write; -/// See [`VerifyCustomHostnameInput`](crate::input::VerifyCustomHostnameInput) -pub mod verify_custom_hostname_input { - /// A builder for [`VerifyCustomHostnameInput`](crate::input::VerifyCustomHostnameInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identifier: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn identifier(mut self, input: impl Into) -> Self { - self.identifier = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_identifier(mut self, input: std::option::Option) -> Self { - self.identifier = input; - self - } - /// Consumes the builder and constructs a [`VerifyCustomHostnameInput`](crate::input::VerifyCustomHostnameInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::VerifyCustomHostnameInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::VerifyCustomHostnameInput { - identifier: self.identifier, - }) - } - } -} -#[doc(hidden)] -pub type VerifyCustomHostnameInputOperationOutputAlias = crate::operation::VerifyCustomHostname; -#[doc(hidden)] -pub type VerifyCustomHostnameInputOperationRetryAlias = (); -impl VerifyCustomHostnameInput { - /// Consumes the builder and constructs an Operation<[`VerifyCustomHostname`](crate::operation::VerifyCustomHostname)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::VerifyCustomHostnameInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_1 = &_input.identifier; - let input_1 = input_1.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "identifier", - details: "cannot be empty or unset", - }, - )?; - let identifier = aws_smithy_http::label::fmt_string(input_1, false); - if identifier.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "identifier", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/.well-known/cf-custom-hostname-challenge/{identifier}", - identifier = identifier - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::VerifyCustomHostnameInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::VerifyCustomHostname::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "VerifyCustomHostname", - "CfVerificationService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`VerifyCustomHostnameInput`](crate::input::VerifyCustomHostnameInput) - pub fn builder() -> crate::input::verify_custom_hostname_input::Builder { - crate::input::verify_custom_hostname_input::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct VerifyCustomHostnameInput { - #[allow(missing_docs)] // documentation missing in model - pub identifier: std::option::Option, -} -impl VerifyCustomHostnameInput { - #[allow(missing_docs)] // documentation missing in model - pub fn identifier(&self) -> std::option::Option<&str> { - self.identifier.as_deref() - } -} -impl std::fmt::Debug for VerifyCustomHostnameInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("VerifyCustomHostnameInput"); - formatter.field("identifier", &self.identifier); - formatter.finish() - } -} diff --git a/lib/smithy-output/api-cf-verification/rust/rust/src/json_deser.rs b/lib/smithy-output/api-cf-verification/rust/rust/src/json_deser.rs deleted file mode 100644 index 570bfab5f..000000000 --- a/lib/smithy-output/api-cf-verification/rust/rust/src/json_deser.rs +++ /dev/null @@ -1,404 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub fn parse_http_generic_error( - response: &http::Response, -) -> Result { - crate::json_errors::parse_generic_error(response.body(), response.headers()) -} - -pub fn deser_structure_crate_error_internal_error_json_err( - value: &[u8], - mut builder: crate::error::internal_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_rate_limit_error_json_err( - value: &[u8], - mut builder: crate::error::rate_limit_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_forbidden_error_json_err( - value: &[u8], - mut builder: crate::error::forbidden_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_unauthorized_error_json_err( - value: &[u8], - mut builder: crate::error::unauthorized_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_not_found_error_json_err( - value: &[u8], - mut builder: crate::error::not_found_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_bad_request_error_json_err( - value: &[u8], - mut builder: crate::error::bad_request_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn or_empty_doc(data: &[u8]) -> &[u8] { - if data.is_empty() { - b"{}" - } else { - data - } -} diff --git a/lib/smithy-output/api-cf-verification/rust/rust/src/json_errors.rs b/lib/smithy-output/api-cf-verification/rust/rust/src/json_errors.rs deleted file mode 100644 index 7b7574319..000000000 --- a/lib/smithy-output/api-cf-verification/rust/rust/src/json_errors.rs +++ /dev/null @@ -1,220 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -use aws_smithy_json::deserialize::token::skip_value; -use aws_smithy_json::deserialize::{json_token_iter, Error as DeserializeError, Token}; -use aws_smithy_types::Error as SmithyError; -use bytes::Bytes; -use http::header::ToStrError; -use http::{HeaderMap, HeaderValue}; -use std::borrow::Cow; - -// currently only used by AwsJson -#[allow(unused)] -pub fn is_error(response: &http::Response) -> bool { - !response.status().is_success() -} - -fn sanitize_error_code(error_code: &str) -> &str { - // Trim a trailing URL from the error code, beginning with a `:` - let error_code = match error_code.find(':') { - Some(idx) => &error_code[..idx], - None => error_code, - }; - - // Trim a prefixing namespace from the error code, beginning with a `#` - match error_code.find('#') { - Some(idx) => &error_code[idx + 1..], - None => error_code, - } -} - -struct ErrorBody<'a> { - code: Option>, - message: Option>, -} - -fn parse_error_body(bytes: &[u8]) -> Result { - let mut tokens = json_token_iter(bytes).peekable(); - let (mut typ, mut code, mut message) = (None, None, None); - if let Some(Token::StartObject { .. }) = tokens.next().transpose()? { - loop { - match tokens.next().transpose()? { - Some(Token::EndObject { .. }) => break, - Some(Token::ObjectKey { key, .. }) => { - if let Some(Ok(Token::ValueString { value, .. })) = tokens.peek() { - match key.as_escaped_str() { - "code" => code = Some(value.to_unescaped()?), - "__type" => typ = Some(value.to_unescaped()?), - "message" | "Message" | "errorMessage" => { - message = Some(value.to_unescaped()?) - } - _ => {} - } - } - skip_value(&mut tokens)?; - } - _ => { - return Err(DeserializeError::custom( - "expected object key or end object", - )) - } - } - } - if tokens.next().is_some() { - return Err(DeserializeError::custom( - "found more JSON tokens after completing parsing", - )); - } - } - Ok(ErrorBody { - code: code.or(typ), - message, - }) -} - -fn error_type_from_header(headers: &HeaderMap) -> Result, ToStrError> { - headers - .get("X-Amzn-Errortype") - .map(|v| v.to_str()) - .transpose() -} - -fn request_id(headers: &HeaderMap) -> Option<&str> { - headers - .get("X-Amzn-Requestid") - .and_then(|v| v.to_str().ok()) -} - -pub fn parse_generic_error( - payload: &Bytes, - headers: &HeaderMap, -) -> Result { - let ErrorBody { code, message } = parse_error_body(payload.as_ref())?; - - let mut err_builder = SmithyError::builder(); - if let Some(code) = error_type_from_header(headers) - .map_err(|_| DeserializeError::custom("X-Amzn-Errortype header was not valid UTF-8"))? - .or_else(|| code.as_deref()) - .map(sanitize_error_code) - { - err_builder.code(code); - } - if let Some(message) = message { - err_builder.message(message); - } - if let Some(request_id) = request_id(headers) { - err_builder.request_id(request_id); - } - Ok(err_builder.build()) -} - -#[cfg(test)] -mod test { - use crate::json_errors::{parse_error_body, parse_generic_error, sanitize_error_code}; - use aws_smithy_types::Error; - use bytes::Bytes; - use std::borrow::Cow; - - #[test] - fn generic_error() { - let response = http::Response::builder() - .header("X-Amzn-Requestid", "1234") - .body(Bytes::from_static( - br#"{ "__type": "FooError", "message": "Go to foo" }"#, - )) - .unwrap(); - assert_eq!( - parse_generic_error(response.body(), response.headers()).unwrap(), - Error::builder() - .code("FooError") - .message("Go to foo") - .request_id("1234") - .build() - ) - } - - #[test] - fn error_type() { - assert_eq!( - Some(Cow::Borrowed("FooError")), - parse_error_body(br#"{ "__type": "FooError" }"#) - .unwrap() - .code - ); - } - - #[test] - fn code_takes_priority() { - assert_eq!( - Some(Cow::Borrowed("BarError")), - parse_error_body(br#"{ "code": "BarError", "__type": "FooError" }"#) - .unwrap() - .code - ); - } - - #[test] - fn ignore_unrecognized_fields() { - assert_eq!( - Some(Cow::Borrowed("FooError")), - parse_error_body(br#"{ "__type": "FooError", "asdf": 5, "fdsa": {}, "foo": "1" }"#) - .unwrap() - .code - ); - } - - #[test] - fn sanitize_namespace_and_url() { - assert_eq!( - sanitize_error_code("aws.protocoltests.restjson#FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/"), - "FooError"); - } - - #[test] - fn sanitize_noop() { - assert_eq!(sanitize_error_code("FooError"), "FooError"); - } - - #[test] - fn sanitize_url() { - assert_eq!( - sanitize_error_code( - "FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/" - ), - "FooError" - ); - } - - #[test] - fn sanitize_namespace() { - assert_eq!( - sanitize_error_code("aws.protocoltests.restjson#FooError"), - "FooError" - ); - } - - // services like lambda use an alternate `Message` instead of `message` - #[test] - fn alternative_error_message_names() { - let response = http::Response::builder() - .header("x-amzn-errortype", "ResourceNotFoundException") - .body(Bytes::from_static( - br#"{ - "Type": "User", - "Message": "Functions from 'us-west-2' are not reachable from us-east-1" - }"#, - )) - .unwrap(); - assert_eq!( - parse_generic_error(response.body(), response.headers()).unwrap(), - Error::builder() - .code("ResourceNotFoundException") - .message("Functions from 'us-west-2' are not reachable from us-east-1") - .build() - ); - } -} diff --git a/lib/smithy-output/api-cf-verification/rust/rust/src/lib.rs b/lib/smithy-output/api-cf-verification/rust/rust/src/lib.rs deleted file mode 100644 index 6da22a8f3..000000000 --- a/lib/smithy-output/api-cf-verification/rust/rust/src/lib.rs +++ /dev/null @@ -1,54 +0,0 @@ -#![allow(clippy::module_inception)] -#![allow(clippy::upper_case_acronyms)] -#![allow(clippy::large_enum_variant)] -#![allow(clippy::wrong_self_convention)] -#![allow(clippy::should_implement_trait)] -#![allow(clippy::blacklisted_name)] -#![allow(clippy::vec_init_then_push)] -#![allow(rustdoc::bare_urls)] -#![warn(missing_docs)] -//! rivet-cf-verification -//! -//! # Crate Organization -//! -//! The entry point for most customers will be [`Client`]. [`Client`] exposes one method for each API offered -//! by the service. -//! -//! Some APIs require complex or nested arguments. These exist in [`model`](crate::model). -//! -//! Lastly, errors that can be returned by the service are contained within [`error`]. [`Error`] defines a meta -//! error encompassing all possible errors that can be returned by the service. -//! -//! The other modules within this crate are not required for normal usage. - -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use error_meta::Error; - -#[doc(inline)] -pub use config::Config; - -/// Client and fluent builders for calling the service. -pub mod client; -/// Configuration for the service. -pub mod config; -/// Errors that can occur when calling the service. -pub mod error; -mod error_meta; -mod http_serde; -/// Input structures for operations. -pub mod input; -mod json_deser; -mod json_errors; -/// All operations that this crate can perform. -pub mod operation; -mod operation_deser; -/// Output structures for operations. -pub mod output; -pub use client::{Builder, Client, ClientWrapper}; -/// Crate version number. -pub static PKG_VERSION: &str = env!("CARGO_PKG_VERSION"); -/// Re-exported types from supporting crates. -pub mod types { - pub use aws_smithy_http::result::SdkError; - pub use aws_smithy_types::DateTime; -} diff --git a/lib/smithy-output/api-cf-verification/rust/rust/src/operation.rs b/lib/smithy-output/api-cf-verification/rust/rust/src/operation.rs deleted file mode 100644 index 77b468bc8..000000000 --- a/lib/smithy-output/api-cf-verification/rust/rust/src/operation.rs +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Operation shape for `VerifyCustomHostname`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`verify_custom_hostname`](crate::client::Client::verify_custom_hostname). -/// -/// See [`crate::client::fluent_builders::VerifyCustomHostname`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct VerifyCustomHostname { - _private: (), -} -impl VerifyCustomHostname { - /// Creates a new builder-style object to manufacture [`VerifyCustomHostnameInput`](crate::input::VerifyCustomHostnameInput) - pub fn builder() -> crate::input::verify_custom_hostname_input::Builder { - crate::input::verify_custom_hostname_input::Builder::default() - } - /// Creates a new `VerifyCustomHostname` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for VerifyCustomHostname { - type Output = std::result::Result< - crate::output::VerifyCustomHostnameOutput, - crate::error::VerifyCustomHostnameError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_verify_custom_hostname_error(response) - } else { - crate::operation_deser::parse_verify_custom_hostname_response(response) - } - } -} diff --git a/lib/smithy-output/api-cf-verification/rust/rust/src/operation_deser.rs b/lib/smithy-output/api-cf-verification/rust/rust/src/operation_deser.rs deleted file mode 100644 index a69869a17..000000000 --- a/lib/smithy-output/api-cf-verification/rust/rust/src/operation_deser.rs +++ /dev/null @@ -1,155 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[allow(clippy::unnecessary_wraps)] -pub fn parse_verify_custom_hostname_error( - response: &http::Response, -) -> std::result::Result< - crate::output::VerifyCustomHostnameOutput, - crate::error::VerifyCustomHostnameError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::VerifyCustomHostnameError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::VerifyCustomHostnameError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::VerifyCustomHostnameError { - meta: generic, - kind: crate::error::VerifyCustomHostnameErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::VerifyCustomHostnameError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::VerifyCustomHostnameError { - meta: generic, - kind: crate::error::VerifyCustomHostnameErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::VerifyCustomHostnameError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::VerifyCustomHostnameError { - meta: generic, - kind: crate::error::VerifyCustomHostnameErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::VerifyCustomHostnameError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::VerifyCustomHostnameError { - meta: generic, - kind: crate::error::VerifyCustomHostnameErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::VerifyCustomHostnameError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::VerifyCustomHostnameError { - meta: generic, - kind: crate::error::VerifyCustomHostnameErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::VerifyCustomHostnameError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::VerifyCustomHostnameError { - meta: generic, - kind: crate::error::VerifyCustomHostnameErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::VerifyCustomHostnameError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::VerifyCustomHostnameError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_verify_custom_hostname_response( - response: &http::Response, -) -> std::result::Result< - crate::output::VerifyCustomHostnameOutput, - crate::error::VerifyCustomHostnameError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::verify_custom_hostname_output::Builder::default(); - let _ = response; - output = output.set_body( - crate::http_serde::deser_payload_verify_custom_hostname_verify_custom_hostname_output_body(response.body().as_ref())? - ); - output.build() - }) -} diff --git a/lib/smithy-output/api-cf-verification/rust/rust/src/output.rs b/lib/smithy-output/api-cf-verification/rust/rust/src/output.rs deleted file mode 100644 index 1cab6f0c7..000000000 --- a/lib/smithy-output/api-cf-verification/rust/rust/src/output.rs +++ /dev/null @@ -1,52 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct VerifyCustomHostnameOutput { - #[allow(missing_docs)] // documentation missing in model - pub body: std::option::Option, -} -impl VerifyCustomHostnameOutput { - #[allow(missing_docs)] // documentation missing in model - pub fn body(&self) -> std::option::Option<&str> { - self.body.as_deref() - } -} -impl std::fmt::Debug for VerifyCustomHostnameOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("VerifyCustomHostnameOutput"); - formatter.field("body", &self.body); - formatter.finish() - } -} -/// See [`VerifyCustomHostnameOutput`](crate::output::VerifyCustomHostnameOutput) -pub mod verify_custom_hostname_output { - /// A builder for [`VerifyCustomHostnameOutput`](crate::output::VerifyCustomHostnameOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) body: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn body(mut self, input: impl Into) -> Self { - self.body = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_body(mut self, input: std::option::Option) -> Self { - self.body = input; - self - } - /// Consumes the builder and constructs a [`VerifyCustomHostnameOutput`](crate::output::VerifyCustomHostnameOutput) - pub fn build(self) -> crate::output::VerifyCustomHostnameOutput { - crate::output::VerifyCustomHostnameOutput { body: self.body } - } - } -} -impl VerifyCustomHostnameOutput { - /// Creates a new builder-style object to manufacture [`VerifyCustomHostnameOutput`](crate::output::VerifyCustomHostnameOutput) - pub fn builder() -> crate::output::verify_custom_hostname_output::Builder { - crate::output::verify_custom_hostname_output::Builder::default() - } -} diff --git a/lib/smithy-output/api-cloud/rust-server/rust-server/Cargo.toml b/lib/smithy-output/api-cloud/rust-server/rust-server/Cargo.toml deleted file mode 100644 index c12e18f9d..000000000 --- a/lib/smithy-output/api-cloud/rust-server/rust-server/Cargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -[package] -name = "rivet-cloud-server" -version = "0.0.1" -authors = ["Rivet "] -edition = "2021" -license = "Apache-2.0" - -[package.metadata.docs.rs] -all-features = true -targets = ["x86_64-unknown-linux-gnu"] - -[dependencies] -serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" -chrono = { version = "0.4", features = ["serde"] } diff --git a/lib/smithy-output/api-cloud/rust-server/rust-server/src/lib.rs b/lib/smithy-output/api-cloud/rust-server/rust-server/src/lib.rs deleted file mode 100644 index ff9294697..000000000 --- a/lib/smithy-output/api-cloud/rust-server/rust-server/src/lib.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod models; \ No newline at end of file diff --git a/lib/smithy-output/api-cloud/rust-server/rust-server/src/models.rs b/lib/smithy-output/api-cloud/rust-server/rust-server/src/models.rs deleted file mode 100644 index b223bf4d8..000000000 --- a/lib/smithy-output/api-cloud/rust-server/rust-server/src/models.rs +++ /dev/null @@ -1,2015 +0,0 @@ -#[allow(unused_imports)] -use chrono; -#[allow(unused_imports)] -use serde::{Deserialize, Serialize}; - -/// A presigned request used to upload files. Upload your file to the given URL via a PUT request. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct UploadPresignedRequest { - /// The name of the file to upload. This is the same as the one given in the upload prepare file. - pub path: std::string::String, - /// The URL of the presigned request for which to upload your file to. - pub url: std::string::String, -} - -/// A custom avatar summary. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CustomAvatarSummary { - /// A universally unique identifier. - pub upload_id: std::string::String, - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// RFC3339 timestamp. - pub create_ts: chrono::DateTime, - /// The URL of this custom avatar image. Only present if upload is complete. - pub url: std::option::Option, - /// Unsigned 64 bit integer. - pub content_length: i64, - /// Whether or not this custom avatar has completely been uploaded. - pub complete: bool, -} - -/// A service performance summary. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct SvcPerf { - /// The name of the service. - pub svc_name: std::string::String, - /// RFC3339 timestamp. - pub ts: chrono::DateTime, - /// Unsigned 64 bit integer. - pub duration: i64, - /// A universally unique identifier. - pub req_id: std::option::Option, - /// A list of performance spans. - pub spans: std::vec::Vec, - /// A list of performance marks. - pub marks: std::vec::Vec, -} - -/// A performance mark. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct LogsPerfMark { - /// The label given to this performance mark. - pub label: std::string::String, - /// RFC3339 timestamp. - pub ts: chrono::DateTime, - /// A universally unique identifier. - pub ray_id: std::option::Option, - /// A universally unique identifier. - pub req_id: std::option::Option, -} - -/// A performance span. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct LogsPerfSpan { - /// The label given to this performance span. - pub label: std::string::String, - /// RFC3339 timestamp. - pub start_ts: chrono::DateTime, - /// RFC3339 timestamp. - pub finish_ts: std::option::Option>, - /// A universally unique identifier. - pub req_id: std::option::Option, -} - -/// An error given by failed content validation. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ValidationError { - /// A list of strings denoting the origin of a validation error. - pub path: std::vec::Vec, -} - -/// A group's billing invoice. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GroupBillingInvoice { - /// RFC3339 timestamp. - pub issuing_ts: chrono::DateTime, - /// A URL to this invoice's PDF document. - pub file_url: std::option::Option, -} - -/// The status of a developer group. -#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd, Hash, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum GroupStatus { - #[allow(missing_docs)] // documentation missing in model - Active, - #[allow(missing_docs)] // documentation missing in model - PaymentFailed, - #[allow(missing_docs)] // documentation missing in model - SetupIncomplete, - #[allow(missing_docs)] // documentation missing in model - SpendingLimitReached, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for GroupStatus { - fn from(s: &str) -> Self { - match s { - "active" => GroupStatus::Active, - "payment_failed" => GroupStatus::PaymentFailed, - "setup_incomplete" => GroupStatus::SetupIncomplete, - "spending_limit_reached" => GroupStatus::SpendingLimitReached, - other => GroupStatus::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for GroupStatus { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(GroupStatus::from(s)) - } -} -impl GroupStatus { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - GroupStatus::Active => "active", - GroupStatus::PaymentFailed => "payment_failed", - GroupStatus::SetupIncomplete => "setup_incomplete", - GroupStatus::SpendingLimitReached => "spending_limit_reached", - GroupStatus::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &[ - "active", - "payment_failed", - "setup_incomplete", - "spending_limit_reached", - ] - } -} -impl AsRef for GroupStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// A region server tier. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct RegionTier { - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub tier_name_id: std::string::String, - /// Together with the denominator, denotes the portion of the CPU a given server uses. - pub rivet_cores_numerator: i32, - /// Together with the numerator, denotes the portion of the CPU a given server uses. - pub rivet_cores_denominator: i32, - /// CPU frequency (MHz). - pub cpu: i64, - /// Allocated memory (MB). - pub memory: i64, - /// Allocated disk space (MB). - pub disk: i64, - /// Internet bandwidth (MB). - pub bandwidth: i64, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd, Hash, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum LogStream { - /// Stderrs tream from the given process. - StdErr, - /// Stdout stream from the given processs. - StdOut, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for LogStream { - fn from(s: &str) -> Self { - match s { - "std_err" => LogStream::StdErr, - "std_out" => LogStream::StdOut, - other => LogStream::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for LogStream { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(LogStream::from(s)) - } -} -impl LogStream { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - LogStream::StdErr => "std_err", - LogStream::StdOut => "std_out", - LogStream::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["std_err", "std_out"] - } -} -impl AsRef for LogStream { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// Provided by watchable endpoints used in blocking loops. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct WatchResponse { - /// Index indicating the version of the data responded. Pas this to `rivet.common#WatchQuery` to block and wait for the next response. - pub index: std::string::String, -} - -/// A file being prepared to upload. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct UploadPrepareFile { - /// The path/filename of the file. - pub path: std::string::String, - /// The MIME type of the file. - pub content_type: std::option::Option, - /// Unsigned 64 bit integer. - pub content_length: i64, -} - -/// A CDN site summary. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CdnSiteSummary { - /// A universally unique identifier. - pub site_id: std::string::String, - /// A universally unique identifier. - pub upload_id: std::string::String, - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// RFC3339 timestamp. - pub create_ts: chrono::DateTime, - /// Unsigned 64 bit integer. - pub content_length: i64, - /// Whether or not this site has completely been uploaded. - pub complete: bool, -} - -/// A build summary. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct BuildSummary { - /// A universally unique identifier. - pub build_id: std::string::String, - /// A universally unique identifier. - pub upload_id: std::string::String, - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// RFC3339 timestamp. - pub create_ts: chrono::DateTime, - /// Unsigned 64 bit integer. - pub content_length: i64, - /// Whether or not this build has completely been uploaded. - pub complete: bool, -} - -/// Metrics relating to a job service. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct SvcMetrics { - /// The job name. - pub job: std::string::String, - /// CPU metrics. - pub cpu: std::vec::Vec, - /// Memory metrics. - pub memory: std::vec::Vec, - /// Peak memory metrics. - pub memory_max: std::vec::Vec, - /// Total allocated memory (MB). - pub allocated_memory: i64, -} - -/// A logs summary for a lobby. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct LogsLobbySummary { - /// A universally unique identifier. - pub lobby_id: std::string::String, - /// A universally unique identifier. - pub namespace_id: std::string::String, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub lobby_group_name_id: std::string::String, - /// A universally unique identifier. - pub region_id: std::string::String, - /// RFC3339 timestamp. - pub create_ts: chrono::DateTime, - /// RFC3339 timestamp. - pub start_ts: std::option::Option>, - /// RFC3339 timestamp. - pub ready_ts: std::option::Option>, - /// A union representing the state of a lobby. - pub status: LogsLobbyStatus, -} - -/// A union representing the state of a lobby. -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum LogsLobbyStatus { - /// A running lobby. - Running(Unit), - /// The status of a stopped lobby. - Stopped(LogsLobbyStatusStopped), -} - -/// The status of a stopped lobby. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct LogsLobbyStatusStopped { - /// RFC3339 timestamp. - pub stop_ts: chrono::DateTime, - /// Whether or not the lobby failed or stopped successfully. - pub failed: bool, - /// The exit code returned by the lobby's main process when stopped. - pub exit_code: i32, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct Unit {} - -/// Analyical information about a lobby. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct AnalyticsLobbySummary { - /// A universally unique identifier. - pub lobby_id: std::string::String, - /// A universally unique identifier. - pub lobby_group_id: std::string::String, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub lobby_group_name_id: std::string::String, - /// A universally unique identifier. - pub region_id: std::string::String, - /// RFC3339 timestamp. - pub create_ts: chrono::DateTime, - /// Whether or not this lobby is ready. - pub is_ready: bool, - /// Whether or not this lobby is idle. - pub is_idle: bool, - /// Whether or not this lobby is in a closed state. - pub is_closed: bool, - /// Whether or not this lobby is outdated. - pub is_outdated: bool, - /// Unsigned 32 bit integer. - pub max_players_normal: i32, - /// Unsigned 32 bit integer. - pub max_players_direct: i32, - /// Unsigned 32 bit integer. - pub max_players_party: i32, - /// Unsigned 32 bit integer. - pub total_player_count: i32, - /// Unsigned 32 bit integer. - pub registered_player_count: i32, -} - -/// A value denoting what type of authentication to use for a game namespace's CDN. -#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd, Hash, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum CdnAuthType { - #[allow(missing_docs)] // documentation missing in model - Basic, - #[allow(missing_docs)] // documentation missing in model - None, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for CdnAuthType { - fn from(s: &str) -> Self { - match s { - "basic" => CdnAuthType::Basic, - "none" => CdnAuthType::None, - other => CdnAuthType::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for CdnAuthType { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(CdnAuthType::from(s)) - } -} -impl CdnAuthType { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - CdnAuthType::Basic => "basic", - CdnAuthType::None => "none", - CdnAuthType::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["basic", "none"] - } -} -impl AsRef for CdnAuthType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// A docker port. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct LobbyGroupRuntimeDockerPort { - /// The label of this docker port. - pub label: std::string::String, - /// The port number to connect to. - pub target_port: std::option::Option, - /// The port range to connect to for UDP. - pub port_range: std::option::Option, - /// A proxy protocol. - pub proxy_protocol: ProxyProtocol, -} - -/// A proxy protocol. -#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd, Hash, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum ProxyProtocol { - #[allow(missing_docs)] // documentation missing in model - Http, - #[allow(missing_docs)] // documentation missing in model - Https, - #[allow(missing_docs)] // documentation missing in model - Udp, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for ProxyProtocol { - fn from(s: &str) -> Self { - match s { - "http" => ProxyProtocol::Http, - "https" => ProxyProtocol::Https, - "udp" => ProxyProtocol::Udp, - other => ProxyProtocol::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for ProxyProtocol { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(ProxyProtocol::from(s)) - } -} -impl ProxyProtocol { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - ProxyProtocol::Http => "http", - ProxyProtocol::Https => "https", - ProxyProtocol::Udp => "udp", - ProxyProtocol::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["http", "https", "udp"] - } -} -impl AsRef for ProxyProtocol { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// Range of ports that can be connected to. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PortRange { - /// Unsigned 32 bit integer. - pub min: i32, - /// Unsigned 32 bit integer. - pub max: i32, -} - -/// A full namespace. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct NamespaceFull { - /// A universally unique identifier. - pub namespace_id: std::string::String, - /// RFC3339 timestamp. - pub create_ts: chrono::DateTime, - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// A universally unique identifier. - pub version_id: std::string::String, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub name_id: std::string::String, - /// Cloud configuration for a given namespace. - pub config: CloudNamespaceConfig, -} - -/// Cloud configuration for a given namespace. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CloudNamespaceConfig { - /// CDN configuration for a given namespace. - pub cdn: CdnNamespaceConfig, - /// Matchmaker configuration for a given namespace. - pub matchmaker: MatchmakerNamespaceConfig, - /// KV configuration for a given namespace. - pub kv: KvNamespaceConfig, - /// Identity configuration for a given namespace. - pub identity: IdentityNamespaceConfig, -} - -/// Identity configuration for a given namespace. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct IdentityNamespaceConfig {} - -/// KV configuration for a given namespace. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct KvNamespaceConfig {} - -/// Matchmaker configuration for a given namespace. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct MatchmakerNamespaceConfig { - /// Unsigned 32 bit integer. - pub lobby_count_max: i32, - /// Unsigned 32 bit integer. - pub max_players_per_client: i32, - /// Unsigned 32 bit integer. - pub max_players_per_client_vpn: i32, - /// Unsigned 32 bit integer. - pub max_players_per_client_proxy: i32, - /// Unsigned 32 bit integer. - pub max_players_per_client_tor: i32, - /// Unsigned 32 bit integer. - pub max_players_per_client_hosting: i32, -} - -/// CDN configuration for a given namespace. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CdnNamespaceConfig { - /// Whether or not to allow users to connect to the given namespace via domain name. - pub enable_domain_public_auth: bool, - /// A list of CDN domains for a given namespace. - pub domains: std::vec::Vec, - /// A value denoting what type of authentication to use for a game namespace's CDN. - pub auth_type: CdnAuthType, - /// A list of CDN authenticated users for a given namespace. - pub auth_user_list: std::vec::Vec, -} - -/// An authenticated CDN user for a given namespace. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CdnNamespaceAuthUser { - /// A user name. - pub user: std::string::String, -} - -/// A CDN domain for a given namespace. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CdnNamespaceDomain { - /// A valid domain name (no protocol). - pub domain: std::string::String, - /// RFC3339 timestamp. - pub create_ts: chrono::DateTime, - /// A value denoting the status of a CDN domain's verification status. - pub verification_status: CdnNamespaceDomainVerificationStatus, - /// A union representing the verification method used for this CDN domain. - pub verification_method: CdnNamespaceDomainVerificationMethod, - #[allow(missing_docs)] // documentation missing in model - pub verification_errors: std::vec::Vec, -} - -/// A union representing the verification method used for this CDN domain. -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum CdnNamespaceDomainVerificationMethod { - /// CDN Namespace domain verification method HTTP variant. - Http(CdnNamespaceDomainVerificationMethodHttp), - /// CDN Namespace domain verification method variant denoting that this record is invalid. - Invalid(CdnNamespaceDomainVerificationMethodInvalid), -} - -/// CDN Namespace domain verification method HTTP variant. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CdnNamespaceDomainVerificationMethodHttp { - /// The CNAME record this domain should point to. - pub cname_record: std::string::String, -} - -/// CDN Namespace domain verification method variant denoting that this record is invalid. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CdnNamespaceDomainVerificationMethodInvalid {} - -/// A value denoting the status of a CDN domain's verification status. -#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd, Hash, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum CdnNamespaceDomainVerificationStatus { - #[allow(missing_docs)] // documentation missing in model - Active, - #[allow(missing_docs)] // documentation missing in model - Failed, - #[allow(missing_docs)] // documentation missing in model - Pending, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for CdnNamespaceDomainVerificationStatus { - fn from(s: &str) -> Self { - match s { - "active" => CdnNamespaceDomainVerificationStatus::Active, - "failed" => CdnNamespaceDomainVerificationStatus::Failed, - "pending" => CdnNamespaceDomainVerificationStatus::Pending, - other => CdnNamespaceDomainVerificationStatus::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for CdnNamespaceDomainVerificationStatus { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(CdnNamespaceDomainVerificationStatus::from(s)) - } -} -impl CdnNamespaceDomainVerificationStatus { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - CdnNamespaceDomainVerificationStatus::Active => "active", - CdnNamespaceDomainVerificationStatus::Failed => "failed", - CdnNamespaceDomainVerificationStatus::Pending => "pending", - CdnNamespaceDomainVerificationStatus::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["active", "failed", "pending"] - } -} -impl AsRef for CdnNamespaceDomainVerificationStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// Cloud configuration for a given version. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CloudVersionConfig { - /// CDN configuration for a given version. - pub cdn: std::option::Option, - /// Matchmaker configuration for a given version. - pub matchmaker: std::option::Option, - /// KV configuration for a given version. - pub kv: std::option::Option, - /// Identity configuration for a given version. - pub identity: std::option::Option, -} - -/// Identity configuration for a given version. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct IdentityVersionConfig { - #[allow(missing_docs)] // documentation missing in model - pub custom_display_names: std::vec::Vec, - #[allow(missing_docs)] // documentation missing in model - pub custom_avatars: std::vec::Vec, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CustomAvatar { - /// A universally unique identifier. - pub upload_id: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CustomDisplayName { - #[allow(missing_docs)] // documentation missing in model - pub display_name: std::string::String, -} - -/// KV configuration for a given version. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct KvVersionConfig {} - -/// Matchmaker configuration for a given version. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct MatchmakerVersionConfig { - /// A list of game modes. - pub lobby_groups: std::option::Option>, - /// Matchmaker captcha configuration. - pub captcha: std::option::Option, -} - -/// Matchmaker captcha configuration. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct MatchmakerCaptcha { - /// Denotes how many requests a connection can make before it is required to reverify a captcha. - pub requests_before_reverify: i32, - /// Denotes how long a connection can continue to reconnect without having to reverify a captcha (in milliseconds). - pub verification_ttl: i64, - /// hCpatcha configuration. - pub hcaptcha: std::option::Option, -} - -/// hCpatcha configuration. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct MatchmakerCaptchaHcaptcha { - /// How hard a captcha should be. - pub level: CaptchaLevel, -} - -/// How hard a captcha should be. -#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd, Hash, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum CaptchaLevel { - #[allow(missing_docs)] // documentation missing in model - AlwaysOn, - #[allow(missing_docs)] // documentation missing in model - Difficult, - #[allow(missing_docs)] // documentation missing in model - Easy, - #[allow(missing_docs)] // documentation missing in model - Moderate, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for CaptchaLevel { - fn from(s: &str) -> Self { - match s { - "always_on" => CaptchaLevel::AlwaysOn, - "difficult" => CaptchaLevel::Difficult, - "easy" => CaptchaLevel::Easy, - "moderate" => CaptchaLevel::Moderate, - other => CaptchaLevel::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for CaptchaLevel { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(CaptchaLevel::from(s)) - } -} -impl CaptchaLevel { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - CaptchaLevel::AlwaysOn => "always_on", - CaptchaLevel::Difficult => "difficult", - CaptchaLevel::Easy => "easy", - CaptchaLevel::Moderate => "moderate", - CaptchaLevel::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["always_on", "difficult", "easy", "moderate"] - } -} -impl AsRef for CaptchaLevel { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// A game mode. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct LobbyGroup { - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub name_id: std::string::String, - /// A list of game mode regions. - pub regions: std::vec::Vec, - /// Unsigned 32 bit integer. - pub max_players_normal: i32, - /// Unsigned 32 bit integer. - pub max_players_direct: i32, - /// Unsigned 32 bit integer. - pub max_players_party: i32, - /// A union representing the runtime a game mode runs on. - pub runtime: LobbyGroupRuntime, -} - -/// A union representing the runtime a game mode runs on. -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum LobbyGroupRuntime { - /// A game mode runtime running through Docker. - Docker(LobbyGroupRuntimeDocker), -} - -/// A game mode runtime running through Docker. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct LobbyGroupRuntimeDocker { - /// A universally unique identifier. - pub build_id: std::option::Option, - /// A list of docker arguments. - pub args: std::vec::Vec, - /// A list of docker environment variables. - pub env_vars: std::vec::Vec, - /// The network mode the job should run on. - pub network_mode: std::option::Option, - /// A list of docker ports. - pub ports: std::vec::Vec, -} - -/// The network mode the job should run on. -#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd, Hash, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum NetworkMode { - #[allow(missing_docs)] // documentation missing in model - Bridge, - #[allow(missing_docs)] // documentation missing in model - Host, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for NetworkMode { - fn from(s: &str) -> Self { - match s { - "bridge" => NetworkMode::Bridge, - "host" => NetworkMode::Host, - other => NetworkMode::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for NetworkMode { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(NetworkMode::from(s)) - } -} -impl NetworkMode { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - NetworkMode::Bridge => "bridge", - NetworkMode::Host => "host", - NetworkMode::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["bridge", "host"] - } -} -impl AsRef for NetworkMode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// A docker environment variable. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct LobbyGroupRuntimeDockerEnvVar { - /// The key of this environment variable. - pub key: std::string::String, - /// The value of this environment variable. - pub value: std::string::String, -} - -/// A game mode region. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct LobbyGroupRegion { - /// A universally unique identifier. - pub region_id: std::string::String, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub tier_name_id: std::string::String, - /// Configuration for how many idle lobbies a game version should have. - pub idle_lobbies: std::option::Option, -} - -/// Configuration for how many idle lobbies a game version should have. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct IdleLobbiesConfig { - /// Unsigned 32 bit integer. - pub min_idle_lobbies: i32, - /// Unsigned 32 bit integer. - pub max_idle_lobbies: i32, -} - -/// CDN configuration for a given version. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CdnVersionConfig { - /// A universally unique identifier. - pub site_id: std::option::Option, - /// Client-side configuration - pub build_command: std::option::Option, - /// Client-side configuration - pub build_output: std::option::Option, - /// Multiple CDN version routes. - pub routes: std::option::Option>, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CdnVersionRoute { - #[allow(missing_docs)] // documentation missing in model - pub glob: std::string::String, - /// Unsigned 32 bit integer. - pub priority: i32, - /// Multiple CDN version middleware. - pub middlewares: std::vec::Vec, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CdnVersionMiddleware { - #[allow(missing_docs)] // documentation missing in model - pub kind: CdnVersionMiddlewareKind, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum CdnVersionMiddlewareKind { - #[allow(missing_docs)] // documentation missing in model - CustomHeaders(CdnVersionCustomHeadersMiddleware), -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CdnVersionCustomHeadersMiddleware { - #[allow(missing_docs)] // documentation missing in model - pub headers: std::vec::Vec, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CdnVersionHeader { - #[allow(missing_docs)] // documentation missing in model - pub name: std::string::String, - #[allow(missing_docs)] // documentation missing in model - pub value: std::string::String, -} - -/// A full version. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct VersionFull { - /// A universally unique identifier. - pub version_id: std::string::String, - /// RFC3339 timestamp. - pub create_ts: chrono::DateTime, - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// Cloud configuration for a given version. - pub config: CloudVersionConfig, -} - -/// A billing plan. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GameBillingPlan { - /// A value denoting a game's billing plan. - pub code: GameBillingPlanCode, - #[allow(missing_docs)] // documentation missing in model - pub name: std::string::String, - /// The interval a billing plan acts on. - pub interval: BillingInterval, - /// Signed 64 bit integer. - pub amount: i64, - #[allow(missing_docs)] // documentation missing in model - pub currency: std::string::String, -} - -/// The interval a billing plan acts on. -#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd, Hash, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum BillingInterval { - #[allow(missing_docs)] // documentation missing in model - Monthly, - #[allow(missing_docs)] // documentation missing in model - Yearly, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for BillingInterval { - fn from(s: &str) -> Self { - match s { - "monthly" => BillingInterval::Monthly, - "yearly" => BillingInterval::Yearly, - other => BillingInterval::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for BillingInterval { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(BillingInterval::from(s)) - } -} -impl BillingInterval { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - BillingInterval::Monthly => "monthly", - BillingInterval::Yearly => "yearly", - BillingInterval::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["monthly", "yearly"] - } -} -impl AsRef for BillingInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// A value denoting a game's billing plan. -#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd, Hash, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum GameBillingPlanCode { - #[allow(missing_docs)] // documentation missing in model - Enterprise, - #[allow(missing_docs)] // documentation missing in model - Free, - #[allow(missing_docs)] // documentation missing in model - GameHobbyMonthly, - #[allow(missing_docs)] // documentation missing in model - GameHobbyYearly, - #[allow(missing_docs)] // documentation missing in model - GameStudioMonthly, - #[allow(missing_docs)] // documentation missing in model - GameStudioYearly, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for GameBillingPlanCode { - fn from(s: &str) -> Self { - match s { - "enterprise" => GameBillingPlanCode::Enterprise, - "free" => GameBillingPlanCode::Free, - "game_hobby_monthly" => GameBillingPlanCode::GameHobbyMonthly, - "game_hobby_yearly" => GameBillingPlanCode::GameHobbyYearly, - "game_studio_monthly" => GameBillingPlanCode::GameStudioMonthly, - "game_studio_yearly" => GameBillingPlanCode::GameStudioYearly, - other => GameBillingPlanCode::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for GameBillingPlanCode { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(GameBillingPlanCode::from(s)) - } -} -impl GameBillingPlanCode { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - GameBillingPlanCode::Enterprise => "enterprise", - GameBillingPlanCode::Free => "free", - GameBillingPlanCode::GameHobbyMonthly => "game_hobby_monthly", - GameBillingPlanCode::GameHobbyYearly => "game_hobby_yearly", - GameBillingPlanCode::GameStudioMonthly => "game_studio_monthly", - GameBillingPlanCode::GameStudioYearly => "game_studio_yearly", - GameBillingPlanCode::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &[ - "enterprise", - "free", - "game_hobby_monthly", - "game_hobby_yearly", - "game_studio_monthly", - "game_studio_yearly", - ] - } -} -impl AsRef for GameBillingPlanCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// A region summary. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct RegionSummary { - /// A universally unique identifier. - pub region_id: std::string::String, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub region_name_id: std::string::String, - /// The server provider of this region. - pub provider: std::string::String, - /// A universal number given to this region. - pub universal_region: i16, - /// Represent a resource's readable display name. - pub provider_display_name: std::string::String, - /// Represent a resource's readable display name. - pub region_display_name: std::string::String, -} - -/// Region tier metrics. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct RegionTierMetrics { - /// A universally unique identifier. - pub namespace_id: std::string::String, - /// A universally unique identifier. - pub region_id: std::string::String, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub tier_name_id: std::string::String, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub lobby_group_name_id: std::string::String, - /// How long a region tier has been active (in seconds). - pub uptime: i64, -} - -/// A namespace summary. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct NamespaceSummary { - /// A universally unique identifier. - pub namespace_id: std::string::String, - /// RFC3339 timestamp. - pub create_ts: chrono::DateTime, - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// A universally unique identifier. - pub version_id: std::string::String, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub name_id: std::string::String, -} - -/// A game handle. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GameHandle { - /// A universally unique identifier. - pub game_id: std::string::String, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub name_id: std::string::String, - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// The URL of this game's logo image. - pub logo_url: std::option::Option, - /// The URL of this game's banner image. - pub banner_url: std::option::Option, -} - -/// A full game. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GameFull { - /// A universally unique identifier. - pub game_id: std::string::String, - /// RFC3339 timestamp. - pub create_ts: chrono::DateTime, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub name_id: std::string::String, - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// A universally unique identifier. - pub developer_group_id: std::string::String, - /// Unsigned 32 bit integer. - pub total_player_count: i32, - /// The URL of this game's logo image. - pub logo_url: std::option::Option, - /// The URL of this game's banner image. - pub banner_url: std::option::Option, - /// A list of namespace summaries. - pub namespaces: std::vec::Vec, - /// A list of version summaries. - pub versions: std::vec::Vec, - /// A list of region summaries. - pub available_regions: std::vec::Vec, -} - -/// A version summary. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct VersionSummary { - /// A universally unique identifier. - pub version_id: std::string::String, - /// RFC3339 timestamp. - pub create_ts: chrono::DateTime, - /// Represent a resource's readable display name. - pub display_name: std::string::String, -} - -/// A group summary. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GroupSummary { - /// A universally unique identifier. - pub group_id: std::string::String, - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// The URL of this group's avatar image. - pub avatar_url: std::option::Option, - /// External links for this group. - pub external: GroupExternalLinks, - /// Whether or not this group is a developer. - pub is_developer: bool, - /// Detailed information about a profile. - pub bio: std::string::String, - /// Whether or not the current identity is a member of this group. - pub is_current_identity_member: bool, - /// The current publicity value for the given group. - pub publicity: GroupPublicity, - /// Unsigned 32 bit integer. - pub member_count: i32, - /// A universally unique identifier. - pub owner_identity_id: std::string::String, -} - -/// The current publicity value for the given group. -#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd, Hash, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum GroupPublicity { - #[allow(missing_docs)] // documentation missing in model - Closed, - #[allow(missing_docs)] // documentation missing in model - Open, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for GroupPublicity { - fn from(s: &str) -> Self { - match s { - "closed" => GroupPublicity::Closed, - "open" => GroupPublicity::Open, - other => GroupPublicity::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for GroupPublicity { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(GroupPublicity::from(s)) - } -} -impl GroupPublicity { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - GroupPublicity::Closed => "closed", - GroupPublicity::Open => "open", - GroupPublicity::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["closed", "open"] - } -} -impl AsRef for GroupPublicity { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// External links for this group. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GroupExternalLinks { - /// A link to this group's profile page. - pub profile: std::string::String, - /// A link to this group's chat page. - pub chat: std::string::String, -} - -/// A game summary. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GameSummary { - /// A universally unique identifier. - pub game_id: std::string::String, - /// RFC3339 timestamp. - pub create_ts: chrono::DateTime, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub name_id: std::string::String, - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// A universally unique identifier. - pub developer_group_id: std::string::String, - /// Unsigned 32 bit integer. - pub total_player_count: i32, - /// The URL of this game's logo image. - pub logo_url: std::option::Option, - /// The URL of this game's banner image. - pub banner_url: std::option::Option, -} - -/// The current authenticated agent. -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum AuthAgent { - /// The current authenticated game cloud. - GameCloud(AuthAgentGameCloud), - /// The current authenticated identity. - Identity(AuthAgentIdentity), -} - -/// The current authenticated game cloud. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct AuthAgentGameCloud { - /// A universally unique identifier. - pub game_id: std::string::String, -} - -/// The current authenticated identity. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct AuthAgentIdentity { - /// A universally unique identifier. - pub identity_id: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CompleteCustomAvatarUploadRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PrepareCustomAvatarUploadRequest { - /// The path/filename of the custom avatar. - pub path: std::string::String, - /// The MIME type of the custom avatar. - pub mime: std::option::Option, - /// Unsigned 64 bit integer. - pub content_length: i64, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ListGameCustomAvatarsRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetRayPerfLogsRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ValidateGroupRequest { - /// Represent a resource's readable display name. - pub display_name: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GroupBillingCheckoutRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ConvertGroupRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetGroupInvoicesListRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetGroupBillingRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetRegionTiersRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ExportLobbyLogsRequest { - #[allow(missing_docs)] // documentation missing in model - pub stream: LogStream, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetLobbyLogsRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ExportMatchmakerLobbyHistoryRequest { - /// Unsigned 64 bit integer. - pub query_start: i64, - /// Unsigned 64 bit integer. - pub query_end: i64, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct DeleteMatchmakerLobbyRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CreateGameCdnSiteRequest { - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// A list of files preparing to upload. - pub files: std::vec::Vec, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ListGameCdnSitesRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CreateGameBuildRequest { - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// A tag given to the game build. - pub image_tag: std::string::String, - /// A file being prepared to upload. - pub image_file: UploadPrepareFile, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ListGameBuildsRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CreateCloudTokenRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetNamespaceLobbyRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ListNamespaceLobbiesRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetNamespaceAnalyticsMatchmakerLiveRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct SetNamespaceCdnAuthTypeRequest { - /// A value denoting what type of authentication to use for a game namespace's CDN. - pub auth_type: CdnAuthType, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct RemoveNamespaceCdnAuthUserRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct UpdateNamespaceCdnAuthUserRequest { - /// A user name. - pub user: std::string::String, - /// A bcrypt encrypted password. An error is returned if the given string is not properly encrypted. - pub password: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ValidateGameNamespaceMatchmakerConfigRequest { - /// Unsigned 32 bit integer. - pub lobby_count_max: i32, - /// Unsigned 32 bit integer. - pub max_players: i32, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ValidateGameNamespaceTokenDevelopmentRequest { - #[allow(missing_docs)] // documentation missing in model - pub hostname: std::string::String, - /// A list of docker ports. - pub lobby_ports: std::vec::Vec, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ValidateGameNamespaceRequest { - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub name_id: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct UpdateGameNamespaceMatchmakerConfigRequest { - /// Unsigned 32 bit integer. - pub lobby_count_max: i32, - /// Unsigned 32 bit integer. - pub max_players: i32, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ToggleNamespaceDomainPublicAuthRequest { - /// Whether or not to enable authentication based on domain. - pub enabled: bool, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct RemoveNamespaceDomainRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct AddNamespaceDomainRequest { - /// A valid domain name (no protocol). - pub domain: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CreateGameNamespaceTokenDevelopmentRequest { - /// The hostname used for the token. - pub hostname: std::string::String, - /// A list of docker ports. - pub lobby_ports: std::vec::Vec, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CreateGameNamespaceTokenPublicRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct UpdateGameNamespaceVersionRequest { - /// A universally unique identifier. - pub version_id: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetGameNamespaceByIdRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CreateGameNamespaceRequest { - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// A universally unique identifier. - pub version_id: std::string::String, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub name_id: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ValidateGameVersionRequest { - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// Cloud configuration for a given version. - pub config: CloudVersionConfig, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetGameVersionByIdRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CreateGameVersionRequest { - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// Cloud configuration for a given version. - pub config: CloudVersionConfig, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetGameBillingPlansRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct SetGameBillingPlanRequest { - /// A value denoting a game's billing plan. - pub plan: GameBillingPlanCode, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetGameBillingRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GameBannerUploadCompleteRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GameBannerUploadPrepareRequest { - /// The path/filename of the game banner. - pub path: std::string::String, - /// The MIME type of the game banner. - pub mime: std::option::Option, - /// Unsigned 64 bit integer. - pub content_length: i64, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GameLogoUploadCompleteRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GameLogoUploadPrepareRequest { - /// The path/filename of the game logo. - pub path: std::string::String, - /// The MIME type of the game logo. - pub mime: std::option::Option, - /// Unsigned 64 bit integer. - pub content_length: i64, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ValidateGameRequest { - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub name_id: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetGameByIdRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CreateGameRequest { - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub name_id: std::string::String, - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// A universally unique identifier. - pub developer_group_id: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetGamesRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CompleteUploadRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct InspectRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CompleteCustomAvatarUploadResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PrepareCustomAvatarUploadResponse { - /// A universally unique identifier. - pub upload_id: std::string::String, - /// A presigned request used to upload files. Upload your file to the given URL via a PUT request. - pub presigned_request: UploadPresignedRequest, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ListGameCustomAvatarsResponse { - /// A list of custom avatar summaries. - pub custom_avatars: std::vec::Vec, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetRayPerfLogsResponse { - /// A list of service performance summaries. - pub perf_lists: std::vec::Vec, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ValidateGroupResponse { - /// A list of validation errors. - pub errors: std::vec::Vec, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GroupBillingCheckoutResponse { - /// The URL of the checkout session. - pub url: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ConvertGroupResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetGroupInvoicesListResponse { - /// A list of a group's billing invoices. - pub invoices: std::vec::Vec, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetGroupBillingResponse { - /// Signed 64 bit integer. - pub usage: i64, - /// The status of a developer group. - pub status: GroupStatus, - /// Whether or not the given group can actively host games. - pub active: bool, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetRegionTiersResponse { - /// A list of region server tiers. - pub tiers: std::vec::Vec, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ExportLobbyLogsResponse { - /// The URL to a CSV file for the given lobby history. - pub url: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetLobbyLogsResponse { - /// Sorted old to new. - pub lines: std::vec::Vec, - /// Sorted old to new. - pub timestamps: std::vec::Vec>, - /// Provided by watchable endpoints used in blocking loops. - pub watch: WatchResponse, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ExportMatchmakerLobbyHistoryResponse { - /// The URL to a CSV file for the given lobby history. - pub url: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct DeleteMatchmakerLobbyResponse { - /// Whether or not the lobby was successfully stopped. - pub did_remove: bool, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CreateGameCdnSiteResponse { - /// A universally unique identifier. - pub site_id: std::string::String, - /// A universally unique identifier. - pub upload_id: std::string::String, - #[allow(missing_docs)] // documentation missing in model - pub presigned_requests: std::vec::Vec, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ListGameCdnSitesResponse { - /// A list of CDN site summaries. - pub sites: std::vec::Vec, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CreateGameBuildResponse { - /// A universally unique identifier. - pub build_id: std::string::String, - /// A universally unique identifier. - pub upload_id: std::string::String, - /// A presigned request used to upload files. Upload your file to the given URL via a PUT request. - pub image_presigned_request: UploadPresignedRequest, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ListGameBuildsResponse { - /// A list of build summaries. - pub builds: std::vec::Vec, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CreateCloudTokenResponse { - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub token: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetNamespaceLobbyResponse { - /// A logs summary for a lobby. - pub lobby: LogsLobbySummary, - /// Metrics relating to a job service. - pub metrics: std::option::Option, - /// A list of URLs. - pub stdout_presigned_urls: std::vec::Vec, - /// A list of URLs. - pub stderr_presigned_urls: std::vec::Vec, - /// A list of service performance summaries. - pub perf_lists: std::vec::Vec, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ListNamespaceLobbiesResponse { - /// A list of lobby log summaries. - pub lobbies: std::vec::Vec, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetNamespaceAnalyticsMatchmakerLiveResponse { - /// A list of analytics lobby summaries. - pub lobbies: std::vec::Vec, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct SetNamespaceCdnAuthTypeResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct RemoveNamespaceCdnAuthUserResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct UpdateNamespaceCdnAuthUserResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ValidateGameNamespaceMatchmakerConfigResponse { - /// A list of validation errors. - pub errors: std::vec::Vec, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ValidateGameNamespaceTokenDevelopmentResponse { - /// A list of validation errors. - pub errors: std::vec::Vec, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ValidateGameNamespaceResponse { - /// A list of validation errors. - pub errors: std::vec::Vec, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct UpdateGameNamespaceMatchmakerConfigResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ToggleNamespaceDomainPublicAuthResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct RemoveNamespaceDomainResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct AddNamespaceDomainResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CreateGameNamespaceTokenDevelopmentResponse { - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub token: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CreateGameNamespaceTokenPublicResponse { - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub token: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct UpdateGameNamespaceVersionResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetGameNamespaceByIdResponse { - /// A full namespace. - pub namespace: NamespaceFull, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CreateGameNamespaceResponse { - /// A universally unique identifier. - pub namespace_id: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ValidateGameVersionResponse { - /// A list of validation errors. - pub errors: std::vec::Vec, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetGameVersionByIdResponse { - /// A full version. - pub version: VersionFull, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CreateGameVersionResponse { - /// A universally unique identifier. - pub version_id: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetGameBillingPlansResponse { - /// A list of billing plans. - pub plans: std::vec::Vec, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct SetGameBillingPlanResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetGameBillingResponse { - /// A game handle. - pub game: GameHandle, - /// A list of namespace summaries. - pub namespaces: std::vec::Vec, - /// A list of multiple region tier metrics. - pub metrics: std::vec::Vec, - /// The status of a developer group. - pub group_status: GroupStatus, - /// Whether or not the given game can actively host games. - pub group_active: bool, - /// A value denoting a game's billing plan. - pub plan: GameBillingPlanCode, - /// A list of region summaries. - pub available_regions: std::vec::Vec, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GameBannerUploadCompleteResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GameBannerUploadPrepareResponse { - /// A universally unique identifier. - pub upload_id: std::string::String, - /// A presigned request used to upload files. Upload your file to the given URL via a PUT request. - pub presigned_request: UploadPresignedRequest, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GameLogoUploadCompleteResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GameLogoUploadPrepareResponse { - /// A universally unique identifier. - pub upload_id: std::string::String, - /// A presigned request used to upload files. Upload your file to the given URL via a PUT request. - pub presigned_request: UploadPresignedRequest, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ValidateGameResponse { - /// A list of validation errors. - pub errors: std::vec::Vec, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetGameByIdResponse { - /// A full game. - pub game: GameFull, - /// Provided by watchable endpoints used in blocking loops. - pub watch: WatchResponse, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CreateGameResponse { - /// A universally unique identifier. - pub game_id: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetGamesResponse { - /// A list of game summaries. - pub games: std::vec::Vec, - /// A list of group summaries. - pub groups: std::vec::Vec, - /// Provided by watchable endpoints used in blocking loops. - pub watch: WatchResponse, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CompleteUploadResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct InspectResponse { - /// The current authenticated agent. - pub agent: AuthAgent, -} - diff --git a/lib/smithy-output/api-cloud/rust/rust/Cargo.toml b/lib/smithy-output/api-cloud/rust/rust/Cargo.toml deleted file mode 100644 index f6ebc25a3..000000000 --- a/lib/smithy-output/api-cloud/rust/rust/Cargo.toml +++ /dev/null @@ -1,33 +0,0 @@ -# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -[package] -name = "rivet-cloud" -version = "0.0.1" -authors = ["Rivet Gaming, LLC "] -description = "Rivet service for developers to manage games" -edition = "2021" -license = "Apache-2.0" - -[package.metadata.docs.rs] -all-features = true -targets = ["x86_64-unknown-linux-gnu"] -[dependencies.aws-smithy-client] -version = "^0.41.0" -[dependencies.aws-smithy-http] -version = "^0.41.0" -[dependencies.aws-smithy-json] -version = "^0.41.0" -[dependencies.aws-smithy-types] -version = "^0.41.0" -[dependencies.bytes] -version = "1" -[dependencies.http] -version = "0.2" -[dependencies.tower] -version = "0.4" -[features] -rt-tokio = ["aws-smithy-http/rt-tokio"] -rustls = ["aws-smithy-client/rustls"] -native-tls = ["aws-smithy-client/native-tls"] -default = ["rt-tokio", "rustls"] - - diff --git a/lib/smithy-output/api-cloud/rust/rust/src/client.rs b/lib/smithy-output/api-cloud/rust/rust/src/client.rs deleted file mode 100644 index 5b0afac53..000000000 --- a/lib/smithy-output/api-cloud/rust/rust/src/client.rs +++ /dev/null @@ -1,5187 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[derive(Debug)] -pub(crate) struct Handle { - pub(crate) client: aws_smithy_client::Client, - pub(crate) conf: crate::Config, -} - -/// An ergonomic service client for `CloudService`. -/// -/// This client allows ergonomic access to a `CloudService`-shaped service. -/// Each method corresponds to an endpoint defined in the service's Smithy model, -/// and the request and response shapes are auto-generated from that same model. -/// -/// # Constructing a Client -/// -/// To construct a client, you need a few different things: -/// -/// - A [`Config`](crate::Config) that specifies additional configuration -/// required by the service. -/// - A connector (`C`) that specifies how HTTP requests are translated -/// into HTTP responses. This will typically be an HTTP client (like -/// `hyper`), though you can also substitute in your own, like a mock -/// mock connector for testing. -/// - A "middleware" (`M`) that modifies requests prior to them being -/// sent to the request. Most commonly, middleware will decide what -/// endpoint the requests should be sent to, as well as perform -/// authentication and authorization of requests (such as SigV4). -/// You can also have middleware that performs request/response -/// tracing, throttling, or other middleware-like tasks. -/// - A retry policy (`R`) that dictates the behavior for requests that -/// fail and should (potentially) be retried. The default type is -/// generally what you want, as it implements a well-vetted retry -/// policy implemented in [`RetryMode::Standard`](aws_smithy_types::retry::RetryMode::Standard). -/// -/// To construct a client, you will generally want to call -/// [`Client::with_config`], which takes a [`aws_smithy_client::Client`] (a -/// Smithy client that isn't specialized to a particular service), -/// and a [`Config`](crate::Config). Both of these are constructed using -/// the [builder pattern] where you first construct a `Builder` type, -/// then configure it with the necessary parameters, and then call -/// `build` to construct the finalized output type. The -/// [`aws_smithy_client::Client`] builder is re-exported in this crate as -/// [`Builder`] for convenience. -/// -/// In _most_ circumstances, you will want to use the following pattern -/// to construct a client: -/// -/// ``` -/// use rivet_cloud::{Builder, Client, Config}; -/// let raw_client = -/// Builder::dyn_https() -/// # /* -/// .middleware(/* discussed below */) -/// # */ -/// # .middleware_fn(|r| r) -/// .build(); -/// let config = Config::builder().build(); -/// let client = Client::with_config(raw_client, config); -/// ``` -/// -/// For the middleware, you'll want to use whatever matches the -/// routing, authentication and authorization required by the target -/// service. For example, for the standard AWS SDK which uses -/// [SigV4-signed requests], the middleware looks like this: -/// -// Ignored as otherwise we'd need to pull in all these dev-dependencies. -/// ```rust,ignore -/// use aws_endpoint::AwsEndpointStage; -/// use aws_http::auth::CredentialsStage; -/// use aws_http::recursion_detection::RecursionDetectionStage; -/// use aws_http::user_agent::UserAgentStage; -/// use aws_sig_auth::middleware::SigV4SigningStage; -/// use aws_sig_auth::signer::SigV4Signer; -/// use aws_smithy_client::retry::Config as RetryConfig; -/// use aws_smithy_http_tower::map_request::{AsyncMapRequestLayer, MapRequestLayer}; -/// use std::fmt::Debug; -/// use tower::layer::util::{Identity, Stack}; -/// use tower::ServiceBuilder; -/// -/// type AwsMiddlewareStack = Stack< -/// MapRequestLayer, -/// Stack< -/// MapRequestLayer, -/// Stack< -/// AsyncMapRequestLayer, -/// Stack< -/// MapRequestLayer, -/// Stack, Identity>, -/// >, -/// >, -/// >, -/// >; -/// -/// /// AWS Middleware Stack -/// /// -/// /// This implements the middleware stack for this service. It will: -/// /// 1. Load credentials asynchronously into the property bag -/// /// 2. Sign the request with SigV4 -/// /// 3. Resolve an Endpoint for the request -/// /// 4. Add a user agent to the request -/// #[derive(Debug, Default, Clone)] -/// #[non_exhaustive] -/// pub struct AwsMiddleware; -/// -/// impl AwsMiddleware { -/// /// Create a new `AwsMiddleware` stack -/// /// -/// /// Note: `AwsMiddleware` holds no state. -/// pub fn new() -> Self { -/// AwsMiddleware::default() -/// } -/// } -/// -/// // define the middleware stack in a non-generic location to reduce code bloat. -/// fn base() -> ServiceBuilder { -/// let credential_provider = AsyncMapRequestLayer::for_mapper(CredentialsStage::new()); -/// let signer = MapRequestLayer::for_mapper(SigV4SigningStage::new(SigV4Signer::new())); -/// let endpoint_resolver = MapRequestLayer::for_mapper(AwsEndpointStage); -/// let user_agent = MapRequestLayer::for_mapper(UserAgentStage::new()); -/// let recursion_detection = MapRequestLayer::for_mapper(RecursionDetectionStage::new()); -/// // These layers can be considered as occurring in order, that is: -/// // 1. Resolve an endpoint -/// // 2. Add a user agent -/// // 3. Acquire credentials -/// // 4. Sign with credentials -/// // (5. Dispatch over the wire) -/// ServiceBuilder::new() -/// .layer(endpoint_resolver) -/// .layer(user_agent) -/// .layer(credential_provider) -/// .layer(signer) -/// .layer(recursion_detection) -/// } -/// -/// impl tower::Layer for AwsMiddleware { -/// type Service = >::Service; -/// -/// fn layer(&self, inner: S) -> Self::Service { -/// base().service(inner) -/// } -/// } -/// ``` -/// -/// # Using a Client -/// -/// Once you have a client set up, you can access the service's endpoints -/// by calling the appropriate method on [`Client`]. Each such method -/// returns a request builder for that endpoint, with methods for setting -/// the various fields of the request. Once your request is complete, use -/// the `send` method to send the request. `send` returns a future, which -/// you then have to `.await` to get the service's response. -/// -/// [builder pattern]: https://rust-lang.github.io/api-guidelines/type-safety.html#c-builder -/// [SigV4-signed requests]: https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html -#[derive(std::fmt::Debug)] -pub struct Client { - handle: std::sync::Arc>, -} - -impl std::clone::Clone for Client { - fn clone(&self) -> Self { - Self { - handle: self.handle.clone(), - } - } -} - -#[doc(inline)] -pub use aws_smithy_client::Builder; - -impl From> for Client { - fn from(client: aws_smithy_client::Client) -> Self { - Self::with_config(client, crate::Config::builder().build()) - } -} - -impl Client { - /// Creates a client with the given service configuration. - pub fn with_config(client: aws_smithy_client::Client, conf: crate::Config) -> Self { - Self { - handle: std::sync::Arc::new(Handle { client, conf }), - } - } - - /// Returns the client's configuration. - pub fn conf(&self) -> &crate::Config { - &self.handle.conf - } -} -impl Client -where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, -{ - /// Constructs a fluent builder for the [`AddNamespaceDomain`](crate::client::fluent_builders::AddNamespaceDomain) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::AddNamespaceDomain::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::AddNamespaceDomain::set_game_id): A universally unique identifier. - /// - [`namespace_id(impl Into)`](crate::client::fluent_builders::AddNamespaceDomain::namespace_id) / [`set_namespace_id(Option)`](crate::client::fluent_builders::AddNamespaceDomain::set_namespace_id): A universally unique identifier. - /// - [`domain(impl Into)`](crate::client::fluent_builders::AddNamespaceDomain::domain) / [`set_domain(Option)`](crate::client::fluent_builders::AddNamespaceDomain::set_domain): A valid domain name (no protocol). - /// - On success, responds with [`AddNamespaceDomainOutput`](crate::output::AddNamespaceDomainOutput) - - /// - On failure, responds with [`SdkError`](crate::error::AddNamespaceDomainError) - pub fn add_namespace_domain(&self) -> fluent_builders::AddNamespaceDomain { - fluent_builders::AddNamespaceDomain::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`CompleteCustomAvatarUpload`](crate::client::fluent_builders::CompleteCustomAvatarUpload) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::CompleteCustomAvatarUpload::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::CompleteCustomAvatarUpload::set_game_id): A universally unique identifier. - /// - [`upload_id(impl Into)`](crate::client::fluent_builders::CompleteCustomAvatarUpload::upload_id) / [`set_upload_id(Option)`](crate::client::fluent_builders::CompleteCustomAvatarUpload::set_upload_id): A universally unique identifier. - /// - On success, responds with [`CompleteCustomAvatarUploadOutput`](crate::output::CompleteCustomAvatarUploadOutput) - - /// - On failure, responds with [`SdkError`](crate::error::CompleteCustomAvatarUploadError) - pub fn complete_custom_avatar_upload( - &self, - ) -> fluent_builders::CompleteCustomAvatarUpload { - fluent_builders::CompleteCustomAvatarUpload::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`CompleteUpload`](crate::client::fluent_builders::CompleteUpload) operation. - /// - /// - The fluent builder is configurable: - /// - [`upload_id(impl Into)`](crate::client::fluent_builders::CompleteUpload::upload_id) / [`set_upload_id(Option)`](crate::client::fluent_builders::CompleteUpload::set_upload_id): A universally unique identifier. - /// - On success, responds with [`CompleteUploadOutput`](crate::output::CompleteUploadOutput) - - /// - On failure, responds with [`SdkError`](crate::error::CompleteUploadError) - pub fn complete_upload(&self) -> fluent_builders::CompleteUpload { - fluent_builders::CompleteUpload::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`ConvertGroup`](crate::client::fluent_builders::ConvertGroup) operation. - /// - /// - The fluent builder is configurable: - /// - [`group_id(impl Into)`](crate::client::fluent_builders::ConvertGroup::group_id) / [`set_group_id(Option)`](crate::client::fluent_builders::ConvertGroup::set_group_id): A universally unique identifier. - /// - On success, responds with [`ConvertGroupOutput`](crate::output::ConvertGroupOutput) - - /// - On failure, responds with [`SdkError`](crate::error::ConvertGroupError) - pub fn convert_group(&self) -> fluent_builders::ConvertGroup { - fluent_builders::ConvertGroup::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`CreateCloudToken`](crate::client::fluent_builders::CreateCloudToken) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::CreateCloudToken::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::CreateCloudToken::set_game_id): A universally unique identifier. - /// - On success, responds with [`CreateCloudTokenOutput`](crate::output::CreateCloudTokenOutput) with field(s): - /// - [`token(Option)`](crate::output::CreateCloudTokenOutput::token): A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - /// - On failure, responds with [`SdkError`](crate::error::CreateCloudTokenError) - pub fn create_cloud_token(&self) -> fluent_builders::CreateCloudToken { - fluent_builders::CreateCloudToken::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`CreateGame`](crate::client::fluent_builders::CreateGame) operation. - /// - /// - The fluent builder is configurable: - /// - [`name_id(impl Into)`](crate::client::fluent_builders::CreateGame::name_id) / [`set_name_id(Option)`](crate::client::fluent_builders::CreateGame::set_name_id): A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - /// - [`display_name(impl Into)`](crate::client::fluent_builders::CreateGame::display_name) / [`set_display_name(Option)`](crate::client::fluent_builders::CreateGame::set_display_name): Represent a resource's readable display name. - /// - [`developer_group_id(impl Into)`](crate::client::fluent_builders::CreateGame::developer_group_id) / [`set_developer_group_id(Option)`](crate::client::fluent_builders::CreateGame::set_developer_group_id): A universally unique identifier. - /// - On success, responds with [`CreateGameOutput`](crate::output::CreateGameOutput) with field(s): - /// - [`game_id(Option)`](crate::output::CreateGameOutput::game_id): A universally unique identifier. - /// - On failure, responds with [`SdkError`](crate::error::CreateGameError) - pub fn create_game(&self) -> fluent_builders::CreateGame { - fluent_builders::CreateGame::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`CreateGameBuild`](crate::client::fluent_builders::CreateGameBuild) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::CreateGameBuild::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::CreateGameBuild::set_game_id): A universally unique identifier. - /// - [`display_name(impl Into)`](crate::client::fluent_builders::CreateGameBuild::display_name) / [`set_display_name(Option)`](crate::client::fluent_builders::CreateGameBuild::set_display_name): Represent a resource's readable display name. - /// - [`image_tag(impl Into)`](crate::client::fluent_builders::CreateGameBuild::image_tag) / [`set_image_tag(Option)`](crate::client::fluent_builders::CreateGameBuild::set_image_tag): A tag given to the game build. - /// - [`image_file(UploadPrepareFile)`](crate::client::fluent_builders::CreateGameBuild::image_file) / [`set_image_file(Option)`](crate::client::fluent_builders::CreateGameBuild::set_image_file): A file being prepared to upload. - /// - On success, responds with [`CreateGameBuildOutput`](crate::output::CreateGameBuildOutput) with field(s): - /// - [`build_id(Option)`](crate::output::CreateGameBuildOutput::build_id): A universally unique identifier. - /// - [`upload_id(Option)`](crate::output::CreateGameBuildOutput::upload_id): A universally unique identifier. - /// - [`image_presigned_request(Option)`](crate::output::CreateGameBuildOutput::image_presigned_request): A presigned request used to upload files. Upload your file to the given URL via a PUT request. - /// - On failure, responds with [`SdkError`](crate::error::CreateGameBuildError) - pub fn create_game_build(&self) -> fluent_builders::CreateGameBuild { - fluent_builders::CreateGameBuild::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`CreateGameCdnSite`](crate::client::fluent_builders::CreateGameCdnSite) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::CreateGameCdnSite::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::CreateGameCdnSite::set_game_id): A universally unique identifier. - /// - [`display_name(impl Into)`](crate::client::fluent_builders::CreateGameCdnSite::display_name) / [`set_display_name(Option)`](crate::client::fluent_builders::CreateGameCdnSite::set_display_name): Represent a resource's readable display name. - /// - [`files(Vec)`](crate::client::fluent_builders::CreateGameCdnSite::files) / [`set_files(Option>)`](crate::client::fluent_builders::CreateGameCdnSite::set_files): A list of files preparing to upload. - /// - On success, responds with [`CreateGameCdnSiteOutput`](crate::output::CreateGameCdnSiteOutput) with field(s): - /// - [`site_id(Option)`](crate::output::CreateGameCdnSiteOutput::site_id): A universally unique identifier. - /// - [`upload_id(Option)`](crate::output::CreateGameCdnSiteOutput::upload_id): A universally unique identifier. - /// - [`presigned_requests(Option>)`](crate::output::CreateGameCdnSiteOutput::presigned_requests): (undocumented) - /// - On failure, responds with [`SdkError`](crate::error::CreateGameCdnSiteError) - pub fn create_game_cdn_site(&self) -> fluent_builders::CreateGameCdnSite { - fluent_builders::CreateGameCdnSite::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`CreateGameNamespace`](crate::client::fluent_builders::CreateGameNamespace) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::CreateGameNamespace::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::CreateGameNamespace::set_game_id): A universally unique identifier. - /// - [`display_name(impl Into)`](crate::client::fluent_builders::CreateGameNamespace::display_name) / [`set_display_name(Option)`](crate::client::fluent_builders::CreateGameNamespace::set_display_name): Represent a resource's readable display name. - /// - [`version_id(impl Into)`](crate::client::fluent_builders::CreateGameNamespace::version_id) / [`set_version_id(Option)`](crate::client::fluent_builders::CreateGameNamespace::set_version_id): A universally unique identifier. - /// - [`name_id(impl Into)`](crate::client::fluent_builders::CreateGameNamespace::name_id) / [`set_name_id(Option)`](crate::client::fluent_builders::CreateGameNamespace::set_name_id): A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - /// - On success, responds with [`CreateGameNamespaceOutput`](crate::output::CreateGameNamespaceOutput) with field(s): - /// - [`namespace_id(Option)`](crate::output::CreateGameNamespaceOutput::namespace_id): A universally unique identifier. - /// - On failure, responds with [`SdkError`](crate::error::CreateGameNamespaceError) - pub fn create_game_namespace(&self) -> fluent_builders::CreateGameNamespace { - fluent_builders::CreateGameNamespace::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`CreateGameNamespaceTokenDevelopment`](crate::client::fluent_builders::CreateGameNamespaceTokenDevelopment) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::CreateGameNamespaceTokenDevelopment::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::CreateGameNamespaceTokenDevelopment::set_game_id): A universally unique identifier. - /// - [`namespace_id(impl Into)`](crate::client::fluent_builders::CreateGameNamespaceTokenDevelopment::namespace_id) / [`set_namespace_id(Option)`](crate::client::fluent_builders::CreateGameNamespaceTokenDevelopment::set_namespace_id): A universally unique identifier. - /// - [`hostname(impl Into)`](crate::client::fluent_builders::CreateGameNamespaceTokenDevelopment::hostname) / [`set_hostname(Option)`](crate::client::fluent_builders::CreateGameNamespaceTokenDevelopment::set_hostname): The hostname used for the token. - /// - [`lobby_ports(Vec)`](crate::client::fluent_builders::CreateGameNamespaceTokenDevelopment::lobby_ports) / [`set_lobby_ports(Option>)`](crate::client::fluent_builders::CreateGameNamespaceTokenDevelopment::set_lobby_ports): A list of docker ports. - /// - On success, responds with [`CreateGameNamespaceTokenDevelopmentOutput`](crate::output::CreateGameNamespaceTokenDevelopmentOutput) with field(s): - /// - [`token(Option)`](crate::output::CreateGameNamespaceTokenDevelopmentOutput::token): A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - /// - On failure, responds with [`SdkError`](crate::error::CreateGameNamespaceTokenDevelopmentError) - pub fn create_game_namespace_token_development( - &self, - ) -> fluent_builders::CreateGameNamespaceTokenDevelopment { - fluent_builders::CreateGameNamespaceTokenDevelopment::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`CreateGameNamespaceTokenPublic`](crate::client::fluent_builders::CreateGameNamespaceTokenPublic) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::CreateGameNamespaceTokenPublic::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::CreateGameNamespaceTokenPublic::set_game_id): A universally unique identifier. - /// - [`namespace_id(impl Into)`](crate::client::fluent_builders::CreateGameNamespaceTokenPublic::namespace_id) / [`set_namespace_id(Option)`](crate::client::fluent_builders::CreateGameNamespaceTokenPublic::set_namespace_id): A universally unique identifier. - /// - On success, responds with [`CreateGameNamespaceTokenPublicOutput`](crate::output::CreateGameNamespaceTokenPublicOutput) with field(s): - /// - [`token(Option)`](crate::output::CreateGameNamespaceTokenPublicOutput::token): A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - /// - On failure, responds with [`SdkError`](crate::error::CreateGameNamespaceTokenPublicError) - pub fn create_game_namespace_token_public( - &self, - ) -> fluent_builders::CreateGameNamespaceTokenPublic { - fluent_builders::CreateGameNamespaceTokenPublic::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`CreateGameVersion`](crate::client::fluent_builders::CreateGameVersion) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::CreateGameVersion::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::CreateGameVersion::set_game_id): A universally unique identifier. - /// - [`display_name(impl Into)`](crate::client::fluent_builders::CreateGameVersion::display_name) / [`set_display_name(Option)`](crate::client::fluent_builders::CreateGameVersion::set_display_name): Represent a resource's readable display name. - /// - [`config(CloudVersionConfig)`](crate::client::fluent_builders::CreateGameVersion::config) / [`set_config(Option)`](crate::client::fluent_builders::CreateGameVersion::set_config): Cloud configuration for a given version. - /// - On success, responds with [`CreateGameVersionOutput`](crate::output::CreateGameVersionOutput) with field(s): - /// - [`version_id(Option)`](crate::output::CreateGameVersionOutput::version_id): A universally unique identifier. - /// - On failure, responds with [`SdkError`](crate::error::CreateGameVersionError) - pub fn create_game_version(&self) -> fluent_builders::CreateGameVersion { - fluent_builders::CreateGameVersion::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`DeleteMatchmakerLobby`](crate::client::fluent_builders::DeleteMatchmakerLobby) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::DeleteMatchmakerLobby::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::DeleteMatchmakerLobby::set_game_id): A universally unique identifier. - /// - [`lobby_id(impl Into)`](crate::client::fluent_builders::DeleteMatchmakerLobby::lobby_id) / [`set_lobby_id(Option)`](crate::client::fluent_builders::DeleteMatchmakerLobby::set_lobby_id): A universally unique identifier. - /// - On success, responds with [`DeleteMatchmakerLobbyOutput`](crate::output::DeleteMatchmakerLobbyOutput) with field(s): - /// - [`did_remove(Option)`](crate::output::DeleteMatchmakerLobbyOutput::did_remove): Whether or not the lobby was successfully stopped. - /// - On failure, responds with [`SdkError`](crate::error::DeleteMatchmakerLobbyError) - pub fn delete_matchmaker_lobby(&self) -> fluent_builders::DeleteMatchmakerLobby { - fluent_builders::DeleteMatchmakerLobby::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`ExportLobbyLogs`](crate::client::fluent_builders::ExportLobbyLogs) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::ExportLobbyLogs::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::ExportLobbyLogs::set_game_id): A universally unique identifier. - /// - [`lobby_id(impl Into)`](crate::client::fluent_builders::ExportLobbyLogs::lobby_id) / [`set_lobby_id(Option)`](crate::client::fluent_builders::ExportLobbyLogs::set_lobby_id): A universally unique identifier. - /// - [`stream(LogStream)`](crate::client::fluent_builders::ExportLobbyLogs::stream) / [`set_stream(Option)`](crate::client::fluent_builders::ExportLobbyLogs::set_stream): (undocumented) - /// - On success, responds with [`ExportLobbyLogsOutput`](crate::output::ExportLobbyLogsOutput) with field(s): - /// - [`url(Option)`](crate::output::ExportLobbyLogsOutput::url): The URL to a CSV file for the given lobby history. - /// - On failure, responds with [`SdkError`](crate::error::ExportLobbyLogsError) - pub fn export_lobby_logs(&self) -> fluent_builders::ExportLobbyLogs { - fluent_builders::ExportLobbyLogs::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`ExportMatchmakerLobbyHistory`](crate::client::fluent_builders::ExportMatchmakerLobbyHistory) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::ExportMatchmakerLobbyHistory::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::ExportMatchmakerLobbyHistory::set_game_id): A universally unique identifier. - /// - [`query_start(i64)`](crate::client::fluent_builders::ExportMatchmakerLobbyHistory::query_start) / [`set_query_start(Option)`](crate::client::fluent_builders::ExportMatchmakerLobbyHistory::set_query_start): Unsigned 64 bit integer. - /// - [`query_end(i64)`](crate::client::fluent_builders::ExportMatchmakerLobbyHistory::query_end) / [`set_query_end(Option)`](crate::client::fluent_builders::ExportMatchmakerLobbyHistory::set_query_end): Unsigned 64 bit integer. - /// - On success, responds with [`ExportMatchmakerLobbyHistoryOutput`](crate::output::ExportMatchmakerLobbyHistoryOutput) with field(s): - /// - [`url(Option)`](crate::output::ExportMatchmakerLobbyHistoryOutput::url): The URL to a CSV file for the given lobby history. - /// - On failure, responds with [`SdkError`](crate::error::ExportMatchmakerLobbyHistoryError) - pub fn export_matchmaker_lobby_history( - &self, - ) -> fluent_builders::ExportMatchmakerLobbyHistory { - fluent_builders::ExportMatchmakerLobbyHistory::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GameBannerUploadComplete`](crate::client::fluent_builders::GameBannerUploadComplete) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::GameBannerUploadComplete::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::GameBannerUploadComplete::set_game_id): A universally unique identifier. - /// - [`upload_id(impl Into)`](crate::client::fluent_builders::GameBannerUploadComplete::upload_id) / [`set_upload_id(Option)`](crate::client::fluent_builders::GameBannerUploadComplete::set_upload_id): A universally unique identifier. - /// - On success, responds with [`GameBannerUploadCompleteOutput`](crate::output::GameBannerUploadCompleteOutput) - - /// - On failure, responds with [`SdkError`](crate::error::GameBannerUploadCompleteError) - pub fn game_banner_upload_complete( - &self, - ) -> fluent_builders::GameBannerUploadComplete { - fluent_builders::GameBannerUploadComplete::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GameBannerUploadPrepare`](crate::client::fluent_builders::GameBannerUploadPrepare) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::GameBannerUploadPrepare::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::GameBannerUploadPrepare::set_game_id): A universally unique identifier. - /// - [`path(impl Into)`](crate::client::fluent_builders::GameBannerUploadPrepare::path) / [`set_path(Option)`](crate::client::fluent_builders::GameBannerUploadPrepare::set_path): The path/filename of the game banner. - /// - [`mime(impl Into)`](crate::client::fluent_builders::GameBannerUploadPrepare::mime) / [`set_mime(Option)`](crate::client::fluent_builders::GameBannerUploadPrepare::set_mime): The MIME type of the game banner. - /// - [`content_length(i64)`](crate::client::fluent_builders::GameBannerUploadPrepare::content_length) / [`set_content_length(Option)`](crate::client::fluent_builders::GameBannerUploadPrepare::set_content_length): Unsigned 64 bit integer. - /// - On success, responds with [`GameBannerUploadPrepareOutput`](crate::output::GameBannerUploadPrepareOutput) with field(s): - /// - [`upload_id(Option)`](crate::output::GameBannerUploadPrepareOutput::upload_id): A universally unique identifier. - /// - [`presigned_request(Option)`](crate::output::GameBannerUploadPrepareOutput::presigned_request): A presigned request used to upload files. Upload your file to the given URL via a PUT request. - /// - On failure, responds with [`SdkError`](crate::error::GameBannerUploadPrepareError) - pub fn game_banner_upload_prepare(&self) -> fluent_builders::GameBannerUploadPrepare { - fluent_builders::GameBannerUploadPrepare::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GameLogoUploadComplete`](crate::client::fluent_builders::GameLogoUploadComplete) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::GameLogoUploadComplete::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::GameLogoUploadComplete::set_game_id): A universally unique identifier. - /// - [`upload_id(impl Into)`](crate::client::fluent_builders::GameLogoUploadComplete::upload_id) / [`set_upload_id(Option)`](crate::client::fluent_builders::GameLogoUploadComplete::set_upload_id): A universally unique identifier. - /// - On success, responds with [`GameLogoUploadCompleteOutput`](crate::output::GameLogoUploadCompleteOutput) - - /// - On failure, responds with [`SdkError`](crate::error::GameLogoUploadCompleteError) - pub fn game_logo_upload_complete(&self) -> fluent_builders::GameLogoUploadComplete { - fluent_builders::GameLogoUploadComplete::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GameLogoUploadPrepare`](crate::client::fluent_builders::GameLogoUploadPrepare) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::GameLogoUploadPrepare::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::GameLogoUploadPrepare::set_game_id): A universally unique identifier. - /// - [`path(impl Into)`](crate::client::fluent_builders::GameLogoUploadPrepare::path) / [`set_path(Option)`](crate::client::fluent_builders::GameLogoUploadPrepare::set_path): The path/filename of the game logo. - /// - [`mime(impl Into)`](crate::client::fluent_builders::GameLogoUploadPrepare::mime) / [`set_mime(Option)`](crate::client::fluent_builders::GameLogoUploadPrepare::set_mime): The MIME type of the game logo. - /// - [`content_length(i64)`](crate::client::fluent_builders::GameLogoUploadPrepare::content_length) / [`set_content_length(Option)`](crate::client::fluent_builders::GameLogoUploadPrepare::set_content_length): Unsigned 64 bit integer. - /// - On success, responds with [`GameLogoUploadPrepareOutput`](crate::output::GameLogoUploadPrepareOutput) with field(s): - /// - [`upload_id(Option)`](crate::output::GameLogoUploadPrepareOutput::upload_id): A universally unique identifier. - /// - [`presigned_request(Option)`](crate::output::GameLogoUploadPrepareOutput::presigned_request): A presigned request used to upload files. Upload your file to the given URL via a PUT request. - /// - On failure, responds with [`SdkError`](crate::error::GameLogoUploadPrepareError) - pub fn game_logo_upload_prepare(&self) -> fluent_builders::GameLogoUploadPrepare { - fluent_builders::GameLogoUploadPrepare::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GetGameBilling`](crate::client::fluent_builders::GetGameBilling) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::GetGameBilling::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::GetGameBilling::set_game_id): A universally unique identifier. - /// - [`query_start(i64)`](crate::client::fluent_builders::GetGameBilling::query_start) / [`set_query_start(Option)`](crate::client::fluent_builders::GetGameBilling::set_query_start): Unsigned 64 bit integer. - /// - [`query_end(i64)`](crate::client::fluent_builders::GetGameBilling::query_end) / [`set_query_end(Option)`](crate::client::fluent_builders::GetGameBilling::set_query_end): Unsigned 64 bit integer. - /// - On success, responds with [`GetGameBillingOutput`](crate::output::GetGameBillingOutput) with field(s): - /// - [`game(Option)`](crate::output::GetGameBillingOutput::game): A game handle. - /// - [`namespaces(Option>)`](crate::output::GetGameBillingOutput::namespaces): A list of namespace summaries. - /// - [`metrics(Option>)`](crate::output::GetGameBillingOutput::metrics): A list of multiple region tier metrics. - /// - [`group_status(Option)`](crate::output::GetGameBillingOutput::group_status): The status of a developer group. - /// - [`group_active(Option)`](crate::output::GetGameBillingOutput::group_active): Whether or not the given game can actively host games. - /// - [`plan(Option)`](crate::output::GetGameBillingOutput::plan): A value denoting a game's billing plan. - /// - [`available_regions(Option>)`](crate::output::GetGameBillingOutput::available_regions): A list of region summaries. - /// - On failure, responds with [`SdkError`](crate::error::GetGameBillingError) - pub fn get_game_billing(&self) -> fluent_builders::GetGameBilling { - fluent_builders::GetGameBilling::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GetGameBillingPlans`](crate::client::fluent_builders::GetGameBillingPlans) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::GetGameBillingPlans::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::GetGameBillingPlans::set_game_id): A universally unique identifier. - /// - On success, responds with [`GetGameBillingPlansOutput`](crate::output::GetGameBillingPlansOutput) with field(s): - /// - [`plans(Option>)`](crate::output::GetGameBillingPlansOutput::plans): A list of billing plans. - /// - On failure, responds with [`SdkError`](crate::error::GetGameBillingPlansError) - pub fn get_game_billing_plans(&self) -> fluent_builders::GetGameBillingPlans { - fluent_builders::GetGameBillingPlans::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GetGameById`](crate::client::fluent_builders::GetGameById) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::GetGameById::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::GetGameById::set_game_id): A universally unique identifier. - /// - [`watch_index(impl Into)`](crate::client::fluent_builders::GetGameById::watch_index) / [`set_watch_index(Option)`](crate::client::fluent_builders::GetGameById::set_watch_index): A query parameter denoting the requests watch index. - /// - On success, responds with [`GetGameByIdOutput`](crate::output::GetGameByIdOutput) with field(s): - /// - [`game(Option)`](crate::output::GetGameByIdOutput::game): A full game. - /// - [`watch(Option)`](crate::output::GetGameByIdOutput::watch): Provided by watchable endpoints used in blocking loops. - /// - On failure, responds with [`SdkError`](crate::error::GetGameByIdError) - pub fn get_game_by_id(&self) -> fluent_builders::GetGameById { - fluent_builders::GetGameById::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GetGameNamespaceById`](crate::client::fluent_builders::GetGameNamespaceById) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::GetGameNamespaceById::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::GetGameNamespaceById::set_game_id): A universally unique identifier. - /// - [`namespace_id(impl Into)`](crate::client::fluent_builders::GetGameNamespaceById::namespace_id) / [`set_namespace_id(Option)`](crate::client::fluent_builders::GetGameNamespaceById::set_namespace_id): A universally unique identifier. - /// - On success, responds with [`GetGameNamespaceByIdOutput`](crate::output::GetGameNamespaceByIdOutput) with field(s): - /// - [`namespace(Option)`](crate::output::GetGameNamespaceByIdOutput::namespace): A full namespace. - /// - On failure, responds with [`SdkError`](crate::error::GetGameNamespaceByIdError) - pub fn get_game_namespace_by_id(&self) -> fluent_builders::GetGameNamespaceById { - fluent_builders::GetGameNamespaceById::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GetGames`](crate::client::fluent_builders::GetGames) operation. - /// - /// - The fluent builder is configurable: - /// - [`watch_index(impl Into)`](crate::client::fluent_builders::GetGames::watch_index) / [`set_watch_index(Option)`](crate::client::fluent_builders::GetGames::set_watch_index): A query parameter denoting the requests watch index. - /// - On success, responds with [`GetGamesOutput`](crate::output::GetGamesOutput) with field(s): - /// - [`games(Option>)`](crate::output::GetGamesOutput::games): A list of game summaries. - /// - [`groups(Option>)`](crate::output::GetGamesOutput::groups): A list of group summaries. - /// - [`watch(Option)`](crate::output::GetGamesOutput::watch): Provided by watchable endpoints used in blocking loops. - /// - On failure, responds with [`SdkError`](crate::error::GetGamesError) - pub fn get_games(&self) -> fluent_builders::GetGames { - fluent_builders::GetGames::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GetGameVersionById`](crate::client::fluent_builders::GetGameVersionById) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::GetGameVersionById::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::GetGameVersionById::set_game_id): A universally unique identifier. - /// - [`version_id(impl Into)`](crate::client::fluent_builders::GetGameVersionById::version_id) / [`set_version_id(Option)`](crate::client::fluent_builders::GetGameVersionById::set_version_id): A universally unique identifier. - /// - On success, responds with [`GetGameVersionByIdOutput`](crate::output::GetGameVersionByIdOutput) with field(s): - /// - [`version(Option)`](crate::output::GetGameVersionByIdOutput::version): A full version. - /// - On failure, responds with [`SdkError`](crate::error::GetGameVersionByIdError) - pub fn get_game_version_by_id(&self) -> fluent_builders::GetGameVersionById { - fluent_builders::GetGameVersionById::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GetGroupBilling`](crate::client::fluent_builders::GetGroupBilling) operation. - /// - /// - The fluent builder is configurable: - /// - [`group_id(impl Into)`](crate::client::fluent_builders::GetGroupBilling::group_id) / [`set_group_id(Option)`](crate::client::fluent_builders::GetGroupBilling::set_group_id): A universally unique identifier. - /// - On success, responds with [`GetGroupBillingOutput`](crate::output::GetGroupBillingOutput) with field(s): - /// - [`usage(Option)`](crate::output::GetGroupBillingOutput::usage): Signed 64 bit integer. - /// - [`status(Option)`](crate::output::GetGroupBillingOutput::status): The status of a developer group. - /// - [`active(Option)`](crate::output::GetGroupBillingOutput::active): Whether or not the given group can actively host games. - /// - On failure, responds with [`SdkError`](crate::error::GetGroupBillingError) - pub fn get_group_billing(&self) -> fluent_builders::GetGroupBilling { - fluent_builders::GetGroupBilling::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GetGroupInvoicesList`](crate::client::fluent_builders::GetGroupInvoicesList) operation. - /// - /// - The fluent builder is configurable: - /// - [`group_id(impl Into)`](crate::client::fluent_builders::GetGroupInvoicesList::group_id) / [`set_group_id(Option)`](crate::client::fluent_builders::GetGroupInvoicesList::set_group_id): A universally unique identifier. - /// - [`page(i32)`](crate::client::fluent_builders::GetGroupInvoicesList::page) / [`set_page(Option)`](crate::client::fluent_builders::GetGroupInvoicesList::set_page): Unsigned 32 bit integer. - /// - [`per_page(i32)`](crate::client::fluent_builders::GetGroupInvoicesList::per_page) / [`set_per_page(Option)`](crate::client::fluent_builders::GetGroupInvoicesList::set_per_page): Unsigned 32 bit integer. - /// - On success, responds with [`GetGroupInvoicesListOutput`](crate::output::GetGroupInvoicesListOutput) with field(s): - /// - [`invoices(Option>)`](crate::output::GetGroupInvoicesListOutput::invoices): A list of a group's billing invoices. - /// - On failure, responds with [`SdkError`](crate::error::GetGroupInvoicesListError) - pub fn get_group_invoices_list(&self) -> fluent_builders::GetGroupInvoicesList { - fluent_builders::GetGroupInvoicesList::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GetLobbyLogs`](crate::client::fluent_builders::GetLobbyLogs) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::GetLobbyLogs::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::GetLobbyLogs::set_game_id): A universally unique identifier. - /// - [`lobby_id(impl Into)`](crate::client::fluent_builders::GetLobbyLogs::lobby_id) / [`set_lobby_id(Option)`](crate::client::fluent_builders::GetLobbyLogs::set_lobby_id): A universally unique identifier. - /// - [`stream(LogStream)`](crate::client::fluent_builders::GetLobbyLogs::stream) / [`set_stream(Option)`](crate::client::fluent_builders::GetLobbyLogs::set_stream): (undocumented) - /// - [`watch_index(impl Into)`](crate::client::fluent_builders::GetLobbyLogs::watch_index) / [`set_watch_index(Option)`](crate::client::fluent_builders::GetLobbyLogs::set_watch_index): A query parameter denoting the requests watch index. - /// - On success, responds with [`GetLobbyLogsOutput`](crate::output::GetLobbyLogsOutput) with field(s): - /// - [`lines(Option>)`](crate::output::GetLobbyLogsOutput::lines): Sorted old to new. - /// - [`timestamps(Option>)`](crate::output::GetLobbyLogsOutput::timestamps): Sorted old to new. - /// - [`watch(Option)`](crate::output::GetLobbyLogsOutput::watch): Provided by watchable endpoints used in blocking loops. - /// - On failure, responds with [`SdkError`](crate::error::GetLobbyLogsError) - pub fn get_lobby_logs(&self) -> fluent_builders::GetLobbyLogs { - fluent_builders::GetLobbyLogs::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GetNamespaceAnalyticsMatchmakerLive`](crate::client::fluent_builders::GetNamespaceAnalyticsMatchmakerLive) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::GetNamespaceAnalyticsMatchmakerLive::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::GetNamespaceAnalyticsMatchmakerLive::set_game_id): A universally unique identifier. - /// - [`namespace_id(impl Into)`](crate::client::fluent_builders::GetNamespaceAnalyticsMatchmakerLive::namespace_id) / [`set_namespace_id(Option)`](crate::client::fluent_builders::GetNamespaceAnalyticsMatchmakerLive::set_namespace_id): A universally unique identifier. - /// - On success, responds with [`GetNamespaceAnalyticsMatchmakerLiveOutput`](crate::output::GetNamespaceAnalyticsMatchmakerLiveOutput) with field(s): - /// - [`lobbies(Option>)`](crate::output::GetNamespaceAnalyticsMatchmakerLiveOutput::lobbies): A list of analytics lobby summaries. - /// - On failure, responds with [`SdkError`](crate::error::GetNamespaceAnalyticsMatchmakerLiveError) - pub fn get_namespace_analytics_matchmaker_live( - &self, - ) -> fluent_builders::GetNamespaceAnalyticsMatchmakerLive { - fluent_builders::GetNamespaceAnalyticsMatchmakerLive::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GetNamespaceLobby`](crate::client::fluent_builders::GetNamespaceLobby) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::GetNamespaceLobby::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::GetNamespaceLobby::set_game_id): A universally unique identifier. - /// - [`namespace_id(impl Into)`](crate::client::fluent_builders::GetNamespaceLobby::namespace_id) / [`set_namespace_id(Option)`](crate::client::fluent_builders::GetNamespaceLobby::set_namespace_id): A universally unique identifier. - /// - [`lobby_id(impl Into)`](crate::client::fluent_builders::GetNamespaceLobby::lobby_id) / [`set_lobby_id(Option)`](crate::client::fluent_builders::GetNamespaceLobby::set_lobby_id): A universally unique identifier. - /// - On success, responds with [`GetNamespaceLobbyOutput`](crate::output::GetNamespaceLobbyOutput) with field(s): - /// - [`lobby(Option)`](crate::output::GetNamespaceLobbyOutput::lobby): A logs summary for a lobby. - /// - [`metrics(Option)`](crate::output::GetNamespaceLobbyOutput::metrics): Metrics relating to a job service. - /// - [`stdout_presigned_urls(Option>)`](crate::output::GetNamespaceLobbyOutput::stdout_presigned_urls): A list of URLs. - /// - [`stderr_presigned_urls(Option>)`](crate::output::GetNamespaceLobbyOutput::stderr_presigned_urls): A list of URLs. - /// - [`perf_lists(Option>)`](crate::output::GetNamespaceLobbyOutput::perf_lists): A list of service performance summaries. - /// - On failure, responds with [`SdkError`](crate::error::GetNamespaceLobbyError) - pub fn get_namespace_lobby(&self) -> fluent_builders::GetNamespaceLobby { - fluent_builders::GetNamespaceLobby::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GetRayPerfLogs`](crate::client::fluent_builders::GetRayPerfLogs) operation. - /// - /// - The fluent builder is configurable: - /// - [`ray_id(impl Into)`](crate::client::fluent_builders::GetRayPerfLogs::ray_id) / [`set_ray_id(Option)`](crate::client::fluent_builders::GetRayPerfLogs::set_ray_id): A universally unique identifier. - /// - On success, responds with [`GetRayPerfLogsOutput`](crate::output::GetRayPerfLogsOutput) with field(s): - /// - [`perf_lists(Option>)`](crate::output::GetRayPerfLogsOutput::perf_lists): A list of service performance summaries. - /// - On failure, responds with [`SdkError`](crate::error::GetRayPerfLogsError) - pub fn get_ray_perf_logs(&self) -> fluent_builders::GetRayPerfLogs { - fluent_builders::GetRayPerfLogs::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GetRegionTiers`](crate::client::fluent_builders::GetRegionTiers) operation. - /// - /// - The fluent builder takes no input, just [`send`](crate::client::fluent_builders::GetRegionTiers::send) it. - - /// - On success, responds with [`GetRegionTiersOutput`](crate::output::GetRegionTiersOutput) with field(s): - /// - [`tiers(Option>)`](crate::output::GetRegionTiersOutput::tiers): A list of region server tiers. - /// - On failure, responds with [`SdkError`](crate::error::GetRegionTiersError) - pub fn get_region_tiers(&self) -> fluent_builders::GetRegionTiers { - fluent_builders::GetRegionTiers::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GroupBillingCheckout`](crate::client::fluent_builders::GroupBillingCheckout) operation. - /// - /// - The fluent builder is configurable: - /// - [`group_id(impl Into)`](crate::client::fluent_builders::GroupBillingCheckout::group_id) / [`set_group_id(Option)`](crate::client::fluent_builders::GroupBillingCheckout::set_group_id): A universally unique identifier. - /// - On success, responds with [`GroupBillingCheckoutOutput`](crate::output::GroupBillingCheckoutOutput) with field(s): - /// - [`url(Option)`](crate::output::GroupBillingCheckoutOutput::url): The URL of the checkout session. - /// - On failure, responds with [`SdkError`](crate::error::GroupBillingCheckoutError) - pub fn group_billing_checkout(&self) -> fluent_builders::GroupBillingCheckout { - fluent_builders::GroupBillingCheckout::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`Inspect`](crate::client::fluent_builders::Inspect) operation. - /// - /// - The fluent builder takes no input, just [`send`](crate::client::fluent_builders::Inspect::send) it. - - /// - On success, responds with [`InspectOutput`](crate::output::InspectOutput) with field(s): - /// - [`agent(Option)`](crate::output::InspectOutput::agent): The current authenticated agent. - /// - On failure, responds with [`SdkError`](crate::error::InspectError) - pub fn inspect(&self) -> fluent_builders::Inspect { - fluent_builders::Inspect::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`ListGameBuilds`](crate::client::fluent_builders::ListGameBuilds) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::ListGameBuilds::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::ListGameBuilds::set_game_id): A universally unique identifier. - /// - On success, responds with [`ListGameBuildsOutput`](crate::output::ListGameBuildsOutput) with field(s): - /// - [`builds(Option>)`](crate::output::ListGameBuildsOutput::builds): A list of build summaries. - /// - On failure, responds with [`SdkError`](crate::error::ListGameBuildsError) - pub fn list_game_builds(&self) -> fluent_builders::ListGameBuilds { - fluent_builders::ListGameBuilds::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`ListGameCdnSites`](crate::client::fluent_builders::ListGameCdnSites) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::ListGameCdnSites::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::ListGameCdnSites::set_game_id): A universally unique identifier. - /// - On success, responds with [`ListGameCdnSitesOutput`](crate::output::ListGameCdnSitesOutput) with field(s): - /// - [`sites(Option>)`](crate::output::ListGameCdnSitesOutput::sites): A list of CDN site summaries. - /// - On failure, responds with [`SdkError`](crate::error::ListGameCdnSitesError) - pub fn list_game_cdn_sites(&self) -> fluent_builders::ListGameCdnSites { - fluent_builders::ListGameCdnSites::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`ListGameCustomAvatars`](crate::client::fluent_builders::ListGameCustomAvatars) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::ListGameCustomAvatars::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::ListGameCustomAvatars::set_game_id): A universally unique identifier. - /// - On success, responds with [`ListGameCustomAvatarsOutput`](crate::output::ListGameCustomAvatarsOutput) with field(s): - /// - [`custom_avatars(Option>)`](crate::output::ListGameCustomAvatarsOutput::custom_avatars): A list of custom avatar summaries. - /// - On failure, responds with [`SdkError`](crate::error::ListGameCustomAvatarsError) - pub fn list_game_custom_avatars(&self) -> fluent_builders::ListGameCustomAvatars { - fluent_builders::ListGameCustomAvatars::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`ListNamespaceLobbies`](crate::client::fluent_builders::ListNamespaceLobbies) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::ListNamespaceLobbies::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::ListNamespaceLobbies::set_game_id): A universally unique identifier. - /// - [`namespace_id(impl Into)`](crate::client::fluent_builders::ListNamespaceLobbies::namespace_id) / [`set_namespace_id(Option)`](crate::client::fluent_builders::ListNamespaceLobbies::set_namespace_id): A universally unique identifier. - /// - [`before_create_ts(DateTime)`](crate::client::fluent_builders::ListNamespaceLobbies::before_create_ts) / [`set_before_create_ts(Option)`](crate::client::fluent_builders::ListNamespaceLobbies::set_before_create_ts): Returns lobbies created before this timestamp. - /// - On success, responds with [`ListNamespaceLobbiesOutput`](crate::output::ListNamespaceLobbiesOutput) with field(s): - /// - [`lobbies(Option>)`](crate::output::ListNamespaceLobbiesOutput::lobbies): A list of lobby log summaries. - /// - On failure, responds with [`SdkError`](crate::error::ListNamespaceLobbiesError) - pub fn list_namespace_lobbies(&self) -> fluent_builders::ListNamespaceLobbies { - fluent_builders::ListNamespaceLobbies::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`PrepareCustomAvatarUpload`](crate::client::fluent_builders::PrepareCustomAvatarUpload) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::PrepareCustomAvatarUpload::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::PrepareCustomAvatarUpload::set_game_id): A universally unique identifier. - /// - [`path(impl Into)`](crate::client::fluent_builders::PrepareCustomAvatarUpload::path) / [`set_path(Option)`](crate::client::fluent_builders::PrepareCustomAvatarUpload::set_path): The path/filename of the custom avatar. - /// - [`mime(impl Into)`](crate::client::fluent_builders::PrepareCustomAvatarUpload::mime) / [`set_mime(Option)`](crate::client::fluent_builders::PrepareCustomAvatarUpload::set_mime): The MIME type of the custom avatar. - /// - [`content_length(i64)`](crate::client::fluent_builders::PrepareCustomAvatarUpload::content_length) / [`set_content_length(Option)`](crate::client::fluent_builders::PrepareCustomAvatarUpload::set_content_length): Unsigned 64 bit integer. - /// - On success, responds with [`PrepareCustomAvatarUploadOutput`](crate::output::PrepareCustomAvatarUploadOutput) with field(s): - /// - [`upload_id(Option)`](crate::output::PrepareCustomAvatarUploadOutput::upload_id): A universally unique identifier. - /// - [`presigned_request(Option)`](crate::output::PrepareCustomAvatarUploadOutput::presigned_request): A presigned request used to upload files. Upload your file to the given URL via a PUT request. - /// - On failure, responds with [`SdkError`](crate::error::PrepareCustomAvatarUploadError) - pub fn prepare_custom_avatar_upload( - &self, - ) -> fluent_builders::PrepareCustomAvatarUpload { - fluent_builders::PrepareCustomAvatarUpload::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`RemoveNamespaceCdnAuthUser`](crate::client::fluent_builders::RemoveNamespaceCdnAuthUser) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::RemoveNamespaceCdnAuthUser::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::RemoveNamespaceCdnAuthUser::set_game_id): A universally unique identifier. - /// - [`namespace_id(impl Into)`](crate::client::fluent_builders::RemoveNamespaceCdnAuthUser::namespace_id) / [`set_namespace_id(Option)`](crate::client::fluent_builders::RemoveNamespaceCdnAuthUser::set_namespace_id): A universally unique identifier. - /// - [`user(impl Into)`](crate::client::fluent_builders::RemoveNamespaceCdnAuthUser::user) / [`set_user(Option)`](crate::client::fluent_builders::RemoveNamespaceCdnAuthUser::set_user): A user name. - /// - On success, responds with [`RemoveNamespaceCdnAuthUserOutput`](crate::output::RemoveNamespaceCdnAuthUserOutput) - - /// - On failure, responds with [`SdkError`](crate::error::RemoveNamespaceCdnAuthUserError) - pub fn remove_namespace_cdn_auth_user( - &self, - ) -> fluent_builders::RemoveNamespaceCdnAuthUser { - fluent_builders::RemoveNamespaceCdnAuthUser::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`RemoveNamespaceDomain`](crate::client::fluent_builders::RemoveNamespaceDomain) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::RemoveNamespaceDomain::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::RemoveNamespaceDomain::set_game_id): A universally unique identifier. - /// - [`namespace_id(impl Into)`](crate::client::fluent_builders::RemoveNamespaceDomain::namespace_id) / [`set_namespace_id(Option)`](crate::client::fluent_builders::RemoveNamespaceDomain::set_namespace_id): A universally unique identifier. - /// - [`domain(impl Into)`](crate::client::fluent_builders::RemoveNamespaceDomain::domain) / [`set_domain(Option)`](crate::client::fluent_builders::RemoveNamespaceDomain::set_domain): A valid domain name (no protocol). - /// - On success, responds with [`RemoveNamespaceDomainOutput`](crate::output::RemoveNamespaceDomainOutput) - - /// - On failure, responds with [`SdkError`](crate::error::RemoveNamespaceDomainError) - pub fn remove_namespace_domain(&self) -> fluent_builders::RemoveNamespaceDomain { - fluent_builders::RemoveNamespaceDomain::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`SetGameBillingPlan`](crate::client::fluent_builders::SetGameBillingPlan) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::SetGameBillingPlan::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::SetGameBillingPlan::set_game_id): A universally unique identifier. - /// - [`plan(GameBillingPlanCode)`](crate::client::fluent_builders::SetGameBillingPlan::plan) / [`set_plan(Option)`](crate::client::fluent_builders::SetGameBillingPlan::set_plan): A value denoting a game's billing plan. - /// - On success, responds with [`SetGameBillingPlanOutput`](crate::output::SetGameBillingPlanOutput) - - /// - On failure, responds with [`SdkError`](crate::error::SetGameBillingPlanError) - pub fn set_game_billing_plan(&self) -> fluent_builders::SetGameBillingPlan { - fluent_builders::SetGameBillingPlan::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`SetNamespaceCdnAuthType`](crate::client::fluent_builders::SetNamespaceCdnAuthType) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::SetNamespaceCdnAuthType::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::SetNamespaceCdnAuthType::set_game_id): A universally unique identifier. - /// - [`namespace_id(impl Into)`](crate::client::fluent_builders::SetNamespaceCdnAuthType::namespace_id) / [`set_namespace_id(Option)`](crate::client::fluent_builders::SetNamespaceCdnAuthType::set_namespace_id): A universally unique identifier. - /// - [`auth_type(CdnAuthType)`](crate::client::fluent_builders::SetNamespaceCdnAuthType::auth_type) / [`set_auth_type(Option)`](crate::client::fluent_builders::SetNamespaceCdnAuthType::set_auth_type): A value denoting what type of authentication to use for a game namespace's CDN. - /// - On success, responds with [`SetNamespaceCdnAuthTypeOutput`](crate::output::SetNamespaceCdnAuthTypeOutput) - - /// - On failure, responds with [`SdkError`](crate::error::SetNamespaceCdnAuthTypeError) - pub fn set_namespace_cdn_auth_type(&self) -> fluent_builders::SetNamespaceCdnAuthType { - fluent_builders::SetNamespaceCdnAuthType::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`ToggleNamespaceDomainPublicAuth`](crate::client::fluent_builders::ToggleNamespaceDomainPublicAuth) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::ToggleNamespaceDomainPublicAuth::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::ToggleNamespaceDomainPublicAuth::set_game_id): A universally unique identifier. - /// - [`namespace_id(impl Into)`](crate::client::fluent_builders::ToggleNamespaceDomainPublicAuth::namespace_id) / [`set_namespace_id(Option)`](crate::client::fluent_builders::ToggleNamespaceDomainPublicAuth::set_namespace_id): A universally unique identifier. - /// - [`enabled(bool)`](crate::client::fluent_builders::ToggleNamespaceDomainPublicAuth::enabled) / [`set_enabled(Option)`](crate::client::fluent_builders::ToggleNamespaceDomainPublicAuth::set_enabled): Whether or not to enable authentication based on domain. - /// - On success, responds with [`ToggleNamespaceDomainPublicAuthOutput`](crate::output::ToggleNamespaceDomainPublicAuthOutput) - - /// - On failure, responds with [`SdkError`](crate::error::ToggleNamespaceDomainPublicAuthError) - pub fn toggle_namespace_domain_public_auth( - &self, - ) -> fluent_builders::ToggleNamespaceDomainPublicAuth { - fluent_builders::ToggleNamespaceDomainPublicAuth::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`UpdateGameNamespaceMatchmakerConfig`](crate::client::fluent_builders::UpdateGameNamespaceMatchmakerConfig) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::UpdateGameNamespaceMatchmakerConfig::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::UpdateGameNamespaceMatchmakerConfig::set_game_id): A universally unique identifier. - /// - [`namespace_id(impl Into)`](crate::client::fluent_builders::UpdateGameNamespaceMatchmakerConfig::namespace_id) / [`set_namespace_id(Option)`](crate::client::fluent_builders::UpdateGameNamespaceMatchmakerConfig::set_namespace_id): A universally unique identifier. - /// - [`lobby_count_max(i32)`](crate::client::fluent_builders::UpdateGameNamespaceMatchmakerConfig::lobby_count_max) / [`set_lobby_count_max(Option)`](crate::client::fluent_builders::UpdateGameNamespaceMatchmakerConfig::set_lobby_count_max): Unsigned 32 bit integer. - /// - [`max_players(i32)`](crate::client::fluent_builders::UpdateGameNamespaceMatchmakerConfig::max_players) / [`set_max_players(Option)`](crate::client::fluent_builders::UpdateGameNamespaceMatchmakerConfig::set_max_players): Unsigned 32 bit integer. - /// - On success, responds with [`UpdateGameNamespaceMatchmakerConfigOutput`](crate::output::UpdateGameNamespaceMatchmakerConfigOutput) - - /// - On failure, responds with [`SdkError`](crate::error::UpdateGameNamespaceMatchmakerConfigError) - pub fn update_game_namespace_matchmaker_config( - &self, - ) -> fluent_builders::UpdateGameNamespaceMatchmakerConfig { - fluent_builders::UpdateGameNamespaceMatchmakerConfig::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`UpdateGameNamespaceVersion`](crate::client::fluent_builders::UpdateGameNamespaceVersion) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::UpdateGameNamespaceVersion::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::UpdateGameNamespaceVersion::set_game_id): A universally unique identifier. - /// - [`namespace_id(impl Into)`](crate::client::fluent_builders::UpdateGameNamespaceVersion::namespace_id) / [`set_namespace_id(Option)`](crate::client::fluent_builders::UpdateGameNamespaceVersion::set_namespace_id): A universally unique identifier. - /// - [`version_id(impl Into)`](crate::client::fluent_builders::UpdateGameNamespaceVersion::version_id) / [`set_version_id(Option)`](crate::client::fluent_builders::UpdateGameNamespaceVersion::set_version_id): A universally unique identifier. - /// - On success, responds with [`UpdateGameNamespaceVersionOutput`](crate::output::UpdateGameNamespaceVersionOutput) - - /// - On failure, responds with [`SdkError`](crate::error::UpdateGameNamespaceVersionError) - pub fn update_game_namespace_version( - &self, - ) -> fluent_builders::UpdateGameNamespaceVersion { - fluent_builders::UpdateGameNamespaceVersion::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`UpdateNamespaceCdnAuthUser`](crate::client::fluent_builders::UpdateNamespaceCdnAuthUser) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::UpdateNamespaceCdnAuthUser::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::UpdateNamespaceCdnAuthUser::set_game_id): A universally unique identifier. - /// - [`namespace_id(impl Into)`](crate::client::fluent_builders::UpdateNamespaceCdnAuthUser::namespace_id) / [`set_namespace_id(Option)`](crate::client::fluent_builders::UpdateNamespaceCdnAuthUser::set_namespace_id): A universally unique identifier. - /// - [`user(impl Into)`](crate::client::fluent_builders::UpdateNamespaceCdnAuthUser::user) / [`set_user(Option)`](crate::client::fluent_builders::UpdateNamespaceCdnAuthUser::set_user): A user name. - /// - [`password(impl Into)`](crate::client::fluent_builders::UpdateNamespaceCdnAuthUser::password) / [`set_password(Option)`](crate::client::fluent_builders::UpdateNamespaceCdnAuthUser::set_password): A bcrypt encrypted password. An error is returned if the given string is not properly encrypted. - /// - On success, responds with [`UpdateNamespaceCdnAuthUserOutput`](crate::output::UpdateNamespaceCdnAuthUserOutput) - - /// - On failure, responds with [`SdkError`](crate::error::UpdateNamespaceCdnAuthUserError) - pub fn update_namespace_cdn_auth_user( - &self, - ) -> fluent_builders::UpdateNamespaceCdnAuthUser { - fluent_builders::UpdateNamespaceCdnAuthUser::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`ValidateGame`](crate::client::fluent_builders::ValidateGame) operation. - /// - /// - The fluent builder is configurable: - /// - [`display_name(impl Into)`](crate::client::fluent_builders::ValidateGame::display_name) / [`set_display_name(Option)`](crate::client::fluent_builders::ValidateGame::set_display_name): Represent a resource's readable display name. - /// - [`name_id(impl Into)`](crate::client::fluent_builders::ValidateGame::name_id) / [`set_name_id(Option)`](crate::client::fluent_builders::ValidateGame::set_name_id): A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - /// - On success, responds with [`ValidateGameOutput`](crate::output::ValidateGameOutput) with field(s): - /// - [`errors(Option>)`](crate::output::ValidateGameOutput::errors): A list of validation errors. - /// - On failure, responds with [`SdkError`](crate::error::ValidateGameError) - pub fn validate_game(&self) -> fluent_builders::ValidateGame { - fluent_builders::ValidateGame::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`ValidateGameNamespace`](crate::client::fluent_builders::ValidateGameNamespace) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::ValidateGameNamespace::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::ValidateGameNamespace::set_game_id): A universally unique identifier. - /// - [`display_name(impl Into)`](crate::client::fluent_builders::ValidateGameNamespace::display_name) / [`set_display_name(Option)`](crate::client::fluent_builders::ValidateGameNamespace::set_display_name): Represent a resource's readable display name. - /// - [`name_id(impl Into)`](crate::client::fluent_builders::ValidateGameNamespace::name_id) / [`set_name_id(Option)`](crate::client::fluent_builders::ValidateGameNamespace::set_name_id): A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - /// - On success, responds with [`ValidateGameNamespaceOutput`](crate::output::ValidateGameNamespaceOutput) with field(s): - /// - [`errors(Option>)`](crate::output::ValidateGameNamespaceOutput::errors): A list of validation errors. - /// - On failure, responds with [`SdkError`](crate::error::ValidateGameNamespaceError) - pub fn validate_game_namespace(&self) -> fluent_builders::ValidateGameNamespace { - fluent_builders::ValidateGameNamespace::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`ValidateGameNamespaceMatchmakerConfig`](crate::client::fluent_builders::ValidateGameNamespaceMatchmakerConfig) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::ValidateGameNamespaceMatchmakerConfig::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::ValidateGameNamespaceMatchmakerConfig::set_game_id): A universally unique identifier. - /// - [`namespace_id(impl Into)`](crate::client::fluent_builders::ValidateGameNamespaceMatchmakerConfig::namespace_id) / [`set_namespace_id(Option)`](crate::client::fluent_builders::ValidateGameNamespaceMatchmakerConfig::set_namespace_id): A universally unique identifier. - /// - [`lobby_count_max(i32)`](crate::client::fluent_builders::ValidateGameNamespaceMatchmakerConfig::lobby_count_max) / [`set_lobby_count_max(Option)`](crate::client::fluent_builders::ValidateGameNamespaceMatchmakerConfig::set_lobby_count_max): Unsigned 32 bit integer. - /// - [`max_players(i32)`](crate::client::fluent_builders::ValidateGameNamespaceMatchmakerConfig::max_players) / [`set_max_players(Option)`](crate::client::fluent_builders::ValidateGameNamespaceMatchmakerConfig::set_max_players): Unsigned 32 bit integer. - /// - On success, responds with [`ValidateGameNamespaceMatchmakerConfigOutput`](crate::output::ValidateGameNamespaceMatchmakerConfigOutput) with field(s): - /// - [`errors(Option>)`](crate::output::ValidateGameNamespaceMatchmakerConfigOutput::errors): A list of validation errors. - /// - On failure, responds with [`SdkError`](crate::error::ValidateGameNamespaceMatchmakerConfigError) - pub fn validate_game_namespace_matchmaker_config( - &self, - ) -> fluent_builders::ValidateGameNamespaceMatchmakerConfig { - fluent_builders::ValidateGameNamespaceMatchmakerConfig::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`ValidateGameNamespaceTokenDevelopment`](crate::client::fluent_builders::ValidateGameNamespaceTokenDevelopment) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::ValidateGameNamespaceTokenDevelopment::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::ValidateGameNamespaceTokenDevelopment::set_game_id): A universally unique identifier. - /// - [`namespace_id(impl Into)`](crate::client::fluent_builders::ValidateGameNamespaceTokenDevelopment::namespace_id) / [`set_namespace_id(Option)`](crate::client::fluent_builders::ValidateGameNamespaceTokenDevelopment::set_namespace_id): A universally unique identifier. - /// - [`hostname(impl Into)`](crate::client::fluent_builders::ValidateGameNamespaceTokenDevelopment::hostname) / [`set_hostname(Option)`](crate::client::fluent_builders::ValidateGameNamespaceTokenDevelopment::set_hostname): (undocumented) - /// - [`lobby_ports(Vec)`](crate::client::fluent_builders::ValidateGameNamespaceTokenDevelopment::lobby_ports) / [`set_lobby_ports(Option>)`](crate::client::fluent_builders::ValidateGameNamespaceTokenDevelopment::set_lobby_ports): A list of docker ports. - /// - On success, responds with [`ValidateGameNamespaceTokenDevelopmentOutput`](crate::output::ValidateGameNamespaceTokenDevelopmentOutput) with field(s): - /// - [`errors(Option>)`](crate::output::ValidateGameNamespaceTokenDevelopmentOutput::errors): A list of validation errors. - /// - On failure, responds with [`SdkError`](crate::error::ValidateGameNamespaceTokenDevelopmentError) - pub fn validate_game_namespace_token_development( - &self, - ) -> fluent_builders::ValidateGameNamespaceTokenDevelopment { - fluent_builders::ValidateGameNamespaceTokenDevelopment::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`ValidateGameVersion`](crate::client::fluent_builders::ValidateGameVersion) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::ValidateGameVersion::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::ValidateGameVersion::set_game_id): A universally unique identifier. - /// - [`display_name(impl Into)`](crate::client::fluent_builders::ValidateGameVersion::display_name) / [`set_display_name(Option)`](crate::client::fluent_builders::ValidateGameVersion::set_display_name): Represent a resource's readable display name. - /// - [`config(CloudVersionConfig)`](crate::client::fluent_builders::ValidateGameVersion::config) / [`set_config(Option)`](crate::client::fluent_builders::ValidateGameVersion::set_config): Cloud configuration for a given version. - /// - On success, responds with [`ValidateGameVersionOutput`](crate::output::ValidateGameVersionOutput) with field(s): - /// - [`errors(Option>)`](crate::output::ValidateGameVersionOutput::errors): A list of validation errors. - /// - On failure, responds with [`SdkError`](crate::error::ValidateGameVersionError) - pub fn validate_game_version(&self) -> fluent_builders::ValidateGameVersion { - fluent_builders::ValidateGameVersion::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`ValidateGroup`](crate::client::fluent_builders::ValidateGroup) operation. - /// - /// - The fluent builder is configurable: - /// - [`display_name(impl Into)`](crate::client::fluent_builders::ValidateGroup::display_name) / [`set_display_name(Option)`](crate::client::fluent_builders::ValidateGroup::set_display_name): Represent a resource's readable display name. - /// - On success, responds with [`ValidateGroupOutput`](crate::output::ValidateGroupOutput) with field(s): - /// - [`errors(Option>)`](crate::output::ValidateGroupOutput::errors): A list of validation errors. - /// - On failure, responds with [`SdkError`](crate::error::ValidateGroupError) - pub fn validate_group(&self) -> fluent_builders::ValidateGroup { - fluent_builders::ValidateGroup::new(self.handle.clone()) - } -} -pub mod fluent_builders { - //! - //! Utilities to ergonomically construct a request to the service. - //! - //! Fluent builders are created through the [`Client`](crate::client::Client) by calling - //! one if its operation methods. After parameters are set using the builder methods, - //! the `send` method can be called to initiate the request. - //! - /// Fluent builder constructing a request to `AddNamespaceDomain`. - /// - /// Adds a domain to the given game namespace. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct AddNamespaceDomain { - handle: std::sync::Arc>, - inner: crate::input::add_namespace_domain_input::Builder, - } - impl AddNamespaceDomain - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `AddNamespaceDomain`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::AddNamespaceDomainOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::AddNamespaceDomainInputOperationOutputAlias, - crate::output::AddNamespaceDomainOutput, - crate::error::AddNamespaceDomainError, - crate::input::AddNamespaceDomainInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.namespace_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_namespace_id(input); - self - } - /// A valid domain name (no protocol). - pub fn domain(mut self, input: impl Into) -> Self { - self.inner = self.inner.domain(input.into()); - self - } - /// A valid domain name (no protocol). - pub fn set_domain(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_domain(input); - self - } - } - /// Fluent builder constructing a request to `CompleteCustomAvatarUpload`. - /// - /// Completes a custom avatar image upload. Must be called after the file upload process completes. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct CompleteCustomAvatarUpload { - handle: std::sync::Arc>, - inner: crate::input::complete_custom_avatar_upload_input::Builder, - } - impl CompleteCustomAvatarUpload - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `CompleteCustomAvatarUpload`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::CompleteCustomAvatarUploadOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::CompleteCustomAvatarUploadInputOperationOutputAlias, - crate::output::CompleteCustomAvatarUploadOutput, - crate::error::CompleteCustomAvatarUploadError, - crate::input::CompleteCustomAvatarUploadInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - /// A universally unique identifier. - pub fn upload_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.upload_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_upload_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_upload_id(input); - self - } - } - /// Fluent builder constructing a request to `CompleteUpload`. - /// - /// Marks an upload as complete. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct CompleteUpload { - handle: std::sync::Arc>, - inner: crate::input::complete_upload_input::Builder, - } - impl CompleteUpload - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `CompleteUpload`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::CompleteUploadOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::CompleteUploadInputOperationOutputAlias, - crate::output::CompleteUploadOutput, - crate::error::CompleteUploadError, - crate::input::CompleteUploadInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn upload_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.upload_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_upload_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_upload_id(input); - self - } - } - /// Fluent builder constructing a request to `ConvertGroup`. - /// - /// Converts the given group into a developer group. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct ConvertGroup { - handle: std::sync::Arc>, - inner: crate::input::convert_group_input::Builder, - } - impl ConvertGroup - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `ConvertGroup`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::ConvertGroupOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::ConvertGroupInputOperationOutputAlias, - crate::output::ConvertGroupOutput, - crate::error::ConvertGroupError, - crate::input::ConvertGroupInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.group_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_group_id(input); - self - } - } - /// Fluent builder constructing a request to `CreateCloudToken`. - /// - /// Creates a new game cloud token. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct CreateCloudToken { - handle: std::sync::Arc>, - inner: crate::input::create_cloud_token_input::Builder, - } - impl CreateCloudToken - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `CreateCloudToken`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::CreateCloudTokenOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::CreateCloudTokenInputOperationOutputAlias, - crate::output::CreateCloudTokenOutput, - crate::error::CreateCloudTokenError, - crate::input::CreateCloudTokenInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - } - /// Fluent builder constructing a request to `CreateGame`. - /// - /// Creates a new game. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct CreateGame { - handle: std::sync::Arc>, - inner: crate::input::create_game_input::Builder, - } - impl CreateGame - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `CreateGame`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::CreateGameOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::CreateGameInputOperationOutputAlias, - crate::output::CreateGameOutput, - crate::error::CreateGameError, - crate::input::CreateGameInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn name_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.name_id(input.into()); - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn set_name_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_name_id(input); - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.inner = self.inner.display_name(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_display_name(input); - self - } - /// A universally unique identifier. - pub fn developer_group_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.developer_group_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_developer_group_id( - mut self, - input: std::option::Option, - ) -> Self { - self.inner = self.inner.set_developer_group_id(input); - self - } - } - /// Fluent builder constructing a request to `CreateGameBuild`. - /// - /// Creates a new game build for the given game. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct CreateGameBuild { - handle: std::sync::Arc>, - inner: crate::input::create_game_build_input::Builder, - } - impl CreateGameBuild - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `CreateGameBuild`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::CreateGameBuildOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::CreateGameBuildInputOperationOutputAlias, - crate::output::CreateGameBuildOutput, - crate::error::CreateGameBuildError, - crate::input::CreateGameBuildInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.inner = self.inner.display_name(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_display_name(input); - self - } - /// A tag given to the game build. - pub fn image_tag(mut self, input: impl Into) -> Self { - self.inner = self.inner.image_tag(input.into()); - self - } - /// A tag given to the game build. - pub fn set_image_tag(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_image_tag(input); - self - } - /// A file being prepared to upload. - pub fn image_file(mut self, input: crate::model::UploadPrepareFile) -> Self { - self.inner = self.inner.image_file(input); - self - } - /// A file being prepared to upload. - pub fn set_image_file( - mut self, - input: std::option::Option, - ) -> Self { - self.inner = self.inner.set_image_file(input); - self - } - } - /// Fluent builder constructing a request to `CreateGameCdnSite`. - /// - /// Creates a new CDN site for the given game. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct CreateGameCdnSite { - handle: std::sync::Arc>, - inner: crate::input::create_game_cdn_site_input::Builder, - } - impl CreateGameCdnSite - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `CreateGameCdnSite`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::CreateGameCdnSiteOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::CreateGameCdnSiteInputOperationOutputAlias, - crate::output::CreateGameCdnSiteOutput, - crate::error::CreateGameCdnSiteError, - crate::input::CreateGameCdnSiteInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.inner = self.inner.display_name(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_display_name(input); - self - } - /// Appends an item to `files`. - /// - /// To override the contents of this collection use [`set_files`](Self::set_files). - /// - /// A list of files preparing to upload. - pub fn files(mut self, input: crate::model::UploadPrepareFile) -> Self { - self.inner = self.inner.files(input); - self - } - /// A list of files preparing to upload. - pub fn set_files( - mut self, - input: std::option::Option>, - ) -> Self { - self.inner = self.inner.set_files(input); - self - } - } - /// Fluent builder constructing a request to `CreateGameNamespace`. - /// - /// Creates a new namespace for the given game. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct CreateGameNamespace { - handle: std::sync::Arc>, - inner: crate::input::create_game_namespace_input::Builder, - } - impl CreateGameNamespace - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `CreateGameNamespace`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::CreateGameNamespaceOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::CreateGameNamespaceInputOperationOutputAlias, - crate::output::CreateGameNamespaceOutput, - crate::error::CreateGameNamespaceError, - crate::input::CreateGameNamespaceInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.inner = self.inner.display_name(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_display_name(input); - self - } - /// A universally unique identifier. - pub fn version_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.version_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_version_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_version_id(input); - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn name_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.name_id(input.into()); - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn set_name_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_name_id(input); - self - } - } - /// Fluent builder constructing a request to `CreateGameNamespaceTokenDevelopment`. - /// - /// Creates a development token for the given namespace. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct CreateGameNamespaceTokenDevelopment { - handle: std::sync::Arc>, - inner: crate::input::create_game_namespace_token_development_input::Builder, - } - impl CreateGameNamespaceTokenDevelopment - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `CreateGameNamespaceTokenDevelopment`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::CreateGameNamespaceTokenDevelopmentOutput, - aws_smithy_http::result::SdkError< - crate::error::CreateGameNamespaceTokenDevelopmentError, - >, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::CreateGameNamespaceTokenDevelopmentInputOperationOutputAlias, - crate::output::CreateGameNamespaceTokenDevelopmentOutput, - crate::error::CreateGameNamespaceTokenDevelopmentError, - crate::input::CreateGameNamespaceTokenDevelopmentInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.namespace_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_namespace_id(input); - self - } - /// The hostname used for the token. - pub fn hostname(mut self, input: impl Into) -> Self { - self.inner = self.inner.hostname(input.into()); - self - } - /// The hostname used for the token. - pub fn set_hostname(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_hostname(input); - self - } - /// Appends an item to `lobby_ports`. - /// - /// To override the contents of this collection use [`set_lobby_ports`](Self::set_lobby_ports). - /// - /// A list of docker ports. - pub fn lobby_ports(mut self, input: crate::model::LobbyGroupRuntimeDockerPort) -> Self { - self.inner = self.inner.lobby_ports(input); - self - } - /// A list of docker ports. - pub fn set_lobby_ports( - mut self, - input: std::option::Option>, - ) -> Self { - self.inner = self.inner.set_lobby_ports(input); - self - } - } - /// Fluent builder constructing a request to `CreateGameNamespaceTokenPublic`. - /// - /// Creates a public token for the given namespace. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct CreateGameNamespaceTokenPublic { - handle: std::sync::Arc>, - inner: crate::input::create_game_namespace_token_public_input::Builder, - } - impl CreateGameNamespaceTokenPublic - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `CreateGameNamespaceTokenPublic`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::CreateGameNamespaceTokenPublicOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::CreateGameNamespaceTokenPublicInputOperationOutputAlias, - crate::output::CreateGameNamespaceTokenPublicOutput, - crate::error::CreateGameNamespaceTokenPublicError, - crate::input::CreateGameNamespaceTokenPublicInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.namespace_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_namespace_id(input); - self - } - } - /// Fluent builder constructing a request to `CreateGameVersion`. - /// - /// Creates a new game version. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct CreateGameVersion { - handle: std::sync::Arc>, - inner: crate::input::create_game_version_input::Builder, - } - impl CreateGameVersion - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `CreateGameVersion`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::CreateGameVersionOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::CreateGameVersionInputOperationOutputAlias, - crate::output::CreateGameVersionOutput, - crate::error::CreateGameVersionError, - crate::input::CreateGameVersionInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.inner = self.inner.display_name(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_display_name(input); - self - } - /// Cloud configuration for a given version. - pub fn config(mut self, input: crate::model::CloudVersionConfig) -> Self { - self.inner = self.inner.config(input); - self - } - /// Cloud configuration for a given version. - pub fn set_config( - mut self, - input: std::option::Option, - ) -> Self { - self.inner = self.inner.set_config(input); - self - } - } - /// Fluent builder constructing a request to `DeleteMatchmakerLobby`. - /// - /// Deletes a matchmaker lobby, stopping it immediately. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct DeleteMatchmakerLobby { - handle: std::sync::Arc>, - inner: crate::input::delete_matchmaker_lobby_input::Builder, - } - impl DeleteMatchmakerLobby - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `DeleteMatchmakerLobby`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::DeleteMatchmakerLobbyOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::DeleteMatchmakerLobbyInputOperationOutputAlias, - crate::output::DeleteMatchmakerLobbyOutput, - crate::error::DeleteMatchmakerLobbyError, - crate::input::DeleteMatchmakerLobbyInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - /// A universally unique identifier. - pub fn lobby_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.lobby_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_lobby_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_lobby_id(input); - self - } - } - /// Fluent builder constructing a request to `ExportLobbyLogs`. - /// - /// Generates a download URL for logs. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct ExportLobbyLogs { - handle: std::sync::Arc>, - inner: crate::input::export_lobby_logs_input::Builder, - } - impl ExportLobbyLogs - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `ExportLobbyLogs`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::ExportLobbyLogsOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::ExportLobbyLogsInputOperationOutputAlias, - crate::output::ExportLobbyLogsOutput, - crate::error::ExportLobbyLogsError, - crate::input::ExportLobbyLogsInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - /// A universally unique identifier. - pub fn lobby_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.lobby_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_lobby_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_lobby_id(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn stream(mut self, input: crate::model::LogStream) -> Self { - self.inner = self.inner.stream(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_stream(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_stream(input); - self - } - } - /// Fluent builder constructing a request to `ExportMatchmakerLobbyHistory`. - /// - /// Exports lobby history over a given query time span. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct ExportMatchmakerLobbyHistory { - handle: std::sync::Arc>, - inner: crate::input::export_matchmaker_lobby_history_input::Builder, - } - impl ExportMatchmakerLobbyHistory - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `ExportMatchmakerLobbyHistory`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::ExportMatchmakerLobbyHistoryOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::ExportMatchmakerLobbyHistoryInputOperationOutputAlias, - crate::output::ExportMatchmakerLobbyHistoryOutput, - crate::error::ExportMatchmakerLobbyHistoryError, - crate::input::ExportMatchmakerLobbyHistoryInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - /// Unsigned 64 bit integer. - pub fn query_start(mut self, input: i64) -> Self { - self.inner = self.inner.query_start(input); - self - } - /// Unsigned 64 bit integer. - pub fn set_query_start(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_query_start(input); - self - } - /// Unsigned 64 bit integer. - pub fn query_end(mut self, input: i64) -> Self { - self.inner = self.inner.query_end(input); - self - } - /// Unsigned 64 bit integer. - pub fn set_query_end(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_query_end(input); - self - } - } - /// Fluent builder constructing a request to `GameBannerUploadComplete`. - /// - /// Completes an game banner image upload. Must be called after the file upload process completes. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GameBannerUploadComplete { - handle: std::sync::Arc>, - inner: crate::input::game_banner_upload_complete_input::Builder, - } - impl GameBannerUploadComplete - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GameBannerUploadComplete`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GameBannerUploadCompleteOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GameBannerUploadCompleteInputOperationOutputAlias, - crate::output::GameBannerUploadCompleteOutput, - crate::error::GameBannerUploadCompleteError, - crate::input::GameBannerUploadCompleteInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - /// A universally unique identifier. - pub fn upload_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.upload_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_upload_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_upload_id(input); - self - } - } - /// Fluent builder constructing a request to `GameBannerUploadPrepare`. - /// - /// Prepares a game banner image upload. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GameBannerUploadPrepare { - handle: std::sync::Arc>, - inner: crate::input::game_banner_upload_prepare_input::Builder, - } - impl GameBannerUploadPrepare - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GameBannerUploadPrepare`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GameBannerUploadPrepareOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GameBannerUploadPrepareInputOperationOutputAlias, - crate::output::GameBannerUploadPrepareOutput, - crate::error::GameBannerUploadPrepareError, - crate::input::GameBannerUploadPrepareInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - /// The path/filename of the game banner. - pub fn path(mut self, input: impl Into) -> Self { - self.inner = self.inner.path(input.into()); - self - } - /// The path/filename of the game banner. - pub fn set_path(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_path(input); - self - } - /// The MIME type of the game banner. - pub fn mime(mut self, input: impl Into) -> Self { - self.inner = self.inner.mime(input.into()); - self - } - /// The MIME type of the game banner. - pub fn set_mime(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_mime(input); - self - } - /// Unsigned 64 bit integer. - pub fn content_length(mut self, input: i64) -> Self { - self.inner = self.inner.content_length(input); - self - } - /// Unsigned 64 bit integer. - pub fn set_content_length(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_content_length(input); - self - } - } - /// Fluent builder constructing a request to `GameLogoUploadComplete`. - /// - /// Completes a game logo image upload. Must be called after the file upload process completes. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GameLogoUploadComplete { - handle: std::sync::Arc>, - inner: crate::input::game_logo_upload_complete_input::Builder, - } - impl GameLogoUploadComplete - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GameLogoUploadComplete`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GameLogoUploadCompleteOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GameLogoUploadCompleteInputOperationOutputAlias, - crate::output::GameLogoUploadCompleteOutput, - crate::error::GameLogoUploadCompleteError, - crate::input::GameLogoUploadCompleteInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - /// A universally unique identifier. - pub fn upload_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.upload_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_upload_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_upload_id(input); - self - } - } - /// Fluent builder constructing a request to `GameLogoUploadPrepare`. - /// - /// Prepares a game logo image upload. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GameLogoUploadPrepare { - handle: std::sync::Arc>, - inner: crate::input::game_logo_upload_prepare_input::Builder, - } - impl GameLogoUploadPrepare - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GameLogoUploadPrepare`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GameLogoUploadPrepareOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GameLogoUploadPrepareInputOperationOutputAlias, - crate::output::GameLogoUploadPrepareOutput, - crate::error::GameLogoUploadPrepareError, - crate::input::GameLogoUploadPrepareInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - /// The path/filename of the game logo. - pub fn path(mut self, input: impl Into) -> Self { - self.inner = self.inner.path(input.into()); - self - } - /// The path/filename of the game logo. - pub fn set_path(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_path(input); - self - } - /// The MIME type of the game logo. - pub fn mime(mut self, input: impl Into) -> Self { - self.inner = self.inner.mime(input.into()); - self - } - /// The MIME type of the game logo. - pub fn set_mime(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_mime(input); - self - } - /// Unsigned 64 bit integer. - pub fn content_length(mut self, input: i64) -> Self { - self.inner = self.inner.content_length(input); - self - } - /// Unsigned 64 bit integer. - pub fn set_content_length(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_content_length(input); - self - } - } - /// Fluent builder constructing a request to `GetGameBilling`. - /// - /// Returns billing information for the given game over the given query time span. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GetGameBilling { - handle: std::sync::Arc>, - inner: crate::input::get_game_billing_input::Builder, - } - impl GetGameBilling - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GetGameBilling`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GetGameBillingOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GetGameBillingInputOperationOutputAlias, - crate::output::GetGameBillingOutput, - crate::error::GetGameBillingError, - crate::input::GetGameBillingInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - /// Unsigned 64 bit integer. - pub fn query_start(mut self, input: i64) -> Self { - self.inner = self.inner.query_start(input); - self - } - /// Unsigned 64 bit integer. - pub fn set_query_start(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_query_start(input); - self - } - /// Unsigned 64 bit integer. - pub fn query_end(mut self, input: i64) -> Self { - self.inner = self.inner.query_end(input); - self - } - /// Unsigned 64 bit integer. - pub fn set_query_end(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_query_end(input); - self - } - } - /// Fluent builder constructing a request to `GetGameBillingPlans`. - /// - /// Returns all available billing plans for the given game. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GetGameBillingPlans { - handle: std::sync::Arc>, - inner: crate::input::get_game_billing_plans_input::Builder, - } - impl GetGameBillingPlans - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GetGameBillingPlans`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GetGameBillingPlansOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GetGameBillingPlansInputOperationOutputAlias, - crate::output::GetGameBillingPlansOutput, - crate::error::GetGameBillingPlansError, - crate::input::GetGameBillingPlansInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - } - /// Fluent builder constructing a request to `GetGameById`. - /// - /// Returns a game by its game id. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GetGameById { - handle: std::sync::Arc>, - inner: crate::input::get_game_by_id_input::Builder, - } - impl GetGameById - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GetGameById`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GetGameByIdOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GetGameByIdInputOperationOutputAlias, - crate::output::GetGameByIdOutput, - crate::error::GetGameByIdError, - crate::input::GetGameByIdInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.inner = self.inner.watch_index(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_watch_index(input); - self - } - } - /// Fluent builder constructing a request to `GetGameNamespaceById`. - /// - /// Gets a game namespace by namespace ID. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GetGameNamespaceById { - handle: std::sync::Arc>, - inner: crate::input::get_game_namespace_by_id_input::Builder, - } - impl GetGameNamespaceById - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GetGameNamespaceById`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GetGameNamespaceByIdOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GetGameNamespaceByIdInputOperationOutputAlias, - crate::output::GetGameNamespaceByIdOutput, - crate::error::GetGameNamespaceByIdError, - crate::input::GetGameNamespaceByIdInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.namespace_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_namespace_id(input); - self - } - } - /// Fluent builder constructing a request to `GetGames`. - /// - /// Returns a list of games in which the current identity is a group member of its development team. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GetGames { - handle: std::sync::Arc>, - inner: crate::input::get_games_input::Builder, - } - impl GetGames - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GetGames`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GetGamesOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GetGamesInputOperationOutputAlias, - crate::output::GetGamesOutput, - crate::error::GetGamesError, - crate::input::GetGamesInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.inner = self.inner.watch_index(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_watch_index(input); - self - } - } - /// Fluent builder constructing a request to `GetGameVersionById`. - /// - /// Returns a game version by its version ID. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GetGameVersionById { - handle: std::sync::Arc>, - inner: crate::input::get_game_version_by_id_input::Builder, - } - impl GetGameVersionById - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GetGameVersionById`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GetGameVersionByIdOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GetGameVersionByIdInputOperationOutputAlias, - crate::output::GetGameVersionByIdOutput, - crate::error::GetGameVersionByIdError, - crate::input::GetGameVersionByIdInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - /// A universally unique identifier. - pub fn version_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.version_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_version_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_version_id(input); - self - } - } - /// Fluent builder constructing a request to `GetGroupBilling`. - /// - /// Returns billing information for the given group over the given query time span. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GetGroupBilling { - handle: std::sync::Arc>, - inner: crate::input::get_group_billing_input::Builder, - } - impl GetGroupBilling - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GetGroupBilling`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GetGroupBillingOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GetGroupBillingInputOperationOutputAlias, - crate::output::GetGroupBillingOutput, - crate::error::GetGroupBillingError, - crate::input::GetGroupBillingInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.group_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_group_id(input); - self - } - } - /// Fluent builder constructing a request to `GetGroupInvoicesList`. - /// - /// Returns a list of invoices for the given group. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GetGroupInvoicesList { - handle: std::sync::Arc>, - inner: crate::input::get_group_invoices_list_input::Builder, - } - impl GetGroupInvoicesList - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GetGroupInvoicesList`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GetGroupInvoicesListOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GetGroupInvoicesListInputOperationOutputAlias, - crate::output::GetGroupInvoicesListOutput, - crate::error::GetGroupInvoicesListError, - crate::input::GetGroupInvoicesListInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.group_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_group_id(input); - self - } - /// Unsigned 32 bit integer. - pub fn page(mut self, input: i32) -> Self { - self.inner = self.inner.page(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_page(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_page(input); - self - } - /// Unsigned 32 bit integer. - pub fn per_page(mut self, input: i32) -> Self { - self.inner = self.inner.per_page(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_per_page(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_per_page(input); - self - } - } - /// Fluent builder constructing a request to `GetLobbyLogs`. - /// - /// Returns the logs for a given lobby. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GetLobbyLogs { - handle: std::sync::Arc>, - inner: crate::input::get_lobby_logs_input::Builder, - } - impl GetLobbyLogs - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GetLobbyLogs`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GetLobbyLogsOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GetLobbyLogsInputOperationOutputAlias, - crate::output::GetLobbyLogsOutput, - crate::error::GetLobbyLogsError, - crate::input::GetLobbyLogsInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - /// A universally unique identifier. - pub fn lobby_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.lobby_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_lobby_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_lobby_id(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn stream(mut self, input: crate::model::LogStream) -> Self { - self.inner = self.inner.stream(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_stream(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_stream(input); - self - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.inner = self.inner.watch_index(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_watch_index(input); - self - } - } - /// Fluent builder constructing a request to `GetNamespaceAnalyticsMatchmakerLive`. - /// - /// Returns live information about all active lobies for a given namespace. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GetNamespaceAnalyticsMatchmakerLive { - handle: std::sync::Arc>, - inner: crate::input::get_namespace_analytics_matchmaker_live_input::Builder, - } - impl GetNamespaceAnalyticsMatchmakerLive - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GetNamespaceAnalyticsMatchmakerLive`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GetNamespaceAnalyticsMatchmakerLiveOutput, - aws_smithy_http::result::SdkError< - crate::error::GetNamespaceAnalyticsMatchmakerLiveError, - >, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GetNamespaceAnalyticsMatchmakerLiveInputOperationOutputAlias, - crate::output::GetNamespaceAnalyticsMatchmakerLiveOutput, - crate::error::GetNamespaceAnalyticsMatchmakerLiveError, - crate::input::GetNamespaceAnalyticsMatchmakerLiveInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.namespace_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_namespace_id(input); - self - } - } - /// Fluent builder constructing a request to `GetNamespaceLobby`. - /// - /// Returns a lobby from the given game namespace. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GetNamespaceLobby { - handle: std::sync::Arc>, - inner: crate::input::get_namespace_lobby_input::Builder, - } - impl GetNamespaceLobby - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GetNamespaceLobby`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GetNamespaceLobbyOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GetNamespaceLobbyInputOperationOutputAlias, - crate::output::GetNamespaceLobbyOutput, - crate::error::GetNamespaceLobbyError, - crate::input::GetNamespaceLobbyInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.namespace_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_namespace_id(input); - self - } - /// A universally unique identifier. - pub fn lobby_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.lobby_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_lobby_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_lobby_id(input); - self - } - } - /// Fluent builder constructing a request to `GetRayPerfLogs`. - /// - /// Returns performance information about a Rivet Ray. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GetRayPerfLogs { - handle: std::sync::Arc>, - inner: crate::input::get_ray_perf_logs_input::Builder, - } - impl GetRayPerfLogs - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GetRayPerfLogs`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GetRayPerfLogsOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GetRayPerfLogsInputOperationOutputAlias, - crate::output::GetRayPerfLogsOutput, - crate::error::GetRayPerfLogsError, - crate::input::GetRayPerfLogsInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn ray_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.ray_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_ray_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_ray_id(input); - self - } - } - /// Fluent builder constructing a request to `GetRegionTiers`. - /// - /// Returns all available region tiers. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GetRegionTiers { - handle: std::sync::Arc>, - inner: crate::input::get_region_tiers_input::Builder, - } - impl GetRegionTiers - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GetRegionTiers`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GetRegionTiersOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GetRegionTiersInputOperationOutputAlias, - crate::output::GetRegionTiersOutput, - crate::error::GetRegionTiersError, - crate::input::GetRegionTiersInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - } - /// Fluent builder constructing a request to `GroupBillingCheckout`. - /// - /// Creates a checkout session for the given group. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GroupBillingCheckout { - handle: std::sync::Arc>, - inner: crate::input::group_billing_checkout_input::Builder, - } - impl GroupBillingCheckout - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GroupBillingCheckout`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GroupBillingCheckoutOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GroupBillingCheckoutInputOperationOutputAlias, - crate::output::GroupBillingCheckoutOutput, - crate::error::GroupBillingCheckoutError, - crate::input::GroupBillingCheckoutInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.group_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_group_id(input); - self - } - } - /// Fluent builder constructing a request to `Inspect`. - /// - /// Returns information about the current authenticated agent. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct Inspect { - handle: std::sync::Arc>, - inner: crate::input::inspect_input::Builder, - } - impl Inspect - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `Inspect`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::InspectOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::InspectInputOperationOutputAlias, - crate::output::InspectOutput, - crate::error::InspectError, - crate::input::InspectInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - } - /// Fluent builder constructing a request to `ListGameBuilds`. - /// - /// Lists game builds for the given game. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct ListGameBuilds { - handle: std::sync::Arc>, - inner: crate::input::list_game_builds_input::Builder, - } - impl ListGameBuilds - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `ListGameBuilds`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::ListGameBuildsOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::ListGameBuildsInputOperationOutputAlias, - crate::output::ListGameBuildsOutput, - crate::error::ListGameBuildsError, - crate::input::ListGameBuildsInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - } - /// Fluent builder constructing a request to `ListGameCdnSites`. - /// - /// Lists CDN sites for a game. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct ListGameCdnSites { - handle: std::sync::Arc>, - inner: crate::input::list_game_cdn_sites_input::Builder, - } - impl ListGameCdnSites - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `ListGameCdnSites`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::ListGameCdnSitesOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::ListGameCdnSitesInputOperationOutputAlias, - crate::output::ListGameCdnSitesOutput, - crate::error::ListGameCdnSitesError, - crate::input::ListGameCdnSitesInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - } - /// Fluent builder constructing a request to `ListGameCustomAvatars`. - /// - /// Lists custom avatars for the given game. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct ListGameCustomAvatars { - handle: std::sync::Arc>, - inner: crate::input::list_game_custom_avatars_input::Builder, - } - impl ListGameCustomAvatars - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `ListGameCustomAvatars`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::ListGameCustomAvatarsOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::ListGameCustomAvatarsInputOperationOutputAlias, - crate::output::ListGameCustomAvatarsOutput, - crate::error::ListGameCustomAvatarsError, - crate::input::ListGameCustomAvatarsInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - } - /// Fluent builder constructing a request to `ListNamespaceLobbies`. - /// - /// Returns a list of lobbies for the given game namespace. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct ListNamespaceLobbies { - handle: std::sync::Arc>, - inner: crate::input::list_namespace_lobbies_input::Builder, - } - impl ListNamespaceLobbies - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `ListNamespaceLobbies`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::ListNamespaceLobbiesOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::ListNamespaceLobbiesInputOperationOutputAlias, - crate::output::ListNamespaceLobbiesOutput, - crate::error::ListNamespaceLobbiesError, - crate::input::ListNamespaceLobbiesInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.namespace_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_namespace_id(input); - self - } - /// Returns lobbies created before this timestamp. - pub fn before_create_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.inner = self.inner.before_create_ts(input); - self - } - /// Returns lobbies created before this timestamp. - pub fn set_before_create_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.inner = self.inner.set_before_create_ts(input); - self - } - } - /// Fluent builder constructing a request to `PrepareCustomAvatarUpload`. - /// - /// Prepares a custom avatar image upload. Complete upload with `rivet.api.cloud#CompleteCustomAvatarUpload`. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct PrepareCustomAvatarUpload { - handle: std::sync::Arc>, - inner: crate::input::prepare_custom_avatar_upload_input::Builder, - } - impl PrepareCustomAvatarUpload - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `PrepareCustomAvatarUpload`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::PrepareCustomAvatarUploadOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::PrepareCustomAvatarUploadInputOperationOutputAlias, - crate::output::PrepareCustomAvatarUploadOutput, - crate::error::PrepareCustomAvatarUploadError, - crate::input::PrepareCustomAvatarUploadInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - /// The path/filename of the custom avatar. - pub fn path(mut self, input: impl Into) -> Self { - self.inner = self.inner.path(input.into()); - self - } - /// The path/filename of the custom avatar. - pub fn set_path(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_path(input); - self - } - /// The MIME type of the custom avatar. - pub fn mime(mut self, input: impl Into) -> Self { - self.inner = self.inner.mime(input.into()); - self - } - /// The MIME type of the custom avatar. - pub fn set_mime(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_mime(input); - self - } - /// Unsigned 64 bit integer. - pub fn content_length(mut self, input: i64) -> Self { - self.inner = self.inner.content_length(input); - self - } - /// Unsigned 64 bit integer. - pub fn set_content_length(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_content_length(input); - self - } - } - /// Fluent builder constructing a request to `RemoveNamespaceCdnAuthUser`. - /// - /// Removes an authenticated user from the given game namespace. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct RemoveNamespaceCdnAuthUser { - handle: std::sync::Arc>, - inner: crate::input::remove_namespace_cdn_auth_user_input::Builder, - } - impl RemoveNamespaceCdnAuthUser - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `RemoveNamespaceCdnAuthUser`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::RemoveNamespaceCdnAuthUserOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::RemoveNamespaceCdnAuthUserInputOperationOutputAlias, - crate::output::RemoveNamespaceCdnAuthUserOutput, - crate::error::RemoveNamespaceCdnAuthUserError, - crate::input::RemoveNamespaceCdnAuthUserInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.namespace_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_namespace_id(input); - self - } - /// A user name. - pub fn user(mut self, input: impl Into) -> Self { - self.inner = self.inner.user(input.into()); - self - } - /// A user name. - pub fn set_user(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_user(input); - self - } - } - /// Fluent builder constructing a request to `RemoveNamespaceDomain`. - /// - /// Removes a domain from the given game namespace. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct RemoveNamespaceDomain { - handle: std::sync::Arc>, - inner: crate::input::remove_namespace_domain_input::Builder, - } - impl RemoveNamespaceDomain - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `RemoveNamespaceDomain`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::RemoveNamespaceDomainOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::RemoveNamespaceDomainInputOperationOutputAlias, - crate::output::RemoveNamespaceDomainOutput, - crate::error::RemoveNamespaceDomainError, - crate::input::RemoveNamespaceDomainInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.namespace_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_namespace_id(input); - self - } - /// A valid domain name (no protocol). - pub fn domain(mut self, input: impl Into) -> Self { - self.inner = self.inner.domain(input.into()); - self - } - /// A valid domain name (no protocol). - pub fn set_domain(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_domain(input); - self - } - } - /// Fluent builder constructing a request to `SetGameBillingPlan`. - /// - /// Sets the current billing plan of the given developer game. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct SetGameBillingPlan { - handle: std::sync::Arc>, - inner: crate::input::set_game_billing_plan_input::Builder, - } - impl SetGameBillingPlan - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `SetGameBillingPlan`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::SetGameBillingPlanOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::SetGameBillingPlanInputOperationOutputAlias, - crate::output::SetGameBillingPlanOutput, - crate::error::SetGameBillingPlanError, - crate::input::SetGameBillingPlanInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - /// A value denoting a game's billing plan. - pub fn plan(mut self, input: crate::model::GameBillingPlanCode) -> Self { - self.inner = self.inner.plan(input); - self - } - /// A value denoting a game's billing plan. - pub fn set_plan( - mut self, - input: std::option::Option, - ) -> Self { - self.inner = self.inner.set_plan(input); - self - } - } - /// Fluent builder constructing a request to `SetNamespaceCdnAuthType`. - /// - /// Updates the CDN authentication type of the given game namespace. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct SetNamespaceCdnAuthType { - handle: std::sync::Arc>, - inner: crate::input::set_namespace_cdn_auth_type_input::Builder, - } - impl SetNamespaceCdnAuthType - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `SetNamespaceCdnAuthType`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::SetNamespaceCdnAuthTypeOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::SetNamespaceCdnAuthTypeInputOperationOutputAlias, - crate::output::SetNamespaceCdnAuthTypeOutput, - crate::error::SetNamespaceCdnAuthTypeError, - crate::input::SetNamespaceCdnAuthTypeInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.namespace_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_namespace_id(input); - self - } - /// A value denoting what type of authentication to use for a game namespace's CDN. - pub fn auth_type(mut self, input: crate::model::CdnAuthType) -> Self { - self.inner = self.inner.auth_type(input); - self - } - /// A value denoting what type of authentication to use for a game namespace's CDN. - pub fn set_auth_type( - mut self, - input: std::option::Option, - ) -> Self { - self.inner = self.inner.set_auth_type(input); - self - } - } - /// Fluent builder constructing a request to `ToggleNamespaceDomainPublicAuth`. - /// - /// Toggles whether or not to allow authentication based on domain for the given game namespace. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct ToggleNamespaceDomainPublicAuth { - handle: std::sync::Arc>, - inner: crate::input::toggle_namespace_domain_public_auth_input::Builder, - } - impl ToggleNamespaceDomainPublicAuth - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `ToggleNamespaceDomainPublicAuth`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::ToggleNamespaceDomainPublicAuthOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::ToggleNamespaceDomainPublicAuthInputOperationOutputAlias, - crate::output::ToggleNamespaceDomainPublicAuthOutput, - crate::error::ToggleNamespaceDomainPublicAuthError, - crate::input::ToggleNamespaceDomainPublicAuthInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.namespace_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_namespace_id(input); - self - } - /// Whether or not to enable authentication based on domain. - pub fn enabled(mut self, input: bool) -> Self { - self.inner = self.inner.enabled(input); - self - } - /// Whether or not to enable authentication based on domain. - pub fn set_enabled(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_enabled(input); - self - } - } - /// Fluent builder constructing a request to `UpdateGameNamespaceMatchmakerConfig`. - /// - /// Updates matchmaker config for the given game namespace. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct UpdateGameNamespaceMatchmakerConfig { - handle: std::sync::Arc>, - inner: crate::input::update_game_namespace_matchmaker_config_input::Builder, - } - impl UpdateGameNamespaceMatchmakerConfig - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `UpdateGameNamespaceMatchmakerConfig`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::UpdateGameNamespaceMatchmakerConfigOutput, - aws_smithy_http::result::SdkError< - crate::error::UpdateGameNamespaceMatchmakerConfigError, - >, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::UpdateGameNamespaceMatchmakerConfigInputOperationOutputAlias, - crate::output::UpdateGameNamespaceMatchmakerConfigOutput, - crate::error::UpdateGameNamespaceMatchmakerConfigError, - crate::input::UpdateGameNamespaceMatchmakerConfigInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.namespace_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_namespace_id(input); - self - } - /// Unsigned 32 bit integer. - pub fn lobby_count_max(mut self, input: i32) -> Self { - self.inner = self.inner.lobby_count_max(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_lobby_count_max(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_lobby_count_max(input); - self - } - /// Unsigned 32 bit integer. - pub fn max_players(mut self, input: i32) -> Self { - self.inner = self.inner.max_players(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_max_players(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_max_players(input); - self - } - } - /// Fluent builder constructing a request to `UpdateGameNamespaceVersion`. - /// - /// Updates the version of a game namespace. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct UpdateGameNamespaceVersion { - handle: std::sync::Arc>, - inner: crate::input::update_game_namespace_version_input::Builder, - } - impl UpdateGameNamespaceVersion - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `UpdateGameNamespaceVersion`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::UpdateGameNamespaceVersionOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::UpdateGameNamespaceVersionInputOperationOutputAlias, - crate::output::UpdateGameNamespaceVersionOutput, - crate::error::UpdateGameNamespaceVersionError, - crate::input::UpdateGameNamespaceVersionInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.namespace_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_namespace_id(input); - self - } - /// A universally unique identifier. - pub fn version_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.version_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_version_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_version_id(input); - self - } - } - /// Fluent builder constructing a request to `UpdateNamespaceCdnAuthUser`. - /// - /// Adds an authenticated user to the given game namespace. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct UpdateNamespaceCdnAuthUser { - handle: std::sync::Arc>, - inner: crate::input::update_namespace_cdn_auth_user_input::Builder, - } - impl UpdateNamespaceCdnAuthUser - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `UpdateNamespaceCdnAuthUser`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::UpdateNamespaceCdnAuthUserOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::UpdateNamespaceCdnAuthUserInputOperationOutputAlias, - crate::output::UpdateNamespaceCdnAuthUserOutput, - crate::error::UpdateNamespaceCdnAuthUserError, - crate::input::UpdateNamespaceCdnAuthUserInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.namespace_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_namespace_id(input); - self - } - /// A user name. - pub fn user(mut self, input: impl Into) -> Self { - self.inner = self.inner.user(input.into()); - self - } - /// A user name. - pub fn set_user(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_user(input); - self - } - /// A bcrypt encrypted password. An error is returned if the given string is not properly encrypted. - pub fn password(mut self, input: impl Into) -> Self { - self.inner = self.inner.password(input.into()); - self - } - /// A bcrypt encrypted password. An error is returned if the given string is not properly encrypted. - pub fn set_password(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_password(input); - self - } - } - /// Fluent builder constructing a request to `ValidateGame`. - /// - /// Validates information used to create a new game. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct ValidateGame { - handle: std::sync::Arc>, - inner: crate::input::validate_game_input::Builder, - } - impl ValidateGame - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `ValidateGame`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::ValidateGameOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::ValidateGameInputOperationOutputAlias, - crate::output::ValidateGameOutput, - crate::error::ValidateGameError, - crate::input::ValidateGameInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.inner = self.inner.display_name(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_display_name(input); - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn name_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.name_id(input.into()); - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn set_name_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_name_id(input); - self - } - } - /// Fluent builder constructing a request to `ValidateGameNamespace`. - /// - /// Validates information used to create a new game namespace. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct ValidateGameNamespace { - handle: std::sync::Arc>, - inner: crate::input::validate_game_namespace_input::Builder, - } - impl ValidateGameNamespace - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `ValidateGameNamespace`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::ValidateGameNamespaceOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::ValidateGameNamespaceInputOperationOutputAlias, - crate::output::ValidateGameNamespaceOutput, - crate::error::ValidateGameNamespaceError, - crate::input::ValidateGameNamespaceInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.inner = self.inner.display_name(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_display_name(input); - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn name_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.name_id(input.into()); - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn set_name_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_name_id(input); - self - } - } - /// Fluent builder constructing a request to `ValidateGameNamespaceMatchmakerConfig`. - /// - /// Validates information used to update a game namespace's matchmaker config. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct ValidateGameNamespaceMatchmakerConfig { - handle: std::sync::Arc>, - inner: crate::input::validate_game_namespace_matchmaker_config_input::Builder, - } - impl ValidateGameNamespaceMatchmakerConfig - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `ValidateGameNamespaceMatchmakerConfig`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::ValidateGameNamespaceMatchmakerConfigOutput, - aws_smithy_http::result::SdkError< - crate::error::ValidateGameNamespaceMatchmakerConfigError, - >, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::ValidateGameNamespaceMatchmakerConfigInputOperationOutputAlias, - crate::output::ValidateGameNamespaceMatchmakerConfigOutput, - crate::error::ValidateGameNamespaceMatchmakerConfigError, - crate::input::ValidateGameNamespaceMatchmakerConfigInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.namespace_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_namespace_id(input); - self - } - /// Unsigned 32 bit integer. - pub fn lobby_count_max(mut self, input: i32) -> Self { - self.inner = self.inner.lobby_count_max(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_lobby_count_max(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_lobby_count_max(input); - self - } - /// Unsigned 32 bit integer. - pub fn max_players(mut self, input: i32) -> Self { - self.inner = self.inner.max_players(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_max_players(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_max_players(input); - self - } - } - /// Fluent builder constructing a request to `ValidateGameNamespaceTokenDevelopment`. - /// - /// Validates information used to create a new game namespace development token. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct ValidateGameNamespaceTokenDevelopment { - handle: std::sync::Arc>, - inner: crate::input::validate_game_namespace_token_development_input::Builder, - } - impl ValidateGameNamespaceTokenDevelopment - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `ValidateGameNamespaceTokenDevelopment`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::ValidateGameNamespaceTokenDevelopmentOutput, - aws_smithy_http::result::SdkError< - crate::error::ValidateGameNamespaceTokenDevelopmentError, - >, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::ValidateGameNamespaceTokenDevelopmentInputOperationOutputAlias, - crate::output::ValidateGameNamespaceTokenDevelopmentOutput, - crate::error::ValidateGameNamespaceTokenDevelopmentError, - crate::input::ValidateGameNamespaceTokenDevelopmentInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.namespace_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_namespace_id(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn hostname(mut self, input: impl Into) -> Self { - self.inner = self.inner.hostname(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_hostname(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_hostname(input); - self - } - /// Appends an item to `lobby_ports`. - /// - /// To override the contents of this collection use [`set_lobby_ports`](Self::set_lobby_ports). - /// - /// A list of docker ports. - pub fn lobby_ports(mut self, input: crate::model::LobbyGroupRuntimeDockerPort) -> Self { - self.inner = self.inner.lobby_ports(input); - self - } - /// A list of docker ports. - pub fn set_lobby_ports( - mut self, - input: std::option::Option>, - ) -> Self { - self.inner = self.inner.set_lobby_ports(input); - self - } - } - /// Fluent builder constructing a request to `ValidateGameVersion`. - /// - /// Validates information used to create a new game version. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct ValidateGameVersion { - handle: std::sync::Arc>, - inner: crate::input::validate_game_version_input::Builder, - } - impl ValidateGameVersion - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `ValidateGameVersion`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::ValidateGameVersionOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::ValidateGameVersionInputOperationOutputAlias, - crate::output::ValidateGameVersionOutput, - crate::error::ValidateGameVersionError, - crate::input::ValidateGameVersionInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.inner = self.inner.display_name(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_display_name(input); - self - } - /// Cloud configuration for a given version. - pub fn config(mut self, input: crate::model::CloudVersionConfig) -> Self { - self.inner = self.inner.config(input); - self - } - /// Cloud configuration for a given version. - pub fn set_config( - mut self, - input: std::option::Option, - ) -> Self { - self.inner = self.inner.set_config(input); - self - } - } - /// Fluent builder constructing a request to `ValidateGroup`. - /// - /// Validates information used to create a new group. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct ValidateGroup { - handle: std::sync::Arc>, - inner: crate::input::validate_group_input::Builder, - } - impl ValidateGroup - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `ValidateGroup`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::ValidateGroupOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::ValidateGroupInputOperationOutputAlias, - crate::output::ValidateGroupOutput, - crate::error::ValidateGroupError, - crate::input::ValidateGroupInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.inner = self.inner.display_name(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_display_name(input); - self - } - } -} -/// A wrapper around [`Client`]. Helps reduce external imports. -pub struct ClientWrapper { - pub(crate) client: Client, -} - -impl std::ops::Deref for ClientWrapper { - type Target = Client; - - fn deref(&self) -> &Self::Target { - &self.client - } -} diff --git a/lib/smithy-output/api-cloud/rust/rust/src/config.rs b/lib/smithy-output/api-cloud/rust/rust/src/config.rs deleted file mode 100644 index 00c7c48ee..000000000 --- a/lib/smithy-output/api-cloud/rust/rust/src/config.rs +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Service config. -/// -pub struct Config { - pub(crate) auth: Option, - pub(crate) uri: String, -} -impl std::fmt::Debug for Config { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut config = f.debug_struct("Config"); - config.finish() - } -} -impl Config { - /// Constructs a config builder. - pub fn builder() -> Builder { - Builder::default() - } -} -/// Builder for creating a `Config`. -#[derive(Default)] -pub struct Builder { - pub(crate) auth: Option, - pub(crate) uri: Option, -} -impl Builder { - /// Constructs a config builder. - pub fn new() -> Self { - Self::default() - } - /// Sets the bearer token to be used with the Smithy client. - pub fn set_bearer_token(mut self, bearer_token: impl std::fmt::Display) -> Self { - self.auth = Some(format!("Bearer {}", bearer_token)); - self - } - /// Sets the base URI to be used with the Smithy client. - pub fn set_uri(mut self, uri: impl ToString) -> Self { - self.uri = Some(uri.to_string()); - self - } - /// Builds a [`Config`]. - pub fn build(self) -> Config { - Config { - auth: self - .auth - .or_else(|| std::env::var("RIVET_LOBBY_TOKEN").ok()) - .or_else(|| std::env::var("RIVET_CLIENT_TOKEN").ok()), - uri: self - .uri - .or_else(|| std::env::var("RIVET_CLOUD_API_URL").ok()) - .unwrap_or_else(|| "https://cloud.api.rivet.gg/v1".to_string()), - } - } - /// Builds a default [`Client`] from the given config. - pub fn build_client(self) -> crate::client::ClientWrapper { - let raw_client = aws_smithy_client::Builder::dyn_https() - .middleware(tower::layer::util::Identity::new()) - .sleep_impl(None) - .build(); - crate::client::ClientWrapper { - client: crate::Client::with_config(raw_client, self.build()), - } - } -} diff --git a/lib/smithy-output/api-cloud/rust/rust/src/error.rs b/lib/smithy-output/api-cloud/rust/rust/src/error.rs deleted file mode 100644 index 5a91d7b67..000000000 --- a/lib/smithy-output/api-cloud/rust/rust/src/error.rs +++ /dev/null @@ -1,8479 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Error type for the `AddNamespaceDomain` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct AddNamespaceDomainError { - /// Kind of error that occurred. - pub kind: AddNamespaceDomainErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `AddNamespaceDomain` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum AddNamespaceDomainErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for AddNamespaceDomainError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - AddNamespaceDomainErrorKind::InternalError(_inner) => _inner.fmt(f), - AddNamespaceDomainErrorKind::RateLimitError(_inner) => _inner.fmt(f), - AddNamespaceDomainErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - AddNamespaceDomainErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - AddNamespaceDomainErrorKind::NotFoundError(_inner) => _inner.fmt(f), - AddNamespaceDomainErrorKind::BadRequestError(_inner) => _inner.fmt(f), - AddNamespaceDomainErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for AddNamespaceDomainError { - fn code(&self) -> Option<&str> { - AddNamespaceDomainError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - AddNamespaceDomainErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - AddNamespaceDomainErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl AddNamespaceDomainError { - /// Creates a new `AddNamespaceDomainError`. - pub fn new(kind: AddNamespaceDomainErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `AddNamespaceDomainError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: AddNamespaceDomainErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `AddNamespaceDomainError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: AddNamespaceDomainErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `AddNamespaceDomainErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, AddNamespaceDomainErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `AddNamespaceDomainErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, AddNamespaceDomainErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `AddNamespaceDomainErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, AddNamespaceDomainErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `AddNamespaceDomainErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - AddNamespaceDomainErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `AddNamespaceDomainErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, AddNamespaceDomainErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `AddNamespaceDomainErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, AddNamespaceDomainErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for AddNamespaceDomainError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - AddNamespaceDomainErrorKind::InternalError(_inner) => Some(_inner), - AddNamespaceDomainErrorKind::RateLimitError(_inner) => Some(_inner), - AddNamespaceDomainErrorKind::ForbiddenError(_inner) => Some(_inner), - AddNamespaceDomainErrorKind::UnauthorizedError(_inner) => Some(_inner), - AddNamespaceDomainErrorKind::NotFoundError(_inner) => Some(_inner), - AddNamespaceDomainErrorKind::BadRequestError(_inner) => Some(_inner), - AddNamespaceDomainErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `CompleteCustomAvatarUpload` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct CompleteCustomAvatarUploadError { - /// Kind of error that occurred. - pub kind: CompleteCustomAvatarUploadErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `CompleteCustomAvatarUpload` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum CompleteCustomAvatarUploadErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for CompleteCustomAvatarUploadError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - CompleteCustomAvatarUploadErrorKind::InternalError(_inner) => _inner.fmt(f), - CompleteCustomAvatarUploadErrorKind::RateLimitError(_inner) => _inner.fmt(f), - CompleteCustomAvatarUploadErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - CompleteCustomAvatarUploadErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - CompleteCustomAvatarUploadErrorKind::NotFoundError(_inner) => _inner.fmt(f), - CompleteCustomAvatarUploadErrorKind::BadRequestError(_inner) => _inner.fmt(f), - CompleteCustomAvatarUploadErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for CompleteCustomAvatarUploadError { - fn code(&self) -> Option<&str> { - CompleteCustomAvatarUploadError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - CompleteCustomAvatarUploadErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - CompleteCustomAvatarUploadErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl CompleteCustomAvatarUploadError { - /// Creates a new `CompleteCustomAvatarUploadError`. - pub fn new(kind: CompleteCustomAvatarUploadErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `CompleteCustomAvatarUploadError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: CompleteCustomAvatarUploadErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `CompleteCustomAvatarUploadError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: CompleteCustomAvatarUploadErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `CompleteCustomAvatarUploadErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!( - &self.kind, - CompleteCustomAvatarUploadErrorKind::InternalError(_) - ) - } - /// Returns `true` if the error kind is `CompleteCustomAvatarUploadErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - CompleteCustomAvatarUploadErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `CompleteCustomAvatarUploadErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - CompleteCustomAvatarUploadErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `CompleteCustomAvatarUploadErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - CompleteCustomAvatarUploadErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `CompleteCustomAvatarUploadErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!( - &self.kind, - CompleteCustomAvatarUploadErrorKind::NotFoundError(_) - ) - } - /// Returns `true` if the error kind is `CompleteCustomAvatarUploadErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - CompleteCustomAvatarUploadErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for CompleteCustomAvatarUploadError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - CompleteCustomAvatarUploadErrorKind::InternalError(_inner) => Some(_inner), - CompleteCustomAvatarUploadErrorKind::RateLimitError(_inner) => Some(_inner), - CompleteCustomAvatarUploadErrorKind::ForbiddenError(_inner) => Some(_inner), - CompleteCustomAvatarUploadErrorKind::UnauthorizedError(_inner) => Some(_inner), - CompleteCustomAvatarUploadErrorKind::NotFoundError(_inner) => Some(_inner), - CompleteCustomAvatarUploadErrorKind::BadRequestError(_inner) => Some(_inner), - CompleteCustomAvatarUploadErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `CompleteUpload` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct CompleteUploadError { - /// Kind of error that occurred. - pub kind: CompleteUploadErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `CompleteUpload` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum CompleteUploadErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for CompleteUploadError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - CompleteUploadErrorKind::InternalError(_inner) => _inner.fmt(f), - CompleteUploadErrorKind::RateLimitError(_inner) => _inner.fmt(f), - CompleteUploadErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - CompleteUploadErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - CompleteUploadErrorKind::NotFoundError(_inner) => _inner.fmt(f), - CompleteUploadErrorKind::BadRequestError(_inner) => _inner.fmt(f), - CompleteUploadErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for CompleteUploadError { - fn code(&self) -> Option<&str> { - CompleteUploadError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - CompleteUploadErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - CompleteUploadErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl CompleteUploadError { - /// Creates a new `CompleteUploadError`. - pub fn new(kind: CompleteUploadErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `CompleteUploadError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: CompleteUploadErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `CompleteUploadError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: CompleteUploadErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `CompleteUploadErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, CompleteUploadErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `CompleteUploadErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, CompleteUploadErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `CompleteUploadErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, CompleteUploadErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `CompleteUploadErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, CompleteUploadErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `CompleteUploadErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, CompleteUploadErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `CompleteUploadErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, CompleteUploadErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for CompleteUploadError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - CompleteUploadErrorKind::InternalError(_inner) => Some(_inner), - CompleteUploadErrorKind::RateLimitError(_inner) => Some(_inner), - CompleteUploadErrorKind::ForbiddenError(_inner) => Some(_inner), - CompleteUploadErrorKind::UnauthorizedError(_inner) => Some(_inner), - CompleteUploadErrorKind::NotFoundError(_inner) => Some(_inner), - CompleteUploadErrorKind::BadRequestError(_inner) => Some(_inner), - CompleteUploadErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `ConvertGroup` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct ConvertGroupError { - /// Kind of error that occurred. - pub kind: ConvertGroupErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `ConvertGroup` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum ConvertGroupErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for ConvertGroupError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - ConvertGroupErrorKind::InternalError(_inner) => _inner.fmt(f), - ConvertGroupErrorKind::RateLimitError(_inner) => _inner.fmt(f), - ConvertGroupErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - ConvertGroupErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - ConvertGroupErrorKind::NotFoundError(_inner) => _inner.fmt(f), - ConvertGroupErrorKind::BadRequestError(_inner) => _inner.fmt(f), - ConvertGroupErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for ConvertGroupError { - fn code(&self) -> Option<&str> { - ConvertGroupError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - ConvertGroupErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - ConvertGroupErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl ConvertGroupError { - /// Creates a new `ConvertGroupError`. - pub fn new(kind: ConvertGroupErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `ConvertGroupError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: ConvertGroupErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `ConvertGroupError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: ConvertGroupErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `ConvertGroupErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, ConvertGroupErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `ConvertGroupErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, ConvertGroupErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `ConvertGroupErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, ConvertGroupErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `ConvertGroupErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, ConvertGroupErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `ConvertGroupErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, ConvertGroupErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `ConvertGroupErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, ConvertGroupErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for ConvertGroupError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - ConvertGroupErrorKind::InternalError(_inner) => Some(_inner), - ConvertGroupErrorKind::RateLimitError(_inner) => Some(_inner), - ConvertGroupErrorKind::ForbiddenError(_inner) => Some(_inner), - ConvertGroupErrorKind::UnauthorizedError(_inner) => Some(_inner), - ConvertGroupErrorKind::NotFoundError(_inner) => Some(_inner), - ConvertGroupErrorKind::BadRequestError(_inner) => Some(_inner), - ConvertGroupErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `CreateCloudToken` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct CreateCloudTokenError { - /// Kind of error that occurred. - pub kind: CreateCloudTokenErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `CreateCloudToken` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum CreateCloudTokenErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for CreateCloudTokenError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - CreateCloudTokenErrorKind::InternalError(_inner) => _inner.fmt(f), - CreateCloudTokenErrorKind::RateLimitError(_inner) => _inner.fmt(f), - CreateCloudTokenErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - CreateCloudTokenErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - CreateCloudTokenErrorKind::NotFoundError(_inner) => _inner.fmt(f), - CreateCloudTokenErrorKind::BadRequestError(_inner) => _inner.fmt(f), - CreateCloudTokenErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for CreateCloudTokenError { - fn code(&self) -> Option<&str> { - CreateCloudTokenError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - CreateCloudTokenErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - CreateCloudTokenErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl CreateCloudTokenError { - /// Creates a new `CreateCloudTokenError`. - pub fn new(kind: CreateCloudTokenErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `CreateCloudTokenError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: CreateCloudTokenErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `CreateCloudTokenError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: CreateCloudTokenErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `CreateCloudTokenErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, CreateCloudTokenErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `CreateCloudTokenErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, CreateCloudTokenErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `CreateCloudTokenErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, CreateCloudTokenErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `CreateCloudTokenErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, CreateCloudTokenErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `CreateCloudTokenErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, CreateCloudTokenErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `CreateCloudTokenErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, CreateCloudTokenErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for CreateCloudTokenError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - CreateCloudTokenErrorKind::InternalError(_inner) => Some(_inner), - CreateCloudTokenErrorKind::RateLimitError(_inner) => Some(_inner), - CreateCloudTokenErrorKind::ForbiddenError(_inner) => Some(_inner), - CreateCloudTokenErrorKind::UnauthorizedError(_inner) => Some(_inner), - CreateCloudTokenErrorKind::NotFoundError(_inner) => Some(_inner), - CreateCloudTokenErrorKind::BadRequestError(_inner) => Some(_inner), - CreateCloudTokenErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `CreateGame` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct CreateGameError { - /// Kind of error that occurred. - pub kind: CreateGameErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `CreateGame` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum CreateGameErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for CreateGameError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - CreateGameErrorKind::InternalError(_inner) => _inner.fmt(f), - CreateGameErrorKind::RateLimitError(_inner) => _inner.fmt(f), - CreateGameErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - CreateGameErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - CreateGameErrorKind::NotFoundError(_inner) => _inner.fmt(f), - CreateGameErrorKind::BadRequestError(_inner) => _inner.fmt(f), - CreateGameErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for CreateGameError { - fn code(&self) -> Option<&str> { - CreateGameError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - CreateGameErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - CreateGameErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl CreateGameError { - /// Creates a new `CreateGameError`. - pub fn new(kind: CreateGameErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `CreateGameError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: CreateGameErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `CreateGameError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: CreateGameErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `CreateGameErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, CreateGameErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `CreateGameErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, CreateGameErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `CreateGameErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, CreateGameErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `CreateGameErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, CreateGameErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `CreateGameErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, CreateGameErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `CreateGameErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, CreateGameErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for CreateGameError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - CreateGameErrorKind::InternalError(_inner) => Some(_inner), - CreateGameErrorKind::RateLimitError(_inner) => Some(_inner), - CreateGameErrorKind::ForbiddenError(_inner) => Some(_inner), - CreateGameErrorKind::UnauthorizedError(_inner) => Some(_inner), - CreateGameErrorKind::NotFoundError(_inner) => Some(_inner), - CreateGameErrorKind::BadRequestError(_inner) => Some(_inner), - CreateGameErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `CreateGameBuild` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct CreateGameBuildError { - /// Kind of error that occurred. - pub kind: CreateGameBuildErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `CreateGameBuild` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum CreateGameBuildErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for CreateGameBuildError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - CreateGameBuildErrorKind::InternalError(_inner) => _inner.fmt(f), - CreateGameBuildErrorKind::RateLimitError(_inner) => _inner.fmt(f), - CreateGameBuildErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - CreateGameBuildErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - CreateGameBuildErrorKind::NotFoundError(_inner) => _inner.fmt(f), - CreateGameBuildErrorKind::BadRequestError(_inner) => _inner.fmt(f), - CreateGameBuildErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for CreateGameBuildError { - fn code(&self) -> Option<&str> { - CreateGameBuildError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - CreateGameBuildErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - CreateGameBuildErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl CreateGameBuildError { - /// Creates a new `CreateGameBuildError`. - pub fn new(kind: CreateGameBuildErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `CreateGameBuildError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: CreateGameBuildErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `CreateGameBuildError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: CreateGameBuildErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `CreateGameBuildErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, CreateGameBuildErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `CreateGameBuildErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, CreateGameBuildErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `CreateGameBuildErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, CreateGameBuildErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `CreateGameBuildErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, CreateGameBuildErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `CreateGameBuildErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, CreateGameBuildErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `CreateGameBuildErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, CreateGameBuildErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for CreateGameBuildError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - CreateGameBuildErrorKind::InternalError(_inner) => Some(_inner), - CreateGameBuildErrorKind::RateLimitError(_inner) => Some(_inner), - CreateGameBuildErrorKind::ForbiddenError(_inner) => Some(_inner), - CreateGameBuildErrorKind::UnauthorizedError(_inner) => Some(_inner), - CreateGameBuildErrorKind::NotFoundError(_inner) => Some(_inner), - CreateGameBuildErrorKind::BadRequestError(_inner) => Some(_inner), - CreateGameBuildErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `CreateGameCdnSite` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct CreateGameCdnSiteError { - /// Kind of error that occurred. - pub kind: CreateGameCdnSiteErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `CreateGameCdnSite` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum CreateGameCdnSiteErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for CreateGameCdnSiteError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - CreateGameCdnSiteErrorKind::InternalError(_inner) => _inner.fmt(f), - CreateGameCdnSiteErrorKind::RateLimitError(_inner) => _inner.fmt(f), - CreateGameCdnSiteErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - CreateGameCdnSiteErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - CreateGameCdnSiteErrorKind::NotFoundError(_inner) => _inner.fmt(f), - CreateGameCdnSiteErrorKind::BadRequestError(_inner) => _inner.fmt(f), - CreateGameCdnSiteErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for CreateGameCdnSiteError { - fn code(&self) -> Option<&str> { - CreateGameCdnSiteError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - CreateGameCdnSiteErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - CreateGameCdnSiteErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl CreateGameCdnSiteError { - /// Creates a new `CreateGameCdnSiteError`. - pub fn new(kind: CreateGameCdnSiteErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `CreateGameCdnSiteError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: CreateGameCdnSiteErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `CreateGameCdnSiteError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: CreateGameCdnSiteErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `CreateGameCdnSiteErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, CreateGameCdnSiteErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `CreateGameCdnSiteErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, CreateGameCdnSiteErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `CreateGameCdnSiteErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, CreateGameCdnSiteErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `CreateGameCdnSiteErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, CreateGameCdnSiteErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `CreateGameCdnSiteErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, CreateGameCdnSiteErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `CreateGameCdnSiteErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, CreateGameCdnSiteErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for CreateGameCdnSiteError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - CreateGameCdnSiteErrorKind::InternalError(_inner) => Some(_inner), - CreateGameCdnSiteErrorKind::RateLimitError(_inner) => Some(_inner), - CreateGameCdnSiteErrorKind::ForbiddenError(_inner) => Some(_inner), - CreateGameCdnSiteErrorKind::UnauthorizedError(_inner) => Some(_inner), - CreateGameCdnSiteErrorKind::NotFoundError(_inner) => Some(_inner), - CreateGameCdnSiteErrorKind::BadRequestError(_inner) => Some(_inner), - CreateGameCdnSiteErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `CreateGameNamespace` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct CreateGameNamespaceError { - /// Kind of error that occurred. - pub kind: CreateGameNamespaceErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `CreateGameNamespace` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum CreateGameNamespaceErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for CreateGameNamespaceError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - CreateGameNamespaceErrorKind::InternalError(_inner) => _inner.fmt(f), - CreateGameNamespaceErrorKind::RateLimitError(_inner) => _inner.fmt(f), - CreateGameNamespaceErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - CreateGameNamespaceErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - CreateGameNamespaceErrorKind::NotFoundError(_inner) => _inner.fmt(f), - CreateGameNamespaceErrorKind::BadRequestError(_inner) => _inner.fmt(f), - CreateGameNamespaceErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for CreateGameNamespaceError { - fn code(&self) -> Option<&str> { - CreateGameNamespaceError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - CreateGameNamespaceErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - CreateGameNamespaceErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl CreateGameNamespaceError { - /// Creates a new `CreateGameNamespaceError`. - pub fn new(kind: CreateGameNamespaceErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `CreateGameNamespaceError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: CreateGameNamespaceErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `CreateGameNamespaceError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: CreateGameNamespaceErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `CreateGameNamespaceErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, CreateGameNamespaceErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `CreateGameNamespaceErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, CreateGameNamespaceErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `CreateGameNamespaceErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, CreateGameNamespaceErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `CreateGameNamespaceErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - CreateGameNamespaceErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `CreateGameNamespaceErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, CreateGameNamespaceErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `CreateGameNamespaceErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, CreateGameNamespaceErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for CreateGameNamespaceError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - CreateGameNamespaceErrorKind::InternalError(_inner) => Some(_inner), - CreateGameNamespaceErrorKind::RateLimitError(_inner) => Some(_inner), - CreateGameNamespaceErrorKind::ForbiddenError(_inner) => Some(_inner), - CreateGameNamespaceErrorKind::UnauthorizedError(_inner) => Some(_inner), - CreateGameNamespaceErrorKind::NotFoundError(_inner) => Some(_inner), - CreateGameNamespaceErrorKind::BadRequestError(_inner) => Some(_inner), - CreateGameNamespaceErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `CreateGameNamespaceTokenDevelopment` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct CreateGameNamespaceTokenDevelopmentError { - /// Kind of error that occurred. - pub kind: CreateGameNamespaceTokenDevelopmentErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `CreateGameNamespaceTokenDevelopment` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum CreateGameNamespaceTokenDevelopmentErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for CreateGameNamespaceTokenDevelopmentError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - CreateGameNamespaceTokenDevelopmentErrorKind::InternalError(_inner) => _inner.fmt(f), - CreateGameNamespaceTokenDevelopmentErrorKind::RateLimitError(_inner) => _inner.fmt(f), - CreateGameNamespaceTokenDevelopmentErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - CreateGameNamespaceTokenDevelopmentErrorKind::UnauthorizedError(_inner) => { - _inner.fmt(f) - } - CreateGameNamespaceTokenDevelopmentErrorKind::NotFoundError(_inner) => _inner.fmt(f), - CreateGameNamespaceTokenDevelopmentErrorKind::BadRequestError(_inner) => _inner.fmt(f), - CreateGameNamespaceTokenDevelopmentErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for CreateGameNamespaceTokenDevelopmentError { - fn code(&self) -> Option<&str> { - CreateGameNamespaceTokenDevelopmentError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - CreateGameNamespaceTokenDevelopmentErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - CreateGameNamespaceTokenDevelopmentErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl CreateGameNamespaceTokenDevelopmentError { - /// Creates a new `CreateGameNamespaceTokenDevelopmentError`. - pub fn new( - kind: CreateGameNamespaceTokenDevelopmentErrorKind, - meta: aws_smithy_types::Error, - ) -> Self { - Self { kind, meta } - } - - /// Creates the `CreateGameNamespaceTokenDevelopmentError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: CreateGameNamespaceTokenDevelopmentErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `CreateGameNamespaceTokenDevelopmentError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: CreateGameNamespaceTokenDevelopmentErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `CreateGameNamespaceTokenDevelopmentErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!( - &self.kind, - CreateGameNamespaceTokenDevelopmentErrorKind::InternalError(_) - ) - } - /// Returns `true` if the error kind is `CreateGameNamespaceTokenDevelopmentErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - CreateGameNamespaceTokenDevelopmentErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `CreateGameNamespaceTokenDevelopmentErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - CreateGameNamespaceTokenDevelopmentErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `CreateGameNamespaceTokenDevelopmentErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - CreateGameNamespaceTokenDevelopmentErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `CreateGameNamespaceTokenDevelopmentErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!( - &self.kind, - CreateGameNamespaceTokenDevelopmentErrorKind::NotFoundError(_) - ) - } - /// Returns `true` if the error kind is `CreateGameNamespaceTokenDevelopmentErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - CreateGameNamespaceTokenDevelopmentErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for CreateGameNamespaceTokenDevelopmentError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - CreateGameNamespaceTokenDevelopmentErrorKind::InternalError(_inner) => Some(_inner), - CreateGameNamespaceTokenDevelopmentErrorKind::RateLimitError(_inner) => Some(_inner), - CreateGameNamespaceTokenDevelopmentErrorKind::ForbiddenError(_inner) => Some(_inner), - CreateGameNamespaceTokenDevelopmentErrorKind::UnauthorizedError(_inner) => Some(_inner), - CreateGameNamespaceTokenDevelopmentErrorKind::NotFoundError(_inner) => Some(_inner), - CreateGameNamespaceTokenDevelopmentErrorKind::BadRequestError(_inner) => Some(_inner), - CreateGameNamespaceTokenDevelopmentErrorKind::Unhandled(_inner) => { - Some(_inner.as_ref()) - } - } - } -} - -/// Error type for the `CreateGameNamespaceTokenPublic` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct CreateGameNamespaceTokenPublicError { - /// Kind of error that occurred. - pub kind: CreateGameNamespaceTokenPublicErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `CreateGameNamespaceTokenPublic` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum CreateGameNamespaceTokenPublicErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for CreateGameNamespaceTokenPublicError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - CreateGameNamespaceTokenPublicErrorKind::InternalError(_inner) => _inner.fmt(f), - CreateGameNamespaceTokenPublicErrorKind::RateLimitError(_inner) => _inner.fmt(f), - CreateGameNamespaceTokenPublicErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - CreateGameNamespaceTokenPublicErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - CreateGameNamespaceTokenPublicErrorKind::NotFoundError(_inner) => _inner.fmt(f), - CreateGameNamespaceTokenPublicErrorKind::BadRequestError(_inner) => _inner.fmt(f), - CreateGameNamespaceTokenPublicErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for CreateGameNamespaceTokenPublicError { - fn code(&self) -> Option<&str> { - CreateGameNamespaceTokenPublicError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - CreateGameNamespaceTokenPublicErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - CreateGameNamespaceTokenPublicErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl CreateGameNamespaceTokenPublicError { - /// Creates a new `CreateGameNamespaceTokenPublicError`. - pub fn new( - kind: CreateGameNamespaceTokenPublicErrorKind, - meta: aws_smithy_types::Error, - ) -> Self { - Self { kind, meta } - } - - /// Creates the `CreateGameNamespaceTokenPublicError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: CreateGameNamespaceTokenPublicErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `CreateGameNamespaceTokenPublicError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: CreateGameNamespaceTokenPublicErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `CreateGameNamespaceTokenPublicErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!( - &self.kind, - CreateGameNamespaceTokenPublicErrorKind::InternalError(_) - ) - } - /// Returns `true` if the error kind is `CreateGameNamespaceTokenPublicErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - CreateGameNamespaceTokenPublicErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `CreateGameNamespaceTokenPublicErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - CreateGameNamespaceTokenPublicErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `CreateGameNamespaceTokenPublicErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - CreateGameNamespaceTokenPublicErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `CreateGameNamespaceTokenPublicErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!( - &self.kind, - CreateGameNamespaceTokenPublicErrorKind::NotFoundError(_) - ) - } - /// Returns `true` if the error kind is `CreateGameNamespaceTokenPublicErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - CreateGameNamespaceTokenPublicErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for CreateGameNamespaceTokenPublicError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - CreateGameNamespaceTokenPublicErrorKind::InternalError(_inner) => Some(_inner), - CreateGameNamespaceTokenPublicErrorKind::RateLimitError(_inner) => Some(_inner), - CreateGameNamespaceTokenPublicErrorKind::ForbiddenError(_inner) => Some(_inner), - CreateGameNamespaceTokenPublicErrorKind::UnauthorizedError(_inner) => Some(_inner), - CreateGameNamespaceTokenPublicErrorKind::NotFoundError(_inner) => Some(_inner), - CreateGameNamespaceTokenPublicErrorKind::BadRequestError(_inner) => Some(_inner), - CreateGameNamespaceTokenPublicErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `CreateGameVersion` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct CreateGameVersionError { - /// Kind of error that occurred. - pub kind: CreateGameVersionErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `CreateGameVersion` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum CreateGameVersionErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for CreateGameVersionError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - CreateGameVersionErrorKind::InternalError(_inner) => _inner.fmt(f), - CreateGameVersionErrorKind::RateLimitError(_inner) => _inner.fmt(f), - CreateGameVersionErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - CreateGameVersionErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - CreateGameVersionErrorKind::NotFoundError(_inner) => _inner.fmt(f), - CreateGameVersionErrorKind::BadRequestError(_inner) => _inner.fmt(f), - CreateGameVersionErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for CreateGameVersionError { - fn code(&self) -> Option<&str> { - CreateGameVersionError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - CreateGameVersionErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - CreateGameVersionErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl CreateGameVersionError { - /// Creates a new `CreateGameVersionError`. - pub fn new(kind: CreateGameVersionErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `CreateGameVersionError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: CreateGameVersionErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `CreateGameVersionError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: CreateGameVersionErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `CreateGameVersionErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, CreateGameVersionErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `CreateGameVersionErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, CreateGameVersionErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `CreateGameVersionErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, CreateGameVersionErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `CreateGameVersionErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, CreateGameVersionErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `CreateGameVersionErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, CreateGameVersionErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `CreateGameVersionErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, CreateGameVersionErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for CreateGameVersionError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - CreateGameVersionErrorKind::InternalError(_inner) => Some(_inner), - CreateGameVersionErrorKind::RateLimitError(_inner) => Some(_inner), - CreateGameVersionErrorKind::ForbiddenError(_inner) => Some(_inner), - CreateGameVersionErrorKind::UnauthorizedError(_inner) => Some(_inner), - CreateGameVersionErrorKind::NotFoundError(_inner) => Some(_inner), - CreateGameVersionErrorKind::BadRequestError(_inner) => Some(_inner), - CreateGameVersionErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `DeleteMatchmakerLobby` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct DeleteMatchmakerLobbyError { - /// Kind of error that occurred. - pub kind: DeleteMatchmakerLobbyErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `DeleteMatchmakerLobby` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum DeleteMatchmakerLobbyErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for DeleteMatchmakerLobbyError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - DeleteMatchmakerLobbyErrorKind::InternalError(_inner) => _inner.fmt(f), - DeleteMatchmakerLobbyErrorKind::RateLimitError(_inner) => _inner.fmt(f), - DeleteMatchmakerLobbyErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - DeleteMatchmakerLobbyErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - DeleteMatchmakerLobbyErrorKind::NotFoundError(_inner) => _inner.fmt(f), - DeleteMatchmakerLobbyErrorKind::BadRequestError(_inner) => _inner.fmt(f), - DeleteMatchmakerLobbyErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for DeleteMatchmakerLobbyError { - fn code(&self) -> Option<&str> { - DeleteMatchmakerLobbyError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - DeleteMatchmakerLobbyErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - DeleteMatchmakerLobbyErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl DeleteMatchmakerLobbyError { - /// Creates a new `DeleteMatchmakerLobbyError`. - pub fn new(kind: DeleteMatchmakerLobbyErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `DeleteMatchmakerLobbyError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: DeleteMatchmakerLobbyErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `DeleteMatchmakerLobbyError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: DeleteMatchmakerLobbyErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `DeleteMatchmakerLobbyErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, DeleteMatchmakerLobbyErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `DeleteMatchmakerLobbyErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - DeleteMatchmakerLobbyErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `DeleteMatchmakerLobbyErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - DeleteMatchmakerLobbyErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `DeleteMatchmakerLobbyErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - DeleteMatchmakerLobbyErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `DeleteMatchmakerLobbyErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, DeleteMatchmakerLobbyErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `DeleteMatchmakerLobbyErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - DeleteMatchmakerLobbyErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for DeleteMatchmakerLobbyError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - DeleteMatchmakerLobbyErrorKind::InternalError(_inner) => Some(_inner), - DeleteMatchmakerLobbyErrorKind::RateLimitError(_inner) => Some(_inner), - DeleteMatchmakerLobbyErrorKind::ForbiddenError(_inner) => Some(_inner), - DeleteMatchmakerLobbyErrorKind::UnauthorizedError(_inner) => Some(_inner), - DeleteMatchmakerLobbyErrorKind::NotFoundError(_inner) => Some(_inner), - DeleteMatchmakerLobbyErrorKind::BadRequestError(_inner) => Some(_inner), - DeleteMatchmakerLobbyErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `ExportLobbyLogs` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct ExportLobbyLogsError { - /// Kind of error that occurred. - pub kind: ExportLobbyLogsErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `ExportLobbyLogs` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum ExportLobbyLogsErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for ExportLobbyLogsError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - ExportLobbyLogsErrorKind::InternalError(_inner) => _inner.fmt(f), - ExportLobbyLogsErrorKind::RateLimitError(_inner) => _inner.fmt(f), - ExportLobbyLogsErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - ExportLobbyLogsErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - ExportLobbyLogsErrorKind::NotFoundError(_inner) => _inner.fmt(f), - ExportLobbyLogsErrorKind::BadRequestError(_inner) => _inner.fmt(f), - ExportLobbyLogsErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for ExportLobbyLogsError { - fn code(&self) -> Option<&str> { - ExportLobbyLogsError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - ExportLobbyLogsErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - ExportLobbyLogsErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl ExportLobbyLogsError { - /// Creates a new `ExportLobbyLogsError`. - pub fn new(kind: ExportLobbyLogsErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `ExportLobbyLogsError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: ExportLobbyLogsErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `ExportLobbyLogsError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: ExportLobbyLogsErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `ExportLobbyLogsErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, ExportLobbyLogsErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `ExportLobbyLogsErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, ExportLobbyLogsErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `ExportLobbyLogsErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, ExportLobbyLogsErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `ExportLobbyLogsErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, ExportLobbyLogsErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `ExportLobbyLogsErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, ExportLobbyLogsErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `ExportLobbyLogsErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, ExportLobbyLogsErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for ExportLobbyLogsError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - ExportLobbyLogsErrorKind::InternalError(_inner) => Some(_inner), - ExportLobbyLogsErrorKind::RateLimitError(_inner) => Some(_inner), - ExportLobbyLogsErrorKind::ForbiddenError(_inner) => Some(_inner), - ExportLobbyLogsErrorKind::UnauthorizedError(_inner) => Some(_inner), - ExportLobbyLogsErrorKind::NotFoundError(_inner) => Some(_inner), - ExportLobbyLogsErrorKind::BadRequestError(_inner) => Some(_inner), - ExportLobbyLogsErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `ExportMatchmakerLobbyHistory` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct ExportMatchmakerLobbyHistoryError { - /// Kind of error that occurred. - pub kind: ExportMatchmakerLobbyHistoryErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `ExportMatchmakerLobbyHistory` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum ExportMatchmakerLobbyHistoryErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for ExportMatchmakerLobbyHistoryError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - ExportMatchmakerLobbyHistoryErrorKind::InternalError(_inner) => _inner.fmt(f), - ExportMatchmakerLobbyHistoryErrorKind::RateLimitError(_inner) => _inner.fmt(f), - ExportMatchmakerLobbyHistoryErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - ExportMatchmakerLobbyHistoryErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - ExportMatchmakerLobbyHistoryErrorKind::NotFoundError(_inner) => _inner.fmt(f), - ExportMatchmakerLobbyHistoryErrorKind::BadRequestError(_inner) => _inner.fmt(f), - ExportMatchmakerLobbyHistoryErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for ExportMatchmakerLobbyHistoryError { - fn code(&self) -> Option<&str> { - ExportMatchmakerLobbyHistoryError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - ExportMatchmakerLobbyHistoryErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - ExportMatchmakerLobbyHistoryErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl ExportMatchmakerLobbyHistoryError { - /// Creates a new `ExportMatchmakerLobbyHistoryError`. - pub fn new(kind: ExportMatchmakerLobbyHistoryErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `ExportMatchmakerLobbyHistoryError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: ExportMatchmakerLobbyHistoryErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `ExportMatchmakerLobbyHistoryError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: ExportMatchmakerLobbyHistoryErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `ExportMatchmakerLobbyHistoryErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!( - &self.kind, - ExportMatchmakerLobbyHistoryErrorKind::InternalError(_) - ) - } - /// Returns `true` if the error kind is `ExportMatchmakerLobbyHistoryErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - ExportMatchmakerLobbyHistoryErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `ExportMatchmakerLobbyHistoryErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - ExportMatchmakerLobbyHistoryErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `ExportMatchmakerLobbyHistoryErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - ExportMatchmakerLobbyHistoryErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `ExportMatchmakerLobbyHistoryErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!( - &self.kind, - ExportMatchmakerLobbyHistoryErrorKind::NotFoundError(_) - ) - } - /// Returns `true` if the error kind is `ExportMatchmakerLobbyHistoryErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - ExportMatchmakerLobbyHistoryErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for ExportMatchmakerLobbyHistoryError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - ExportMatchmakerLobbyHistoryErrorKind::InternalError(_inner) => Some(_inner), - ExportMatchmakerLobbyHistoryErrorKind::RateLimitError(_inner) => Some(_inner), - ExportMatchmakerLobbyHistoryErrorKind::ForbiddenError(_inner) => Some(_inner), - ExportMatchmakerLobbyHistoryErrorKind::UnauthorizedError(_inner) => Some(_inner), - ExportMatchmakerLobbyHistoryErrorKind::NotFoundError(_inner) => Some(_inner), - ExportMatchmakerLobbyHistoryErrorKind::BadRequestError(_inner) => Some(_inner), - ExportMatchmakerLobbyHistoryErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `GameBannerUploadComplete` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GameBannerUploadCompleteError { - /// Kind of error that occurred. - pub kind: GameBannerUploadCompleteErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GameBannerUploadComplete` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GameBannerUploadCompleteErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GameBannerUploadCompleteError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GameBannerUploadCompleteErrorKind::InternalError(_inner) => _inner.fmt(f), - GameBannerUploadCompleteErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GameBannerUploadCompleteErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GameBannerUploadCompleteErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GameBannerUploadCompleteErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GameBannerUploadCompleteErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GameBannerUploadCompleteErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GameBannerUploadCompleteError { - fn code(&self) -> Option<&str> { - GameBannerUploadCompleteError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GameBannerUploadCompleteErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - GameBannerUploadCompleteErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl GameBannerUploadCompleteError { - /// Creates a new `GameBannerUploadCompleteError`. - pub fn new(kind: GameBannerUploadCompleteErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GameBannerUploadCompleteError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GameBannerUploadCompleteErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GameBannerUploadCompleteError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GameBannerUploadCompleteErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GameBannerUploadCompleteErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!( - &self.kind, - GameBannerUploadCompleteErrorKind::InternalError(_) - ) - } - /// Returns `true` if the error kind is `GameBannerUploadCompleteErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - GameBannerUploadCompleteErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `GameBannerUploadCompleteErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - GameBannerUploadCompleteErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `GameBannerUploadCompleteErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - GameBannerUploadCompleteErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `GameBannerUploadCompleteErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!( - &self.kind, - GameBannerUploadCompleteErrorKind::NotFoundError(_) - ) - } - /// Returns `true` if the error kind is `GameBannerUploadCompleteErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - GameBannerUploadCompleteErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for GameBannerUploadCompleteError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GameBannerUploadCompleteErrorKind::InternalError(_inner) => Some(_inner), - GameBannerUploadCompleteErrorKind::RateLimitError(_inner) => Some(_inner), - GameBannerUploadCompleteErrorKind::ForbiddenError(_inner) => Some(_inner), - GameBannerUploadCompleteErrorKind::UnauthorizedError(_inner) => Some(_inner), - GameBannerUploadCompleteErrorKind::NotFoundError(_inner) => Some(_inner), - GameBannerUploadCompleteErrorKind::BadRequestError(_inner) => Some(_inner), - GameBannerUploadCompleteErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `GameBannerUploadPrepare` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GameBannerUploadPrepareError { - /// Kind of error that occurred. - pub kind: GameBannerUploadPrepareErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GameBannerUploadPrepare` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GameBannerUploadPrepareErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GameBannerUploadPrepareError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GameBannerUploadPrepareErrorKind::InternalError(_inner) => _inner.fmt(f), - GameBannerUploadPrepareErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GameBannerUploadPrepareErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GameBannerUploadPrepareErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GameBannerUploadPrepareErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GameBannerUploadPrepareErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GameBannerUploadPrepareErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GameBannerUploadPrepareError { - fn code(&self) -> Option<&str> { - GameBannerUploadPrepareError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GameBannerUploadPrepareErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - GameBannerUploadPrepareErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl GameBannerUploadPrepareError { - /// Creates a new `GameBannerUploadPrepareError`. - pub fn new(kind: GameBannerUploadPrepareErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GameBannerUploadPrepareError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GameBannerUploadPrepareErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GameBannerUploadPrepareError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GameBannerUploadPrepareErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GameBannerUploadPrepareErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!( - &self.kind, - GameBannerUploadPrepareErrorKind::InternalError(_) - ) - } - /// Returns `true` if the error kind is `GameBannerUploadPrepareErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - GameBannerUploadPrepareErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `GameBannerUploadPrepareErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - GameBannerUploadPrepareErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `GameBannerUploadPrepareErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - GameBannerUploadPrepareErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `GameBannerUploadPrepareErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!( - &self.kind, - GameBannerUploadPrepareErrorKind::NotFoundError(_) - ) - } - /// Returns `true` if the error kind is `GameBannerUploadPrepareErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - GameBannerUploadPrepareErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for GameBannerUploadPrepareError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GameBannerUploadPrepareErrorKind::InternalError(_inner) => Some(_inner), - GameBannerUploadPrepareErrorKind::RateLimitError(_inner) => Some(_inner), - GameBannerUploadPrepareErrorKind::ForbiddenError(_inner) => Some(_inner), - GameBannerUploadPrepareErrorKind::UnauthorizedError(_inner) => Some(_inner), - GameBannerUploadPrepareErrorKind::NotFoundError(_inner) => Some(_inner), - GameBannerUploadPrepareErrorKind::BadRequestError(_inner) => Some(_inner), - GameBannerUploadPrepareErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `GameLogoUploadComplete` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GameLogoUploadCompleteError { - /// Kind of error that occurred. - pub kind: GameLogoUploadCompleteErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GameLogoUploadComplete` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GameLogoUploadCompleteErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GameLogoUploadCompleteError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GameLogoUploadCompleteErrorKind::InternalError(_inner) => _inner.fmt(f), - GameLogoUploadCompleteErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GameLogoUploadCompleteErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GameLogoUploadCompleteErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GameLogoUploadCompleteErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GameLogoUploadCompleteErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GameLogoUploadCompleteErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GameLogoUploadCompleteError { - fn code(&self) -> Option<&str> { - GameLogoUploadCompleteError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GameLogoUploadCompleteErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - GameLogoUploadCompleteErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl GameLogoUploadCompleteError { - /// Creates a new `GameLogoUploadCompleteError`. - pub fn new(kind: GameLogoUploadCompleteErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GameLogoUploadCompleteError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GameLogoUploadCompleteErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GameLogoUploadCompleteError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GameLogoUploadCompleteErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GameLogoUploadCompleteErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!( - &self.kind, - GameLogoUploadCompleteErrorKind::InternalError(_) - ) - } - /// Returns `true` if the error kind is `GameLogoUploadCompleteErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - GameLogoUploadCompleteErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `GameLogoUploadCompleteErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - GameLogoUploadCompleteErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `GameLogoUploadCompleteErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - GameLogoUploadCompleteErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `GameLogoUploadCompleteErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!( - &self.kind, - GameLogoUploadCompleteErrorKind::NotFoundError(_) - ) - } - /// Returns `true` if the error kind is `GameLogoUploadCompleteErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - GameLogoUploadCompleteErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for GameLogoUploadCompleteError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GameLogoUploadCompleteErrorKind::InternalError(_inner) => Some(_inner), - GameLogoUploadCompleteErrorKind::RateLimitError(_inner) => Some(_inner), - GameLogoUploadCompleteErrorKind::ForbiddenError(_inner) => Some(_inner), - GameLogoUploadCompleteErrorKind::UnauthorizedError(_inner) => Some(_inner), - GameLogoUploadCompleteErrorKind::NotFoundError(_inner) => Some(_inner), - GameLogoUploadCompleteErrorKind::BadRequestError(_inner) => Some(_inner), - GameLogoUploadCompleteErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `GameLogoUploadPrepare` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GameLogoUploadPrepareError { - /// Kind of error that occurred. - pub kind: GameLogoUploadPrepareErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GameLogoUploadPrepare` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GameLogoUploadPrepareErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GameLogoUploadPrepareError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GameLogoUploadPrepareErrorKind::InternalError(_inner) => _inner.fmt(f), - GameLogoUploadPrepareErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GameLogoUploadPrepareErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GameLogoUploadPrepareErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GameLogoUploadPrepareErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GameLogoUploadPrepareErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GameLogoUploadPrepareErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GameLogoUploadPrepareError { - fn code(&self) -> Option<&str> { - GameLogoUploadPrepareError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GameLogoUploadPrepareErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - GameLogoUploadPrepareErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl GameLogoUploadPrepareError { - /// Creates a new `GameLogoUploadPrepareError`. - pub fn new(kind: GameLogoUploadPrepareErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GameLogoUploadPrepareError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GameLogoUploadPrepareErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GameLogoUploadPrepareError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GameLogoUploadPrepareErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GameLogoUploadPrepareErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, GameLogoUploadPrepareErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `GameLogoUploadPrepareErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - GameLogoUploadPrepareErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `GameLogoUploadPrepareErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - GameLogoUploadPrepareErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `GameLogoUploadPrepareErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - GameLogoUploadPrepareErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `GameLogoUploadPrepareErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, GameLogoUploadPrepareErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `GameLogoUploadPrepareErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - GameLogoUploadPrepareErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for GameLogoUploadPrepareError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GameLogoUploadPrepareErrorKind::InternalError(_inner) => Some(_inner), - GameLogoUploadPrepareErrorKind::RateLimitError(_inner) => Some(_inner), - GameLogoUploadPrepareErrorKind::ForbiddenError(_inner) => Some(_inner), - GameLogoUploadPrepareErrorKind::UnauthorizedError(_inner) => Some(_inner), - GameLogoUploadPrepareErrorKind::NotFoundError(_inner) => Some(_inner), - GameLogoUploadPrepareErrorKind::BadRequestError(_inner) => Some(_inner), - GameLogoUploadPrepareErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `GetGameBilling` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GetGameBillingError { - /// Kind of error that occurred. - pub kind: GetGameBillingErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GetGameBilling` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GetGameBillingErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GetGameBillingError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GetGameBillingErrorKind::InternalError(_inner) => _inner.fmt(f), - GetGameBillingErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GetGameBillingErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GetGameBillingErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GetGameBillingErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GetGameBillingErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GetGameBillingErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GetGameBillingError { - fn code(&self) -> Option<&str> { - GetGameBillingError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GetGameBillingErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - GetGameBillingErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl GetGameBillingError { - /// Creates a new `GetGameBillingError`. - pub fn new(kind: GetGameBillingErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GetGameBillingError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GetGameBillingErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GetGameBillingError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GetGameBillingErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GetGameBillingErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, GetGameBillingErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `GetGameBillingErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, GetGameBillingErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `GetGameBillingErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, GetGameBillingErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `GetGameBillingErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, GetGameBillingErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `GetGameBillingErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, GetGameBillingErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `GetGameBillingErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, GetGameBillingErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for GetGameBillingError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GetGameBillingErrorKind::InternalError(_inner) => Some(_inner), - GetGameBillingErrorKind::RateLimitError(_inner) => Some(_inner), - GetGameBillingErrorKind::ForbiddenError(_inner) => Some(_inner), - GetGameBillingErrorKind::UnauthorizedError(_inner) => Some(_inner), - GetGameBillingErrorKind::NotFoundError(_inner) => Some(_inner), - GetGameBillingErrorKind::BadRequestError(_inner) => Some(_inner), - GetGameBillingErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `GetGameBillingPlans` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GetGameBillingPlansError { - /// Kind of error that occurred. - pub kind: GetGameBillingPlansErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GetGameBillingPlans` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GetGameBillingPlansErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GetGameBillingPlansError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GetGameBillingPlansErrorKind::InternalError(_inner) => _inner.fmt(f), - GetGameBillingPlansErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GetGameBillingPlansErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GetGameBillingPlansErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GetGameBillingPlansErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GetGameBillingPlansErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GetGameBillingPlansErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GetGameBillingPlansError { - fn code(&self) -> Option<&str> { - GetGameBillingPlansError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GetGameBillingPlansErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - GetGameBillingPlansErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl GetGameBillingPlansError { - /// Creates a new `GetGameBillingPlansError`. - pub fn new(kind: GetGameBillingPlansErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GetGameBillingPlansError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GetGameBillingPlansErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GetGameBillingPlansError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GetGameBillingPlansErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GetGameBillingPlansErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, GetGameBillingPlansErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `GetGameBillingPlansErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, GetGameBillingPlansErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `GetGameBillingPlansErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, GetGameBillingPlansErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `GetGameBillingPlansErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - GetGameBillingPlansErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `GetGameBillingPlansErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, GetGameBillingPlansErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `GetGameBillingPlansErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, GetGameBillingPlansErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for GetGameBillingPlansError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GetGameBillingPlansErrorKind::InternalError(_inner) => Some(_inner), - GetGameBillingPlansErrorKind::RateLimitError(_inner) => Some(_inner), - GetGameBillingPlansErrorKind::ForbiddenError(_inner) => Some(_inner), - GetGameBillingPlansErrorKind::UnauthorizedError(_inner) => Some(_inner), - GetGameBillingPlansErrorKind::NotFoundError(_inner) => Some(_inner), - GetGameBillingPlansErrorKind::BadRequestError(_inner) => Some(_inner), - GetGameBillingPlansErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `GetGameById` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GetGameByIdError { - /// Kind of error that occurred. - pub kind: GetGameByIdErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GetGameById` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GetGameByIdErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GetGameByIdError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GetGameByIdErrorKind::InternalError(_inner) => _inner.fmt(f), - GetGameByIdErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GetGameByIdErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GetGameByIdErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GetGameByIdErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GetGameByIdErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GetGameByIdErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GetGameByIdError { - fn code(&self) -> Option<&str> { - GetGameByIdError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GetGameByIdErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - GetGameByIdErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl GetGameByIdError { - /// Creates a new `GetGameByIdError`. - pub fn new(kind: GetGameByIdErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GetGameByIdError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GetGameByIdErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GetGameByIdError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GetGameByIdErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GetGameByIdErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, GetGameByIdErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `GetGameByIdErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, GetGameByIdErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `GetGameByIdErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, GetGameByIdErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `GetGameByIdErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, GetGameByIdErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `GetGameByIdErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, GetGameByIdErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `GetGameByIdErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, GetGameByIdErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for GetGameByIdError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GetGameByIdErrorKind::InternalError(_inner) => Some(_inner), - GetGameByIdErrorKind::RateLimitError(_inner) => Some(_inner), - GetGameByIdErrorKind::ForbiddenError(_inner) => Some(_inner), - GetGameByIdErrorKind::UnauthorizedError(_inner) => Some(_inner), - GetGameByIdErrorKind::NotFoundError(_inner) => Some(_inner), - GetGameByIdErrorKind::BadRequestError(_inner) => Some(_inner), - GetGameByIdErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `GetGameNamespaceById` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GetGameNamespaceByIdError { - /// Kind of error that occurred. - pub kind: GetGameNamespaceByIdErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GetGameNamespaceById` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GetGameNamespaceByIdErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GetGameNamespaceByIdError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GetGameNamespaceByIdErrorKind::InternalError(_inner) => _inner.fmt(f), - GetGameNamespaceByIdErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GetGameNamespaceByIdErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GetGameNamespaceByIdErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GetGameNamespaceByIdErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GetGameNamespaceByIdErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GetGameNamespaceByIdErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GetGameNamespaceByIdError { - fn code(&self) -> Option<&str> { - GetGameNamespaceByIdError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GetGameNamespaceByIdErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - GetGameNamespaceByIdErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl GetGameNamespaceByIdError { - /// Creates a new `GetGameNamespaceByIdError`. - pub fn new(kind: GetGameNamespaceByIdErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GetGameNamespaceByIdError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GetGameNamespaceByIdErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GetGameNamespaceByIdError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GetGameNamespaceByIdErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GetGameNamespaceByIdErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, GetGameNamespaceByIdErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `GetGameNamespaceByIdErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, GetGameNamespaceByIdErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `GetGameNamespaceByIdErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, GetGameNamespaceByIdErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `GetGameNamespaceByIdErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - GetGameNamespaceByIdErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `GetGameNamespaceByIdErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, GetGameNamespaceByIdErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `GetGameNamespaceByIdErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - GetGameNamespaceByIdErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for GetGameNamespaceByIdError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GetGameNamespaceByIdErrorKind::InternalError(_inner) => Some(_inner), - GetGameNamespaceByIdErrorKind::RateLimitError(_inner) => Some(_inner), - GetGameNamespaceByIdErrorKind::ForbiddenError(_inner) => Some(_inner), - GetGameNamespaceByIdErrorKind::UnauthorizedError(_inner) => Some(_inner), - GetGameNamespaceByIdErrorKind::NotFoundError(_inner) => Some(_inner), - GetGameNamespaceByIdErrorKind::BadRequestError(_inner) => Some(_inner), - GetGameNamespaceByIdErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `GetGames` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GetGamesError { - /// Kind of error that occurred. - pub kind: GetGamesErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GetGames` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GetGamesErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GetGamesError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GetGamesErrorKind::InternalError(_inner) => _inner.fmt(f), - GetGamesErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GetGamesErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GetGamesErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GetGamesErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GetGamesErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GetGamesErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GetGamesError { - fn code(&self) -> Option<&str> { - GetGamesError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GetGamesErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - GetGamesErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl GetGamesError { - /// Creates a new `GetGamesError`. - pub fn new(kind: GetGamesErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GetGamesError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GetGamesErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GetGamesError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GetGamesErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GetGamesErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, GetGamesErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `GetGamesErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, GetGamesErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `GetGamesErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, GetGamesErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `GetGamesErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, GetGamesErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `GetGamesErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, GetGamesErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `GetGamesErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, GetGamesErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for GetGamesError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GetGamesErrorKind::InternalError(_inner) => Some(_inner), - GetGamesErrorKind::RateLimitError(_inner) => Some(_inner), - GetGamesErrorKind::ForbiddenError(_inner) => Some(_inner), - GetGamesErrorKind::UnauthorizedError(_inner) => Some(_inner), - GetGamesErrorKind::NotFoundError(_inner) => Some(_inner), - GetGamesErrorKind::BadRequestError(_inner) => Some(_inner), - GetGamesErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `GetGameVersionById` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GetGameVersionByIdError { - /// Kind of error that occurred. - pub kind: GetGameVersionByIdErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GetGameVersionById` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GetGameVersionByIdErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GetGameVersionByIdError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GetGameVersionByIdErrorKind::InternalError(_inner) => _inner.fmt(f), - GetGameVersionByIdErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GetGameVersionByIdErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GetGameVersionByIdErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GetGameVersionByIdErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GetGameVersionByIdErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GetGameVersionByIdErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GetGameVersionByIdError { - fn code(&self) -> Option<&str> { - GetGameVersionByIdError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GetGameVersionByIdErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - GetGameVersionByIdErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl GetGameVersionByIdError { - /// Creates a new `GetGameVersionByIdError`. - pub fn new(kind: GetGameVersionByIdErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GetGameVersionByIdError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GetGameVersionByIdErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GetGameVersionByIdError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GetGameVersionByIdErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GetGameVersionByIdErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, GetGameVersionByIdErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `GetGameVersionByIdErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, GetGameVersionByIdErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `GetGameVersionByIdErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, GetGameVersionByIdErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `GetGameVersionByIdErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - GetGameVersionByIdErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `GetGameVersionByIdErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, GetGameVersionByIdErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `GetGameVersionByIdErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, GetGameVersionByIdErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for GetGameVersionByIdError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GetGameVersionByIdErrorKind::InternalError(_inner) => Some(_inner), - GetGameVersionByIdErrorKind::RateLimitError(_inner) => Some(_inner), - GetGameVersionByIdErrorKind::ForbiddenError(_inner) => Some(_inner), - GetGameVersionByIdErrorKind::UnauthorizedError(_inner) => Some(_inner), - GetGameVersionByIdErrorKind::NotFoundError(_inner) => Some(_inner), - GetGameVersionByIdErrorKind::BadRequestError(_inner) => Some(_inner), - GetGameVersionByIdErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `GetGroupBilling` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GetGroupBillingError { - /// Kind of error that occurred. - pub kind: GetGroupBillingErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GetGroupBilling` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GetGroupBillingErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GetGroupBillingError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GetGroupBillingErrorKind::InternalError(_inner) => _inner.fmt(f), - GetGroupBillingErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GetGroupBillingErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GetGroupBillingErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GetGroupBillingErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GetGroupBillingErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GetGroupBillingErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GetGroupBillingError { - fn code(&self) -> Option<&str> { - GetGroupBillingError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GetGroupBillingErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - GetGroupBillingErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl GetGroupBillingError { - /// Creates a new `GetGroupBillingError`. - pub fn new(kind: GetGroupBillingErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GetGroupBillingError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GetGroupBillingErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GetGroupBillingError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GetGroupBillingErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GetGroupBillingErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, GetGroupBillingErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `GetGroupBillingErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, GetGroupBillingErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `GetGroupBillingErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, GetGroupBillingErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `GetGroupBillingErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, GetGroupBillingErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `GetGroupBillingErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, GetGroupBillingErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `GetGroupBillingErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, GetGroupBillingErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for GetGroupBillingError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GetGroupBillingErrorKind::InternalError(_inner) => Some(_inner), - GetGroupBillingErrorKind::RateLimitError(_inner) => Some(_inner), - GetGroupBillingErrorKind::ForbiddenError(_inner) => Some(_inner), - GetGroupBillingErrorKind::UnauthorizedError(_inner) => Some(_inner), - GetGroupBillingErrorKind::NotFoundError(_inner) => Some(_inner), - GetGroupBillingErrorKind::BadRequestError(_inner) => Some(_inner), - GetGroupBillingErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `GetGroupInvoicesList` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GetGroupInvoicesListError { - /// Kind of error that occurred. - pub kind: GetGroupInvoicesListErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GetGroupInvoicesList` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GetGroupInvoicesListErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GetGroupInvoicesListError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GetGroupInvoicesListErrorKind::InternalError(_inner) => _inner.fmt(f), - GetGroupInvoicesListErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GetGroupInvoicesListErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GetGroupInvoicesListErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GetGroupInvoicesListErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GetGroupInvoicesListErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GetGroupInvoicesListErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GetGroupInvoicesListError { - fn code(&self) -> Option<&str> { - GetGroupInvoicesListError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GetGroupInvoicesListErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - GetGroupInvoicesListErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl GetGroupInvoicesListError { - /// Creates a new `GetGroupInvoicesListError`. - pub fn new(kind: GetGroupInvoicesListErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GetGroupInvoicesListError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GetGroupInvoicesListErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GetGroupInvoicesListError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GetGroupInvoicesListErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GetGroupInvoicesListErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, GetGroupInvoicesListErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `GetGroupInvoicesListErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, GetGroupInvoicesListErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `GetGroupInvoicesListErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, GetGroupInvoicesListErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `GetGroupInvoicesListErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - GetGroupInvoicesListErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `GetGroupInvoicesListErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, GetGroupInvoicesListErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `GetGroupInvoicesListErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - GetGroupInvoicesListErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for GetGroupInvoicesListError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GetGroupInvoicesListErrorKind::InternalError(_inner) => Some(_inner), - GetGroupInvoicesListErrorKind::RateLimitError(_inner) => Some(_inner), - GetGroupInvoicesListErrorKind::ForbiddenError(_inner) => Some(_inner), - GetGroupInvoicesListErrorKind::UnauthorizedError(_inner) => Some(_inner), - GetGroupInvoicesListErrorKind::NotFoundError(_inner) => Some(_inner), - GetGroupInvoicesListErrorKind::BadRequestError(_inner) => Some(_inner), - GetGroupInvoicesListErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `GetLobbyLogs` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GetLobbyLogsError { - /// Kind of error that occurred. - pub kind: GetLobbyLogsErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GetLobbyLogs` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GetLobbyLogsErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GetLobbyLogsError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GetLobbyLogsErrorKind::InternalError(_inner) => _inner.fmt(f), - GetLobbyLogsErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GetLobbyLogsErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GetLobbyLogsErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GetLobbyLogsErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GetLobbyLogsErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GetLobbyLogsErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GetLobbyLogsError { - fn code(&self) -> Option<&str> { - GetLobbyLogsError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GetLobbyLogsErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - GetLobbyLogsErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl GetLobbyLogsError { - /// Creates a new `GetLobbyLogsError`. - pub fn new(kind: GetLobbyLogsErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GetLobbyLogsError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GetLobbyLogsErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GetLobbyLogsError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GetLobbyLogsErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GetLobbyLogsErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, GetLobbyLogsErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `GetLobbyLogsErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, GetLobbyLogsErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `GetLobbyLogsErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, GetLobbyLogsErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `GetLobbyLogsErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, GetLobbyLogsErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `GetLobbyLogsErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, GetLobbyLogsErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `GetLobbyLogsErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, GetLobbyLogsErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for GetLobbyLogsError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GetLobbyLogsErrorKind::InternalError(_inner) => Some(_inner), - GetLobbyLogsErrorKind::RateLimitError(_inner) => Some(_inner), - GetLobbyLogsErrorKind::ForbiddenError(_inner) => Some(_inner), - GetLobbyLogsErrorKind::UnauthorizedError(_inner) => Some(_inner), - GetLobbyLogsErrorKind::NotFoundError(_inner) => Some(_inner), - GetLobbyLogsErrorKind::BadRequestError(_inner) => Some(_inner), - GetLobbyLogsErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `GetNamespaceAnalyticsMatchmakerLive` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GetNamespaceAnalyticsMatchmakerLiveError { - /// Kind of error that occurred. - pub kind: GetNamespaceAnalyticsMatchmakerLiveErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GetNamespaceAnalyticsMatchmakerLive` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GetNamespaceAnalyticsMatchmakerLiveErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GetNamespaceAnalyticsMatchmakerLiveError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GetNamespaceAnalyticsMatchmakerLiveErrorKind::InternalError(_inner) => _inner.fmt(f), - GetNamespaceAnalyticsMatchmakerLiveErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GetNamespaceAnalyticsMatchmakerLiveErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GetNamespaceAnalyticsMatchmakerLiveErrorKind::UnauthorizedError(_inner) => { - _inner.fmt(f) - } - GetNamespaceAnalyticsMatchmakerLiveErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GetNamespaceAnalyticsMatchmakerLiveErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GetNamespaceAnalyticsMatchmakerLiveErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GetNamespaceAnalyticsMatchmakerLiveError { - fn code(&self) -> Option<&str> { - GetNamespaceAnalyticsMatchmakerLiveError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GetNamespaceAnalyticsMatchmakerLiveErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - GetNamespaceAnalyticsMatchmakerLiveErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl GetNamespaceAnalyticsMatchmakerLiveError { - /// Creates a new `GetNamespaceAnalyticsMatchmakerLiveError`. - pub fn new( - kind: GetNamespaceAnalyticsMatchmakerLiveErrorKind, - meta: aws_smithy_types::Error, - ) -> Self { - Self { kind, meta } - } - - /// Creates the `GetNamespaceAnalyticsMatchmakerLiveError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GetNamespaceAnalyticsMatchmakerLiveErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GetNamespaceAnalyticsMatchmakerLiveError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GetNamespaceAnalyticsMatchmakerLiveErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GetNamespaceAnalyticsMatchmakerLiveErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!( - &self.kind, - GetNamespaceAnalyticsMatchmakerLiveErrorKind::InternalError(_) - ) - } - /// Returns `true` if the error kind is `GetNamespaceAnalyticsMatchmakerLiveErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - GetNamespaceAnalyticsMatchmakerLiveErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `GetNamespaceAnalyticsMatchmakerLiveErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - GetNamespaceAnalyticsMatchmakerLiveErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `GetNamespaceAnalyticsMatchmakerLiveErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - GetNamespaceAnalyticsMatchmakerLiveErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `GetNamespaceAnalyticsMatchmakerLiveErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!( - &self.kind, - GetNamespaceAnalyticsMatchmakerLiveErrorKind::NotFoundError(_) - ) - } - /// Returns `true` if the error kind is `GetNamespaceAnalyticsMatchmakerLiveErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - GetNamespaceAnalyticsMatchmakerLiveErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for GetNamespaceAnalyticsMatchmakerLiveError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GetNamespaceAnalyticsMatchmakerLiveErrorKind::InternalError(_inner) => Some(_inner), - GetNamespaceAnalyticsMatchmakerLiveErrorKind::RateLimitError(_inner) => Some(_inner), - GetNamespaceAnalyticsMatchmakerLiveErrorKind::ForbiddenError(_inner) => Some(_inner), - GetNamespaceAnalyticsMatchmakerLiveErrorKind::UnauthorizedError(_inner) => Some(_inner), - GetNamespaceAnalyticsMatchmakerLiveErrorKind::NotFoundError(_inner) => Some(_inner), - GetNamespaceAnalyticsMatchmakerLiveErrorKind::BadRequestError(_inner) => Some(_inner), - GetNamespaceAnalyticsMatchmakerLiveErrorKind::Unhandled(_inner) => { - Some(_inner.as_ref()) - } - } - } -} - -/// Error type for the `GetNamespaceLobby` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GetNamespaceLobbyError { - /// Kind of error that occurred. - pub kind: GetNamespaceLobbyErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GetNamespaceLobby` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GetNamespaceLobbyErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GetNamespaceLobbyError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GetNamespaceLobbyErrorKind::InternalError(_inner) => _inner.fmt(f), - GetNamespaceLobbyErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GetNamespaceLobbyErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GetNamespaceLobbyErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GetNamespaceLobbyErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GetNamespaceLobbyErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GetNamespaceLobbyErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GetNamespaceLobbyError { - fn code(&self) -> Option<&str> { - GetNamespaceLobbyError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GetNamespaceLobbyErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - GetNamespaceLobbyErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl GetNamespaceLobbyError { - /// Creates a new `GetNamespaceLobbyError`. - pub fn new(kind: GetNamespaceLobbyErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GetNamespaceLobbyError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GetNamespaceLobbyErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GetNamespaceLobbyError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GetNamespaceLobbyErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GetNamespaceLobbyErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, GetNamespaceLobbyErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `GetNamespaceLobbyErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, GetNamespaceLobbyErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `GetNamespaceLobbyErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, GetNamespaceLobbyErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `GetNamespaceLobbyErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, GetNamespaceLobbyErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `GetNamespaceLobbyErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, GetNamespaceLobbyErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `GetNamespaceLobbyErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, GetNamespaceLobbyErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for GetNamespaceLobbyError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GetNamespaceLobbyErrorKind::InternalError(_inner) => Some(_inner), - GetNamespaceLobbyErrorKind::RateLimitError(_inner) => Some(_inner), - GetNamespaceLobbyErrorKind::ForbiddenError(_inner) => Some(_inner), - GetNamespaceLobbyErrorKind::UnauthorizedError(_inner) => Some(_inner), - GetNamespaceLobbyErrorKind::NotFoundError(_inner) => Some(_inner), - GetNamespaceLobbyErrorKind::BadRequestError(_inner) => Some(_inner), - GetNamespaceLobbyErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `GetRayPerfLogs` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GetRayPerfLogsError { - /// Kind of error that occurred. - pub kind: GetRayPerfLogsErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GetRayPerfLogs` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GetRayPerfLogsErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GetRayPerfLogsError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GetRayPerfLogsErrorKind::InternalError(_inner) => _inner.fmt(f), - GetRayPerfLogsErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GetRayPerfLogsErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GetRayPerfLogsErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GetRayPerfLogsErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GetRayPerfLogsErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GetRayPerfLogsErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GetRayPerfLogsError { - fn code(&self) -> Option<&str> { - GetRayPerfLogsError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GetRayPerfLogsErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - GetRayPerfLogsErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl GetRayPerfLogsError { - /// Creates a new `GetRayPerfLogsError`. - pub fn new(kind: GetRayPerfLogsErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GetRayPerfLogsError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GetRayPerfLogsErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GetRayPerfLogsError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GetRayPerfLogsErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GetRayPerfLogsErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, GetRayPerfLogsErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `GetRayPerfLogsErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, GetRayPerfLogsErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `GetRayPerfLogsErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, GetRayPerfLogsErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `GetRayPerfLogsErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, GetRayPerfLogsErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `GetRayPerfLogsErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, GetRayPerfLogsErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `GetRayPerfLogsErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, GetRayPerfLogsErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for GetRayPerfLogsError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GetRayPerfLogsErrorKind::InternalError(_inner) => Some(_inner), - GetRayPerfLogsErrorKind::RateLimitError(_inner) => Some(_inner), - GetRayPerfLogsErrorKind::ForbiddenError(_inner) => Some(_inner), - GetRayPerfLogsErrorKind::UnauthorizedError(_inner) => Some(_inner), - GetRayPerfLogsErrorKind::NotFoundError(_inner) => Some(_inner), - GetRayPerfLogsErrorKind::BadRequestError(_inner) => Some(_inner), - GetRayPerfLogsErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `GetRegionTiers` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GetRegionTiersError { - /// Kind of error that occurred. - pub kind: GetRegionTiersErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GetRegionTiers` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GetRegionTiersErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GetRegionTiersError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GetRegionTiersErrorKind::InternalError(_inner) => _inner.fmt(f), - GetRegionTiersErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GetRegionTiersErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GetRegionTiersErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GetRegionTiersErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GetRegionTiersErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GetRegionTiersErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GetRegionTiersError { - fn code(&self) -> Option<&str> { - GetRegionTiersError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GetRegionTiersErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - GetRegionTiersErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl GetRegionTiersError { - /// Creates a new `GetRegionTiersError`. - pub fn new(kind: GetRegionTiersErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GetRegionTiersError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GetRegionTiersErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GetRegionTiersError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GetRegionTiersErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GetRegionTiersErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, GetRegionTiersErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `GetRegionTiersErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, GetRegionTiersErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `GetRegionTiersErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, GetRegionTiersErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `GetRegionTiersErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, GetRegionTiersErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `GetRegionTiersErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, GetRegionTiersErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `GetRegionTiersErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, GetRegionTiersErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for GetRegionTiersError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GetRegionTiersErrorKind::InternalError(_inner) => Some(_inner), - GetRegionTiersErrorKind::RateLimitError(_inner) => Some(_inner), - GetRegionTiersErrorKind::ForbiddenError(_inner) => Some(_inner), - GetRegionTiersErrorKind::UnauthorizedError(_inner) => Some(_inner), - GetRegionTiersErrorKind::NotFoundError(_inner) => Some(_inner), - GetRegionTiersErrorKind::BadRequestError(_inner) => Some(_inner), - GetRegionTiersErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `GroupBillingCheckout` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GroupBillingCheckoutError { - /// Kind of error that occurred. - pub kind: GroupBillingCheckoutErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GroupBillingCheckout` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GroupBillingCheckoutErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GroupBillingCheckoutError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GroupBillingCheckoutErrorKind::InternalError(_inner) => _inner.fmt(f), - GroupBillingCheckoutErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GroupBillingCheckoutErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GroupBillingCheckoutErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GroupBillingCheckoutErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GroupBillingCheckoutErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GroupBillingCheckoutErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GroupBillingCheckoutError { - fn code(&self) -> Option<&str> { - GroupBillingCheckoutError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GroupBillingCheckoutErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - GroupBillingCheckoutErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl GroupBillingCheckoutError { - /// Creates a new `GroupBillingCheckoutError`. - pub fn new(kind: GroupBillingCheckoutErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GroupBillingCheckoutError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GroupBillingCheckoutErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GroupBillingCheckoutError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GroupBillingCheckoutErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GroupBillingCheckoutErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, GroupBillingCheckoutErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `GroupBillingCheckoutErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, GroupBillingCheckoutErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `GroupBillingCheckoutErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, GroupBillingCheckoutErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `GroupBillingCheckoutErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - GroupBillingCheckoutErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `GroupBillingCheckoutErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, GroupBillingCheckoutErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `GroupBillingCheckoutErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - GroupBillingCheckoutErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for GroupBillingCheckoutError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GroupBillingCheckoutErrorKind::InternalError(_inner) => Some(_inner), - GroupBillingCheckoutErrorKind::RateLimitError(_inner) => Some(_inner), - GroupBillingCheckoutErrorKind::ForbiddenError(_inner) => Some(_inner), - GroupBillingCheckoutErrorKind::UnauthorizedError(_inner) => Some(_inner), - GroupBillingCheckoutErrorKind::NotFoundError(_inner) => Some(_inner), - GroupBillingCheckoutErrorKind::BadRequestError(_inner) => Some(_inner), - GroupBillingCheckoutErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `Inspect` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct InspectError { - /// Kind of error that occurred. - pub kind: InspectErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `Inspect` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum InspectErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for InspectError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - InspectErrorKind::InternalError(_inner) => _inner.fmt(f), - InspectErrorKind::RateLimitError(_inner) => _inner.fmt(f), - InspectErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - InspectErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - InspectErrorKind::NotFoundError(_inner) => _inner.fmt(f), - InspectErrorKind::BadRequestError(_inner) => _inner.fmt(f), - InspectErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for InspectError { - fn code(&self) -> Option<&str> { - InspectError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - InspectErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - InspectErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl InspectError { - /// Creates a new `InspectError`. - pub fn new(kind: InspectErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `InspectError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: InspectErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `InspectError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: InspectErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `InspectErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, InspectErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `InspectErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, InspectErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `InspectErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, InspectErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `InspectErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, InspectErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `InspectErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, InspectErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `InspectErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, InspectErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for InspectError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - InspectErrorKind::InternalError(_inner) => Some(_inner), - InspectErrorKind::RateLimitError(_inner) => Some(_inner), - InspectErrorKind::ForbiddenError(_inner) => Some(_inner), - InspectErrorKind::UnauthorizedError(_inner) => Some(_inner), - InspectErrorKind::NotFoundError(_inner) => Some(_inner), - InspectErrorKind::BadRequestError(_inner) => Some(_inner), - InspectErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `ListGameBuilds` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct ListGameBuildsError { - /// Kind of error that occurred. - pub kind: ListGameBuildsErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `ListGameBuilds` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum ListGameBuildsErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for ListGameBuildsError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - ListGameBuildsErrorKind::InternalError(_inner) => _inner.fmt(f), - ListGameBuildsErrorKind::RateLimitError(_inner) => _inner.fmt(f), - ListGameBuildsErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - ListGameBuildsErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - ListGameBuildsErrorKind::NotFoundError(_inner) => _inner.fmt(f), - ListGameBuildsErrorKind::BadRequestError(_inner) => _inner.fmt(f), - ListGameBuildsErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for ListGameBuildsError { - fn code(&self) -> Option<&str> { - ListGameBuildsError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - ListGameBuildsErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - ListGameBuildsErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl ListGameBuildsError { - /// Creates a new `ListGameBuildsError`. - pub fn new(kind: ListGameBuildsErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `ListGameBuildsError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: ListGameBuildsErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `ListGameBuildsError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: ListGameBuildsErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `ListGameBuildsErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, ListGameBuildsErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `ListGameBuildsErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, ListGameBuildsErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `ListGameBuildsErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, ListGameBuildsErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `ListGameBuildsErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, ListGameBuildsErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `ListGameBuildsErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, ListGameBuildsErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `ListGameBuildsErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, ListGameBuildsErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for ListGameBuildsError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - ListGameBuildsErrorKind::InternalError(_inner) => Some(_inner), - ListGameBuildsErrorKind::RateLimitError(_inner) => Some(_inner), - ListGameBuildsErrorKind::ForbiddenError(_inner) => Some(_inner), - ListGameBuildsErrorKind::UnauthorizedError(_inner) => Some(_inner), - ListGameBuildsErrorKind::NotFoundError(_inner) => Some(_inner), - ListGameBuildsErrorKind::BadRequestError(_inner) => Some(_inner), - ListGameBuildsErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `ListGameCdnSites` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct ListGameCdnSitesError { - /// Kind of error that occurred. - pub kind: ListGameCdnSitesErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `ListGameCdnSites` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum ListGameCdnSitesErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for ListGameCdnSitesError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - ListGameCdnSitesErrorKind::InternalError(_inner) => _inner.fmt(f), - ListGameCdnSitesErrorKind::RateLimitError(_inner) => _inner.fmt(f), - ListGameCdnSitesErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - ListGameCdnSitesErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - ListGameCdnSitesErrorKind::NotFoundError(_inner) => _inner.fmt(f), - ListGameCdnSitesErrorKind::BadRequestError(_inner) => _inner.fmt(f), - ListGameCdnSitesErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for ListGameCdnSitesError { - fn code(&self) -> Option<&str> { - ListGameCdnSitesError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - ListGameCdnSitesErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - ListGameCdnSitesErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl ListGameCdnSitesError { - /// Creates a new `ListGameCdnSitesError`. - pub fn new(kind: ListGameCdnSitesErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `ListGameCdnSitesError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: ListGameCdnSitesErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `ListGameCdnSitesError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: ListGameCdnSitesErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `ListGameCdnSitesErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, ListGameCdnSitesErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `ListGameCdnSitesErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, ListGameCdnSitesErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `ListGameCdnSitesErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, ListGameCdnSitesErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `ListGameCdnSitesErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, ListGameCdnSitesErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `ListGameCdnSitesErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, ListGameCdnSitesErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `ListGameCdnSitesErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, ListGameCdnSitesErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for ListGameCdnSitesError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - ListGameCdnSitesErrorKind::InternalError(_inner) => Some(_inner), - ListGameCdnSitesErrorKind::RateLimitError(_inner) => Some(_inner), - ListGameCdnSitesErrorKind::ForbiddenError(_inner) => Some(_inner), - ListGameCdnSitesErrorKind::UnauthorizedError(_inner) => Some(_inner), - ListGameCdnSitesErrorKind::NotFoundError(_inner) => Some(_inner), - ListGameCdnSitesErrorKind::BadRequestError(_inner) => Some(_inner), - ListGameCdnSitesErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `ListGameCustomAvatars` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct ListGameCustomAvatarsError { - /// Kind of error that occurred. - pub kind: ListGameCustomAvatarsErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `ListGameCustomAvatars` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum ListGameCustomAvatarsErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for ListGameCustomAvatarsError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - ListGameCustomAvatarsErrorKind::InternalError(_inner) => _inner.fmt(f), - ListGameCustomAvatarsErrorKind::RateLimitError(_inner) => _inner.fmt(f), - ListGameCustomAvatarsErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - ListGameCustomAvatarsErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - ListGameCustomAvatarsErrorKind::NotFoundError(_inner) => _inner.fmt(f), - ListGameCustomAvatarsErrorKind::BadRequestError(_inner) => _inner.fmt(f), - ListGameCustomAvatarsErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for ListGameCustomAvatarsError { - fn code(&self) -> Option<&str> { - ListGameCustomAvatarsError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - ListGameCustomAvatarsErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - ListGameCustomAvatarsErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl ListGameCustomAvatarsError { - /// Creates a new `ListGameCustomAvatarsError`. - pub fn new(kind: ListGameCustomAvatarsErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `ListGameCustomAvatarsError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: ListGameCustomAvatarsErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `ListGameCustomAvatarsError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: ListGameCustomAvatarsErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `ListGameCustomAvatarsErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, ListGameCustomAvatarsErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `ListGameCustomAvatarsErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - ListGameCustomAvatarsErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `ListGameCustomAvatarsErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - ListGameCustomAvatarsErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `ListGameCustomAvatarsErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - ListGameCustomAvatarsErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `ListGameCustomAvatarsErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, ListGameCustomAvatarsErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `ListGameCustomAvatarsErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - ListGameCustomAvatarsErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for ListGameCustomAvatarsError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - ListGameCustomAvatarsErrorKind::InternalError(_inner) => Some(_inner), - ListGameCustomAvatarsErrorKind::RateLimitError(_inner) => Some(_inner), - ListGameCustomAvatarsErrorKind::ForbiddenError(_inner) => Some(_inner), - ListGameCustomAvatarsErrorKind::UnauthorizedError(_inner) => Some(_inner), - ListGameCustomAvatarsErrorKind::NotFoundError(_inner) => Some(_inner), - ListGameCustomAvatarsErrorKind::BadRequestError(_inner) => Some(_inner), - ListGameCustomAvatarsErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `ListNamespaceLobbies` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct ListNamespaceLobbiesError { - /// Kind of error that occurred. - pub kind: ListNamespaceLobbiesErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `ListNamespaceLobbies` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum ListNamespaceLobbiesErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for ListNamespaceLobbiesError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - ListNamespaceLobbiesErrorKind::InternalError(_inner) => _inner.fmt(f), - ListNamespaceLobbiesErrorKind::RateLimitError(_inner) => _inner.fmt(f), - ListNamespaceLobbiesErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - ListNamespaceLobbiesErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - ListNamespaceLobbiesErrorKind::NotFoundError(_inner) => _inner.fmt(f), - ListNamespaceLobbiesErrorKind::BadRequestError(_inner) => _inner.fmt(f), - ListNamespaceLobbiesErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for ListNamespaceLobbiesError { - fn code(&self) -> Option<&str> { - ListNamespaceLobbiesError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - ListNamespaceLobbiesErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - ListNamespaceLobbiesErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl ListNamespaceLobbiesError { - /// Creates a new `ListNamespaceLobbiesError`. - pub fn new(kind: ListNamespaceLobbiesErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `ListNamespaceLobbiesError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: ListNamespaceLobbiesErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `ListNamespaceLobbiesError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: ListNamespaceLobbiesErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `ListNamespaceLobbiesErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, ListNamespaceLobbiesErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `ListNamespaceLobbiesErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, ListNamespaceLobbiesErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `ListNamespaceLobbiesErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, ListNamespaceLobbiesErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `ListNamespaceLobbiesErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - ListNamespaceLobbiesErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `ListNamespaceLobbiesErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, ListNamespaceLobbiesErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `ListNamespaceLobbiesErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - ListNamespaceLobbiesErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for ListNamespaceLobbiesError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - ListNamespaceLobbiesErrorKind::InternalError(_inner) => Some(_inner), - ListNamespaceLobbiesErrorKind::RateLimitError(_inner) => Some(_inner), - ListNamespaceLobbiesErrorKind::ForbiddenError(_inner) => Some(_inner), - ListNamespaceLobbiesErrorKind::UnauthorizedError(_inner) => Some(_inner), - ListNamespaceLobbiesErrorKind::NotFoundError(_inner) => Some(_inner), - ListNamespaceLobbiesErrorKind::BadRequestError(_inner) => Some(_inner), - ListNamespaceLobbiesErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `PrepareCustomAvatarUpload` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct PrepareCustomAvatarUploadError { - /// Kind of error that occurred. - pub kind: PrepareCustomAvatarUploadErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `PrepareCustomAvatarUpload` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum PrepareCustomAvatarUploadErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for PrepareCustomAvatarUploadError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - PrepareCustomAvatarUploadErrorKind::InternalError(_inner) => _inner.fmt(f), - PrepareCustomAvatarUploadErrorKind::RateLimitError(_inner) => _inner.fmt(f), - PrepareCustomAvatarUploadErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - PrepareCustomAvatarUploadErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - PrepareCustomAvatarUploadErrorKind::NotFoundError(_inner) => _inner.fmt(f), - PrepareCustomAvatarUploadErrorKind::BadRequestError(_inner) => _inner.fmt(f), - PrepareCustomAvatarUploadErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for PrepareCustomAvatarUploadError { - fn code(&self) -> Option<&str> { - PrepareCustomAvatarUploadError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - PrepareCustomAvatarUploadErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - PrepareCustomAvatarUploadErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl PrepareCustomAvatarUploadError { - /// Creates a new `PrepareCustomAvatarUploadError`. - pub fn new(kind: PrepareCustomAvatarUploadErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `PrepareCustomAvatarUploadError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: PrepareCustomAvatarUploadErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `PrepareCustomAvatarUploadError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: PrepareCustomAvatarUploadErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `PrepareCustomAvatarUploadErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!( - &self.kind, - PrepareCustomAvatarUploadErrorKind::InternalError(_) - ) - } - /// Returns `true` if the error kind is `PrepareCustomAvatarUploadErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - PrepareCustomAvatarUploadErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `PrepareCustomAvatarUploadErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - PrepareCustomAvatarUploadErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `PrepareCustomAvatarUploadErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - PrepareCustomAvatarUploadErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `PrepareCustomAvatarUploadErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!( - &self.kind, - PrepareCustomAvatarUploadErrorKind::NotFoundError(_) - ) - } - /// Returns `true` if the error kind is `PrepareCustomAvatarUploadErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - PrepareCustomAvatarUploadErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for PrepareCustomAvatarUploadError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - PrepareCustomAvatarUploadErrorKind::InternalError(_inner) => Some(_inner), - PrepareCustomAvatarUploadErrorKind::RateLimitError(_inner) => Some(_inner), - PrepareCustomAvatarUploadErrorKind::ForbiddenError(_inner) => Some(_inner), - PrepareCustomAvatarUploadErrorKind::UnauthorizedError(_inner) => Some(_inner), - PrepareCustomAvatarUploadErrorKind::NotFoundError(_inner) => Some(_inner), - PrepareCustomAvatarUploadErrorKind::BadRequestError(_inner) => Some(_inner), - PrepareCustomAvatarUploadErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `RemoveNamespaceCdnAuthUser` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct RemoveNamespaceCdnAuthUserError { - /// Kind of error that occurred. - pub kind: RemoveNamespaceCdnAuthUserErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `RemoveNamespaceCdnAuthUser` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum RemoveNamespaceCdnAuthUserErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for RemoveNamespaceCdnAuthUserError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - RemoveNamespaceCdnAuthUserErrorKind::InternalError(_inner) => _inner.fmt(f), - RemoveNamespaceCdnAuthUserErrorKind::RateLimitError(_inner) => _inner.fmt(f), - RemoveNamespaceCdnAuthUserErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - RemoveNamespaceCdnAuthUserErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - RemoveNamespaceCdnAuthUserErrorKind::NotFoundError(_inner) => _inner.fmt(f), - RemoveNamespaceCdnAuthUserErrorKind::BadRequestError(_inner) => _inner.fmt(f), - RemoveNamespaceCdnAuthUserErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for RemoveNamespaceCdnAuthUserError { - fn code(&self) -> Option<&str> { - RemoveNamespaceCdnAuthUserError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - RemoveNamespaceCdnAuthUserErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - RemoveNamespaceCdnAuthUserErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl RemoveNamespaceCdnAuthUserError { - /// Creates a new `RemoveNamespaceCdnAuthUserError`. - pub fn new(kind: RemoveNamespaceCdnAuthUserErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `RemoveNamespaceCdnAuthUserError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: RemoveNamespaceCdnAuthUserErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `RemoveNamespaceCdnAuthUserError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: RemoveNamespaceCdnAuthUserErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `RemoveNamespaceCdnAuthUserErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!( - &self.kind, - RemoveNamespaceCdnAuthUserErrorKind::InternalError(_) - ) - } - /// Returns `true` if the error kind is `RemoveNamespaceCdnAuthUserErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - RemoveNamespaceCdnAuthUserErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `RemoveNamespaceCdnAuthUserErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - RemoveNamespaceCdnAuthUserErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `RemoveNamespaceCdnAuthUserErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - RemoveNamespaceCdnAuthUserErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `RemoveNamespaceCdnAuthUserErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!( - &self.kind, - RemoveNamespaceCdnAuthUserErrorKind::NotFoundError(_) - ) - } - /// Returns `true` if the error kind is `RemoveNamespaceCdnAuthUserErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - RemoveNamespaceCdnAuthUserErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for RemoveNamespaceCdnAuthUserError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - RemoveNamespaceCdnAuthUserErrorKind::InternalError(_inner) => Some(_inner), - RemoveNamespaceCdnAuthUserErrorKind::RateLimitError(_inner) => Some(_inner), - RemoveNamespaceCdnAuthUserErrorKind::ForbiddenError(_inner) => Some(_inner), - RemoveNamespaceCdnAuthUserErrorKind::UnauthorizedError(_inner) => Some(_inner), - RemoveNamespaceCdnAuthUserErrorKind::NotFoundError(_inner) => Some(_inner), - RemoveNamespaceCdnAuthUserErrorKind::BadRequestError(_inner) => Some(_inner), - RemoveNamespaceCdnAuthUserErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `RemoveNamespaceDomain` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct RemoveNamespaceDomainError { - /// Kind of error that occurred. - pub kind: RemoveNamespaceDomainErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `RemoveNamespaceDomain` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum RemoveNamespaceDomainErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for RemoveNamespaceDomainError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - RemoveNamespaceDomainErrorKind::InternalError(_inner) => _inner.fmt(f), - RemoveNamespaceDomainErrorKind::RateLimitError(_inner) => _inner.fmt(f), - RemoveNamespaceDomainErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - RemoveNamespaceDomainErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - RemoveNamespaceDomainErrorKind::NotFoundError(_inner) => _inner.fmt(f), - RemoveNamespaceDomainErrorKind::BadRequestError(_inner) => _inner.fmt(f), - RemoveNamespaceDomainErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for RemoveNamespaceDomainError { - fn code(&self) -> Option<&str> { - RemoveNamespaceDomainError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - RemoveNamespaceDomainErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - RemoveNamespaceDomainErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl RemoveNamespaceDomainError { - /// Creates a new `RemoveNamespaceDomainError`. - pub fn new(kind: RemoveNamespaceDomainErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `RemoveNamespaceDomainError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: RemoveNamespaceDomainErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `RemoveNamespaceDomainError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: RemoveNamespaceDomainErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `RemoveNamespaceDomainErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, RemoveNamespaceDomainErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `RemoveNamespaceDomainErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - RemoveNamespaceDomainErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `RemoveNamespaceDomainErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - RemoveNamespaceDomainErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `RemoveNamespaceDomainErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - RemoveNamespaceDomainErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `RemoveNamespaceDomainErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, RemoveNamespaceDomainErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `RemoveNamespaceDomainErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - RemoveNamespaceDomainErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for RemoveNamespaceDomainError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - RemoveNamespaceDomainErrorKind::InternalError(_inner) => Some(_inner), - RemoveNamespaceDomainErrorKind::RateLimitError(_inner) => Some(_inner), - RemoveNamespaceDomainErrorKind::ForbiddenError(_inner) => Some(_inner), - RemoveNamespaceDomainErrorKind::UnauthorizedError(_inner) => Some(_inner), - RemoveNamespaceDomainErrorKind::NotFoundError(_inner) => Some(_inner), - RemoveNamespaceDomainErrorKind::BadRequestError(_inner) => Some(_inner), - RemoveNamespaceDomainErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `SetGameBillingPlan` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct SetGameBillingPlanError { - /// Kind of error that occurred. - pub kind: SetGameBillingPlanErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `SetGameBillingPlan` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum SetGameBillingPlanErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for SetGameBillingPlanError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - SetGameBillingPlanErrorKind::InternalError(_inner) => _inner.fmt(f), - SetGameBillingPlanErrorKind::RateLimitError(_inner) => _inner.fmt(f), - SetGameBillingPlanErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - SetGameBillingPlanErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - SetGameBillingPlanErrorKind::NotFoundError(_inner) => _inner.fmt(f), - SetGameBillingPlanErrorKind::BadRequestError(_inner) => _inner.fmt(f), - SetGameBillingPlanErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for SetGameBillingPlanError { - fn code(&self) -> Option<&str> { - SetGameBillingPlanError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - SetGameBillingPlanErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - SetGameBillingPlanErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl SetGameBillingPlanError { - /// Creates a new `SetGameBillingPlanError`. - pub fn new(kind: SetGameBillingPlanErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `SetGameBillingPlanError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: SetGameBillingPlanErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `SetGameBillingPlanError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: SetGameBillingPlanErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `SetGameBillingPlanErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, SetGameBillingPlanErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `SetGameBillingPlanErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, SetGameBillingPlanErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `SetGameBillingPlanErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, SetGameBillingPlanErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `SetGameBillingPlanErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - SetGameBillingPlanErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `SetGameBillingPlanErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, SetGameBillingPlanErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `SetGameBillingPlanErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, SetGameBillingPlanErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for SetGameBillingPlanError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - SetGameBillingPlanErrorKind::InternalError(_inner) => Some(_inner), - SetGameBillingPlanErrorKind::RateLimitError(_inner) => Some(_inner), - SetGameBillingPlanErrorKind::ForbiddenError(_inner) => Some(_inner), - SetGameBillingPlanErrorKind::UnauthorizedError(_inner) => Some(_inner), - SetGameBillingPlanErrorKind::NotFoundError(_inner) => Some(_inner), - SetGameBillingPlanErrorKind::BadRequestError(_inner) => Some(_inner), - SetGameBillingPlanErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `SetNamespaceCdnAuthType` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct SetNamespaceCdnAuthTypeError { - /// Kind of error that occurred. - pub kind: SetNamespaceCdnAuthTypeErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `SetNamespaceCdnAuthType` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum SetNamespaceCdnAuthTypeErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for SetNamespaceCdnAuthTypeError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - SetNamespaceCdnAuthTypeErrorKind::InternalError(_inner) => _inner.fmt(f), - SetNamespaceCdnAuthTypeErrorKind::RateLimitError(_inner) => _inner.fmt(f), - SetNamespaceCdnAuthTypeErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - SetNamespaceCdnAuthTypeErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - SetNamespaceCdnAuthTypeErrorKind::NotFoundError(_inner) => _inner.fmt(f), - SetNamespaceCdnAuthTypeErrorKind::BadRequestError(_inner) => _inner.fmt(f), - SetNamespaceCdnAuthTypeErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for SetNamespaceCdnAuthTypeError { - fn code(&self) -> Option<&str> { - SetNamespaceCdnAuthTypeError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - SetNamespaceCdnAuthTypeErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - SetNamespaceCdnAuthTypeErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl SetNamespaceCdnAuthTypeError { - /// Creates a new `SetNamespaceCdnAuthTypeError`. - pub fn new(kind: SetNamespaceCdnAuthTypeErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `SetNamespaceCdnAuthTypeError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: SetNamespaceCdnAuthTypeErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `SetNamespaceCdnAuthTypeError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: SetNamespaceCdnAuthTypeErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `SetNamespaceCdnAuthTypeErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!( - &self.kind, - SetNamespaceCdnAuthTypeErrorKind::InternalError(_) - ) - } - /// Returns `true` if the error kind is `SetNamespaceCdnAuthTypeErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - SetNamespaceCdnAuthTypeErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `SetNamespaceCdnAuthTypeErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - SetNamespaceCdnAuthTypeErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `SetNamespaceCdnAuthTypeErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - SetNamespaceCdnAuthTypeErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `SetNamespaceCdnAuthTypeErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!( - &self.kind, - SetNamespaceCdnAuthTypeErrorKind::NotFoundError(_) - ) - } - /// Returns `true` if the error kind is `SetNamespaceCdnAuthTypeErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - SetNamespaceCdnAuthTypeErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for SetNamespaceCdnAuthTypeError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - SetNamespaceCdnAuthTypeErrorKind::InternalError(_inner) => Some(_inner), - SetNamespaceCdnAuthTypeErrorKind::RateLimitError(_inner) => Some(_inner), - SetNamespaceCdnAuthTypeErrorKind::ForbiddenError(_inner) => Some(_inner), - SetNamespaceCdnAuthTypeErrorKind::UnauthorizedError(_inner) => Some(_inner), - SetNamespaceCdnAuthTypeErrorKind::NotFoundError(_inner) => Some(_inner), - SetNamespaceCdnAuthTypeErrorKind::BadRequestError(_inner) => Some(_inner), - SetNamespaceCdnAuthTypeErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `ToggleNamespaceDomainPublicAuth` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct ToggleNamespaceDomainPublicAuthError { - /// Kind of error that occurred. - pub kind: ToggleNamespaceDomainPublicAuthErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `ToggleNamespaceDomainPublicAuth` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum ToggleNamespaceDomainPublicAuthErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for ToggleNamespaceDomainPublicAuthError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - ToggleNamespaceDomainPublicAuthErrorKind::InternalError(_inner) => _inner.fmt(f), - ToggleNamespaceDomainPublicAuthErrorKind::RateLimitError(_inner) => _inner.fmt(f), - ToggleNamespaceDomainPublicAuthErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - ToggleNamespaceDomainPublicAuthErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - ToggleNamespaceDomainPublicAuthErrorKind::NotFoundError(_inner) => _inner.fmt(f), - ToggleNamespaceDomainPublicAuthErrorKind::BadRequestError(_inner) => _inner.fmt(f), - ToggleNamespaceDomainPublicAuthErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for ToggleNamespaceDomainPublicAuthError { - fn code(&self) -> Option<&str> { - ToggleNamespaceDomainPublicAuthError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - ToggleNamespaceDomainPublicAuthErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - ToggleNamespaceDomainPublicAuthErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl ToggleNamespaceDomainPublicAuthError { - /// Creates a new `ToggleNamespaceDomainPublicAuthError`. - pub fn new( - kind: ToggleNamespaceDomainPublicAuthErrorKind, - meta: aws_smithy_types::Error, - ) -> Self { - Self { kind, meta } - } - - /// Creates the `ToggleNamespaceDomainPublicAuthError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: ToggleNamespaceDomainPublicAuthErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `ToggleNamespaceDomainPublicAuthError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: ToggleNamespaceDomainPublicAuthErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `ToggleNamespaceDomainPublicAuthErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!( - &self.kind, - ToggleNamespaceDomainPublicAuthErrorKind::InternalError(_) - ) - } - /// Returns `true` if the error kind is `ToggleNamespaceDomainPublicAuthErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - ToggleNamespaceDomainPublicAuthErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `ToggleNamespaceDomainPublicAuthErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - ToggleNamespaceDomainPublicAuthErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `ToggleNamespaceDomainPublicAuthErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - ToggleNamespaceDomainPublicAuthErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `ToggleNamespaceDomainPublicAuthErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!( - &self.kind, - ToggleNamespaceDomainPublicAuthErrorKind::NotFoundError(_) - ) - } - /// Returns `true` if the error kind is `ToggleNamespaceDomainPublicAuthErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - ToggleNamespaceDomainPublicAuthErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for ToggleNamespaceDomainPublicAuthError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - ToggleNamespaceDomainPublicAuthErrorKind::InternalError(_inner) => Some(_inner), - ToggleNamespaceDomainPublicAuthErrorKind::RateLimitError(_inner) => Some(_inner), - ToggleNamespaceDomainPublicAuthErrorKind::ForbiddenError(_inner) => Some(_inner), - ToggleNamespaceDomainPublicAuthErrorKind::UnauthorizedError(_inner) => Some(_inner), - ToggleNamespaceDomainPublicAuthErrorKind::NotFoundError(_inner) => Some(_inner), - ToggleNamespaceDomainPublicAuthErrorKind::BadRequestError(_inner) => Some(_inner), - ToggleNamespaceDomainPublicAuthErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `UpdateGameNamespaceMatchmakerConfig` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct UpdateGameNamespaceMatchmakerConfigError { - /// Kind of error that occurred. - pub kind: UpdateGameNamespaceMatchmakerConfigErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `UpdateGameNamespaceMatchmakerConfig` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum UpdateGameNamespaceMatchmakerConfigErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for UpdateGameNamespaceMatchmakerConfigError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - UpdateGameNamespaceMatchmakerConfigErrorKind::InternalError(_inner) => _inner.fmt(f), - UpdateGameNamespaceMatchmakerConfigErrorKind::RateLimitError(_inner) => _inner.fmt(f), - UpdateGameNamespaceMatchmakerConfigErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - UpdateGameNamespaceMatchmakerConfigErrorKind::UnauthorizedError(_inner) => { - _inner.fmt(f) - } - UpdateGameNamespaceMatchmakerConfigErrorKind::NotFoundError(_inner) => _inner.fmt(f), - UpdateGameNamespaceMatchmakerConfigErrorKind::BadRequestError(_inner) => _inner.fmt(f), - UpdateGameNamespaceMatchmakerConfigErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for UpdateGameNamespaceMatchmakerConfigError { - fn code(&self) -> Option<&str> { - UpdateGameNamespaceMatchmakerConfigError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - UpdateGameNamespaceMatchmakerConfigErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - UpdateGameNamespaceMatchmakerConfigErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl UpdateGameNamespaceMatchmakerConfigError { - /// Creates a new `UpdateGameNamespaceMatchmakerConfigError`. - pub fn new( - kind: UpdateGameNamespaceMatchmakerConfigErrorKind, - meta: aws_smithy_types::Error, - ) -> Self { - Self { kind, meta } - } - - /// Creates the `UpdateGameNamespaceMatchmakerConfigError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: UpdateGameNamespaceMatchmakerConfigErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `UpdateGameNamespaceMatchmakerConfigError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: UpdateGameNamespaceMatchmakerConfigErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `UpdateGameNamespaceMatchmakerConfigErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!( - &self.kind, - UpdateGameNamespaceMatchmakerConfigErrorKind::InternalError(_) - ) - } - /// Returns `true` if the error kind is `UpdateGameNamespaceMatchmakerConfigErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - UpdateGameNamespaceMatchmakerConfigErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `UpdateGameNamespaceMatchmakerConfigErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - UpdateGameNamespaceMatchmakerConfigErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `UpdateGameNamespaceMatchmakerConfigErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - UpdateGameNamespaceMatchmakerConfigErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `UpdateGameNamespaceMatchmakerConfigErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!( - &self.kind, - UpdateGameNamespaceMatchmakerConfigErrorKind::NotFoundError(_) - ) - } - /// Returns `true` if the error kind is `UpdateGameNamespaceMatchmakerConfigErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - UpdateGameNamespaceMatchmakerConfigErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for UpdateGameNamespaceMatchmakerConfigError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - UpdateGameNamespaceMatchmakerConfigErrorKind::InternalError(_inner) => Some(_inner), - UpdateGameNamespaceMatchmakerConfigErrorKind::RateLimitError(_inner) => Some(_inner), - UpdateGameNamespaceMatchmakerConfigErrorKind::ForbiddenError(_inner) => Some(_inner), - UpdateGameNamespaceMatchmakerConfigErrorKind::UnauthorizedError(_inner) => Some(_inner), - UpdateGameNamespaceMatchmakerConfigErrorKind::NotFoundError(_inner) => Some(_inner), - UpdateGameNamespaceMatchmakerConfigErrorKind::BadRequestError(_inner) => Some(_inner), - UpdateGameNamespaceMatchmakerConfigErrorKind::Unhandled(_inner) => { - Some(_inner.as_ref()) - } - } - } -} - -/// Error type for the `UpdateGameNamespaceVersion` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct UpdateGameNamespaceVersionError { - /// Kind of error that occurred. - pub kind: UpdateGameNamespaceVersionErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `UpdateGameNamespaceVersion` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum UpdateGameNamespaceVersionErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for UpdateGameNamespaceVersionError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - UpdateGameNamespaceVersionErrorKind::InternalError(_inner) => _inner.fmt(f), - UpdateGameNamespaceVersionErrorKind::RateLimitError(_inner) => _inner.fmt(f), - UpdateGameNamespaceVersionErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - UpdateGameNamespaceVersionErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - UpdateGameNamespaceVersionErrorKind::NotFoundError(_inner) => _inner.fmt(f), - UpdateGameNamespaceVersionErrorKind::BadRequestError(_inner) => _inner.fmt(f), - UpdateGameNamespaceVersionErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for UpdateGameNamespaceVersionError { - fn code(&self) -> Option<&str> { - UpdateGameNamespaceVersionError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - UpdateGameNamespaceVersionErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - UpdateGameNamespaceVersionErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl UpdateGameNamespaceVersionError { - /// Creates a new `UpdateGameNamespaceVersionError`. - pub fn new(kind: UpdateGameNamespaceVersionErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `UpdateGameNamespaceVersionError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: UpdateGameNamespaceVersionErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `UpdateGameNamespaceVersionError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: UpdateGameNamespaceVersionErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `UpdateGameNamespaceVersionErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!( - &self.kind, - UpdateGameNamespaceVersionErrorKind::InternalError(_) - ) - } - /// Returns `true` if the error kind is `UpdateGameNamespaceVersionErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - UpdateGameNamespaceVersionErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `UpdateGameNamespaceVersionErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - UpdateGameNamespaceVersionErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `UpdateGameNamespaceVersionErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - UpdateGameNamespaceVersionErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `UpdateGameNamespaceVersionErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!( - &self.kind, - UpdateGameNamespaceVersionErrorKind::NotFoundError(_) - ) - } - /// Returns `true` if the error kind is `UpdateGameNamespaceVersionErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - UpdateGameNamespaceVersionErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for UpdateGameNamespaceVersionError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - UpdateGameNamespaceVersionErrorKind::InternalError(_inner) => Some(_inner), - UpdateGameNamespaceVersionErrorKind::RateLimitError(_inner) => Some(_inner), - UpdateGameNamespaceVersionErrorKind::ForbiddenError(_inner) => Some(_inner), - UpdateGameNamespaceVersionErrorKind::UnauthorizedError(_inner) => Some(_inner), - UpdateGameNamespaceVersionErrorKind::NotFoundError(_inner) => Some(_inner), - UpdateGameNamespaceVersionErrorKind::BadRequestError(_inner) => Some(_inner), - UpdateGameNamespaceVersionErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `UpdateNamespaceCdnAuthUser` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct UpdateNamespaceCdnAuthUserError { - /// Kind of error that occurred. - pub kind: UpdateNamespaceCdnAuthUserErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `UpdateNamespaceCdnAuthUser` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum UpdateNamespaceCdnAuthUserErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for UpdateNamespaceCdnAuthUserError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - UpdateNamespaceCdnAuthUserErrorKind::InternalError(_inner) => _inner.fmt(f), - UpdateNamespaceCdnAuthUserErrorKind::RateLimitError(_inner) => _inner.fmt(f), - UpdateNamespaceCdnAuthUserErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - UpdateNamespaceCdnAuthUserErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - UpdateNamespaceCdnAuthUserErrorKind::NotFoundError(_inner) => _inner.fmt(f), - UpdateNamespaceCdnAuthUserErrorKind::BadRequestError(_inner) => _inner.fmt(f), - UpdateNamespaceCdnAuthUserErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for UpdateNamespaceCdnAuthUserError { - fn code(&self) -> Option<&str> { - UpdateNamespaceCdnAuthUserError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - UpdateNamespaceCdnAuthUserErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - UpdateNamespaceCdnAuthUserErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl UpdateNamespaceCdnAuthUserError { - /// Creates a new `UpdateNamespaceCdnAuthUserError`. - pub fn new(kind: UpdateNamespaceCdnAuthUserErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `UpdateNamespaceCdnAuthUserError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: UpdateNamespaceCdnAuthUserErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `UpdateNamespaceCdnAuthUserError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: UpdateNamespaceCdnAuthUserErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `UpdateNamespaceCdnAuthUserErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!( - &self.kind, - UpdateNamespaceCdnAuthUserErrorKind::InternalError(_) - ) - } - /// Returns `true` if the error kind is `UpdateNamespaceCdnAuthUserErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - UpdateNamespaceCdnAuthUserErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `UpdateNamespaceCdnAuthUserErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - UpdateNamespaceCdnAuthUserErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `UpdateNamespaceCdnAuthUserErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - UpdateNamespaceCdnAuthUserErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `UpdateNamespaceCdnAuthUserErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!( - &self.kind, - UpdateNamespaceCdnAuthUserErrorKind::NotFoundError(_) - ) - } - /// Returns `true` if the error kind is `UpdateNamespaceCdnAuthUserErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - UpdateNamespaceCdnAuthUserErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for UpdateNamespaceCdnAuthUserError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - UpdateNamespaceCdnAuthUserErrorKind::InternalError(_inner) => Some(_inner), - UpdateNamespaceCdnAuthUserErrorKind::RateLimitError(_inner) => Some(_inner), - UpdateNamespaceCdnAuthUserErrorKind::ForbiddenError(_inner) => Some(_inner), - UpdateNamespaceCdnAuthUserErrorKind::UnauthorizedError(_inner) => Some(_inner), - UpdateNamespaceCdnAuthUserErrorKind::NotFoundError(_inner) => Some(_inner), - UpdateNamespaceCdnAuthUserErrorKind::BadRequestError(_inner) => Some(_inner), - UpdateNamespaceCdnAuthUserErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `ValidateGame` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct ValidateGameError { - /// Kind of error that occurred. - pub kind: ValidateGameErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `ValidateGame` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum ValidateGameErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for ValidateGameError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - ValidateGameErrorKind::InternalError(_inner) => _inner.fmt(f), - ValidateGameErrorKind::RateLimitError(_inner) => _inner.fmt(f), - ValidateGameErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - ValidateGameErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - ValidateGameErrorKind::NotFoundError(_inner) => _inner.fmt(f), - ValidateGameErrorKind::BadRequestError(_inner) => _inner.fmt(f), - ValidateGameErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for ValidateGameError { - fn code(&self) -> Option<&str> { - ValidateGameError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - ValidateGameErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - ValidateGameErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl ValidateGameError { - /// Creates a new `ValidateGameError`. - pub fn new(kind: ValidateGameErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `ValidateGameError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: ValidateGameErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `ValidateGameError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: ValidateGameErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `ValidateGameErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, ValidateGameErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `ValidateGameErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, ValidateGameErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `ValidateGameErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, ValidateGameErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `ValidateGameErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, ValidateGameErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `ValidateGameErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, ValidateGameErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `ValidateGameErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, ValidateGameErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for ValidateGameError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - ValidateGameErrorKind::InternalError(_inner) => Some(_inner), - ValidateGameErrorKind::RateLimitError(_inner) => Some(_inner), - ValidateGameErrorKind::ForbiddenError(_inner) => Some(_inner), - ValidateGameErrorKind::UnauthorizedError(_inner) => Some(_inner), - ValidateGameErrorKind::NotFoundError(_inner) => Some(_inner), - ValidateGameErrorKind::BadRequestError(_inner) => Some(_inner), - ValidateGameErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `ValidateGameNamespace` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct ValidateGameNamespaceError { - /// Kind of error that occurred. - pub kind: ValidateGameNamespaceErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `ValidateGameNamespace` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum ValidateGameNamespaceErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for ValidateGameNamespaceError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - ValidateGameNamespaceErrorKind::InternalError(_inner) => _inner.fmt(f), - ValidateGameNamespaceErrorKind::RateLimitError(_inner) => _inner.fmt(f), - ValidateGameNamespaceErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - ValidateGameNamespaceErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - ValidateGameNamespaceErrorKind::NotFoundError(_inner) => _inner.fmt(f), - ValidateGameNamespaceErrorKind::BadRequestError(_inner) => _inner.fmt(f), - ValidateGameNamespaceErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for ValidateGameNamespaceError { - fn code(&self) -> Option<&str> { - ValidateGameNamespaceError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - ValidateGameNamespaceErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - ValidateGameNamespaceErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl ValidateGameNamespaceError { - /// Creates a new `ValidateGameNamespaceError`. - pub fn new(kind: ValidateGameNamespaceErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `ValidateGameNamespaceError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: ValidateGameNamespaceErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `ValidateGameNamespaceError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: ValidateGameNamespaceErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `ValidateGameNamespaceErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, ValidateGameNamespaceErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `ValidateGameNamespaceErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - ValidateGameNamespaceErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `ValidateGameNamespaceErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - ValidateGameNamespaceErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `ValidateGameNamespaceErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - ValidateGameNamespaceErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `ValidateGameNamespaceErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, ValidateGameNamespaceErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `ValidateGameNamespaceErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - ValidateGameNamespaceErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for ValidateGameNamespaceError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - ValidateGameNamespaceErrorKind::InternalError(_inner) => Some(_inner), - ValidateGameNamespaceErrorKind::RateLimitError(_inner) => Some(_inner), - ValidateGameNamespaceErrorKind::ForbiddenError(_inner) => Some(_inner), - ValidateGameNamespaceErrorKind::UnauthorizedError(_inner) => Some(_inner), - ValidateGameNamespaceErrorKind::NotFoundError(_inner) => Some(_inner), - ValidateGameNamespaceErrorKind::BadRequestError(_inner) => Some(_inner), - ValidateGameNamespaceErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `ValidateGameNamespaceMatchmakerConfig` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct ValidateGameNamespaceMatchmakerConfigError { - /// Kind of error that occurred. - pub kind: ValidateGameNamespaceMatchmakerConfigErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `ValidateGameNamespaceMatchmakerConfig` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum ValidateGameNamespaceMatchmakerConfigErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for ValidateGameNamespaceMatchmakerConfigError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - ValidateGameNamespaceMatchmakerConfigErrorKind::InternalError(_inner) => _inner.fmt(f), - ValidateGameNamespaceMatchmakerConfigErrorKind::RateLimitError(_inner) => _inner.fmt(f), - ValidateGameNamespaceMatchmakerConfigErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - ValidateGameNamespaceMatchmakerConfigErrorKind::UnauthorizedError(_inner) => { - _inner.fmt(f) - } - ValidateGameNamespaceMatchmakerConfigErrorKind::NotFoundError(_inner) => _inner.fmt(f), - ValidateGameNamespaceMatchmakerConfigErrorKind::BadRequestError(_inner) => { - _inner.fmt(f) - } - ValidateGameNamespaceMatchmakerConfigErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for ValidateGameNamespaceMatchmakerConfigError { - fn code(&self) -> Option<&str> { - ValidateGameNamespaceMatchmakerConfigError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - ValidateGameNamespaceMatchmakerConfigErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - ValidateGameNamespaceMatchmakerConfigErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl ValidateGameNamespaceMatchmakerConfigError { - /// Creates a new `ValidateGameNamespaceMatchmakerConfigError`. - pub fn new( - kind: ValidateGameNamespaceMatchmakerConfigErrorKind, - meta: aws_smithy_types::Error, - ) -> Self { - Self { kind, meta } - } - - /// Creates the `ValidateGameNamespaceMatchmakerConfigError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: ValidateGameNamespaceMatchmakerConfigErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `ValidateGameNamespaceMatchmakerConfigError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: ValidateGameNamespaceMatchmakerConfigErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `ValidateGameNamespaceMatchmakerConfigErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!( - &self.kind, - ValidateGameNamespaceMatchmakerConfigErrorKind::InternalError(_) - ) - } - /// Returns `true` if the error kind is `ValidateGameNamespaceMatchmakerConfigErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - ValidateGameNamespaceMatchmakerConfigErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `ValidateGameNamespaceMatchmakerConfigErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - ValidateGameNamespaceMatchmakerConfigErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `ValidateGameNamespaceMatchmakerConfigErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - ValidateGameNamespaceMatchmakerConfigErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `ValidateGameNamespaceMatchmakerConfigErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!( - &self.kind, - ValidateGameNamespaceMatchmakerConfigErrorKind::NotFoundError(_) - ) - } - /// Returns `true` if the error kind is `ValidateGameNamespaceMatchmakerConfigErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - ValidateGameNamespaceMatchmakerConfigErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for ValidateGameNamespaceMatchmakerConfigError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - ValidateGameNamespaceMatchmakerConfigErrorKind::InternalError(_inner) => Some(_inner), - ValidateGameNamespaceMatchmakerConfigErrorKind::RateLimitError(_inner) => Some(_inner), - ValidateGameNamespaceMatchmakerConfigErrorKind::ForbiddenError(_inner) => Some(_inner), - ValidateGameNamespaceMatchmakerConfigErrorKind::UnauthorizedError(_inner) => { - Some(_inner) - } - ValidateGameNamespaceMatchmakerConfigErrorKind::NotFoundError(_inner) => Some(_inner), - ValidateGameNamespaceMatchmakerConfigErrorKind::BadRequestError(_inner) => Some(_inner), - ValidateGameNamespaceMatchmakerConfigErrorKind::Unhandled(_inner) => { - Some(_inner.as_ref()) - } - } - } -} - -/// Error type for the `ValidateGameNamespaceTokenDevelopment` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct ValidateGameNamespaceTokenDevelopmentError { - /// Kind of error that occurred. - pub kind: ValidateGameNamespaceTokenDevelopmentErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `ValidateGameNamespaceTokenDevelopment` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum ValidateGameNamespaceTokenDevelopmentErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for ValidateGameNamespaceTokenDevelopmentError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - ValidateGameNamespaceTokenDevelopmentErrorKind::InternalError(_inner) => _inner.fmt(f), - ValidateGameNamespaceTokenDevelopmentErrorKind::RateLimitError(_inner) => _inner.fmt(f), - ValidateGameNamespaceTokenDevelopmentErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - ValidateGameNamespaceTokenDevelopmentErrorKind::UnauthorizedError(_inner) => { - _inner.fmt(f) - } - ValidateGameNamespaceTokenDevelopmentErrorKind::NotFoundError(_inner) => _inner.fmt(f), - ValidateGameNamespaceTokenDevelopmentErrorKind::BadRequestError(_inner) => { - _inner.fmt(f) - } - ValidateGameNamespaceTokenDevelopmentErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for ValidateGameNamespaceTokenDevelopmentError { - fn code(&self) -> Option<&str> { - ValidateGameNamespaceTokenDevelopmentError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - ValidateGameNamespaceTokenDevelopmentErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - ValidateGameNamespaceTokenDevelopmentErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl ValidateGameNamespaceTokenDevelopmentError { - /// Creates a new `ValidateGameNamespaceTokenDevelopmentError`. - pub fn new( - kind: ValidateGameNamespaceTokenDevelopmentErrorKind, - meta: aws_smithy_types::Error, - ) -> Self { - Self { kind, meta } - } - - /// Creates the `ValidateGameNamespaceTokenDevelopmentError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: ValidateGameNamespaceTokenDevelopmentErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `ValidateGameNamespaceTokenDevelopmentError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: ValidateGameNamespaceTokenDevelopmentErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `ValidateGameNamespaceTokenDevelopmentErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!( - &self.kind, - ValidateGameNamespaceTokenDevelopmentErrorKind::InternalError(_) - ) - } - /// Returns `true` if the error kind is `ValidateGameNamespaceTokenDevelopmentErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - ValidateGameNamespaceTokenDevelopmentErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `ValidateGameNamespaceTokenDevelopmentErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - ValidateGameNamespaceTokenDevelopmentErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `ValidateGameNamespaceTokenDevelopmentErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - ValidateGameNamespaceTokenDevelopmentErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `ValidateGameNamespaceTokenDevelopmentErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!( - &self.kind, - ValidateGameNamespaceTokenDevelopmentErrorKind::NotFoundError(_) - ) - } - /// Returns `true` if the error kind is `ValidateGameNamespaceTokenDevelopmentErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - ValidateGameNamespaceTokenDevelopmentErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for ValidateGameNamespaceTokenDevelopmentError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - ValidateGameNamespaceTokenDevelopmentErrorKind::InternalError(_inner) => Some(_inner), - ValidateGameNamespaceTokenDevelopmentErrorKind::RateLimitError(_inner) => Some(_inner), - ValidateGameNamespaceTokenDevelopmentErrorKind::ForbiddenError(_inner) => Some(_inner), - ValidateGameNamespaceTokenDevelopmentErrorKind::UnauthorizedError(_inner) => { - Some(_inner) - } - ValidateGameNamespaceTokenDevelopmentErrorKind::NotFoundError(_inner) => Some(_inner), - ValidateGameNamespaceTokenDevelopmentErrorKind::BadRequestError(_inner) => Some(_inner), - ValidateGameNamespaceTokenDevelopmentErrorKind::Unhandled(_inner) => { - Some(_inner.as_ref()) - } - } - } -} - -/// Error type for the `ValidateGameVersion` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct ValidateGameVersionError { - /// Kind of error that occurred. - pub kind: ValidateGameVersionErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `ValidateGameVersion` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum ValidateGameVersionErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for ValidateGameVersionError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - ValidateGameVersionErrorKind::InternalError(_inner) => _inner.fmt(f), - ValidateGameVersionErrorKind::RateLimitError(_inner) => _inner.fmt(f), - ValidateGameVersionErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - ValidateGameVersionErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - ValidateGameVersionErrorKind::NotFoundError(_inner) => _inner.fmt(f), - ValidateGameVersionErrorKind::BadRequestError(_inner) => _inner.fmt(f), - ValidateGameVersionErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for ValidateGameVersionError { - fn code(&self) -> Option<&str> { - ValidateGameVersionError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - ValidateGameVersionErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - ValidateGameVersionErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl ValidateGameVersionError { - /// Creates a new `ValidateGameVersionError`. - pub fn new(kind: ValidateGameVersionErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `ValidateGameVersionError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: ValidateGameVersionErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `ValidateGameVersionError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: ValidateGameVersionErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `ValidateGameVersionErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, ValidateGameVersionErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `ValidateGameVersionErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, ValidateGameVersionErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `ValidateGameVersionErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, ValidateGameVersionErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `ValidateGameVersionErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - ValidateGameVersionErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `ValidateGameVersionErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, ValidateGameVersionErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `ValidateGameVersionErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, ValidateGameVersionErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for ValidateGameVersionError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - ValidateGameVersionErrorKind::InternalError(_inner) => Some(_inner), - ValidateGameVersionErrorKind::RateLimitError(_inner) => Some(_inner), - ValidateGameVersionErrorKind::ForbiddenError(_inner) => Some(_inner), - ValidateGameVersionErrorKind::UnauthorizedError(_inner) => Some(_inner), - ValidateGameVersionErrorKind::NotFoundError(_inner) => Some(_inner), - ValidateGameVersionErrorKind::BadRequestError(_inner) => Some(_inner), - ValidateGameVersionErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `ValidateGroup` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct ValidateGroupError { - /// Kind of error that occurred. - pub kind: ValidateGroupErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `ValidateGroup` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum ValidateGroupErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for ValidateGroupError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - ValidateGroupErrorKind::InternalError(_inner) => _inner.fmt(f), - ValidateGroupErrorKind::RateLimitError(_inner) => _inner.fmt(f), - ValidateGroupErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - ValidateGroupErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - ValidateGroupErrorKind::NotFoundError(_inner) => _inner.fmt(f), - ValidateGroupErrorKind::BadRequestError(_inner) => _inner.fmt(f), - ValidateGroupErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for ValidateGroupError { - fn code(&self) -> Option<&str> { - ValidateGroupError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - ValidateGroupErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - ValidateGroupErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl ValidateGroupError { - /// Creates a new `ValidateGroupError`. - pub fn new(kind: ValidateGroupErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `ValidateGroupError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: ValidateGroupErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `ValidateGroupError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: ValidateGroupErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `ValidateGroupErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, ValidateGroupErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `ValidateGroupErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, ValidateGroupErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `ValidateGroupErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, ValidateGroupErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `ValidateGroupErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, ValidateGroupErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `ValidateGroupErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, ValidateGroupErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `ValidateGroupErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, ValidateGroupErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for ValidateGroupError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - ValidateGroupErrorKind::InternalError(_inner) => Some(_inner), - ValidateGroupErrorKind::RateLimitError(_inner) => Some(_inner), - ValidateGroupErrorKind::ForbiddenError(_inner) => Some(_inner), - ValidateGroupErrorKind::UnauthorizedError(_inner) => Some(_inner), - ValidateGroupErrorKind::NotFoundError(_inner) => Some(_inner), - ValidateGroupErrorKind::BadRequestError(_inner) => Some(_inner), - ValidateGroupErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// An error thrown when the requestee has sent an invalid or malformed request. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct BadRequestError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl BadRequestError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for BadRequestError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("BadRequestError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl BadRequestError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for BadRequestError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "BadRequestError")?; - if let Some(inner_1) = &self.message { - write!(f, ": {}", inner_1)?; - } - Ok(()) - } -} -impl std::error::Error for BadRequestError {} -/// See [`BadRequestError`](crate::error::BadRequestError) -pub mod bad_request_error { - /// A builder for [`BadRequestError`](crate::error::BadRequestError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`BadRequestError`](crate::error::BadRequestError) - pub fn build(self) -> crate::error::BadRequestError { - crate::error::BadRequestError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl BadRequestError { - /// Creates a new builder-style object to manufacture [`BadRequestError`](crate::error::BadRequestError) - pub fn builder() -> crate::error::bad_request_error::Builder { - crate::error::bad_request_error::Builder::default() - } -} - -/// An error thrown when the requestee requests a non existent resource. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct NotFoundError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl NotFoundError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for NotFoundError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("NotFoundError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl NotFoundError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for NotFoundError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "NotFoundError")?; - if let Some(inner_2) = &self.message { - write!(f, ": {}", inner_2)?; - } - Ok(()) - } -} -impl std::error::Error for NotFoundError {} -/// See [`NotFoundError`](crate::error::NotFoundError) -pub mod not_found_error { - /// A builder for [`NotFoundError`](crate::error::NotFoundError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`NotFoundError`](crate::error::NotFoundError) - pub fn build(self) -> crate::error::NotFoundError { - crate::error::NotFoundError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl NotFoundError { - /// Creates a new builder-style object to manufacture [`NotFoundError`](crate::error::NotFoundError) - pub fn builder() -> crate::error::not_found_error::Builder { - crate::error::not_found_error::Builder::default() - } -} - -/// An error thrown when the requestee is not authenticated. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UnauthorizedError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl UnauthorizedError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for UnauthorizedError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UnauthorizedError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl UnauthorizedError { - /// Returns `Some(ErrorKind)` if the error is retryable. Otherwise, returns `None`. - pub fn retryable_error_kind(&self) -> aws_smithy_types::retry::ErrorKind { - aws_smithy_types::retry::ErrorKind::ClientError - } - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for UnauthorizedError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "UnauthorizedError")?; - if let Some(inner_3) = &self.message { - write!(f, ": {}", inner_3)?; - } - Ok(()) - } -} -impl std::error::Error for UnauthorizedError {} -/// See [`UnauthorizedError`](crate::error::UnauthorizedError) -pub mod unauthorized_error { - /// A builder for [`UnauthorizedError`](crate::error::UnauthorizedError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`UnauthorizedError`](crate::error::UnauthorizedError) - pub fn build(self) -> crate::error::UnauthorizedError { - crate::error::UnauthorizedError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl UnauthorizedError { - /// Creates a new builder-style object to manufacture [`UnauthorizedError`](crate::error::UnauthorizedError) - pub fn builder() -> crate::error::unauthorized_error::Builder { - crate::error::unauthorized_error::Builder::default() - } -} - -/// An error thrown when the requestee requests a resource they do not have access to. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ForbiddenError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl ForbiddenError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for ForbiddenError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ForbiddenError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl ForbiddenError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for ForbiddenError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "ForbiddenError")?; - if let Some(inner_4) = &self.message { - write!(f, ": {}", inner_4)?; - } - Ok(()) - } -} -impl std::error::Error for ForbiddenError {} -/// See [`ForbiddenError`](crate::error::ForbiddenError) -pub mod forbidden_error { - /// A builder for [`ForbiddenError`](crate::error::ForbiddenError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`ForbiddenError`](crate::error::ForbiddenError) - pub fn build(self) -> crate::error::ForbiddenError { - crate::error::ForbiddenError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl ForbiddenError { - /// Creates a new builder-style object to manufacture [`ForbiddenError`](crate::error::ForbiddenError) - pub fn builder() -> crate::error::forbidden_error::Builder { - crate::error::forbidden_error::Builder::default() - } -} - -/// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct RateLimitError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl RateLimitError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for RateLimitError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("RateLimitError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl RateLimitError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for RateLimitError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "RateLimitError")?; - if let Some(inner_5) = &self.message { - write!(f, ": {}", inner_5)?; - } - Ok(()) - } -} -impl std::error::Error for RateLimitError {} -/// See [`RateLimitError`](crate::error::RateLimitError) -pub mod rate_limit_error { - /// A builder for [`RateLimitError`](crate::error::RateLimitError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`RateLimitError`](crate::error::RateLimitError) - pub fn build(self) -> crate::error::RateLimitError { - crate::error::RateLimitError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl RateLimitError { - /// Creates a new builder-style object to manufacture [`RateLimitError`](crate::error::RateLimitError) - pub fn builder() -> crate::error::rate_limit_error::Builder { - crate::error::rate_limit_error::Builder::default() - } -} - -/// An error caused by internal server problems. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct InternalError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl InternalError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for InternalError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("InternalError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl InternalError { - /// Returns `Some(ErrorKind)` if the error is retryable. Otherwise, returns `None`. - pub fn retryable_error_kind(&self) -> aws_smithy_types::retry::ErrorKind { - aws_smithy_types::retry::ErrorKind::ServerError - } - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for InternalError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "InternalError")?; - if let Some(inner_6) = &self.message { - write!(f, ": {}", inner_6)?; - } - Ok(()) - } -} -impl std::error::Error for InternalError {} -/// See [`InternalError`](crate::error::InternalError) -pub mod internal_error { - /// A builder for [`InternalError`](crate::error::InternalError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`InternalError`](crate::error::InternalError) - pub fn build(self) -> crate::error::InternalError { - crate::error::InternalError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl InternalError { - /// Creates a new builder-style object to manufacture [`InternalError`](crate::error::InternalError) - pub fn builder() -> crate::error::internal_error::Builder { - crate::error::internal_error::Builder::default() - } -} diff --git a/lib/smithy-output/api-cloud/rust/rust/src/error_meta.rs b/lib/smithy-output/api-cloud/rust/rust/src/error_meta.rs deleted file mode 100644 index bb049fba6..000000000 --- a/lib/smithy-output/api-cloud/rust/rust/src/error_meta.rs +++ /dev/null @@ -1,1895 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// All possible error types for this service. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum Error { - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An unhandled error occurred. - Unhandled(Box), -} -impl std::fmt::Display for Error { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Error::BadRequestError(inner) => inner.fmt(f), - Error::ForbiddenError(inner) => inner.fmt(f), - Error::InternalError(inner) => inner.fmt(f), - Error::NotFoundError(inner) => inner.fmt(f), - Error::RateLimitError(inner) => inner.fmt(f), - Error::UnauthorizedError(inner) => inner.fmt(f), - Error::Unhandled(inner) => inner.fmt(f), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::AddNamespaceDomainErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::AddNamespaceDomainErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::AddNamespaceDomainErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::AddNamespaceDomainErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::AddNamespaceDomainErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::AddNamespaceDomainErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::AddNamespaceDomainErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::CompleteCustomAvatarUploadErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::CompleteCustomAvatarUploadErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::CompleteCustomAvatarUploadErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::CompleteCustomAvatarUploadErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::CompleteCustomAvatarUploadErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::CompleteCustomAvatarUploadErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::CompleteCustomAvatarUploadErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::CompleteUploadErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::CompleteUploadErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::CompleteUploadErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::CompleteUploadErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::CompleteUploadErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::CompleteUploadErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::CompleteUploadErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::ConvertGroupErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::ConvertGroupErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::ConvertGroupErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::ConvertGroupErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::ConvertGroupErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::ConvertGroupErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::ConvertGroupErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::CreateCloudTokenErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::CreateCloudTokenErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::CreateCloudTokenErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::CreateCloudTokenErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::CreateCloudTokenErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::CreateCloudTokenErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::CreateCloudTokenErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::CreateGameErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::CreateGameErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::CreateGameErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::CreateGameErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::CreateGameErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::CreateGameErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::CreateGameErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::CreateGameBuildErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::CreateGameBuildErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::CreateGameBuildErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::CreateGameBuildErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::CreateGameBuildErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::CreateGameBuildErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::CreateGameBuildErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::CreateGameCdnSiteErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::CreateGameCdnSiteErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::CreateGameCdnSiteErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::CreateGameCdnSiteErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::CreateGameCdnSiteErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::CreateGameCdnSiteErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::CreateGameCdnSiteErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::CreateGameNamespaceErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::CreateGameNamespaceErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::CreateGameNamespaceErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::CreateGameNamespaceErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::CreateGameNamespaceErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::CreateGameNamespaceErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::CreateGameNamespaceErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl - From< - aws_smithy_http::result::SdkError< - crate::error::CreateGameNamespaceTokenDevelopmentError, - R, - >, - > for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError< - crate::error::CreateGameNamespaceTokenDevelopmentError, - R, - >, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::CreateGameNamespaceTokenDevelopmentErrorKind::InternalError( - inner, - ) => Error::InternalError(inner), - crate::error::CreateGameNamespaceTokenDevelopmentErrorKind::RateLimitError( - inner, - ) => Error::RateLimitError(inner), - crate::error::CreateGameNamespaceTokenDevelopmentErrorKind::ForbiddenError( - inner, - ) => Error::ForbiddenError(inner), - crate::error::CreateGameNamespaceTokenDevelopmentErrorKind::UnauthorizedError( - inner, - ) => Error::UnauthorizedError(inner), - crate::error::CreateGameNamespaceTokenDevelopmentErrorKind::NotFoundError( - inner, - ) => Error::NotFoundError(inner), - crate::error::CreateGameNamespaceTokenDevelopmentErrorKind::BadRequestError( - inner, - ) => Error::BadRequestError(inner), - crate::error::CreateGameNamespaceTokenDevelopmentErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl - From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError< - crate::error::CreateGameNamespaceTokenPublicError, - R, - >, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::CreateGameNamespaceTokenPublicErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::CreateGameNamespaceTokenPublicErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::CreateGameNamespaceTokenPublicErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::CreateGameNamespaceTokenPublicErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::CreateGameNamespaceTokenPublicErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::CreateGameNamespaceTokenPublicErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::CreateGameNamespaceTokenPublicErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::CreateGameVersionErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::CreateGameVersionErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::CreateGameVersionErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::CreateGameVersionErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::CreateGameVersionErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::CreateGameVersionErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::CreateGameVersionErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::DeleteMatchmakerLobbyErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::DeleteMatchmakerLobbyErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::DeleteMatchmakerLobbyErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::DeleteMatchmakerLobbyErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::DeleteMatchmakerLobbyErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::DeleteMatchmakerLobbyErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::DeleteMatchmakerLobbyErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::ExportLobbyLogsErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::ExportLobbyLogsErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::ExportLobbyLogsErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::ExportLobbyLogsErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::ExportLobbyLogsErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::ExportLobbyLogsErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::ExportLobbyLogsErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::ExportMatchmakerLobbyHistoryErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::ExportMatchmakerLobbyHistoryErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::ExportMatchmakerLobbyHistoryErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::ExportMatchmakerLobbyHistoryErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::ExportMatchmakerLobbyHistoryErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::ExportMatchmakerLobbyHistoryErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::ExportMatchmakerLobbyHistoryErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GameBannerUploadCompleteErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GameBannerUploadCompleteErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GameBannerUploadCompleteErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GameBannerUploadCompleteErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GameBannerUploadCompleteErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GameBannerUploadCompleteErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GameBannerUploadCompleteErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GameBannerUploadPrepareErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GameBannerUploadPrepareErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GameBannerUploadPrepareErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GameBannerUploadPrepareErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GameBannerUploadPrepareErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GameBannerUploadPrepareErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GameBannerUploadPrepareErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GameLogoUploadCompleteErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GameLogoUploadCompleteErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GameLogoUploadCompleteErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GameLogoUploadCompleteErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GameLogoUploadCompleteErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GameLogoUploadCompleteErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GameLogoUploadCompleteErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GameLogoUploadPrepareErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GameLogoUploadPrepareErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GameLogoUploadPrepareErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GameLogoUploadPrepareErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GameLogoUploadPrepareErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GameLogoUploadPrepareErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GameLogoUploadPrepareErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GetGameBillingErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GetGameBillingErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GetGameBillingErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GetGameBillingErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GetGameBillingErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GetGameBillingErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GetGameBillingErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GetGameBillingPlansErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GetGameBillingPlansErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GetGameBillingPlansErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GetGameBillingPlansErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GetGameBillingPlansErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GetGameBillingPlansErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GetGameBillingPlansErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GetGameByIdErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GetGameByIdErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GetGameByIdErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GetGameByIdErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GetGameByIdErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GetGameByIdErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GetGameByIdErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GetGameNamespaceByIdErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GetGameNamespaceByIdErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GetGameNamespaceByIdErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GetGameNamespaceByIdErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GetGameNamespaceByIdErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GetGameNamespaceByIdErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GetGameNamespaceByIdErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GetGamesErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GetGamesErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GetGamesErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GetGamesErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GetGamesErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GetGamesErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GetGamesErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GetGameVersionByIdErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GetGameVersionByIdErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GetGameVersionByIdErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GetGameVersionByIdErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GetGameVersionByIdErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GetGameVersionByIdErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GetGameVersionByIdErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GetGroupBillingErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GetGroupBillingErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GetGroupBillingErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GetGroupBillingErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GetGroupBillingErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GetGroupBillingErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GetGroupBillingErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GetGroupInvoicesListErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GetGroupInvoicesListErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GetGroupInvoicesListErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GetGroupInvoicesListErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GetGroupInvoicesListErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GetGroupInvoicesListErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GetGroupInvoicesListErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GetLobbyLogsErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GetLobbyLogsErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GetLobbyLogsErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GetLobbyLogsErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GetLobbyLogsErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GetLobbyLogsErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GetLobbyLogsErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl - From< - aws_smithy_http::result::SdkError< - crate::error::GetNamespaceAnalyticsMatchmakerLiveError, - R, - >, - > for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError< - crate::error::GetNamespaceAnalyticsMatchmakerLiveError, - R, - >, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GetNamespaceAnalyticsMatchmakerLiveErrorKind::InternalError( - inner, - ) => Error::InternalError(inner), - crate::error::GetNamespaceAnalyticsMatchmakerLiveErrorKind::RateLimitError( - inner, - ) => Error::RateLimitError(inner), - crate::error::GetNamespaceAnalyticsMatchmakerLiveErrorKind::ForbiddenError( - inner, - ) => Error::ForbiddenError(inner), - crate::error::GetNamespaceAnalyticsMatchmakerLiveErrorKind::UnauthorizedError( - inner, - ) => Error::UnauthorizedError(inner), - crate::error::GetNamespaceAnalyticsMatchmakerLiveErrorKind::NotFoundError( - inner, - ) => Error::NotFoundError(inner), - crate::error::GetNamespaceAnalyticsMatchmakerLiveErrorKind::BadRequestError( - inner, - ) => Error::BadRequestError(inner), - crate::error::GetNamespaceAnalyticsMatchmakerLiveErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GetNamespaceLobbyErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GetNamespaceLobbyErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GetNamespaceLobbyErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GetNamespaceLobbyErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GetNamespaceLobbyErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GetNamespaceLobbyErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GetNamespaceLobbyErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GetRayPerfLogsErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GetRayPerfLogsErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GetRayPerfLogsErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GetRayPerfLogsErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GetRayPerfLogsErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GetRayPerfLogsErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GetRayPerfLogsErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GetRegionTiersErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GetRegionTiersErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GetRegionTiersErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GetRegionTiersErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GetRegionTiersErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GetRegionTiersErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GetRegionTiersErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GroupBillingCheckoutErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GroupBillingCheckoutErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GroupBillingCheckoutErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GroupBillingCheckoutErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GroupBillingCheckoutErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GroupBillingCheckoutErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GroupBillingCheckoutErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::InspectErrorKind::InternalError(inner) => Error::InternalError(inner), - crate::error::InspectErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::InspectErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::InspectErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::InspectErrorKind::NotFoundError(inner) => Error::NotFoundError(inner), - crate::error::InspectErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::InspectErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::ListGameBuildsErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::ListGameBuildsErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::ListGameBuildsErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::ListGameBuildsErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::ListGameBuildsErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::ListGameBuildsErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::ListGameBuildsErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::ListGameCdnSitesErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::ListGameCdnSitesErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::ListGameCdnSitesErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::ListGameCdnSitesErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::ListGameCdnSitesErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::ListGameCdnSitesErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::ListGameCdnSitesErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::ListGameCustomAvatarsErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::ListGameCustomAvatarsErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::ListGameCustomAvatarsErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::ListGameCustomAvatarsErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::ListGameCustomAvatarsErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::ListGameCustomAvatarsErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::ListGameCustomAvatarsErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::ListNamespaceLobbiesErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::ListNamespaceLobbiesErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::ListNamespaceLobbiesErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::ListNamespaceLobbiesErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::ListNamespaceLobbiesErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::ListNamespaceLobbiesErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::ListNamespaceLobbiesErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::PrepareCustomAvatarUploadErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::PrepareCustomAvatarUploadErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::PrepareCustomAvatarUploadErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::PrepareCustomAvatarUploadErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::PrepareCustomAvatarUploadErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::PrepareCustomAvatarUploadErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::PrepareCustomAvatarUploadErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::RemoveNamespaceCdnAuthUserErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::RemoveNamespaceCdnAuthUserErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::RemoveNamespaceCdnAuthUserErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::RemoveNamespaceCdnAuthUserErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::RemoveNamespaceCdnAuthUserErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::RemoveNamespaceCdnAuthUserErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::RemoveNamespaceCdnAuthUserErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::RemoveNamespaceDomainErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::RemoveNamespaceDomainErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::RemoveNamespaceDomainErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::RemoveNamespaceDomainErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::RemoveNamespaceDomainErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::RemoveNamespaceDomainErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::RemoveNamespaceDomainErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::SetGameBillingPlanErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::SetGameBillingPlanErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::SetGameBillingPlanErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::SetGameBillingPlanErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::SetGameBillingPlanErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::SetGameBillingPlanErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::SetGameBillingPlanErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::SetNamespaceCdnAuthTypeErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::SetNamespaceCdnAuthTypeErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::SetNamespaceCdnAuthTypeErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::SetNamespaceCdnAuthTypeErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::SetNamespaceCdnAuthTypeErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::SetNamespaceCdnAuthTypeErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::SetNamespaceCdnAuthTypeErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl - From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError< - crate::error::ToggleNamespaceDomainPublicAuthError, - R, - >, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::ToggleNamespaceDomainPublicAuthErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::ToggleNamespaceDomainPublicAuthErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::ToggleNamespaceDomainPublicAuthErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::ToggleNamespaceDomainPublicAuthErrorKind::UnauthorizedError( - inner, - ) => Error::UnauthorizedError(inner), - crate::error::ToggleNamespaceDomainPublicAuthErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::ToggleNamespaceDomainPublicAuthErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::ToggleNamespaceDomainPublicAuthErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl - From< - aws_smithy_http::result::SdkError< - crate::error::UpdateGameNamespaceMatchmakerConfigError, - R, - >, - > for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError< - crate::error::UpdateGameNamespaceMatchmakerConfigError, - R, - >, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::UpdateGameNamespaceMatchmakerConfigErrorKind::InternalError( - inner, - ) => Error::InternalError(inner), - crate::error::UpdateGameNamespaceMatchmakerConfigErrorKind::RateLimitError( - inner, - ) => Error::RateLimitError(inner), - crate::error::UpdateGameNamespaceMatchmakerConfigErrorKind::ForbiddenError( - inner, - ) => Error::ForbiddenError(inner), - crate::error::UpdateGameNamespaceMatchmakerConfigErrorKind::UnauthorizedError( - inner, - ) => Error::UnauthorizedError(inner), - crate::error::UpdateGameNamespaceMatchmakerConfigErrorKind::NotFoundError( - inner, - ) => Error::NotFoundError(inner), - crate::error::UpdateGameNamespaceMatchmakerConfigErrorKind::BadRequestError( - inner, - ) => Error::BadRequestError(inner), - crate::error::UpdateGameNamespaceMatchmakerConfigErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::UpdateGameNamespaceVersionErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::UpdateGameNamespaceVersionErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::UpdateGameNamespaceVersionErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::UpdateGameNamespaceVersionErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::UpdateGameNamespaceVersionErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::UpdateGameNamespaceVersionErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::UpdateGameNamespaceVersionErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::UpdateNamespaceCdnAuthUserErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::UpdateNamespaceCdnAuthUserErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::UpdateNamespaceCdnAuthUserErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::UpdateNamespaceCdnAuthUserErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::UpdateNamespaceCdnAuthUserErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::UpdateNamespaceCdnAuthUserErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::UpdateNamespaceCdnAuthUserErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::ValidateGameErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::ValidateGameErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::ValidateGameErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::ValidateGameErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::ValidateGameErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::ValidateGameErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::ValidateGameErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::ValidateGameNamespaceErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::ValidateGameNamespaceErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::ValidateGameNamespaceErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::ValidateGameNamespaceErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::ValidateGameNamespaceErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::ValidateGameNamespaceErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::ValidateGameNamespaceErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl - From< - aws_smithy_http::result::SdkError< - crate::error::ValidateGameNamespaceMatchmakerConfigError, - R, - >, - > for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError< - crate::error::ValidateGameNamespaceMatchmakerConfigError, - R, - >, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::ValidateGameNamespaceMatchmakerConfigErrorKind::InternalError( - inner, - ) => Error::InternalError(inner), - crate::error::ValidateGameNamespaceMatchmakerConfigErrorKind::RateLimitError( - inner, - ) => Error::RateLimitError(inner), - crate::error::ValidateGameNamespaceMatchmakerConfigErrorKind::ForbiddenError( - inner, - ) => Error::ForbiddenError(inner), - crate::error::ValidateGameNamespaceMatchmakerConfigErrorKind::UnauthorizedError( - inner, - ) => Error::UnauthorizedError(inner), - crate::error::ValidateGameNamespaceMatchmakerConfigErrorKind::NotFoundError( - inner, - ) => Error::NotFoundError(inner), - crate::error::ValidateGameNamespaceMatchmakerConfigErrorKind::BadRequestError( - inner, - ) => Error::BadRequestError(inner), - crate::error::ValidateGameNamespaceMatchmakerConfigErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl - From< - aws_smithy_http::result::SdkError< - crate::error::ValidateGameNamespaceTokenDevelopmentError, - R, - >, - > for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError< - crate::error::ValidateGameNamespaceTokenDevelopmentError, - R, - >, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::ValidateGameNamespaceTokenDevelopmentErrorKind::InternalError( - inner, - ) => Error::InternalError(inner), - crate::error::ValidateGameNamespaceTokenDevelopmentErrorKind::RateLimitError( - inner, - ) => Error::RateLimitError(inner), - crate::error::ValidateGameNamespaceTokenDevelopmentErrorKind::ForbiddenError( - inner, - ) => Error::ForbiddenError(inner), - crate::error::ValidateGameNamespaceTokenDevelopmentErrorKind::UnauthorizedError( - inner, - ) => Error::UnauthorizedError(inner), - crate::error::ValidateGameNamespaceTokenDevelopmentErrorKind::NotFoundError( - inner, - ) => Error::NotFoundError(inner), - crate::error::ValidateGameNamespaceTokenDevelopmentErrorKind::BadRequestError( - inner, - ) => Error::BadRequestError(inner), - crate::error::ValidateGameNamespaceTokenDevelopmentErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::ValidateGameVersionErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::ValidateGameVersionErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::ValidateGameVersionErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::ValidateGameVersionErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::ValidateGameVersionErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::ValidateGameVersionErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::ValidateGameVersionErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::ValidateGroupErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::ValidateGroupErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::ValidateGroupErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::ValidateGroupErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::ValidateGroupErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::ValidateGroupErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::ValidateGroupErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl std::error::Error for Error {} diff --git a/lib/smithy-output/api-cloud/rust/rust/src/input.rs b/lib/smithy-output/api-cloud/rust/rust/src/input.rs deleted file mode 100644 index a12e4914c..000000000 --- a/lib/smithy-output/api-cloud/rust/rust/src/input.rs +++ /dev/null @@ -1,9583 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -use std::fmt::Write; -/// See [`AddNamespaceDomainInput`](crate::input::AddNamespaceDomainInput) -pub mod add_namespace_domain_input { - /// A builder for [`AddNamespaceDomainInput`](crate::input::AddNamespaceDomainInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) namespace_id: std::option::Option, - pub(crate) domain: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.namespace_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.namespace_id = input; - self - } - /// A valid domain name (no protocol). - pub fn domain(mut self, input: impl Into) -> Self { - self.domain = Some(input.into()); - self - } - /// A valid domain name (no protocol). - pub fn set_domain(mut self, input: std::option::Option) -> Self { - self.domain = input; - self - } - /// Consumes the builder and constructs a [`AddNamespaceDomainInput`](crate::input::AddNamespaceDomainInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::AddNamespaceDomainInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::AddNamespaceDomainInput { - game_id: self.game_id, - namespace_id: self.namespace_id, - domain: self.domain, - }) - } - } -} -#[doc(hidden)] -pub type AddNamespaceDomainInputOperationOutputAlias = crate::operation::AddNamespaceDomain; -#[doc(hidden)] -pub type AddNamespaceDomainInputOperationRetryAlias = (); -impl AddNamespaceDomainInput { - /// Consumes the builder and constructs an Operation<[`AddNamespaceDomain`](crate::operation::AddNamespaceDomain)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::AddNamespaceDomainInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_1 = &_input.game_id; - let input_1 = input_1.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_1, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - let input_2 = &_input.namespace_id; - let input_2 = input_2.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "namespace_id", - details: "cannot be empty or unset", - }, - )?; - let namespace_id = aws_smithy_http::label::fmt_string(input_2, false); - if namespace_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "namespace_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/games/{game_id}/namespaces/{namespace_id}/domains", - game_id = game_id, - namespace_id = namespace_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::AddNamespaceDomainInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_add_namespace_domain(&self)?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::AddNamespaceDomain::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "AddNamespaceDomain", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`AddNamespaceDomainInput`](crate::input::AddNamespaceDomainInput) - pub fn builder() -> crate::input::add_namespace_domain_input::Builder { - crate::input::add_namespace_domain_input::Builder::default() - } -} - -/// See [`CompleteCustomAvatarUploadInput`](crate::input::CompleteCustomAvatarUploadInput) -pub mod complete_custom_avatar_upload_input { - /// A builder for [`CompleteCustomAvatarUploadInput`](crate::input::CompleteCustomAvatarUploadInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) upload_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// A universally unique identifier. - pub fn upload_id(mut self, input: impl Into) -> Self { - self.upload_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_upload_id(mut self, input: std::option::Option) -> Self { - self.upload_id = input; - self - } - /// Consumes the builder and constructs a [`CompleteCustomAvatarUploadInput`](crate::input::CompleteCustomAvatarUploadInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::CompleteCustomAvatarUploadInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::CompleteCustomAvatarUploadInput { - game_id: self.game_id, - upload_id: self.upload_id, - }) - } - } -} -#[doc(hidden)] -pub type CompleteCustomAvatarUploadInputOperationOutputAlias = - crate::operation::CompleteCustomAvatarUpload; -#[doc(hidden)] -pub type CompleteCustomAvatarUploadInputOperationRetryAlias = (); -impl CompleteCustomAvatarUploadInput { - /// Consumes the builder and constructs an Operation<[`CompleteCustomAvatarUpload`](crate::operation::CompleteCustomAvatarUpload)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::CompleteCustomAvatarUploadInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_3 = &_input.game_id; - let input_3 = input_3.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_3, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - let input_4 = &_input.upload_id; - let input_4 = input_4.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "upload_id", - details: "cannot be empty or unset", - }, - )?; - let upload_id = aws_smithy_http::label::fmt_string(input_4, false); - if upload_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "upload_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/games/{game_id}/avatar-upload/{upload_id}/complete", - game_id = game_id, - upload_id = upload_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::CompleteCustomAvatarUploadInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from("{}"); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::CompleteCustomAvatarUpload::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "CompleteCustomAvatarUpload", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`CompleteCustomAvatarUploadInput`](crate::input::CompleteCustomAvatarUploadInput) - pub fn builder() -> crate::input::complete_custom_avatar_upload_input::Builder { - crate::input::complete_custom_avatar_upload_input::Builder::default() - } -} - -/// See [`CompleteUploadInput`](crate::input::CompleteUploadInput) -pub mod complete_upload_input { - /// A builder for [`CompleteUploadInput`](crate::input::CompleteUploadInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) upload_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn upload_id(mut self, input: impl Into) -> Self { - self.upload_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_upload_id(mut self, input: std::option::Option) -> Self { - self.upload_id = input; - self - } - /// Consumes the builder and constructs a [`CompleteUploadInput`](crate::input::CompleteUploadInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::CompleteUploadInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::CompleteUploadInput { - upload_id: self.upload_id, - }) - } - } -} -#[doc(hidden)] -pub type CompleteUploadInputOperationOutputAlias = crate::operation::CompleteUpload; -#[doc(hidden)] -pub type CompleteUploadInputOperationRetryAlias = (); -impl CompleteUploadInput { - /// Consumes the builder and constructs an Operation<[`CompleteUpload`](crate::operation::CompleteUpload)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::CompleteUploadInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_5 = &_input.upload_id; - let input_5 = input_5.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "upload_id", - details: "cannot be empty or unset", - }, - )?; - let upload_id = aws_smithy_http::label::fmt_string(input_5, false); - if upload_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "upload_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/uploads/{upload_id}/complete", - upload_id = upload_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::CompleteUploadInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from("{}"); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::CompleteUpload::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "CompleteUpload", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`CompleteUploadInput`](crate::input::CompleteUploadInput) - pub fn builder() -> crate::input::complete_upload_input::Builder { - crate::input::complete_upload_input::Builder::default() - } -} - -/// See [`ConvertGroupInput`](crate::input::ConvertGroupInput) -pub mod convert_group_input { - /// A builder for [`ConvertGroupInput`](crate::input::ConvertGroupInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) group_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.group_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.group_id = input; - self - } - /// Consumes the builder and constructs a [`ConvertGroupInput`](crate::input::ConvertGroupInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::ConvertGroupInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::ConvertGroupInput { - group_id: self.group_id, - }) - } - } -} -#[doc(hidden)] -pub type ConvertGroupInputOperationOutputAlias = crate::operation::ConvertGroup; -#[doc(hidden)] -pub type ConvertGroupInputOperationRetryAlias = (); -impl ConvertGroupInput { - /// Consumes the builder and constructs an Operation<[`ConvertGroup`](crate::operation::ConvertGroup)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::ConvertGroupInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_6 = &_input.group_id; - let input_6 = input_6.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }, - )?; - let group_id = aws_smithy_http::label::fmt_string(input_6, false); - if group_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }); - } - write!(output, "/groups/{group_id}/convert", group_id = group_id) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::ConvertGroupInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from("{}"); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::ConvertGroup::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "ConvertGroup", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`ConvertGroupInput`](crate::input::ConvertGroupInput) - pub fn builder() -> crate::input::convert_group_input::Builder { - crate::input::convert_group_input::Builder::default() - } -} - -/// See [`CreateCloudTokenInput`](crate::input::CreateCloudTokenInput) -pub mod create_cloud_token_input { - /// A builder for [`CreateCloudTokenInput`](crate::input::CreateCloudTokenInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// Consumes the builder and constructs a [`CreateCloudTokenInput`](crate::input::CreateCloudTokenInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::CreateCloudTokenInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::CreateCloudTokenInput { - game_id: self.game_id, - }) - } - } -} -#[doc(hidden)] -pub type CreateCloudTokenInputOperationOutputAlias = crate::operation::CreateCloudToken; -#[doc(hidden)] -pub type CreateCloudTokenInputOperationRetryAlias = (); -impl CreateCloudTokenInput { - /// Consumes the builder and constructs an Operation<[`CreateCloudToken`](crate::operation::CreateCloudToken)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::CreateCloudTokenInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_7 = &_input.game_id; - let input_7 = input_7.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_7, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - write!(output, "/games/{game_id}/tokens/cloud", game_id = game_id) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::CreateCloudTokenInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from("{}"); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::CreateCloudToken::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "CreateCloudToken", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`CreateCloudTokenInput`](crate::input::CreateCloudTokenInput) - pub fn builder() -> crate::input::create_cloud_token_input::Builder { - crate::input::create_cloud_token_input::Builder::default() - } -} - -/// See [`CreateGameInput`](crate::input::CreateGameInput) -pub mod create_game_input { - /// A builder for [`CreateGameInput`](crate::input::CreateGameInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) name_id: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) developer_group_id: std::option::Option, - } - impl Builder { - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn name_id(mut self, input: impl Into) -> Self { - self.name_id = Some(input.into()); - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn set_name_id(mut self, input: std::option::Option) -> Self { - self.name_id = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// A universally unique identifier. - pub fn developer_group_id(mut self, input: impl Into) -> Self { - self.developer_group_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_developer_group_id( - mut self, - input: std::option::Option, - ) -> Self { - self.developer_group_id = input; - self - } - /// Consumes the builder and constructs a [`CreateGameInput`](crate::input::CreateGameInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::CreateGameInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::CreateGameInput { - name_id: self.name_id, - display_name: self.display_name, - developer_group_id: self.developer_group_id, - }) - } - } -} -#[doc(hidden)] -pub type CreateGameInputOperationOutputAlias = crate::operation::CreateGame; -#[doc(hidden)] -pub type CreateGameInputOperationRetryAlias = (); -impl CreateGameInput { - /// Consumes the builder and constructs an Operation<[`CreateGame`](crate::operation::CreateGame)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::CreateGameInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/games").expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::CreateGameInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_create_game(&self)?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::CreateGame::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "CreateGame", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`CreateGameInput`](crate::input::CreateGameInput) - pub fn builder() -> crate::input::create_game_input::Builder { - crate::input::create_game_input::Builder::default() - } -} - -/// See [`CreateGameBuildInput`](crate::input::CreateGameBuildInput) -pub mod create_game_build_input { - /// A builder for [`CreateGameBuildInput`](crate::input::CreateGameBuildInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) image_tag: std::option::Option, - pub(crate) image_file: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// A tag given to the game build. - pub fn image_tag(mut self, input: impl Into) -> Self { - self.image_tag = Some(input.into()); - self - } - /// A tag given to the game build. - pub fn set_image_tag(mut self, input: std::option::Option) -> Self { - self.image_tag = input; - self - } - /// A file being prepared to upload. - pub fn image_file(mut self, input: crate::model::UploadPrepareFile) -> Self { - self.image_file = Some(input); - self - } - /// A file being prepared to upload. - pub fn set_image_file( - mut self, - input: std::option::Option, - ) -> Self { - self.image_file = input; - self - } - /// Consumes the builder and constructs a [`CreateGameBuildInput`](crate::input::CreateGameBuildInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::CreateGameBuildInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::CreateGameBuildInput { - game_id: self.game_id, - display_name: self.display_name, - image_tag: self.image_tag, - image_file: self.image_file, - }) - } - } -} -#[doc(hidden)] -pub type CreateGameBuildInputOperationOutputAlias = crate::operation::CreateGameBuild; -#[doc(hidden)] -pub type CreateGameBuildInputOperationRetryAlias = (); -impl CreateGameBuildInput { - /// Consumes the builder and constructs an Operation<[`CreateGameBuild`](crate::operation::CreateGameBuild)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::CreateGameBuildInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_8 = &_input.game_id; - let input_8 = input_8.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_8, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - write!(output, "/games/{game_id}/builds", game_id = game_id) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::CreateGameBuildInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_create_game_build(&self)?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::CreateGameBuild::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "CreateGameBuild", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`CreateGameBuildInput`](crate::input::CreateGameBuildInput) - pub fn builder() -> crate::input::create_game_build_input::Builder { - crate::input::create_game_build_input::Builder::default() - } -} - -/// See [`CreateGameCdnSiteInput`](crate::input::CreateGameCdnSiteInput) -pub mod create_game_cdn_site_input { - /// A builder for [`CreateGameCdnSiteInput`](crate::input::CreateGameCdnSiteInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) files: std::option::Option>, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// Appends an item to `files`. - /// - /// To override the contents of this collection use [`set_files`](Self::set_files). - /// - /// A list of files preparing to upload. - pub fn files(mut self, input: crate::model::UploadPrepareFile) -> Self { - let mut v = self.files.unwrap_or_default(); - v.push(input); - self.files = Some(v); - self - } - /// A list of files preparing to upload. - pub fn set_files( - mut self, - input: std::option::Option>, - ) -> Self { - self.files = input; - self - } - /// Consumes the builder and constructs a [`CreateGameCdnSiteInput`](crate::input::CreateGameCdnSiteInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::CreateGameCdnSiteInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::CreateGameCdnSiteInput { - game_id: self.game_id, - display_name: self.display_name, - files: self.files, - }) - } - } -} -#[doc(hidden)] -pub type CreateGameCdnSiteInputOperationOutputAlias = crate::operation::CreateGameCdnSite; -#[doc(hidden)] -pub type CreateGameCdnSiteInputOperationRetryAlias = (); -impl CreateGameCdnSiteInput { - /// Consumes the builder and constructs an Operation<[`CreateGameCdnSite`](crate::operation::CreateGameCdnSite)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::CreateGameCdnSiteInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_9 = &_input.game_id; - let input_9 = input_9.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_9, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - write!(output, "/games/{game_id}/cdn/sites", game_id = game_id) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::CreateGameCdnSiteInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_create_game_cdn_site(&self)?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::CreateGameCdnSite::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "CreateGameCdnSite", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`CreateGameCdnSiteInput`](crate::input::CreateGameCdnSiteInput) - pub fn builder() -> crate::input::create_game_cdn_site_input::Builder { - crate::input::create_game_cdn_site_input::Builder::default() - } -} - -/// See [`CreateGameNamespaceInput`](crate::input::CreateGameNamespaceInput) -pub mod create_game_namespace_input { - /// A builder for [`CreateGameNamespaceInput`](crate::input::CreateGameNamespaceInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) version_id: std::option::Option, - pub(crate) name_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// A universally unique identifier. - pub fn version_id(mut self, input: impl Into) -> Self { - self.version_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_version_id(mut self, input: std::option::Option) -> Self { - self.version_id = input; - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn name_id(mut self, input: impl Into) -> Self { - self.name_id = Some(input.into()); - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn set_name_id(mut self, input: std::option::Option) -> Self { - self.name_id = input; - self - } - /// Consumes the builder and constructs a [`CreateGameNamespaceInput`](crate::input::CreateGameNamespaceInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::CreateGameNamespaceInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::CreateGameNamespaceInput { - game_id: self.game_id, - display_name: self.display_name, - version_id: self.version_id, - name_id: self.name_id, - }) - } - } -} -#[doc(hidden)] -pub type CreateGameNamespaceInputOperationOutputAlias = crate::operation::CreateGameNamespace; -#[doc(hidden)] -pub type CreateGameNamespaceInputOperationRetryAlias = (); -impl CreateGameNamespaceInput { - /// Consumes the builder and constructs an Operation<[`CreateGameNamespace`](crate::operation::CreateGameNamespace)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::CreateGameNamespaceInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_10 = &_input.game_id; - let input_10 = input_10.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_10, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - write!(output, "/games/{game_id}/namespaces", game_id = game_id) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::CreateGameNamespaceInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_create_game_namespace(&self)?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::CreateGameNamespace::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "CreateGameNamespace", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`CreateGameNamespaceInput`](crate::input::CreateGameNamespaceInput) - pub fn builder() -> crate::input::create_game_namespace_input::Builder { - crate::input::create_game_namespace_input::Builder::default() - } -} - -/// See [`CreateGameNamespaceTokenDevelopmentInput`](crate::input::CreateGameNamespaceTokenDevelopmentInput) -pub mod create_game_namespace_token_development_input { - /// A builder for [`CreateGameNamespaceTokenDevelopmentInput`](crate::input::CreateGameNamespaceTokenDevelopmentInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) namespace_id: std::option::Option, - pub(crate) hostname: std::option::Option, - pub(crate) lobby_ports: - std::option::Option>, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.namespace_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.namespace_id = input; - self - } - /// The hostname used for the token. - pub fn hostname(mut self, input: impl Into) -> Self { - self.hostname = Some(input.into()); - self - } - /// The hostname used for the token. - pub fn set_hostname(mut self, input: std::option::Option) -> Self { - self.hostname = input; - self - } - /// Appends an item to `lobby_ports`. - /// - /// To override the contents of this collection use [`set_lobby_ports`](Self::set_lobby_ports). - /// - /// A list of docker ports. - pub fn lobby_ports(mut self, input: crate::model::LobbyGroupRuntimeDockerPort) -> Self { - let mut v = self.lobby_ports.unwrap_or_default(); - v.push(input); - self.lobby_ports = Some(v); - self - } - /// A list of docker ports. - pub fn set_lobby_ports( - mut self, - input: std::option::Option>, - ) -> Self { - self.lobby_ports = input; - self - } - /// Consumes the builder and constructs a [`CreateGameNamespaceTokenDevelopmentInput`](crate::input::CreateGameNamespaceTokenDevelopmentInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::CreateGameNamespaceTokenDevelopmentInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::CreateGameNamespaceTokenDevelopmentInput { - game_id: self.game_id, - namespace_id: self.namespace_id, - hostname: self.hostname, - lobby_ports: self.lobby_ports, - }) - } - } -} -#[doc(hidden)] -pub type CreateGameNamespaceTokenDevelopmentInputOperationOutputAlias = - crate::operation::CreateGameNamespaceTokenDevelopment; -#[doc(hidden)] -pub type CreateGameNamespaceTokenDevelopmentInputOperationRetryAlias = (); -impl CreateGameNamespaceTokenDevelopmentInput { - /// Consumes the builder and constructs an Operation<[`CreateGameNamespaceTokenDevelopment`](crate::operation::CreateGameNamespaceTokenDevelopment)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation< - crate::operation::CreateGameNamespaceTokenDevelopment, - (), - >, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::CreateGameNamespaceTokenDevelopmentInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_11 = &_input.game_id; - let input_11 = input_11.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_11, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - let input_12 = &_input.namespace_id; - let input_12 = input_12.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "namespace_id", - details: "cannot be empty or unset", - }, - )?; - let namespace_id = aws_smithy_http::label::fmt_string(input_12, false); - if namespace_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "namespace_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/games/{game_id}/namespaces/{namespace_id}/tokens/development", - game_id = game_id, - namespace_id = namespace_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::CreateGameNamespaceTokenDevelopmentInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)]let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_create_game_namespace_token_development(&self)? - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::CreateGameNamespaceTokenDevelopment::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "CreateGameNamespaceTokenDevelopment", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`CreateGameNamespaceTokenDevelopmentInput`](crate::input::CreateGameNamespaceTokenDevelopmentInput) - pub fn builder() -> crate::input::create_game_namespace_token_development_input::Builder { - crate::input::create_game_namespace_token_development_input::Builder::default() - } -} - -/// See [`CreateGameNamespaceTokenPublicInput`](crate::input::CreateGameNamespaceTokenPublicInput) -pub mod create_game_namespace_token_public_input { - /// A builder for [`CreateGameNamespaceTokenPublicInput`](crate::input::CreateGameNamespaceTokenPublicInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) namespace_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.namespace_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.namespace_id = input; - self - } - /// Consumes the builder and constructs a [`CreateGameNamespaceTokenPublicInput`](crate::input::CreateGameNamespaceTokenPublicInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::CreateGameNamespaceTokenPublicInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::CreateGameNamespaceTokenPublicInput { - game_id: self.game_id, - namespace_id: self.namespace_id, - }) - } - } -} -#[doc(hidden)] -pub type CreateGameNamespaceTokenPublicInputOperationOutputAlias = - crate::operation::CreateGameNamespaceTokenPublic; -#[doc(hidden)] -pub type CreateGameNamespaceTokenPublicInputOperationRetryAlias = (); -impl CreateGameNamespaceTokenPublicInput { - /// Consumes the builder and constructs an Operation<[`CreateGameNamespaceTokenPublic`](crate::operation::CreateGameNamespaceTokenPublic)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::CreateGameNamespaceTokenPublicInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_13 = &_input.game_id; - let input_13 = input_13.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_13, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - let input_14 = &_input.namespace_id; - let input_14 = input_14.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "namespace_id", - details: "cannot be empty or unset", - }, - )?; - let namespace_id = aws_smithy_http::label::fmt_string(input_14, false); - if namespace_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "namespace_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/games/{game_id}/namespaces/{namespace_id}/tokens/public", - game_id = game_id, - namespace_id = namespace_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::CreateGameNamespaceTokenPublicInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from("{}"); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::CreateGameNamespaceTokenPublic::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "CreateGameNamespaceTokenPublic", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`CreateGameNamespaceTokenPublicInput`](crate::input::CreateGameNamespaceTokenPublicInput) - pub fn builder() -> crate::input::create_game_namespace_token_public_input::Builder { - crate::input::create_game_namespace_token_public_input::Builder::default() - } -} - -/// See [`CreateGameVersionInput`](crate::input::CreateGameVersionInput) -pub mod create_game_version_input { - /// A builder for [`CreateGameVersionInput`](crate::input::CreateGameVersionInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) config: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// Cloud configuration for a given version. - pub fn config(mut self, input: crate::model::CloudVersionConfig) -> Self { - self.config = Some(input); - self - } - /// Cloud configuration for a given version. - pub fn set_config( - mut self, - input: std::option::Option, - ) -> Self { - self.config = input; - self - } - /// Consumes the builder and constructs a [`CreateGameVersionInput`](crate::input::CreateGameVersionInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::CreateGameVersionInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::CreateGameVersionInput { - game_id: self.game_id, - display_name: self.display_name, - config: self.config, - }) - } - } -} -#[doc(hidden)] -pub type CreateGameVersionInputOperationOutputAlias = crate::operation::CreateGameVersion; -#[doc(hidden)] -pub type CreateGameVersionInputOperationRetryAlias = (); -impl CreateGameVersionInput { - /// Consumes the builder and constructs an Operation<[`CreateGameVersion`](crate::operation::CreateGameVersion)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::CreateGameVersionInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_15 = &_input.game_id; - let input_15 = input_15.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_15, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - write!(output, "/games/{game_id}/versions", game_id = game_id) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::CreateGameVersionInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_create_game_version(&self)?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::CreateGameVersion::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "CreateGameVersion", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`CreateGameVersionInput`](crate::input::CreateGameVersionInput) - pub fn builder() -> crate::input::create_game_version_input::Builder { - crate::input::create_game_version_input::Builder::default() - } -} - -/// See [`DeleteMatchmakerLobbyInput`](crate::input::DeleteMatchmakerLobbyInput) -pub mod delete_matchmaker_lobby_input { - /// A builder for [`DeleteMatchmakerLobbyInput`](crate::input::DeleteMatchmakerLobbyInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) lobby_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// A universally unique identifier. - pub fn lobby_id(mut self, input: impl Into) -> Self { - self.lobby_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_lobby_id(mut self, input: std::option::Option) -> Self { - self.lobby_id = input; - self - } - /// Consumes the builder and constructs a [`DeleteMatchmakerLobbyInput`](crate::input::DeleteMatchmakerLobbyInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::DeleteMatchmakerLobbyInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::DeleteMatchmakerLobbyInput { - game_id: self.game_id, - lobby_id: self.lobby_id, - }) - } - } -} -#[doc(hidden)] -pub type DeleteMatchmakerLobbyInputOperationOutputAlias = crate::operation::DeleteMatchmakerLobby; -#[doc(hidden)] -pub type DeleteMatchmakerLobbyInputOperationRetryAlias = (); -impl DeleteMatchmakerLobbyInput { - /// Consumes the builder and constructs an Operation<[`DeleteMatchmakerLobby`](crate::operation::DeleteMatchmakerLobby)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::DeleteMatchmakerLobbyInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_16 = &_input.game_id; - let input_16 = input_16.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_16, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - let input_17 = &_input.lobby_id; - let input_17 = input_17.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "lobby_id", - details: "cannot be empty or unset", - }, - )?; - let lobby_id = aws_smithy_http::label::fmt_string(input_17, false); - if lobby_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "lobby_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/games/{game_id}/matchmaker/lobbies/{lobby_id}", - game_id = game_id, - lobby_id = lobby_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::DeleteMatchmakerLobbyInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("DELETE").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::DeleteMatchmakerLobby::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "DeleteMatchmakerLobby", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`DeleteMatchmakerLobbyInput`](crate::input::DeleteMatchmakerLobbyInput) - pub fn builder() -> crate::input::delete_matchmaker_lobby_input::Builder { - crate::input::delete_matchmaker_lobby_input::Builder::default() - } -} - -/// See [`ExportLobbyLogsInput`](crate::input::ExportLobbyLogsInput) -pub mod export_lobby_logs_input { - /// A builder for [`ExportLobbyLogsInput`](crate::input::ExportLobbyLogsInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) lobby_id: std::option::Option, - pub(crate) stream: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// A universally unique identifier. - pub fn lobby_id(mut self, input: impl Into) -> Self { - self.lobby_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_lobby_id(mut self, input: std::option::Option) -> Self { - self.lobby_id = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn stream(mut self, input: crate::model::LogStream) -> Self { - self.stream = Some(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_stream(mut self, input: std::option::Option) -> Self { - self.stream = input; - self - } - /// Consumes the builder and constructs a [`ExportLobbyLogsInput`](crate::input::ExportLobbyLogsInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::ExportLobbyLogsInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::ExportLobbyLogsInput { - game_id: self.game_id, - lobby_id: self.lobby_id, - stream: self.stream, - }) - } - } -} -#[doc(hidden)] -pub type ExportLobbyLogsInputOperationOutputAlias = crate::operation::ExportLobbyLogs; -#[doc(hidden)] -pub type ExportLobbyLogsInputOperationRetryAlias = (); -impl ExportLobbyLogsInput { - /// Consumes the builder and constructs an Operation<[`ExportLobbyLogs`](crate::operation::ExportLobbyLogs)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::ExportLobbyLogsInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_18 = &_input.game_id; - let input_18 = input_18.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_18, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - let input_19 = &_input.lobby_id; - let input_19 = input_19.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "lobby_id", - details: "cannot be empty or unset", - }, - )?; - let lobby_id = aws_smithy_http::label::fmt_string(input_19, false); - if lobby_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "lobby_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/games/{game_id}/matchmaker/lobbies/{lobby_id}/logs/export", - game_id = game_id, - lobby_id = lobby_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::ExportLobbyLogsInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_export_lobby_logs(&self)?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::ExportLobbyLogs::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "ExportLobbyLogs", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`ExportLobbyLogsInput`](crate::input::ExportLobbyLogsInput) - pub fn builder() -> crate::input::export_lobby_logs_input::Builder { - crate::input::export_lobby_logs_input::Builder::default() - } -} - -/// See [`ExportMatchmakerLobbyHistoryInput`](crate::input::ExportMatchmakerLobbyHistoryInput) -pub mod export_matchmaker_lobby_history_input { - /// A builder for [`ExportMatchmakerLobbyHistoryInput`](crate::input::ExportMatchmakerLobbyHistoryInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) query_start: std::option::Option, - pub(crate) query_end: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// Unsigned 64 bit integer. - pub fn query_start(mut self, input: i64) -> Self { - self.query_start = Some(input); - self - } - /// Unsigned 64 bit integer. - pub fn set_query_start(mut self, input: std::option::Option) -> Self { - self.query_start = input; - self - } - /// Unsigned 64 bit integer. - pub fn query_end(mut self, input: i64) -> Self { - self.query_end = Some(input); - self - } - /// Unsigned 64 bit integer. - pub fn set_query_end(mut self, input: std::option::Option) -> Self { - self.query_end = input; - self - } - /// Consumes the builder and constructs a [`ExportMatchmakerLobbyHistoryInput`](crate::input::ExportMatchmakerLobbyHistoryInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::ExportMatchmakerLobbyHistoryInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::ExportMatchmakerLobbyHistoryInput { - game_id: self.game_id, - query_start: self.query_start, - query_end: self.query_end, - }) - } - } -} -#[doc(hidden)] -pub type ExportMatchmakerLobbyHistoryInputOperationOutputAlias = - crate::operation::ExportMatchmakerLobbyHistory; -#[doc(hidden)] -pub type ExportMatchmakerLobbyHistoryInputOperationRetryAlias = (); -impl ExportMatchmakerLobbyHistoryInput { - /// Consumes the builder and constructs an Operation<[`ExportMatchmakerLobbyHistory`](crate::operation::ExportMatchmakerLobbyHistory)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::ExportMatchmakerLobbyHistoryInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_20 = &_input.game_id; - let input_20 = input_20.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_20, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/games/{game_id}/matchmaker/lobbies/export-history", - game_id = game_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::ExportMatchmakerLobbyHistoryInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)]let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_export_matchmaker_lobby_history(&self)? - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::ExportMatchmakerLobbyHistory::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "ExportMatchmakerLobbyHistory", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`ExportMatchmakerLobbyHistoryInput`](crate::input::ExportMatchmakerLobbyHistoryInput) - pub fn builder() -> crate::input::export_matchmaker_lobby_history_input::Builder { - crate::input::export_matchmaker_lobby_history_input::Builder::default() - } -} - -/// See [`GameBannerUploadCompleteInput`](crate::input::GameBannerUploadCompleteInput) -pub mod game_banner_upload_complete_input { - /// A builder for [`GameBannerUploadCompleteInput`](crate::input::GameBannerUploadCompleteInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) upload_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// A universally unique identifier. - pub fn upload_id(mut self, input: impl Into) -> Self { - self.upload_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_upload_id(mut self, input: std::option::Option) -> Self { - self.upload_id = input; - self - } - /// Consumes the builder and constructs a [`GameBannerUploadCompleteInput`](crate::input::GameBannerUploadCompleteInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::GameBannerUploadCompleteInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::GameBannerUploadCompleteInput { - game_id: self.game_id, - upload_id: self.upload_id, - }) - } - } -} -#[doc(hidden)] -pub type GameBannerUploadCompleteInputOperationOutputAlias = - crate::operation::GameBannerUploadComplete; -#[doc(hidden)] -pub type GameBannerUploadCompleteInputOperationRetryAlias = (); -impl GameBannerUploadCompleteInput { - /// Consumes the builder and constructs an Operation<[`GameBannerUploadComplete`](crate::operation::GameBannerUploadComplete)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GameBannerUploadCompleteInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_21 = &_input.game_id; - let input_21 = input_21.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_21, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - let input_22 = &_input.upload_id; - let input_22 = input_22.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "upload_id", - details: "cannot be empty or unset", - }, - )?; - let upload_id = aws_smithy_http::label::fmt_string(input_22, false); - if upload_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "upload_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/games/{game_id}/banner-upload/{upload_id}/complete", - game_id = game_id, - upload_id = upload_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GameBannerUploadCompleteInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from("{}"); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::GameBannerUploadComplete::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GameBannerUploadComplete", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GameBannerUploadCompleteInput`](crate::input::GameBannerUploadCompleteInput) - pub fn builder() -> crate::input::game_banner_upload_complete_input::Builder { - crate::input::game_banner_upload_complete_input::Builder::default() - } -} - -/// See [`GameBannerUploadPrepareInput`](crate::input::GameBannerUploadPrepareInput) -pub mod game_banner_upload_prepare_input { - /// A builder for [`GameBannerUploadPrepareInput`](crate::input::GameBannerUploadPrepareInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) path: std::option::Option, - pub(crate) mime: std::option::Option, - pub(crate) content_length: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// The path/filename of the game banner. - pub fn path(mut self, input: impl Into) -> Self { - self.path = Some(input.into()); - self - } - /// The path/filename of the game banner. - pub fn set_path(mut self, input: std::option::Option) -> Self { - self.path = input; - self - } - /// The MIME type of the game banner. - pub fn mime(mut self, input: impl Into) -> Self { - self.mime = Some(input.into()); - self - } - /// The MIME type of the game banner. - pub fn set_mime(mut self, input: std::option::Option) -> Self { - self.mime = input; - self - } - /// Unsigned 64 bit integer. - pub fn content_length(mut self, input: i64) -> Self { - self.content_length = Some(input); - self - } - /// Unsigned 64 bit integer. - pub fn set_content_length(mut self, input: std::option::Option) -> Self { - self.content_length = input; - self - } - /// Consumes the builder and constructs a [`GameBannerUploadPrepareInput`](crate::input::GameBannerUploadPrepareInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::GameBannerUploadPrepareInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::GameBannerUploadPrepareInput { - game_id: self.game_id, - path: self.path, - mime: self.mime, - content_length: self.content_length, - }) - } - } -} -#[doc(hidden)] -pub type GameBannerUploadPrepareInputOperationOutputAlias = - crate::operation::GameBannerUploadPrepare; -#[doc(hidden)] -pub type GameBannerUploadPrepareInputOperationRetryAlias = (); -impl GameBannerUploadPrepareInput { - /// Consumes the builder and constructs an Operation<[`GameBannerUploadPrepare`](crate::operation::GameBannerUploadPrepare)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GameBannerUploadPrepareInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_23 = &_input.game_id; - let input_23 = input_23.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_23, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/games/{game_id}/banner-upload/prepare", - game_id = game_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GameBannerUploadPrepareInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_game_banner_upload_prepare( - &self, - )?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::GameBannerUploadPrepare::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GameBannerUploadPrepare", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GameBannerUploadPrepareInput`](crate::input::GameBannerUploadPrepareInput) - pub fn builder() -> crate::input::game_banner_upload_prepare_input::Builder { - crate::input::game_banner_upload_prepare_input::Builder::default() - } -} - -/// See [`GameLogoUploadCompleteInput`](crate::input::GameLogoUploadCompleteInput) -pub mod game_logo_upload_complete_input { - /// A builder for [`GameLogoUploadCompleteInput`](crate::input::GameLogoUploadCompleteInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) upload_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// A universally unique identifier. - pub fn upload_id(mut self, input: impl Into) -> Self { - self.upload_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_upload_id(mut self, input: std::option::Option) -> Self { - self.upload_id = input; - self - } - /// Consumes the builder and constructs a [`GameLogoUploadCompleteInput`](crate::input::GameLogoUploadCompleteInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::GameLogoUploadCompleteInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::GameLogoUploadCompleteInput { - game_id: self.game_id, - upload_id: self.upload_id, - }) - } - } -} -#[doc(hidden)] -pub type GameLogoUploadCompleteInputOperationOutputAlias = crate::operation::GameLogoUploadComplete; -#[doc(hidden)] -pub type GameLogoUploadCompleteInputOperationRetryAlias = (); -impl GameLogoUploadCompleteInput { - /// Consumes the builder and constructs an Operation<[`GameLogoUploadComplete`](crate::operation::GameLogoUploadComplete)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GameLogoUploadCompleteInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_24 = &_input.game_id; - let input_24 = input_24.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_24, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - let input_25 = &_input.upload_id; - let input_25 = input_25.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "upload_id", - details: "cannot be empty or unset", - }, - )?; - let upload_id = aws_smithy_http::label::fmt_string(input_25, false); - if upload_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "upload_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/games/{game_id}/logo-upload/{upload_id}/complete", - game_id = game_id, - upload_id = upload_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GameLogoUploadCompleteInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from("{}"); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::GameLogoUploadComplete::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GameLogoUploadComplete", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GameLogoUploadCompleteInput`](crate::input::GameLogoUploadCompleteInput) - pub fn builder() -> crate::input::game_logo_upload_complete_input::Builder { - crate::input::game_logo_upload_complete_input::Builder::default() - } -} - -/// See [`GameLogoUploadPrepareInput`](crate::input::GameLogoUploadPrepareInput) -pub mod game_logo_upload_prepare_input { - /// A builder for [`GameLogoUploadPrepareInput`](crate::input::GameLogoUploadPrepareInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) path: std::option::Option, - pub(crate) mime: std::option::Option, - pub(crate) content_length: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// The path/filename of the game logo. - pub fn path(mut self, input: impl Into) -> Self { - self.path = Some(input.into()); - self - } - /// The path/filename of the game logo. - pub fn set_path(mut self, input: std::option::Option) -> Self { - self.path = input; - self - } - /// The MIME type of the game logo. - pub fn mime(mut self, input: impl Into) -> Self { - self.mime = Some(input.into()); - self - } - /// The MIME type of the game logo. - pub fn set_mime(mut self, input: std::option::Option) -> Self { - self.mime = input; - self - } - /// Unsigned 64 bit integer. - pub fn content_length(mut self, input: i64) -> Self { - self.content_length = Some(input); - self - } - /// Unsigned 64 bit integer. - pub fn set_content_length(mut self, input: std::option::Option) -> Self { - self.content_length = input; - self - } - /// Consumes the builder and constructs a [`GameLogoUploadPrepareInput`](crate::input::GameLogoUploadPrepareInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::GameLogoUploadPrepareInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::GameLogoUploadPrepareInput { - game_id: self.game_id, - path: self.path, - mime: self.mime, - content_length: self.content_length, - }) - } - } -} -#[doc(hidden)] -pub type GameLogoUploadPrepareInputOperationOutputAlias = crate::operation::GameLogoUploadPrepare; -#[doc(hidden)] -pub type GameLogoUploadPrepareInputOperationRetryAlias = (); -impl GameLogoUploadPrepareInput { - /// Consumes the builder and constructs an Operation<[`GameLogoUploadPrepare`](crate::operation::GameLogoUploadPrepare)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GameLogoUploadPrepareInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_26 = &_input.game_id; - let input_26 = input_26.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_26, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/games/{game_id}/logo-upload/prepare", - game_id = game_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GameLogoUploadPrepareInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_game_logo_upload_prepare( - &self, - )?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::GameLogoUploadPrepare::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GameLogoUploadPrepare", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GameLogoUploadPrepareInput`](crate::input::GameLogoUploadPrepareInput) - pub fn builder() -> crate::input::game_logo_upload_prepare_input::Builder { - crate::input::game_logo_upload_prepare_input::Builder::default() - } -} - -/// See [`GetGameBillingInput`](crate::input::GetGameBillingInput) -pub mod get_game_billing_input { - /// A builder for [`GetGameBillingInput`](crate::input::GetGameBillingInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) query_start: std::option::Option, - pub(crate) query_end: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// Unsigned 64 bit integer. - pub fn query_start(mut self, input: i64) -> Self { - self.query_start = Some(input); - self - } - /// Unsigned 64 bit integer. - pub fn set_query_start(mut self, input: std::option::Option) -> Self { - self.query_start = input; - self - } - /// Unsigned 64 bit integer. - pub fn query_end(mut self, input: i64) -> Self { - self.query_end = Some(input); - self - } - /// Unsigned 64 bit integer. - pub fn set_query_end(mut self, input: std::option::Option) -> Self { - self.query_end = input; - self - } - /// Consumes the builder and constructs a [`GetGameBillingInput`](crate::input::GetGameBillingInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::GetGameBillingInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::GetGameBillingInput { - game_id: self.game_id, - query_start: self.query_start, - query_end: self.query_end, - }) - } - } -} -#[doc(hidden)] -pub type GetGameBillingInputOperationOutputAlias = crate::operation::GetGameBilling; -#[doc(hidden)] -pub type GetGameBillingInputOperationRetryAlias = (); -impl GetGameBillingInput { - /// Consumes the builder and constructs an Operation<[`GetGameBilling`](crate::operation::GetGameBilling)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GetGameBillingInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_27 = &_input.game_id; - let input_27 = input_27.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_27, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - write!(output, "/games/{game_id}/billing", game_id = game_id) - .expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::GetGameBillingInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_28) = &_input.query_start { - query.push_kv( - "query_start", - aws_smithy_types::primitive::Encoder::from(*inner_28).encode(), - ); - } - if let Some(inner_29) = &_input.query_end { - query.push_kv( - "query_end", - aws_smithy_types::primitive::Encoder::from(*inner_29).encode(), - ); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GetGameBillingInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::GetGameBilling::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GetGameBilling", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GetGameBillingInput`](crate::input::GetGameBillingInput) - pub fn builder() -> crate::input::get_game_billing_input::Builder { - crate::input::get_game_billing_input::Builder::default() - } -} - -/// See [`GetGameBillingPlansInput`](crate::input::GetGameBillingPlansInput) -pub mod get_game_billing_plans_input { - /// A builder for [`GetGameBillingPlansInput`](crate::input::GetGameBillingPlansInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// Consumes the builder and constructs a [`GetGameBillingPlansInput`](crate::input::GetGameBillingPlansInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::GetGameBillingPlansInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::GetGameBillingPlansInput { - game_id: self.game_id, - }) - } - } -} -#[doc(hidden)] -pub type GetGameBillingPlansInputOperationOutputAlias = crate::operation::GetGameBillingPlans; -#[doc(hidden)] -pub type GetGameBillingPlansInputOperationRetryAlias = (); -impl GetGameBillingPlansInput { - /// Consumes the builder and constructs an Operation<[`GetGameBillingPlans`](crate::operation::GetGameBillingPlans)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GetGameBillingPlansInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_30 = &_input.game_id; - let input_30 = input_30.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_30, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - write!(output, "/games/{game_id}/billing/plans", game_id = game_id) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GetGameBillingPlansInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::GetGameBillingPlans::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GetGameBillingPlans", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GetGameBillingPlansInput`](crate::input::GetGameBillingPlansInput) - pub fn builder() -> crate::input::get_game_billing_plans_input::Builder { - crate::input::get_game_billing_plans_input::Builder::default() - } -} - -/// See [`GetGameByIdInput`](crate::input::GetGameByIdInput) -pub mod get_game_by_id_input { - /// A builder for [`GetGameByIdInput`](crate::input::GetGameByIdInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) watch_index: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.watch_index = Some(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.watch_index = input; - self - } - /// Consumes the builder and constructs a [`GetGameByIdInput`](crate::input::GetGameByIdInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::GetGameByIdInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::GetGameByIdInput { - game_id: self.game_id, - watch_index: self.watch_index, - }) - } - } -} -#[doc(hidden)] -pub type GetGameByIdInputOperationOutputAlias = crate::operation::GetGameById; -#[doc(hidden)] -pub type GetGameByIdInputOperationRetryAlias = (); -impl GetGameByIdInput { - /// Consumes the builder and constructs an Operation<[`GetGameById`](crate::operation::GetGameById)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GetGameByIdInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_31 = &_input.game_id; - let input_31 = input_31.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_31, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - write!(output, "/games/{game_id}", game_id = game_id) - .expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::GetGameByIdInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_32) = &_input.watch_index { - query.push_kv( - "watch_index", - &aws_smithy_http::query::fmt_string(&inner_32), - ); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GetGameByIdInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::GetGameById::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GetGameById", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GetGameByIdInput`](crate::input::GetGameByIdInput) - pub fn builder() -> crate::input::get_game_by_id_input::Builder { - crate::input::get_game_by_id_input::Builder::default() - } -} - -/// See [`GetGameNamespaceByIdInput`](crate::input::GetGameNamespaceByIdInput) -pub mod get_game_namespace_by_id_input { - /// A builder for [`GetGameNamespaceByIdInput`](crate::input::GetGameNamespaceByIdInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) namespace_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.namespace_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.namespace_id = input; - self - } - /// Consumes the builder and constructs a [`GetGameNamespaceByIdInput`](crate::input::GetGameNamespaceByIdInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::GetGameNamespaceByIdInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::GetGameNamespaceByIdInput { - game_id: self.game_id, - namespace_id: self.namespace_id, - }) - } - } -} -#[doc(hidden)] -pub type GetGameNamespaceByIdInputOperationOutputAlias = crate::operation::GetGameNamespaceById; -#[doc(hidden)] -pub type GetGameNamespaceByIdInputOperationRetryAlias = (); -impl GetGameNamespaceByIdInput { - /// Consumes the builder and constructs an Operation<[`GetGameNamespaceById`](crate::operation::GetGameNamespaceById)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GetGameNamespaceByIdInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_33 = &_input.game_id; - let input_33 = input_33.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_33, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - let input_34 = &_input.namespace_id; - let input_34 = input_34.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "namespace_id", - details: "cannot be empty or unset", - }, - )?; - let namespace_id = aws_smithy_http::label::fmt_string(input_34, false); - if namespace_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "namespace_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/games/{game_id}/namespaces/{namespace_id}", - game_id = game_id, - namespace_id = namespace_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GetGameNamespaceByIdInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::GetGameNamespaceById::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GetGameNamespaceById", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GetGameNamespaceByIdInput`](crate::input::GetGameNamespaceByIdInput) - pub fn builder() -> crate::input::get_game_namespace_by_id_input::Builder { - crate::input::get_game_namespace_by_id_input::Builder::default() - } -} - -/// See [`GetGamesInput`](crate::input::GetGamesInput) -pub mod get_games_input { - /// A builder for [`GetGamesInput`](crate::input::GetGamesInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) watch_index: std::option::Option, - } - impl Builder { - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.watch_index = Some(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.watch_index = input; - self - } - /// Consumes the builder and constructs a [`GetGamesInput`](crate::input::GetGamesInput) - pub fn build( - self, - ) -> std::result::Result - { - Ok(crate::input::GetGamesInput { - watch_index: self.watch_index, - }) - } - } -} -#[doc(hidden)] -pub type GetGamesInputOperationOutputAlias = crate::operation::GetGames; -#[doc(hidden)] -pub type GetGamesInputOperationRetryAlias = (); -impl GetGamesInput { - /// Consumes the builder and constructs an Operation<[`GetGames`](crate::operation::GetGames)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GetGamesInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/games").expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::GetGamesInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_35) = &_input.watch_index { - query.push_kv( - "watch_index", - &aws_smithy_http::query::fmt_string(&inner_35), - ); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GetGamesInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = - aws_smithy_http::operation::Operation::new(request, crate::operation::GetGames::new()) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GetGames", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GetGamesInput`](crate::input::GetGamesInput) - pub fn builder() -> crate::input::get_games_input::Builder { - crate::input::get_games_input::Builder::default() - } -} - -/// See [`GetGameVersionByIdInput`](crate::input::GetGameVersionByIdInput) -pub mod get_game_version_by_id_input { - /// A builder for [`GetGameVersionByIdInput`](crate::input::GetGameVersionByIdInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) version_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// A universally unique identifier. - pub fn version_id(mut self, input: impl Into) -> Self { - self.version_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_version_id(mut self, input: std::option::Option) -> Self { - self.version_id = input; - self - } - /// Consumes the builder and constructs a [`GetGameVersionByIdInput`](crate::input::GetGameVersionByIdInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::GetGameVersionByIdInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::GetGameVersionByIdInput { - game_id: self.game_id, - version_id: self.version_id, - }) - } - } -} -#[doc(hidden)] -pub type GetGameVersionByIdInputOperationOutputAlias = crate::operation::GetGameVersionById; -#[doc(hidden)] -pub type GetGameVersionByIdInputOperationRetryAlias = (); -impl GetGameVersionByIdInput { - /// Consumes the builder and constructs an Operation<[`GetGameVersionById`](crate::operation::GetGameVersionById)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GetGameVersionByIdInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_36 = &_input.game_id; - let input_36 = input_36.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_36, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - let input_37 = &_input.version_id; - let input_37 = input_37.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "version_id", - details: "cannot be empty or unset", - }, - )?; - let version_id = aws_smithy_http::label::fmt_string(input_37, false); - if version_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "version_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/games/{game_id}/versions/{version_id}", - game_id = game_id, - version_id = version_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GetGameVersionByIdInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::GetGameVersionById::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GetGameVersionById", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GetGameVersionByIdInput`](crate::input::GetGameVersionByIdInput) - pub fn builder() -> crate::input::get_game_version_by_id_input::Builder { - crate::input::get_game_version_by_id_input::Builder::default() - } -} - -/// See [`GetGroupBillingInput`](crate::input::GetGroupBillingInput) -pub mod get_group_billing_input { - /// A builder for [`GetGroupBillingInput`](crate::input::GetGroupBillingInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) group_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.group_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.group_id = input; - self - } - /// Consumes the builder and constructs a [`GetGroupBillingInput`](crate::input::GetGroupBillingInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::GetGroupBillingInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::GetGroupBillingInput { - group_id: self.group_id, - }) - } - } -} -#[doc(hidden)] -pub type GetGroupBillingInputOperationOutputAlias = crate::operation::GetGroupBilling; -#[doc(hidden)] -pub type GetGroupBillingInputOperationRetryAlias = (); -impl GetGroupBillingInput { - /// Consumes the builder and constructs an Operation<[`GetGroupBilling`](crate::operation::GetGroupBilling)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GetGroupBillingInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_38 = &_input.group_id; - let input_38 = input_38.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }, - )?; - let group_id = aws_smithy_http::label::fmt_string(input_38, false); - if group_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }); - } - write!(output, "/groups/{group_id}/billing", group_id = group_id) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GetGroupBillingInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::GetGroupBilling::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GetGroupBilling", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GetGroupBillingInput`](crate::input::GetGroupBillingInput) - pub fn builder() -> crate::input::get_group_billing_input::Builder { - crate::input::get_group_billing_input::Builder::default() - } -} - -/// See [`GetGroupInvoicesListInput`](crate::input::GetGroupInvoicesListInput) -pub mod get_group_invoices_list_input { - /// A builder for [`GetGroupInvoicesListInput`](crate::input::GetGroupInvoicesListInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) group_id: std::option::Option, - pub(crate) page: std::option::Option, - pub(crate) per_page: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.group_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.group_id = input; - self - } - /// Unsigned 32 bit integer. - pub fn page(mut self, input: i32) -> Self { - self.page = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_page(mut self, input: std::option::Option) -> Self { - self.page = input; - self - } - /// Unsigned 32 bit integer. - pub fn per_page(mut self, input: i32) -> Self { - self.per_page = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_per_page(mut self, input: std::option::Option) -> Self { - self.per_page = input; - self - } - /// Consumes the builder and constructs a [`GetGroupInvoicesListInput`](crate::input::GetGroupInvoicesListInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::GetGroupInvoicesListInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::GetGroupInvoicesListInput { - group_id: self.group_id, - page: self.page, - per_page: self.per_page, - }) - } - } -} -#[doc(hidden)] -pub type GetGroupInvoicesListInputOperationOutputAlias = crate::operation::GetGroupInvoicesList; -#[doc(hidden)] -pub type GetGroupInvoicesListInputOperationRetryAlias = (); -impl GetGroupInvoicesListInput { - /// Consumes the builder and constructs an Operation<[`GetGroupInvoicesList`](crate::operation::GetGroupInvoicesList)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GetGroupInvoicesListInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_39 = &_input.group_id; - let input_39 = input_39.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }, - )?; - let group_id = aws_smithy_http::label::fmt_string(input_39, false); - if group_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/groups/{group_id}/billing/invoices", - group_id = group_id - ) - .expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::GetGroupInvoicesListInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_40) = &_input.page { - query.push_kv( - "page", - aws_smithy_types::primitive::Encoder::from(*inner_40).encode(), - ); - } - if let Some(inner_41) = &_input.per_page { - query.push_kv( - "per_page", - aws_smithy_types::primitive::Encoder::from(*inner_41).encode(), - ); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GetGroupInvoicesListInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::GetGroupInvoicesList::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GetGroupInvoicesList", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GetGroupInvoicesListInput`](crate::input::GetGroupInvoicesListInput) - pub fn builder() -> crate::input::get_group_invoices_list_input::Builder { - crate::input::get_group_invoices_list_input::Builder::default() - } -} - -/// See [`GetLobbyLogsInput`](crate::input::GetLobbyLogsInput) -pub mod get_lobby_logs_input { - /// A builder for [`GetLobbyLogsInput`](crate::input::GetLobbyLogsInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) lobby_id: std::option::Option, - pub(crate) stream: std::option::Option, - pub(crate) watch_index: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// A universally unique identifier. - pub fn lobby_id(mut self, input: impl Into) -> Self { - self.lobby_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_lobby_id(mut self, input: std::option::Option) -> Self { - self.lobby_id = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn stream(mut self, input: crate::model::LogStream) -> Self { - self.stream = Some(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_stream(mut self, input: std::option::Option) -> Self { - self.stream = input; - self - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.watch_index = Some(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.watch_index = input; - self - } - /// Consumes the builder and constructs a [`GetLobbyLogsInput`](crate::input::GetLobbyLogsInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::GetLobbyLogsInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::GetLobbyLogsInput { - game_id: self.game_id, - lobby_id: self.lobby_id, - stream: self.stream, - watch_index: self.watch_index, - }) - } - } -} -#[doc(hidden)] -pub type GetLobbyLogsInputOperationOutputAlias = crate::operation::GetLobbyLogs; -#[doc(hidden)] -pub type GetLobbyLogsInputOperationRetryAlias = (); -impl GetLobbyLogsInput { - /// Consumes the builder and constructs an Operation<[`GetLobbyLogs`](crate::operation::GetLobbyLogs)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GetLobbyLogsInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_42 = &_input.game_id; - let input_42 = input_42.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_42, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - let input_43 = &_input.lobby_id; - let input_43 = input_43.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "lobby_id", - details: "cannot be empty or unset", - }, - )?; - let lobby_id = aws_smithy_http::label::fmt_string(input_43, false); - if lobby_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "lobby_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/games/{game_id}/matchmaker/lobbies/{lobby_id}/logs", - game_id = game_id, - lobby_id = lobby_id - ) - .expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::GetLobbyLogsInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_44) = &_input.stream { - query.push_kv("stream", &aws_smithy_http::query::fmt_string(&inner_44)); - } - if let Some(inner_45) = &_input.watch_index { - query.push_kv( - "watch_index", - &aws_smithy_http::query::fmt_string(&inner_45), - ); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GetLobbyLogsInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::GetLobbyLogs::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GetLobbyLogs", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GetLobbyLogsInput`](crate::input::GetLobbyLogsInput) - pub fn builder() -> crate::input::get_lobby_logs_input::Builder { - crate::input::get_lobby_logs_input::Builder::default() - } -} - -/// See [`GetNamespaceAnalyticsMatchmakerLiveInput`](crate::input::GetNamespaceAnalyticsMatchmakerLiveInput) -pub mod get_namespace_analytics_matchmaker_live_input { - /// A builder for [`GetNamespaceAnalyticsMatchmakerLiveInput`](crate::input::GetNamespaceAnalyticsMatchmakerLiveInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) namespace_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.namespace_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.namespace_id = input; - self - } - /// Consumes the builder and constructs a [`GetNamespaceAnalyticsMatchmakerLiveInput`](crate::input::GetNamespaceAnalyticsMatchmakerLiveInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::GetNamespaceAnalyticsMatchmakerLiveInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::GetNamespaceAnalyticsMatchmakerLiveInput { - game_id: self.game_id, - namespace_id: self.namespace_id, - }) - } - } -} -#[doc(hidden)] -pub type GetNamespaceAnalyticsMatchmakerLiveInputOperationOutputAlias = - crate::operation::GetNamespaceAnalyticsMatchmakerLive; -#[doc(hidden)] -pub type GetNamespaceAnalyticsMatchmakerLiveInputOperationRetryAlias = (); -impl GetNamespaceAnalyticsMatchmakerLiveInput { - /// Consumes the builder and constructs an Operation<[`GetNamespaceAnalyticsMatchmakerLive`](crate::operation::GetNamespaceAnalyticsMatchmakerLive)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation< - crate::operation::GetNamespaceAnalyticsMatchmakerLive, - (), - >, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GetNamespaceAnalyticsMatchmakerLiveInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_46 = &_input.game_id; - let input_46 = input_46.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_46, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - let input_47 = &_input.namespace_id; - let input_47 = input_47.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "namespace_id", - details: "cannot be empty or unset", - }, - )?; - let namespace_id = aws_smithy_http::label::fmt_string(input_47, false); - if namespace_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "namespace_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/games/{game_id}/namespaces/{namespace_id}/analytics/matchmaker/live", - game_id = game_id, - namespace_id = namespace_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GetNamespaceAnalyticsMatchmakerLiveInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::GetNamespaceAnalyticsMatchmakerLive::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GetNamespaceAnalyticsMatchmakerLive", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GetNamespaceAnalyticsMatchmakerLiveInput`](crate::input::GetNamespaceAnalyticsMatchmakerLiveInput) - pub fn builder() -> crate::input::get_namespace_analytics_matchmaker_live_input::Builder { - crate::input::get_namespace_analytics_matchmaker_live_input::Builder::default() - } -} - -/// See [`GetNamespaceLobbyInput`](crate::input::GetNamespaceLobbyInput) -pub mod get_namespace_lobby_input { - /// A builder for [`GetNamespaceLobbyInput`](crate::input::GetNamespaceLobbyInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) namespace_id: std::option::Option, - pub(crate) lobby_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.namespace_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.namespace_id = input; - self - } - /// A universally unique identifier. - pub fn lobby_id(mut self, input: impl Into) -> Self { - self.lobby_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_lobby_id(mut self, input: std::option::Option) -> Self { - self.lobby_id = input; - self - } - /// Consumes the builder and constructs a [`GetNamespaceLobbyInput`](crate::input::GetNamespaceLobbyInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::GetNamespaceLobbyInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::GetNamespaceLobbyInput { - game_id: self.game_id, - namespace_id: self.namespace_id, - lobby_id: self.lobby_id, - }) - } - } -} -#[doc(hidden)] -pub type GetNamespaceLobbyInputOperationOutputAlias = crate::operation::GetNamespaceLobby; -#[doc(hidden)] -pub type GetNamespaceLobbyInputOperationRetryAlias = (); -impl GetNamespaceLobbyInput { - /// Consumes the builder and constructs an Operation<[`GetNamespaceLobby`](crate::operation::GetNamespaceLobby)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GetNamespaceLobbyInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_48 = &_input.game_id; - let input_48 = input_48.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_48, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - let input_49 = &_input.namespace_id; - let input_49 = input_49.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "namespace_id", - details: "cannot be empty or unset", - }, - )?; - let namespace_id = aws_smithy_http::label::fmt_string(input_49, false); - if namespace_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "namespace_id", - details: "cannot be empty or unset", - }); - } - let input_50 = &_input.lobby_id; - let input_50 = input_50.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "lobby_id", - details: "cannot be empty or unset", - }, - )?; - let lobby_id = aws_smithy_http::label::fmt_string(input_50, false); - if lobby_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "lobby_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/games/{game_id}/namespaces/{namespace_id}/logs/lobbies/{lobby_id}", - game_id = game_id, - namespace_id = namespace_id, - lobby_id = lobby_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GetNamespaceLobbyInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::GetNamespaceLobby::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GetNamespaceLobby", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GetNamespaceLobbyInput`](crate::input::GetNamespaceLobbyInput) - pub fn builder() -> crate::input::get_namespace_lobby_input::Builder { - crate::input::get_namespace_lobby_input::Builder::default() - } -} - -/// See [`GetRayPerfLogsInput`](crate::input::GetRayPerfLogsInput) -pub mod get_ray_perf_logs_input { - /// A builder for [`GetRayPerfLogsInput`](crate::input::GetRayPerfLogsInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) ray_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn ray_id(mut self, input: impl Into) -> Self { - self.ray_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_ray_id(mut self, input: std::option::Option) -> Self { - self.ray_id = input; - self - } - /// Consumes the builder and constructs a [`GetRayPerfLogsInput`](crate::input::GetRayPerfLogsInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::GetRayPerfLogsInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::GetRayPerfLogsInput { - ray_id: self.ray_id, - }) - } - } -} -#[doc(hidden)] -pub type GetRayPerfLogsInputOperationOutputAlias = crate::operation::GetRayPerfLogs; -#[doc(hidden)] -pub type GetRayPerfLogsInputOperationRetryAlias = (); -impl GetRayPerfLogsInput { - /// Consumes the builder and constructs an Operation<[`GetRayPerfLogs`](crate::operation::GetRayPerfLogs)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GetRayPerfLogsInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_51 = &_input.ray_id; - let input_51 = input_51.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "ray_id", - details: "cannot be empty or unset", - }, - )?; - let ray_id = aws_smithy_http::label::fmt_string(input_51, false); - if ray_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "ray_id", - details: "cannot be empty or unset", - }); - } - write!(output, "/rays/{ray_id}/perf", ray_id = ray_id) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GetRayPerfLogsInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::GetRayPerfLogs::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GetRayPerfLogs", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GetRayPerfLogsInput`](crate::input::GetRayPerfLogsInput) - pub fn builder() -> crate::input::get_ray_perf_logs_input::Builder { - crate::input::get_ray_perf_logs_input::Builder::default() - } -} - -/// See [`GetRegionTiersInput`](crate::input::GetRegionTiersInput) -pub mod get_region_tiers_input { - /// A builder for [`GetRegionTiersInput`](crate::input::GetRegionTiersInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`GetRegionTiersInput`](crate::input::GetRegionTiersInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::GetRegionTiersInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::GetRegionTiersInput {}) - } - } -} -#[doc(hidden)] -pub type GetRegionTiersInputOperationOutputAlias = crate::operation::GetRegionTiers; -#[doc(hidden)] -pub type GetRegionTiersInputOperationRetryAlias = (); -impl GetRegionTiersInput { - /// Consumes the builder and constructs an Operation<[`GetRegionTiers`](crate::operation::GetRegionTiers)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GetRegionTiersInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/region-tiers").expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GetRegionTiersInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::GetRegionTiers::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GetRegionTiers", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GetRegionTiersInput`](crate::input::GetRegionTiersInput) - pub fn builder() -> crate::input::get_region_tiers_input::Builder { - crate::input::get_region_tiers_input::Builder::default() - } -} - -/// See [`GroupBillingCheckoutInput`](crate::input::GroupBillingCheckoutInput) -pub mod group_billing_checkout_input { - /// A builder for [`GroupBillingCheckoutInput`](crate::input::GroupBillingCheckoutInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) group_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.group_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.group_id = input; - self - } - /// Consumes the builder and constructs a [`GroupBillingCheckoutInput`](crate::input::GroupBillingCheckoutInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::GroupBillingCheckoutInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::GroupBillingCheckoutInput { - group_id: self.group_id, - }) - } - } -} -#[doc(hidden)] -pub type GroupBillingCheckoutInputOperationOutputAlias = crate::operation::GroupBillingCheckout; -#[doc(hidden)] -pub type GroupBillingCheckoutInputOperationRetryAlias = (); -impl GroupBillingCheckoutInput { - /// Consumes the builder and constructs an Operation<[`GroupBillingCheckout`](crate::operation::GroupBillingCheckout)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GroupBillingCheckoutInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_52 = &_input.group_id; - let input_52 = input_52.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }, - )?; - let group_id = aws_smithy_http::label::fmt_string(input_52, false); - if group_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }); - } - write!(output, "/groups/{group_id}/checkout", group_id = group_id) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GroupBillingCheckoutInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from("{}"); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::GroupBillingCheckout::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GroupBillingCheckout", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GroupBillingCheckoutInput`](crate::input::GroupBillingCheckoutInput) - pub fn builder() -> crate::input::group_billing_checkout_input::Builder { - crate::input::group_billing_checkout_input::Builder::default() - } -} - -/// See [`InspectInput`](crate::input::InspectInput) -pub mod inspect_input { - /// A builder for [`InspectInput`](crate::input::InspectInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`InspectInput`](crate::input::InspectInput) - pub fn build( - self, - ) -> std::result::Result - { - Ok(crate::input::InspectInput {}) - } - } -} -#[doc(hidden)] -pub type InspectInputOperationOutputAlias = crate::operation::Inspect; -#[doc(hidden)] -pub type InspectInputOperationRetryAlias = (); -impl InspectInput { - /// Consumes the builder and constructs an Operation<[`Inspect`](crate::operation::Inspect)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::InspectInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/auth/inspect").expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::InspectInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = - aws_smithy_http::operation::Operation::new(request, crate::operation::Inspect::new()) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "Inspect", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`InspectInput`](crate::input::InspectInput) - pub fn builder() -> crate::input::inspect_input::Builder { - crate::input::inspect_input::Builder::default() - } -} - -/// See [`ListGameBuildsInput`](crate::input::ListGameBuildsInput) -pub mod list_game_builds_input { - /// A builder for [`ListGameBuildsInput`](crate::input::ListGameBuildsInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// Consumes the builder and constructs a [`ListGameBuildsInput`](crate::input::ListGameBuildsInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::ListGameBuildsInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::ListGameBuildsInput { - game_id: self.game_id, - }) - } - } -} -#[doc(hidden)] -pub type ListGameBuildsInputOperationOutputAlias = crate::operation::ListGameBuilds; -#[doc(hidden)] -pub type ListGameBuildsInputOperationRetryAlias = (); -impl ListGameBuildsInput { - /// Consumes the builder and constructs an Operation<[`ListGameBuilds`](crate::operation::ListGameBuilds)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::ListGameBuildsInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_53 = &_input.game_id; - let input_53 = input_53.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_53, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - write!(output, "/games/{game_id}/builds", game_id = game_id) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::ListGameBuildsInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::ListGameBuilds::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "ListGameBuilds", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`ListGameBuildsInput`](crate::input::ListGameBuildsInput) - pub fn builder() -> crate::input::list_game_builds_input::Builder { - crate::input::list_game_builds_input::Builder::default() - } -} - -/// See [`ListGameCdnSitesInput`](crate::input::ListGameCdnSitesInput) -pub mod list_game_cdn_sites_input { - /// A builder for [`ListGameCdnSitesInput`](crate::input::ListGameCdnSitesInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// Consumes the builder and constructs a [`ListGameCdnSitesInput`](crate::input::ListGameCdnSitesInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::ListGameCdnSitesInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::ListGameCdnSitesInput { - game_id: self.game_id, - }) - } - } -} -#[doc(hidden)] -pub type ListGameCdnSitesInputOperationOutputAlias = crate::operation::ListGameCdnSites; -#[doc(hidden)] -pub type ListGameCdnSitesInputOperationRetryAlias = (); -impl ListGameCdnSitesInput { - /// Consumes the builder and constructs an Operation<[`ListGameCdnSites`](crate::operation::ListGameCdnSites)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::ListGameCdnSitesInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_54 = &_input.game_id; - let input_54 = input_54.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_54, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - write!(output, "/games/{game_id}/cdn/sites", game_id = game_id) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::ListGameCdnSitesInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::ListGameCdnSites::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "ListGameCdnSites", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`ListGameCdnSitesInput`](crate::input::ListGameCdnSitesInput) - pub fn builder() -> crate::input::list_game_cdn_sites_input::Builder { - crate::input::list_game_cdn_sites_input::Builder::default() - } -} - -/// See [`ListGameCustomAvatarsInput`](crate::input::ListGameCustomAvatarsInput) -pub mod list_game_custom_avatars_input { - /// A builder for [`ListGameCustomAvatarsInput`](crate::input::ListGameCustomAvatarsInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// Consumes the builder and constructs a [`ListGameCustomAvatarsInput`](crate::input::ListGameCustomAvatarsInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::ListGameCustomAvatarsInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::ListGameCustomAvatarsInput { - game_id: self.game_id, - }) - } - } -} -#[doc(hidden)] -pub type ListGameCustomAvatarsInputOperationOutputAlias = crate::operation::ListGameCustomAvatars; -#[doc(hidden)] -pub type ListGameCustomAvatarsInputOperationRetryAlias = (); -impl ListGameCustomAvatarsInput { - /// Consumes the builder and constructs an Operation<[`ListGameCustomAvatars`](crate::operation::ListGameCustomAvatars)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::ListGameCustomAvatarsInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_55 = &_input.game_id; - let input_55 = input_55.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_55, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - write!(output, "/games/{game_id}/avatars", game_id = game_id) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::ListGameCustomAvatarsInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::ListGameCustomAvatars::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "ListGameCustomAvatars", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`ListGameCustomAvatarsInput`](crate::input::ListGameCustomAvatarsInput) - pub fn builder() -> crate::input::list_game_custom_avatars_input::Builder { - crate::input::list_game_custom_avatars_input::Builder::default() - } -} - -/// See [`ListNamespaceLobbiesInput`](crate::input::ListNamespaceLobbiesInput) -pub mod list_namespace_lobbies_input { - /// A builder for [`ListNamespaceLobbiesInput`](crate::input::ListNamespaceLobbiesInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) namespace_id: std::option::Option, - pub(crate) before_create_ts: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.namespace_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.namespace_id = input; - self - } - /// Returns lobbies created before this timestamp. - pub fn before_create_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.before_create_ts = Some(input); - self - } - /// Returns lobbies created before this timestamp. - pub fn set_before_create_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.before_create_ts = input; - self - } - /// Consumes the builder and constructs a [`ListNamespaceLobbiesInput`](crate::input::ListNamespaceLobbiesInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::ListNamespaceLobbiesInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::ListNamespaceLobbiesInput { - game_id: self.game_id, - namespace_id: self.namespace_id, - before_create_ts: self.before_create_ts, - }) - } - } -} -#[doc(hidden)] -pub type ListNamespaceLobbiesInputOperationOutputAlias = crate::operation::ListNamespaceLobbies; -#[doc(hidden)] -pub type ListNamespaceLobbiesInputOperationRetryAlias = (); -impl ListNamespaceLobbiesInput { - /// Consumes the builder and constructs an Operation<[`ListNamespaceLobbies`](crate::operation::ListNamespaceLobbies)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::ListNamespaceLobbiesInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_56 = &_input.game_id; - let input_56 = input_56.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_56, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - let input_57 = &_input.namespace_id; - let input_57 = input_57.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "namespace_id", - details: "cannot be empty or unset", - }, - )?; - let namespace_id = aws_smithy_http::label::fmt_string(input_57, false); - if namespace_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "namespace_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/games/{game_id}/namespaces/{namespace_id}/logs/lobbies", - game_id = game_id, - namespace_id = namespace_id - ) - .expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::ListNamespaceLobbiesInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_58) = &_input.before_create_ts { - query.push_kv( - "before_create_ts", - &aws_smithy_http::query::fmt_timestamp( - inner_58, - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::ListNamespaceLobbiesInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::ListNamespaceLobbies::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "ListNamespaceLobbies", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`ListNamespaceLobbiesInput`](crate::input::ListNamespaceLobbiesInput) - pub fn builder() -> crate::input::list_namespace_lobbies_input::Builder { - crate::input::list_namespace_lobbies_input::Builder::default() - } -} - -/// See [`PrepareCustomAvatarUploadInput`](crate::input::PrepareCustomAvatarUploadInput) -pub mod prepare_custom_avatar_upload_input { - /// A builder for [`PrepareCustomAvatarUploadInput`](crate::input::PrepareCustomAvatarUploadInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) path: std::option::Option, - pub(crate) mime: std::option::Option, - pub(crate) content_length: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// The path/filename of the custom avatar. - pub fn path(mut self, input: impl Into) -> Self { - self.path = Some(input.into()); - self - } - /// The path/filename of the custom avatar. - pub fn set_path(mut self, input: std::option::Option) -> Self { - self.path = input; - self - } - /// The MIME type of the custom avatar. - pub fn mime(mut self, input: impl Into) -> Self { - self.mime = Some(input.into()); - self - } - /// The MIME type of the custom avatar. - pub fn set_mime(mut self, input: std::option::Option) -> Self { - self.mime = input; - self - } - /// Unsigned 64 bit integer. - pub fn content_length(mut self, input: i64) -> Self { - self.content_length = Some(input); - self - } - /// Unsigned 64 bit integer. - pub fn set_content_length(mut self, input: std::option::Option) -> Self { - self.content_length = input; - self - } - /// Consumes the builder and constructs a [`PrepareCustomAvatarUploadInput`](crate::input::PrepareCustomAvatarUploadInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::PrepareCustomAvatarUploadInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::PrepareCustomAvatarUploadInput { - game_id: self.game_id, - path: self.path, - mime: self.mime, - content_length: self.content_length, - }) - } - } -} -#[doc(hidden)] -pub type PrepareCustomAvatarUploadInputOperationOutputAlias = - crate::operation::PrepareCustomAvatarUpload; -#[doc(hidden)] -pub type PrepareCustomAvatarUploadInputOperationRetryAlias = (); -impl PrepareCustomAvatarUploadInput { - /// Consumes the builder and constructs an Operation<[`PrepareCustomAvatarUpload`](crate::operation::PrepareCustomAvatarUpload)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::PrepareCustomAvatarUploadInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_59 = &_input.game_id; - let input_59 = input_59.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_59, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/games/{game_id}/avatar-upload/prepare", - game_id = game_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::PrepareCustomAvatarUploadInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_prepare_custom_avatar_upload( - &self, - )?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::PrepareCustomAvatarUpload::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "PrepareCustomAvatarUpload", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`PrepareCustomAvatarUploadInput`](crate::input::PrepareCustomAvatarUploadInput) - pub fn builder() -> crate::input::prepare_custom_avatar_upload_input::Builder { - crate::input::prepare_custom_avatar_upload_input::Builder::default() - } -} - -/// See [`RemoveNamespaceCdnAuthUserInput`](crate::input::RemoveNamespaceCdnAuthUserInput) -pub mod remove_namespace_cdn_auth_user_input { - /// A builder for [`RemoveNamespaceCdnAuthUserInput`](crate::input::RemoveNamespaceCdnAuthUserInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) namespace_id: std::option::Option, - pub(crate) user: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.namespace_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.namespace_id = input; - self - } - /// A user name. - pub fn user(mut self, input: impl Into) -> Self { - self.user = Some(input.into()); - self - } - /// A user name. - pub fn set_user(mut self, input: std::option::Option) -> Self { - self.user = input; - self - } - /// Consumes the builder and constructs a [`RemoveNamespaceCdnAuthUserInput`](crate::input::RemoveNamespaceCdnAuthUserInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::RemoveNamespaceCdnAuthUserInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::RemoveNamespaceCdnAuthUserInput { - game_id: self.game_id, - namespace_id: self.namespace_id, - user: self.user, - }) - } - } -} -#[doc(hidden)] -pub type RemoveNamespaceCdnAuthUserInputOperationOutputAlias = - crate::operation::RemoveNamespaceCdnAuthUser; -#[doc(hidden)] -pub type RemoveNamespaceCdnAuthUserInputOperationRetryAlias = (); -impl RemoveNamespaceCdnAuthUserInput { - /// Consumes the builder and constructs an Operation<[`RemoveNamespaceCdnAuthUser`](crate::operation::RemoveNamespaceCdnAuthUser)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::RemoveNamespaceCdnAuthUserInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_60 = &_input.game_id; - let input_60 = input_60.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_60, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - let input_61 = &_input.namespace_id; - let input_61 = input_61.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "namespace_id", - details: "cannot be empty or unset", - }, - )?; - let namespace_id = aws_smithy_http::label::fmt_string(input_61, false); - if namespace_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "namespace_id", - details: "cannot be empty or unset", - }); - } - let input_62 = &_input.user; - let input_62 = input_62.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "user", - details: "cannot be empty or unset", - }, - )?; - let user = aws_smithy_http::label::fmt_string(input_62, false); - if user.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "user", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/games/{game_id}/namespaces/{namespace_id}/auth-user/{user}", - game_id = game_id, - namespace_id = namespace_id, - user = user - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::RemoveNamespaceCdnAuthUserInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("DELETE").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::RemoveNamespaceCdnAuthUser::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "RemoveNamespaceCdnAuthUser", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`RemoveNamespaceCdnAuthUserInput`](crate::input::RemoveNamespaceCdnAuthUserInput) - pub fn builder() -> crate::input::remove_namespace_cdn_auth_user_input::Builder { - crate::input::remove_namespace_cdn_auth_user_input::Builder::default() - } -} - -/// See [`RemoveNamespaceDomainInput`](crate::input::RemoveNamespaceDomainInput) -pub mod remove_namespace_domain_input { - /// A builder for [`RemoveNamespaceDomainInput`](crate::input::RemoveNamespaceDomainInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) namespace_id: std::option::Option, - pub(crate) domain: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.namespace_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.namespace_id = input; - self - } - /// A valid domain name (no protocol). - pub fn domain(mut self, input: impl Into) -> Self { - self.domain = Some(input.into()); - self - } - /// A valid domain name (no protocol). - pub fn set_domain(mut self, input: std::option::Option) -> Self { - self.domain = input; - self - } - /// Consumes the builder and constructs a [`RemoveNamespaceDomainInput`](crate::input::RemoveNamespaceDomainInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::RemoveNamespaceDomainInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::RemoveNamespaceDomainInput { - game_id: self.game_id, - namespace_id: self.namespace_id, - domain: self.domain, - }) - } - } -} -#[doc(hidden)] -pub type RemoveNamespaceDomainInputOperationOutputAlias = crate::operation::RemoveNamespaceDomain; -#[doc(hidden)] -pub type RemoveNamespaceDomainInputOperationRetryAlias = (); -impl RemoveNamespaceDomainInput { - /// Consumes the builder and constructs an Operation<[`RemoveNamespaceDomain`](crate::operation::RemoveNamespaceDomain)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::RemoveNamespaceDomainInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_63 = &_input.game_id; - let input_63 = input_63.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_63, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - let input_64 = &_input.namespace_id; - let input_64 = input_64.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "namespace_id", - details: "cannot be empty or unset", - }, - )?; - let namespace_id = aws_smithy_http::label::fmt_string(input_64, false); - if namespace_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "namespace_id", - details: "cannot be empty or unset", - }); - } - let input_65 = &_input.domain; - let input_65 = input_65.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "domain", - details: "cannot be empty or unset", - }, - )?; - let domain = aws_smithy_http::label::fmt_string(input_65, false); - if domain.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "domain", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/games/{game_id}/namespaces/{namespace_id}/domains/{domain}", - game_id = game_id, - namespace_id = namespace_id, - domain = domain - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::RemoveNamespaceDomainInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("DELETE").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::RemoveNamespaceDomain::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "RemoveNamespaceDomain", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`RemoveNamespaceDomainInput`](crate::input::RemoveNamespaceDomainInput) - pub fn builder() -> crate::input::remove_namespace_domain_input::Builder { - crate::input::remove_namespace_domain_input::Builder::default() - } -} - -/// See [`SetGameBillingPlanInput`](crate::input::SetGameBillingPlanInput) -pub mod set_game_billing_plan_input { - /// A builder for [`SetGameBillingPlanInput`](crate::input::SetGameBillingPlanInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) plan: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// A value denoting a game's billing plan. - pub fn plan(mut self, input: crate::model::GameBillingPlanCode) -> Self { - self.plan = Some(input); - self - } - /// A value denoting a game's billing plan. - pub fn set_plan( - mut self, - input: std::option::Option, - ) -> Self { - self.plan = input; - self - } - /// Consumes the builder and constructs a [`SetGameBillingPlanInput`](crate::input::SetGameBillingPlanInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::SetGameBillingPlanInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::SetGameBillingPlanInput { - game_id: self.game_id, - plan: self.plan, - }) - } - } -} -#[doc(hidden)] -pub type SetGameBillingPlanInputOperationOutputAlias = crate::operation::SetGameBillingPlan; -#[doc(hidden)] -pub type SetGameBillingPlanInputOperationRetryAlias = (); -impl SetGameBillingPlanInput { - /// Consumes the builder and constructs an Operation<[`SetGameBillingPlan`](crate::operation::SetGameBillingPlan)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::SetGameBillingPlanInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_66 = &_input.game_id; - let input_66 = input_66.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_66, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - write!(output, "/games/{game_id}/billing/plan", game_id = game_id) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::SetGameBillingPlanInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_set_game_billing_plan(&self)?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::SetGameBillingPlan::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "SetGameBillingPlan", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`SetGameBillingPlanInput`](crate::input::SetGameBillingPlanInput) - pub fn builder() -> crate::input::set_game_billing_plan_input::Builder { - crate::input::set_game_billing_plan_input::Builder::default() - } -} - -/// See [`SetNamespaceCdnAuthTypeInput`](crate::input::SetNamespaceCdnAuthTypeInput) -pub mod set_namespace_cdn_auth_type_input { - /// A builder for [`SetNamespaceCdnAuthTypeInput`](crate::input::SetNamespaceCdnAuthTypeInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) namespace_id: std::option::Option, - pub(crate) auth_type: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.namespace_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.namespace_id = input; - self - } - /// A value denoting what type of authentication to use for a game namespace's CDN. - pub fn auth_type(mut self, input: crate::model::CdnAuthType) -> Self { - self.auth_type = Some(input); - self - } - /// A value denoting what type of authentication to use for a game namespace's CDN. - pub fn set_auth_type( - mut self, - input: std::option::Option, - ) -> Self { - self.auth_type = input; - self - } - /// Consumes the builder and constructs a [`SetNamespaceCdnAuthTypeInput`](crate::input::SetNamespaceCdnAuthTypeInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::SetNamespaceCdnAuthTypeInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::SetNamespaceCdnAuthTypeInput { - game_id: self.game_id, - namespace_id: self.namespace_id, - auth_type: self.auth_type, - }) - } - } -} -#[doc(hidden)] -pub type SetNamespaceCdnAuthTypeInputOperationOutputAlias = - crate::operation::SetNamespaceCdnAuthType; -#[doc(hidden)] -pub type SetNamespaceCdnAuthTypeInputOperationRetryAlias = (); -impl SetNamespaceCdnAuthTypeInput { - /// Consumes the builder and constructs an Operation<[`SetNamespaceCdnAuthType`](crate::operation::SetNamespaceCdnAuthType)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::SetNamespaceCdnAuthTypeInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_67 = &_input.game_id; - let input_67 = input_67.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_67, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - let input_68 = &_input.namespace_id; - let input_68 = input_68.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "namespace_id", - details: "cannot be empty or unset", - }, - )?; - let namespace_id = aws_smithy_http::label::fmt_string(input_68, false); - if namespace_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "namespace_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/games/{game_id}/namespaces/{namespace_id}/cdn-auth", - game_id = game_id, - namespace_id = namespace_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::SetNamespaceCdnAuthTypeInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("PUT").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_set_namespace_cdn_auth_type( - &self, - )?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::SetNamespaceCdnAuthType::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "SetNamespaceCdnAuthType", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`SetNamespaceCdnAuthTypeInput`](crate::input::SetNamespaceCdnAuthTypeInput) - pub fn builder() -> crate::input::set_namespace_cdn_auth_type_input::Builder { - crate::input::set_namespace_cdn_auth_type_input::Builder::default() - } -} - -/// See [`ToggleNamespaceDomainPublicAuthInput`](crate::input::ToggleNamespaceDomainPublicAuthInput) -pub mod toggle_namespace_domain_public_auth_input { - /// A builder for [`ToggleNamespaceDomainPublicAuthInput`](crate::input::ToggleNamespaceDomainPublicAuthInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) namespace_id: std::option::Option, - pub(crate) enabled: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.namespace_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.namespace_id = input; - self - } - /// Whether or not to enable authentication based on domain. - pub fn enabled(mut self, input: bool) -> Self { - self.enabled = Some(input); - self - } - /// Whether or not to enable authentication based on domain. - pub fn set_enabled(mut self, input: std::option::Option) -> Self { - self.enabled = input; - self - } - /// Consumes the builder and constructs a [`ToggleNamespaceDomainPublicAuthInput`](crate::input::ToggleNamespaceDomainPublicAuthInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::ToggleNamespaceDomainPublicAuthInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::ToggleNamespaceDomainPublicAuthInput { - game_id: self.game_id, - namespace_id: self.namespace_id, - enabled: self.enabled, - }) - } - } -} -#[doc(hidden)] -pub type ToggleNamespaceDomainPublicAuthInputOperationOutputAlias = - crate::operation::ToggleNamespaceDomainPublicAuth; -#[doc(hidden)] -pub type ToggleNamespaceDomainPublicAuthInputOperationRetryAlias = (); -impl ToggleNamespaceDomainPublicAuthInput { - /// Consumes the builder and constructs an Operation<[`ToggleNamespaceDomainPublicAuth`](crate::operation::ToggleNamespaceDomainPublicAuth)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation< - crate::operation::ToggleNamespaceDomainPublicAuth, - (), - >, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::ToggleNamespaceDomainPublicAuthInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_69 = &_input.game_id; - let input_69 = input_69.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_69, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - let input_70 = &_input.namespace_id; - let input_70 = input_70.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "namespace_id", - details: "cannot be empty or unset", - }, - )?; - let namespace_id = aws_smithy_http::label::fmt_string(input_70, false); - if namespace_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "namespace_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/games/{game_id}/namespaces/{namespace_id}/domain-public-auth", - game_id = game_id, - namespace_id = namespace_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::ToggleNamespaceDomainPublicAuthInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("PUT").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)]let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_toggle_namespace_domain_public_auth(&self)? - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::ToggleNamespaceDomainPublicAuth::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "ToggleNamespaceDomainPublicAuth", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`ToggleNamespaceDomainPublicAuthInput`](crate::input::ToggleNamespaceDomainPublicAuthInput) - pub fn builder() -> crate::input::toggle_namespace_domain_public_auth_input::Builder { - crate::input::toggle_namespace_domain_public_auth_input::Builder::default() - } -} - -/// See [`UpdateGameNamespaceMatchmakerConfigInput`](crate::input::UpdateGameNamespaceMatchmakerConfigInput) -pub mod update_game_namespace_matchmaker_config_input { - /// A builder for [`UpdateGameNamespaceMatchmakerConfigInput`](crate::input::UpdateGameNamespaceMatchmakerConfigInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) namespace_id: std::option::Option, - pub(crate) lobby_count_max: std::option::Option, - pub(crate) max_players: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.namespace_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.namespace_id = input; - self - } - /// Unsigned 32 bit integer. - pub fn lobby_count_max(mut self, input: i32) -> Self { - self.lobby_count_max = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_lobby_count_max(mut self, input: std::option::Option) -> Self { - self.lobby_count_max = input; - self - } - /// Unsigned 32 bit integer. - pub fn max_players(mut self, input: i32) -> Self { - self.max_players = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_max_players(mut self, input: std::option::Option) -> Self { - self.max_players = input; - self - } - /// Consumes the builder and constructs a [`UpdateGameNamespaceMatchmakerConfigInput`](crate::input::UpdateGameNamespaceMatchmakerConfigInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::UpdateGameNamespaceMatchmakerConfigInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::UpdateGameNamespaceMatchmakerConfigInput { - game_id: self.game_id, - namespace_id: self.namespace_id, - lobby_count_max: self.lobby_count_max, - max_players: self.max_players, - }) - } - } -} -#[doc(hidden)] -pub type UpdateGameNamespaceMatchmakerConfigInputOperationOutputAlias = - crate::operation::UpdateGameNamespaceMatchmakerConfig; -#[doc(hidden)] -pub type UpdateGameNamespaceMatchmakerConfigInputOperationRetryAlias = (); -impl UpdateGameNamespaceMatchmakerConfigInput { - /// Consumes the builder and constructs an Operation<[`UpdateGameNamespaceMatchmakerConfig`](crate::operation::UpdateGameNamespaceMatchmakerConfig)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation< - crate::operation::UpdateGameNamespaceMatchmakerConfig, - (), - >, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::UpdateGameNamespaceMatchmakerConfigInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_71 = &_input.game_id; - let input_71 = input_71.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_71, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - let input_72 = &_input.namespace_id; - let input_72 = input_72.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "namespace_id", - details: "cannot be empty or unset", - }, - )?; - let namespace_id = aws_smithy_http::label::fmt_string(input_72, false); - if namespace_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "namespace_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/games/{game_id}/namespaces/{namespace_id}/mm-config", - game_id = game_id, - namespace_id = namespace_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::UpdateGameNamespaceMatchmakerConfigInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)]let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_update_game_namespace_matchmaker_config(&self)? - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::UpdateGameNamespaceMatchmakerConfig::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "UpdateGameNamespaceMatchmakerConfig", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`UpdateGameNamespaceMatchmakerConfigInput`](crate::input::UpdateGameNamespaceMatchmakerConfigInput) - pub fn builder() -> crate::input::update_game_namespace_matchmaker_config_input::Builder { - crate::input::update_game_namespace_matchmaker_config_input::Builder::default() - } -} - -/// See [`UpdateGameNamespaceVersionInput`](crate::input::UpdateGameNamespaceVersionInput) -pub mod update_game_namespace_version_input { - /// A builder for [`UpdateGameNamespaceVersionInput`](crate::input::UpdateGameNamespaceVersionInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) namespace_id: std::option::Option, - pub(crate) version_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.namespace_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.namespace_id = input; - self - } - /// A universally unique identifier. - pub fn version_id(mut self, input: impl Into) -> Self { - self.version_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_version_id(mut self, input: std::option::Option) -> Self { - self.version_id = input; - self - } - /// Consumes the builder and constructs a [`UpdateGameNamespaceVersionInput`](crate::input::UpdateGameNamespaceVersionInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::UpdateGameNamespaceVersionInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::UpdateGameNamespaceVersionInput { - game_id: self.game_id, - namespace_id: self.namespace_id, - version_id: self.version_id, - }) - } - } -} -#[doc(hidden)] -pub type UpdateGameNamespaceVersionInputOperationOutputAlias = - crate::operation::UpdateGameNamespaceVersion; -#[doc(hidden)] -pub type UpdateGameNamespaceVersionInputOperationRetryAlias = (); -impl UpdateGameNamespaceVersionInput { - /// Consumes the builder and constructs an Operation<[`UpdateGameNamespaceVersion`](crate::operation::UpdateGameNamespaceVersion)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::UpdateGameNamespaceVersionInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_73 = &_input.game_id; - let input_73 = input_73.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_73, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - let input_74 = &_input.namespace_id; - let input_74 = input_74.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "namespace_id", - details: "cannot be empty or unset", - }, - )?; - let namespace_id = aws_smithy_http::label::fmt_string(input_74, false); - if namespace_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "namespace_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/games/{game_id}/namespaces/{namespace_id}/version", - game_id = game_id, - namespace_id = namespace_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::UpdateGameNamespaceVersionInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("PUT").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)]let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_update_game_namespace_version(&self)? - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::UpdateGameNamespaceVersion::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "UpdateGameNamespaceVersion", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`UpdateGameNamespaceVersionInput`](crate::input::UpdateGameNamespaceVersionInput) - pub fn builder() -> crate::input::update_game_namespace_version_input::Builder { - crate::input::update_game_namespace_version_input::Builder::default() - } -} - -/// See [`UpdateNamespaceCdnAuthUserInput`](crate::input::UpdateNamespaceCdnAuthUserInput) -pub mod update_namespace_cdn_auth_user_input { - /// A builder for [`UpdateNamespaceCdnAuthUserInput`](crate::input::UpdateNamespaceCdnAuthUserInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) namespace_id: std::option::Option, - pub(crate) user: std::option::Option, - pub(crate) password: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.namespace_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.namespace_id = input; - self - } - /// A user name. - pub fn user(mut self, input: impl Into) -> Self { - self.user = Some(input.into()); - self - } - /// A user name. - pub fn set_user(mut self, input: std::option::Option) -> Self { - self.user = input; - self - } - /// A bcrypt encrypted password. An error is returned if the given string is not properly encrypted. - pub fn password(mut self, input: impl Into) -> Self { - self.password = Some(input.into()); - self - } - /// A bcrypt encrypted password. An error is returned if the given string is not properly encrypted. - pub fn set_password(mut self, input: std::option::Option) -> Self { - self.password = input; - self - } - /// Consumes the builder and constructs a [`UpdateNamespaceCdnAuthUserInput`](crate::input::UpdateNamespaceCdnAuthUserInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::UpdateNamespaceCdnAuthUserInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::UpdateNamespaceCdnAuthUserInput { - game_id: self.game_id, - namespace_id: self.namespace_id, - user: self.user, - password: self.password, - }) - } - } -} -#[doc(hidden)] -pub type UpdateNamespaceCdnAuthUserInputOperationOutputAlias = - crate::operation::UpdateNamespaceCdnAuthUser; -#[doc(hidden)] -pub type UpdateNamespaceCdnAuthUserInputOperationRetryAlias = (); -impl UpdateNamespaceCdnAuthUserInput { - /// Consumes the builder and constructs an Operation<[`UpdateNamespaceCdnAuthUser`](crate::operation::UpdateNamespaceCdnAuthUser)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::UpdateNamespaceCdnAuthUserInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_75 = &_input.game_id; - let input_75 = input_75.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_75, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - let input_76 = &_input.namespace_id; - let input_76 = input_76.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "namespace_id", - details: "cannot be empty or unset", - }, - )?; - let namespace_id = aws_smithy_http::label::fmt_string(input_76, false); - if namespace_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "namespace_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/games/{game_id}/namespaces/{namespace_id}/auth-user", - game_id = game_id, - namespace_id = namespace_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::UpdateNamespaceCdnAuthUserInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)]let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_update_namespace_cdn_auth_user(&self)? - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::UpdateNamespaceCdnAuthUser::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "UpdateNamespaceCdnAuthUser", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`UpdateNamespaceCdnAuthUserInput`](crate::input::UpdateNamespaceCdnAuthUserInput) - pub fn builder() -> crate::input::update_namespace_cdn_auth_user_input::Builder { - crate::input::update_namespace_cdn_auth_user_input::Builder::default() - } -} - -/// See [`ValidateGameInput`](crate::input::ValidateGameInput) -pub mod validate_game_input { - /// A builder for [`ValidateGameInput`](crate::input::ValidateGameInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) display_name: std::option::Option, - pub(crate) name_id: std::option::Option, - } - impl Builder { - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn name_id(mut self, input: impl Into) -> Self { - self.name_id = Some(input.into()); - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn set_name_id(mut self, input: std::option::Option) -> Self { - self.name_id = input; - self - } - /// Consumes the builder and constructs a [`ValidateGameInput`](crate::input::ValidateGameInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::ValidateGameInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::ValidateGameInput { - display_name: self.display_name, - name_id: self.name_id, - }) - } - } -} -#[doc(hidden)] -pub type ValidateGameInputOperationOutputAlias = crate::operation::ValidateGame; -#[doc(hidden)] -pub type ValidateGameInputOperationRetryAlias = (); -impl ValidateGameInput { - /// Consumes the builder and constructs an Operation<[`ValidateGame`](crate::operation::ValidateGame)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::ValidateGameInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/games/validate").expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::ValidateGameInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_validate_game(&self)?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::ValidateGame::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "ValidateGame", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`ValidateGameInput`](crate::input::ValidateGameInput) - pub fn builder() -> crate::input::validate_game_input::Builder { - crate::input::validate_game_input::Builder::default() - } -} - -/// See [`ValidateGameNamespaceInput`](crate::input::ValidateGameNamespaceInput) -pub mod validate_game_namespace_input { - /// A builder for [`ValidateGameNamespaceInput`](crate::input::ValidateGameNamespaceInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) name_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn name_id(mut self, input: impl Into) -> Self { - self.name_id = Some(input.into()); - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn set_name_id(mut self, input: std::option::Option) -> Self { - self.name_id = input; - self - } - /// Consumes the builder and constructs a [`ValidateGameNamespaceInput`](crate::input::ValidateGameNamespaceInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::ValidateGameNamespaceInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::ValidateGameNamespaceInput { - game_id: self.game_id, - display_name: self.display_name, - name_id: self.name_id, - }) - } - } -} -#[doc(hidden)] -pub type ValidateGameNamespaceInputOperationOutputAlias = crate::operation::ValidateGameNamespace; -#[doc(hidden)] -pub type ValidateGameNamespaceInputOperationRetryAlias = (); -impl ValidateGameNamespaceInput { - /// Consumes the builder and constructs an Operation<[`ValidateGameNamespace`](crate::operation::ValidateGameNamespace)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::ValidateGameNamespaceInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_77 = &_input.game_id; - let input_77 = input_77.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_77, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/games/{game_id}/namespaces/validate", - game_id = game_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::ValidateGameNamespaceInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_validate_game_namespace( - &self, - )?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::ValidateGameNamespace::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "ValidateGameNamespace", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`ValidateGameNamespaceInput`](crate::input::ValidateGameNamespaceInput) - pub fn builder() -> crate::input::validate_game_namespace_input::Builder { - crate::input::validate_game_namespace_input::Builder::default() - } -} - -/// See [`ValidateGameNamespaceMatchmakerConfigInput`](crate::input::ValidateGameNamespaceMatchmakerConfigInput) -pub mod validate_game_namespace_matchmaker_config_input { - /// A builder for [`ValidateGameNamespaceMatchmakerConfigInput`](crate::input::ValidateGameNamespaceMatchmakerConfigInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) namespace_id: std::option::Option, - pub(crate) lobby_count_max: std::option::Option, - pub(crate) max_players: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.namespace_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.namespace_id = input; - self - } - /// Unsigned 32 bit integer. - pub fn lobby_count_max(mut self, input: i32) -> Self { - self.lobby_count_max = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_lobby_count_max(mut self, input: std::option::Option) -> Self { - self.lobby_count_max = input; - self - } - /// Unsigned 32 bit integer. - pub fn max_players(mut self, input: i32) -> Self { - self.max_players = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_max_players(mut self, input: std::option::Option) -> Self { - self.max_players = input; - self - } - /// Consumes the builder and constructs a [`ValidateGameNamespaceMatchmakerConfigInput`](crate::input::ValidateGameNamespaceMatchmakerConfigInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::ValidateGameNamespaceMatchmakerConfigInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::ValidateGameNamespaceMatchmakerConfigInput { - game_id: self.game_id, - namespace_id: self.namespace_id, - lobby_count_max: self.lobby_count_max, - max_players: self.max_players, - }) - } - } -} -#[doc(hidden)] -pub type ValidateGameNamespaceMatchmakerConfigInputOperationOutputAlias = - crate::operation::ValidateGameNamespaceMatchmakerConfig; -#[doc(hidden)] -pub type ValidateGameNamespaceMatchmakerConfigInputOperationRetryAlias = (); -impl ValidateGameNamespaceMatchmakerConfigInput { - /// Consumes the builder and constructs an Operation<[`ValidateGameNamespaceMatchmakerConfig`](crate::operation::ValidateGameNamespaceMatchmakerConfig)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation< - crate::operation::ValidateGameNamespaceMatchmakerConfig, - (), - >, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::ValidateGameNamespaceMatchmakerConfigInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_78 = &_input.game_id; - let input_78 = input_78.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_78, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - let input_79 = &_input.namespace_id; - let input_79 = input_79.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "namespace_id", - details: "cannot be empty or unset", - }, - )?; - let namespace_id = aws_smithy_http::label::fmt_string(input_79, false); - if namespace_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "namespace_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/games/{game_id}/namespaces/{namespace_id}/mm-config/validate", - game_id = game_id, - namespace_id = namespace_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::ValidateGameNamespaceMatchmakerConfigInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)]let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_validate_game_namespace_matchmaker_config(&self)? - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::ValidateGameNamespaceMatchmakerConfig::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "ValidateGameNamespaceMatchmakerConfig", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`ValidateGameNamespaceMatchmakerConfigInput`](crate::input::ValidateGameNamespaceMatchmakerConfigInput) - pub fn builder() -> crate::input::validate_game_namespace_matchmaker_config_input::Builder { - crate::input::validate_game_namespace_matchmaker_config_input::Builder::default() - } -} - -/// See [`ValidateGameNamespaceTokenDevelopmentInput`](crate::input::ValidateGameNamespaceTokenDevelopmentInput) -pub mod validate_game_namespace_token_development_input { - /// A builder for [`ValidateGameNamespaceTokenDevelopmentInput`](crate::input::ValidateGameNamespaceTokenDevelopmentInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) namespace_id: std::option::Option, - pub(crate) hostname: std::option::Option, - pub(crate) lobby_ports: - std::option::Option>, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.namespace_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.namespace_id = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn hostname(mut self, input: impl Into) -> Self { - self.hostname = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_hostname(mut self, input: std::option::Option) -> Self { - self.hostname = input; - self - } - /// Appends an item to `lobby_ports`. - /// - /// To override the contents of this collection use [`set_lobby_ports`](Self::set_lobby_ports). - /// - /// A list of docker ports. - pub fn lobby_ports(mut self, input: crate::model::LobbyGroupRuntimeDockerPort) -> Self { - let mut v = self.lobby_ports.unwrap_or_default(); - v.push(input); - self.lobby_ports = Some(v); - self - } - /// A list of docker ports. - pub fn set_lobby_ports( - mut self, - input: std::option::Option>, - ) -> Self { - self.lobby_ports = input; - self - } - /// Consumes the builder and constructs a [`ValidateGameNamespaceTokenDevelopmentInput`](crate::input::ValidateGameNamespaceTokenDevelopmentInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::ValidateGameNamespaceTokenDevelopmentInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::ValidateGameNamespaceTokenDevelopmentInput { - game_id: self.game_id, - namespace_id: self.namespace_id, - hostname: self.hostname, - lobby_ports: self.lobby_ports, - }) - } - } -} -#[doc(hidden)] -pub type ValidateGameNamespaceTokenDevelopmentInputOperationOutputAlias = - crate::operation::ValidateGameNamespaceTokenDevelopment; -#[doc(hidden)] -pub type ValidateGameNamespaceTokenDevelopmentInputOperationRetryAlias = (); -impl ValidateGameNamespaceTokenDevelopmentInput { - /// Consumes the builder and constructs an Operation<[`ValidateGameNamespaceTokenDevelopment`](crate::operation::ValidateGameNamespaceTokenDevelopment)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation< - crate::operation::ValidateGameNamespaceTokenDevelopment, - (), - >, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::ValidateGameNamespaceTokenDevelopmentInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_80 = &_input.game_id; - let input_80 = input_80.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_80, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - let input_81 = &_input.namespace_id; - let input_81 = input_81.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "namespace_id", - details: "cannot be empty or unset", - }, - )?; - let namespace_id = aws_smithy_http::label::fmt_string(input_81, false); - if namespace_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "namespace_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/games/{game_id}/namespaces/{namespace_id}/tokens/development/validate", - game_id = game_id, - namespace_id = namespace_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::ValidateGameNamespaceTokenDevelopmentInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)]let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_validate_game_namespace_token_development(&self)? - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::ValidateGameNamespaceTokenDevelopment::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "ValidateGameNamespaceTokenDevelopment", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`ValidateGameNamespaceTokenDevelopmentInput`](crate::input::ValidateGameNamespaceTokenDevelopmentInput) - pub fn builder() -> crate::input::validate_game_namespace_token_development_input::Builder { - crate::input::validate_game_namespace_token_development_input::Builder::default() - } -} - -/// See [`ValidateGameVersionInput`](crate::input::ValidateGameVersionInput) -pub mod validate_game_version_input { - /// A builder for [`ValidateGameVersionInput`](crate::input::ValidateGameVersionInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) config: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// Cloud configuration for a given version. - pub fn config(mut self, input: crate::model::CloudVersionConfig) -> Self { - self.config = Some(input); - self - } - /// Cloud configuration for a given version. - pub fn set_config( - mut self, - input: std::option::Option, - ) -> Self { - self.config = input; - self - } - /// Consumes the builder and constructs a [`ValidateGameVersionInput`](crate::input::ValidateGameVersionInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::ValidateGameVersionInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::ValidateGameVersionInput { - game_id: self.game_id, - display_name: self.display_name, - config: self.config, - }) - } - } -} -#[doc(hidden)] -pub type ValidateGameVersionInputOperationOutputAlias = crate::operation::ValidateGameVersion; -#[doc(hidden)] -pub type ValidateGameVersionInputOperationRetryAlias = (); -impl ValidateGameVersionInput { - /// Consumes the builder and constructs an Operation<[`ValidateGameVersion`](crate::operation::ValidateGameVersion)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::ValidateGameVersionInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_82 = &_input.game_id; - let input_82 = input_82.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_82, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/games/{game_id}/versions/validate", - game_id = game_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::ValidateGameVersionInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_validate_game_version(&self)?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::ValidateGameVersion::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "ValidateGameVersion", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`ValidateGameVersionInput`](crate::input::ValidateGameVersionInput) - pub fn builder() -> crate::input::validate_game_version_input::Builder { - crate::input::validate_game_version_input::Builder::default() - } -} - -/// See [`ValidateGroupInput`](crate::input::ValidateGroupInput) -pub mod validate_group_input { - /// A builder for [`ValidateGroupInput`](crate::input::ValidateGroupInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) display_name: std::option::Option, - } - impl Builder { - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// Consumes the builder and constructs a [`ValidateGroupInput`](crate::input::ValidateGroupInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::ValidateGroupInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::ValidateGroupInput { - display_name: self.display_name, - }) - } - } -} -#[doc(hidden)] -pub type ValidateGroupInputOperationOutputAlias = crate::operation::ValidateGroup; -#[doc(hidden)] -pub type ValidateGroupInputOperationRetryAlias = (); -impl ValidateGroupInput { - /// Consumes the builder and constructs an Operation<[`ValidateGroup`](crate::operation::ValidateGroup)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::ValidateGroupInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/groups/validate").expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::ValidateGroupInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_validate_group(&self)?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::ValidateGroup::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "ValidateGroup", - "CloudService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`ValidateGroupInput`](crate::input::ValidateGroupInput) - pub fn builder() -> crate::input::validate_group_input::Builder { - crate::input::validate_group_input::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CompleteCustomAvatarUploadInput { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// A universally unique identifier. - pub upload_id: std::option::Option, -} -impl CompleteCustomAvatarUploadInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// A universally unique identifier. - pub fn upload_id(&self) -> std::option::Option<&str> { - self.upload_id.as_deref() - } -} -impl std::fmt::Debug for CompleteCustomAvatarUploadInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CompleteCustomAvatarUploadInput"); - formatter.field("game_id", &self.game_id); - formatter.field("upload_id", &self.upload_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PrepareCustomAvatarUploadInput { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// The path/filename of the custom avatar. - pub path: std::option::Option, - /// The MIME type of the custom avatar. - pub mime: std::option::Option, - /// Unsigned 64 bit integer. - pub content_length: std::option::Option, -} -impl PrepareCustomAvatarUploadInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// The path/filename of the custom avatar. - pub fn path(&self) -> std::option::Option<&str> { - self.path.as_deref() - } - /// The MIME type of the custom avatar. - pub fn mime(&self) -> std::option::Option<&str> { - self.mime.as_deref() - } - /// Unsigned 64 bit integer. - pub fn content_length(&self) -> std::option::Option { - self.content_length - } -} -impl std::fmt::Debug for PrepareCustomAvatarUploadInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PrepareCustomAvatarUploadInput"); - formatter.field("game_id", &self.game_id); - formatter.field("path", &self.path); - formatter.field("mime", &self.mime); - formatter.field("content_length", &self.content_length); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ListGameCustomAvatarsInput { - /// A universally unique identifier. - pub game_id: std::option::Option, -} -impl ListGameCustomAvatarsInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } -} -impl std::fmt::Debug for ListGameCustomAvatarsInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ListGameCustomAvatarsInput"); - formatter.field("game_id", &self.game_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetRayPerfLogsInput { - /// A universally unique identifier. - pub ray_id: std::option::Option, -} -impl GetRayPerfLogsInput { - /// A universally unique identifier. - pub fn ray_id(&self) -> std::option::Option<&str> { - self.ray_id.as_deref() - } -} -impl std::fmt::Debug for GetRayPerfLogsInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetRayPerfLogsInput"); - formatter.field("ray_id", &self.ray_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ValidateGroupInput { - /// Represent a resource's readable display name. - pub display_name: std::option::Option, -} -impl ValidateGroupInput { - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } -} -impl std::fmt::Debug for ValidateGroupInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ValidateGroupInput"); - formatter.field("display_name", &self.display_name); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GroupBillingCheckoutInput { - /// A universally unique identifier. - pub group_id: std::option::Option, -} -impl GroupBillingCheckoutInput { - /// A universally unique identifier. - pub fn group_id(&self) -> std::option::Option<&str> { - self.group_id.as_deref() - } -} -impl std::fmt::Debug for GroupBillingCheckoutInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GroupBillingCheckoutInput"); - formatter.field("group_id", &self.group_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ConvertGroupInput { - /// A universally unique identifier. - pub group_id: std::option::Option, -} -impl ConvertGroupInput { - /// A universally unique identifier. - pub fn group_id(&self) -> std::option::Option<&str> { - self.group_id.as_deref() - } -} -impl std::fmt::Debug for ConvertGroupInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ConvertGroupInput"); - formatter.field("group_id", &self.group_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetGroupInvoicesListInput { - /// A universally unique identifier. - pub group_id: std::option::Option, - /// Unsigned 32 bit integer. - pub page: std::option::Option, - /// Unsigned 32 bit integer. - pub per_page: std::option::Option, -} -impl GetGroupInvoicesListInput { - /// A universally unique identifier. - pub fn group_id(&self) -> std::option::Option<&str> { - self.group_id.as_deref() - } - /// Unsigned 32 bit integer. - pub fn page(&self) -> std::option::Option { - self.page - } - /// Unsigned 32 bit integer. - pub fn per_page(&self) -> std::option::Option { - self.per_page - } -} -impl std::fmt::Debug for GetGroupInvoicesListInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetGroupInvoicesListInput"); - formatter.field("group_id", &self.group_id); - formatter.field("page", &self.page); - formatter.field("per_page", &self.per_page); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetGroupBillingInput { - /// A universally unique identifier. - pub group_id: std::option::Option, -} -impl GetGroupBillingInput { - /// A universally unique identifier. - pub fn group_id(&self) -> std::option::Option<&str> { - self.group_id.as_deref() - } -} -impl std::fmt::Debug for GetGroupBillingInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetGroupBillingInput"); - formatter.field("group_id", &self.group_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetRegionTiersInput {} -impl std::fmt::Debug for GetRegionTiersInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetRegionTiersInput"); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ExportLobbyLogsInput { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// A universally unique identifier. - pub lobby_id: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub stream: std::option::Option, -} -impl ExportLobbyLogsInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// A universally unique identifier. - pub fn lobby_id(&self) -> std::option::Option<&str> { - self.lobby_id.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn stream(&self) -> std::option::Option<&crate::model::LogStream> { - self.stream.as_ref() - } -} -impl std::fmt::Debug for ExportLobbyLogsInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ExportLobbyLogsInput"); - formatter.field("game_id", &self.game_id); - formatter.field("lobby_id", &self.lobby_id); - formatter.field("stream", &self.stream); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetLobbyLogsInput { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// A universally unique identifier. - pub lobby_id: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub stream: std::option::Option, - /// A query parameter denoting the requests watch index. - pub watch_index: std::option::Option, -} -impl GetLobbyLogsInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// A universally unique identifier. - pub fn lobby_id(&self) -> std::option::Option<&str> { - self.lobby_id.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn stream(&self) -> std::option::Option<&crate::model::LogStream> { - self.stream.as_ref() - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(&self) -> std::option::Option<&str> { - self.watch_index.as_deref() - } -} -impl std::fmt::Debug for GetLobbyLogsInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetLobbyLogsInput"); - formatter.field("game_id", &self.game_id); - formatter.field("lobby_id", &self.lobby_id); - formatter.field("stream", &self.stream); - formatter.field("watch_index", &self.watch_index); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ExportMatchmakerLobbyHistoryInput { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// Unsigned 64 bit integer. - pub query_start: std::option::Option, - /// Unsigned 64 bit integer. - pub query_end: std::option::Option, -} -impl ExportMatchmakerLobbyHistoryInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// Unsigned 64 bit integer. - pub fn query_start(&self) -> std::option::Option { - self.query_start - } - /// Unsigned 64 bit integer. - pub fn query_end(&self) -> std::option::Option { - self.query_end - } -} -impl std::fmt::Debug for ExportMatchmakerLobbyHistoryInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ExportMatchmakerLobbyHistoryInput"); - formatter.field("game_id", &self.game_id); - formatter.field("query_start", &self.query_start); - formatter.field("query_end", &self.query_end); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct DeleteMatchmakerLobbyInput { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// A universally unique identifier. - pub lobby_id: std::option::Option, -} -impl DeleteMatchmakerLobbyInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// A universally unique identifier. - pub fn lobby_id(&self) -> std::option::Option<&str> { - self.lobby_id.as_deref() - } -} -impl std::fmt::Debug for DeleteMatchmakerLobbyInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("DeleteMatchmakerLobbyInput"); - formatter.field("game_id", &self.game_id); - formatter.field("lobby_id", &self.lobby_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CreateGameCdnSiteInput { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// A list of files preparing to upload. - pub files: std::option::Option>, -} -impl CreateGameCdnSiteInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// A list of files preparing to upload. - pub fn files(&self) -> std::option::Option<&[crate::model::UploadPrepareFile]> { - self.files.as_deref() - } -} -impl std::fmt::Debug for CreateGameCdnSiteInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CreateGameCdnSiteInput"); - formatter.field("game_id", &self.game_id); - formatter.field("display_name", &self.display_name); - formatter.field("files", &self.files); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ListGameCdnSitesInput { - /// A universally unique identifier. - pub game_id: std::option::Option, -} -impl ListGameCdnSitesInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } -} -impl std::fmt::Debug for ListGameCdnSitesInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ListGameCdnSitesInput"); - formatter.field("game_id", &self.game_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CreateGameBuildInput { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// A tag given to the game build. - pub image_tag: std::option::Option, - /// A file being prepared to upload. - pub image_file: std::option::Option, -} -impl CreateGameBuildInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// A tag given to the game build. - pub fn image_tag(&self) -> std::option::Option<&str> { - self.image_tag.as_deref() - } - /// A file being prepared to upload. - pub fn image_file(&self) -> std::option::Option<&crate::model::UploadPrepareFile> { - self.image_file.as_ref() - } -} -impl std::fmt::Debug for CreateGameBuildInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CreateGameBuildInput"); - formatter.field("game_id", &self.game_id); - formatter.field("display_name", &self.display_name); - formatter.field("image_tag", &self.image_tag); - formatter.field("image_file", &self.image_file); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ListGameBuildsInput { - /// A universally unique identifier. - pub game_id: std::option::Option, -} -impl ListGameBuildsInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } -} -impl std::fmt::Debug for ListGameBuildsInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ListGameBuildsInput"); - formatter.field("game_id", &self.game_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CreateCloudTokenInput { - /// A universally unique identifier. - pub game_id: std::option::Option, -} -impl CreateCloudTokenInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } -} -impl std::fmt::Debug for CreateCloudTokenInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CreateCloudTokenInput"); - formatter.field("game_id", &self.game_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetNamespaceLobbyInput { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// A universally unique identifier. - pub namespace_id: std::option::Option, - /// A universally unique identifier. - pub lobby_id: std::option::Option, -} -impl GetNamespaceLobbyInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// A universally unique identifier. - pub fn namespace_id(&self) -> std::option::Option<&str> { - self.namespace_id.as_deref() - } - /// A universally unique identifier. - pub fn lobby_id(&self) -> std::option::Option<&str> { - self.lobby_id.as_deref() - } -} -impl std::fmt::Debug for GetNamespaceLobbyInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetNamespaceLobbyInput"); - formatter.field("game_id", &self.game_id); - formatter.field("namespace_id", &self.namespace_id); - formatter.field("lobby_id", &self.lobby_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ListNamespaceLobbiesInput { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// A universally unique identifier. - pub namespace_id: std::option::Option, - /// Returns lobbies created before this timestamp. - pub before_create_ts: std::option::Option, -} -impl ListNamespaceLobbiesInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// A universally unique identifier. - pub fn namespace_id(&self) -> std::option::Option<&str> { - self.namespace_id.as_deref() - } - /// Returns lobbies created before this timestamp. - pub fn before_create_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.before_create_ts.as_ref() - } -} -impl std::fmt::Debug for ListNamespaceLobbiesInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ListNamespaceLobbiesInput"); - formatter.field("game_id", &self.game_id); - formatter.field("namespace_id", &self.namespace_id); - formatter.field("before_create_ts", &self.before_create_ts); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetNamespaceAnalyticsMatchmakerLiveInput { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// A universally unique identifier. - pub namespace_id: std::option::Option, -} -impl GetNamespaceAnalyticsMatchmakerLiveInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// A universally unique identifier. - pub fn namespace_id(&self) -> std::option::Option<&str> { - self.namespace_id.as_deref() - } -} -impl std::fmt::Debug for GetNamespaceAnalyticsMatchmakerLiveInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetNamespaceAnalyticsMatchmakerLiveInput"); - formatter.field("game_id", &self.game_id); - formatter.field("namespace_id", &self.namespace_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct SetNamespaceCdnAuthTypeInput { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// A universally unique identifier. - pub namespace_id: std::option::Option, - /// A value denoting what type of authentication to use for a game namespace's CDN. - pub auth_type: std::option::Option, -} -impl SetNamespaceCdnAuthTypeInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// A universally unique identifier. - pub fn namespace_id(&self) -> std::option::Option<&str> { - self.namespace_id.as_deref() - } - /// A value denoting what type of authentication to use for a game namespace's CDN. - pub fn auth_type(&self) -> std::option::Option<&crate::model::CdnAuthType> { - self.auth_type.as_ref() - } -} -impl std::fmt::Debug for SetNamespaceCdnAuthTypeInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("SetNamespaceCdnAuthTypeInput"); - formatter.field("game_id", &self.game_id); - formatter.field("namespace_id", &self.namespace_id); - formatter.field("auth_type", &self.auth_type); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct RemoveNamespaceCdnAuthUserInput { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// A universally unique identifier. - pub namespace_id: std::option::Option, - /// A user name. - pub user: std::option::Option, -} -impl RemoveNamespaceCdnAuthUserInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// A universally unique identifier. - pub fn namespace_id(&self) -> std::option::Option<&str> { - self.namespace_id.as_deref() - } - /// A user name. - pub fn user(&self) -> std::option::Option<&str> { - self.user.as_deref() - } -} -impl std::fmt::Debug for RemoveNamespaceCdnAuthUserInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("RemoveNamespaceCdnAuthUserInput"); - formatter.field("game_id", &self.game_id); - formatter.field("namespace_id", &self.namespace_id); - formatter.field("user", &self.user); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UpdateNamespaceCdnAuthUserInput { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// A universally unique identifier. - pub namespace_id: std::option::Option, - /// A user name. - pub user: std::option::Option, - /// A bcrypt encrypted password. An error is returned if the given string is not properly encrypted. - pub password: std::option::Option, -} -impl UpdateNamespaceCdnAuthUserInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// A universally unique identifier. - pub fn namespace_id(&self) -> std::option::Option<&str> { - self.namespace_id.as_deref() - } - /// A user name. - pub fn user(&self) -> std::option::Option<&str> { - self.user.as_deref() - } - /// A bcrypt encrypted password. An error is returned if the given string is not properly encrypted. - pub fn password(&self) -> std::option::Option<&str> { - self.password.as_deref() - } -} -impl std::fmt::Debug for UpdateNamespaceCdnAuthUserInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UpdateNamespaceCdnAuthUserInput"); - formatter.field("game_id", &self.game_id); - formatter.field("namespace_id", &self.namespace_id); - formatter.field("user", &self.user); - formatter.field("password", &self.password); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ValidateGameNamespaceMatchmakerConfigInput { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// A universally unique identifier. - pub namespace_id: std::option::Option, - /// Unsigned 32 bit integer. - pub lobby_count_max: std::option::Option, - /// Unsigned 32 bit integer. - pub max_players: std::option::Option, -} -impl ValidateGameNamespaceMatchmakerConfigInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// A universally unique identifier. - pub fn namespace_id(&self) -> std::option::Option<&str> { - self.namespace_id.as_deref() - } - /// Unsigned 32 bit integer. - pub fn lobby_count_max(&self) -> std::option::Option { - self.lobby_count_max - } - /// Unsigned 32 bit integer. - pub fn max_players(&self) -> std::option::Option { - self.max_players - } -} -impl std::fmt::Debug for ValidateGameNamespaceMatchmakerConfigInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ValidateGameNamespaceMatchmakerConfigInput"); - formatter.field("game_id", &self.game_id); - formatter.field("namespace_id", &self.namespace_id); - formatter.field("lobby_count_max", &self.lobby_count_max); - formatter.field("max_players", &self.max_players); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ValidateGameNamespaceTokenDevelopmentInput { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// A universally unique identifier. - pub namespace_id: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub hostname: std::option::Option, - /// A list of docker ports. - pub lobby_ports: std::option::Option>, -} -impl ValidateGameNamespaceTokenDevelopmentInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// A universally unique identifier. - pub fn namespace_id(&self) -> std::option::Option<&str> { - self.namespace_id.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn hostname(&self) -> std::option::Option<&str> { - self.hostname.as_deref() - } - /// A list of docker ports. - pub fn lobby_ports(&self) -> std::option::Option<&[crate::model::LobbyGroupRuntimeDockerPort]> { - self.lobby_ports.as_deref() - } -} -impl std::fmt::Debug for ValidateGameNamespaceTokenDevelopmentInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ValidateGameNamespaceTokenDevelopmentInput"); - formatter.field("game_id", &self.game_id); - formatter.field("namespace_id", &self.namespace_id); - formatter.field("hostname", &self.hostname); - formatter.field("lobby_ports", &self.lobby_ports); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ValidateGameNamespaceInput { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub name_id: std::option::Option, -} -impl ValidateGameNamespaceInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn name_id(&self) -> std::option::Option<&str> { - self.name_id.as_deref() - } -} -impl std::fmt::Debug for ValidateGameNamespaceInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ValidateGameNamespaceInput"); - formatter.field("game_id", &self.game_id); - formatter.field("display_name", &self.display_name); - formatter.field("name_id", &self.name_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UpdateGameNamespaceMatchmakerConfigInput { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// A universally unique identifier. - pub namespace_id: std::option::Option, - /// Unsigned 32 bit integer. - pub lobby_count_max: std::option::Option, - /// Unsigned 32 bit integer. - pub max_players: std::option::Option, -} -impl UpdateGameNamespaceMatchmakerConfigInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// A universally unique identifier. - pub fn namespace_id(&self) -> std::option::Option<&str> { - self.namespace_id.as_deref() - } - /// Unsigned 32 bit integer. - pub fn lobby_count_max(&self) -> std::option::Option { - self.lobby_count_max - } - /// Unsigned 32 bit integer. - pub fn max_players(&self) -> std::option::Option { - self.max_players - } -} -impl std::fmt::Debug for UpdateGameNamespaceMatchmakerConfigInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UpdateGameNamespaceMatchmakerConfigInput"); - formatter.field("game_id", &self.game_id); - formatter.field("namespace_id", &self.namespace_id); - formatter.field("lobby_count_max", &self.lobby_count_max); - formatter.field("max_players", &self.max_players); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ToggleNamespaceDomainPublicAuthInput { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// A universally unique identifier. - pub namespace_id: std::option::Option, - /// Whether or not to enable authentication based on domain. - pub enabled: std::option::Option, -} -impl ToggleNamespaceDomainPublicAuthInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// A universally unique identifier. - pub fn namespace_id(&self) -> std::option::Option<&str> { - self.namespace_id.as_deref() - } - /// Whether or not to enable authentication based on domain. - pub fn enabled(&self) -> std::option::Option { - self.enabled - } -} -impl std::fmt::Debug for ToggleNamespaceDomainPublicAuthInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ToggleNamespaceDomainPublicAuthInput"); - formatter.field("game_id", &self.game_id); - formatter.field("namespace_id", &self.namespace_id); - formatter.field("enabled", &self.enabled); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct RemoveNamespaceDomainInput { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// A universally unique identifier. - pub namespace_id: std::option::Option, - /// A valid domain name (no protocol). - pub domain: std::option::Option, -} -impl RemoveNamespaceDomainInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// A universally unique identifier. - pub fn namespace_id(&self) -> std::option::Option<&str> { - self.namespace_id.as_deref() - } - /// A valid domain name (no protocol). - pub fn domain(&self) -> std::option::Option<&str> { - self.domain.as_deref() - } -} -impl std::fmt::Debug for RemoveNamespaceDomainInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("RemoveNamespaceDomainInput"); - formatter.field("game_id", &self.game_id); - formatter.field("namespace_id", &self.namespace_id); - formatter.field("domain", &self.domain); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct AddNamespaceDomainInput { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// A universally unique identifier. - pub namespace_id: std::option::Option, - /// A valid domain name (no protocol). - pub domain: std::option::Option, -} -impl AddNamespaceDomainInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// A universally unique identifier. - pub fn namespace_id(&self) -> std::option::Option<&str> { - self.namespace_id.as_deref() - } - /// A valid domain name (no protocol). - pub fn domain(&self) -> std::option::Option<&str> { - self.domain.as_deref() - } -} -impl std::fmt::Debug for AddNamespaceDomainInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("AddNamespaceDomainInput"); - formatter.field("game_id", &self.game_id); - formatter.field("namespace_id", &self.namespace_id); - formatter.field("domain", &self.domain); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CreateGameNamespaceTokenDevelopmentInput { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// A universally unique identifier. - pub namespace_id: std::option::Option, - /// The hostname used for the token. - pub hostname: std::option::Option, - /// A list of docker ports. - pub lobby_ports: std::option::Option>, -} -impl CreateGameNamespaceTokenDevelopmentInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// A universally unique identifier. - pub fn namespace_id(&self) -> std::option::Option<&str> { - self.namespace_id.as_deref() - } - /// The hostname used for the token. - pub fn hostname(&self) -> std::option::Option<&str> { - self.hostname.as_deref() - } - /// A list of docker ports. - pub fn lobby_ports(&self) -> std::option::Option<&[crate::model::LobbyGroupRuntimeDockerPort]> { - self.lobby_ports.as_deref() - } -} -impl std::fmt::Debug for CreateGameNamespaceTokenDevelopmentInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CreateGameNamespaceTokenDevelopmentInput"); - formatter.field("game_id", &self.game_id); - formatter.field("namespace_id", &self.namespace_id); - formatter.field("hostname", &self.hostname); - formatter.field("lobby_ports", &self.lobby_ports); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CreateGameNamespaceTokenPublicInput { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// A universally unique identifier. - pub namespace_id: std::option::Option, -} -impl CreateGameNamespaceTokenPublicInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// A universally unique identifier. - pub fn namespace_id(&self) -> std::option::Option<&str> { - self.namespace_id.as_deref() - } -} -impl std::fmt::Debug for CreateGameNamespaceTokenPublicInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CreateGameNamespaceTokenPublicInput"); - formatter.field("game_id", &self.game_id); - formatter.field("namespace_id", &self.namespace_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UpdateGameNamespaceVersionInput { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// A universally unique identifier. - pub namespace_id: std::option::Option, - /// A universally unique identifier. - pub version_id: std::option::Option, -} -impl UpdateGameNamespaceVersionInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// A universally unique identifier. - pub fn namespace_id(&self) -> std::option::Option<&str> { - self.namespace_id.as_deref() - } - /// A universally unique identifier. - pub fn version_id(&self) -> std::option::Option<&str> { - self.version_id.as_deref() - } -} -impl std::fmt::Debug for UpdateGameNamespaceVersionInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UpdateGameNamespaceVersionInput"); - formatter.field("game_id", &self.game_id); - formatter.field("namespace_id", &self.namespace_id); - formatter.field("version_id", &self.version_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetGameNamespaceByIdInput { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// A universally unique identifier. - pub namespace_id: std::option::Option, -} -impl GetGameNamespaceByIdInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// A universally unique identifier. - pub fn namespace_id(&self) -> std::option::Option<&str> { - self.namespace_id.as_deref() - } -} -impl std::fmt::Debug for GetGameNamespaceByIdInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetGameNamespaceByIdInput"); - formatter.field("game_id", &self.game_id); - formatter.field("namespace_id", &self.namespace_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CreateGameNamespaceInput { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// A universally unique identifier. - pub version_id: std::option::Option, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub name_id: std::option::Option, -} -impl CreateGameNamespaceInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// A universally unique identifier. - pub fn version_id(&self) -> std::option::Option<&str> { - self.version_id.as_deref() - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn name_id(&self) -> std::option::Option<&str> { - self.name_id.as_deref() - } -} -impl std::fmt::Debug for CreateGameNamespaceInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CreateGameNamespaceInput"); - formatter.field("game_id", &self.game_id); - formatter.field("display_name", &self.display_name); - formatter.field("version_id", &self.version_id); - formatter.field("name_id", &self.name_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ValidateGameVersionInput { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// Cloud configuration for a given version. - pub config: std::option::Option, -} -impl ValidateGameVersionInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// Cloud configuration for a given version. - pub fn config(&self) -> std::option::Option<&crate::model::CloudVersionConfig> { - self.config.as_ref() - } -} -impl std::fmt::Debug for ValidateGameVersionInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ValidateGameVersionInput"); - formatter.field("game_id", &self.game_id); - formatter.field("display_name", &self.display_name); - formatter.field("config", &self.config); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetGameVersionByIdInput { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// A universally unique identifier. - pub version_id: std::option::Option, -} -impl GetGameVersionByIdInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// A universally unique identifier. - pub fn version_id(&self) -> std::option::Option<&str> { - self.version_id.as_deref() - } -} -impl std::fmt::Debug for GetGameVersionByIdInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetGameVersionByIdInput"); - formatter.field("game_id", &self.game_id); - formatter.field("version_id", &self.version_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CreateGameVersionInput { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// Cloud configuration for a given version. - pub config: std::option::Option, -} -impl CreateGameVersionInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// Cloud configuration for a given version. - pub fn config(&self) -> std::option::Option<&crate::model::CloudVersionConfig> { - self.config.as_ref() - } -} -impl std::fmt::Debug for CreateGameVersionInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CreateGameVersionInput"); - formatter.field("game_id", &self.game_id); - formatter.field("display_name", &self.display_name); - formatter.field("config", &self.config); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetGameBillingPlansInput { - /// A universally unique identifier. - pub game_id: std::option::Option, -} -impl GetGameBillingPlansInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } -} -impl std::fmt::Debug for GetGameBillingPlansInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetGameBillingPlansInput"); - formatter.field("game_id", &self.game_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct SetGameBillingPlanInput { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// A value denoting a game's billing plan. - pub plan: std::option::Option, -} -impl SetGameBillingPlanInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// A value denoting a game's billing plan. - pub fn plan(&self) -> std::option::Option<&crate::model::GameBillingPlanCode> { - self.plan.as_ref() - } -} -impl std::fmt::Debug for SetGameBillingPlanInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("SetGameBillingPlanInput"); - formatter.field("game_id", &self.game_id); - formatter.field("plan", &self.plan); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetGameBillingInput { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// Unsigned 64 bit integer. - pub query_start: std::option::Option, - /// Unsigned 64 bit integer. - pub query_end: std::option::Option, -} -impl GetGameBillingInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// Unsigned 64 bit integer. - pub fn query_start(&self) -> std::option::Option { - self.query_start - } - /// Unsigned 64 bit integer. - pub fn query_end(&self) -> std::option::Option { - self.query_end - } -} -impl std::fmt::Debug for GetGameBillingInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetGameBillingInput"); - formatter.field("game_id", &self.game_id); - formatter.field("query_start", &self.query_start); - formatter.field("query_end", &self.query_end); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GameBannerUploadCompleteInput { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// A universally unique identifier. - pub upload_id: std::option::Option, -} -impl GameBannerUploadCompleteInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// A universally unique identifier. - pub fn upload_id(&self) -> std::option::Option<&str> { - self.upload_id.as_deref() - } -} -impl std::fmt::Debug for GameBannerUploadCompleteInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GameBannerUploadCompleteInput"); - formatter.field("game_id", &self.game_id); - formatter.field("upload_id", &self.upload_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GameBannerUploadPrepareInput { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// The path/filename of the game banner. - pub path: std::option::Option, - /// The MIME type of the game banner. - pub mime: std::option::Option, - /// Unsigned 64 bit integer. - pub content_length: std::option::Option, -} -impl GameBannerUploadPrepareInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// The path/filename of the game banner. - pub fn path(&self) -> std::option::Option<&str> { - self.path.as_deref() - } - /// The MIME type of the game banner. - pub fn mime(&self) -> std::option::Option<&str> { - self.mime.as_deref() - } - /// Unsigned 64 bit integer. - pub fn content_length(&self) -> std::option::Option { - self.content_length - } -} -impl std::fmt::Debug for GameBannerUploadPrepareInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GameBannerUploadPrepareInput"); - formatter.field("game_id", &self.game_id); - formatter.field("path", &self.path); - formatter.field("mime", &self.mime); - formatter.field("content_length", &self.content_length); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GameLogoUploadCompleteInput { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// A universally unique identifier. - pub upload_id: std::option::Option, -} -impl GameLogoUploadCompleteInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// A universally unique identifier. - pub fn upload_id(&self) -> std::option::Option<&str> { - self.upload_id.as_deref() - } -} -impl std::fmt::Debug for GameLogoUploadCompleteInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GameLogoUploadCompleteInput"); - formatter.field("game_id", &self.game_id); - formatter.field("upload_id", &self.upload_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GameLogoUploadPrepareInput { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// The path/filename of the game logo. - pub path: std::option::Option, - /// The MIME type of the game logo. - pub mime: std::option::Option, - /// Unsigned 64 bit integer. - pub content_length: std::option::Option, -} -impl GameLogoUploadPrepareInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// The path/filename of the game logo. - pub fn path(&self) -> std::option::Option<&str> { - self.path.as_deref() - } - /// The MIME type of the game logo. - pub fn mime(&self) -> std::option::Option<&str> { - self.mime.as_deref() - } - /// Unsigned 64 bit integer. - pub fn content_length(&self) -> std::option::Option { - self.content_length - } -} -impl std::fmt::Debug for GameLogoUploadPrepareInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GameLogoUploadPrepareInput"); - formatter.field("game_id", &self.game_id); - formatter.field("path", &self.path); - formatter.field("mime", &self.mime); - formatter.field("content_length", &self.content_length); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ValidateGameInput { - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub name_id: std::option::Option, -} -impl ValidateGameInput { - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn name_id(&self) -> std::option::Option<&str> { - self.name_id.as_deref() - } -} -impl std::fmt::Debug for ValidateGameInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ValidateGameInput"); - formatter.field("display_name", &self.display_name); - formatter.field("name_id", &self.name_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetGameByIdInput { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// A query parameter denoting the requests watch index. - pub watch_index: std::option::Option, -} -impl GetGameByIdInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(&self) -> std::option::Option<&str> { - self.watch_index.as_deref() - } -} -impl std::fmt::Debug for GetGameByIdInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetGameByIdInput"); - formatter.field("game_id", &self.game_id); - formatter.field("watch_index", &self.watch_index); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CreateGameInput { - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub name_id: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// A universally unique identifier. - pub developer_group_id: std::option::Option, -} -impl CreateGameInput { - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn name_id(&self) -> std::option::Option<&str> { - self.name_id.as_deref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// A universally unique identifier. - pub fn developer_group_id(&self) -> std::option::Option<&str> { - self.developer_group_id.as_deref() - } -} -impl std::fmt::Debug for CreateGameInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CreateGameInput"); - formatter.field("name_id", &self.name_id); - formatter.field("display_name", &self.display_name); - formatter.field("developer_group_id", &self.developer_group_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetGamesInput { - /// A query parameter denoting the requests watch index. - pub watch_index: std::option::Option, -} -impl GetGamesInput { - /// A query parameter denoting the requests watch index. - pub fn watch_index(&self) -> std::option::Option<&str> { - self.watch_index.as_deref() - } -} -impl std::fmt::Debug for GetGamesInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetGamesInput"); - formatter.field("watch_index", &self.watch_index); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CompleteUploadInput { - /// A universally unique identifier. - pub upload_id: std::option::Option, -} -impl CompleteUploadInput { - /// A universally unique identifier. - pub fn upload_id(&self) -> std::option::Option<&str> { - self.upload_id.as_deref() - } -} -impl std::fmt::Debug for CompleteUploadInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CompleteUploadInput"); - formatter.field("upload_id", &self.upload_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct InspectInput {} -impl std::fmt::Debug for InspectInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("InspectInput"); - formatter.finish() - } -} diff --git a/lib/smithy-output/api-cloud/rust/rust/src/json_deser.rs b/lib/smithy-output/api-cloud/rust/rust/src/json_deser.rs deleted file mode 100644 index 375a91dbf..000000000 --- a/lib/smithy-output/api-cloud/rust/rust/src/json_deser.rs +++ /dev/null @@ -1,7789 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub fn parse_http_generic_error( - response: &http::Response, -) -> Result { - crate::json_errors::parse_generic_error(response.body(), response.headers()) -} - -pub fn deser_structure_crate_error_internal_error_json_err( - value: &[u8], - mut builder: crate::error::internal_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_rate_limit_error_json_err( - value: &[u8], - mut builder: crate::error::rate_limit_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_forbidden_error_json_err( - value: &[u8], - mut builder: crate::error::forbidden_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_unauthorized_error_json_err( - value: &[u8], - mut builder: crate::error::unauthorized_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_not_found_error_json_err( - value: &[u8], - mut builder: crate::error::not_found_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_bad_request_error_json_err( - value: &[u8], - mut builder: crate::error::bad_request_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_create_cloud_token( - value: &[u8], - mut builder: crate::output::create_cloud_token_output::Builder, -) -> Result -{ - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "token" => { - builder = builder.set_token( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_create_game( - value: &[u8], - mut builder: crate::output::create_game_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "game_id" => { - builder = builder.set_game_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_create_game_build( - value: &[u8], - mut builder: crate::output::create_game_build_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "build_id" => { - builder = builder.set_build_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "image_presigned_request" => { - builder = builder.set_image_presigned_request( - crate::json_deser::deser_structure_crate_model_upload_presigned_request(tokens)? - ); - } - "upload_id" => { - builder = builder.set_upload_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_create_game_cdn_site( - value: &[u8], - mut builder: crate::output::create_game_cdn_site_output::Builder, -) -> Result -{ - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "presigned_requests" => { - builder = builder.set_presigned_requests( - crate::json_deser::deser_list_rivet_upload_upload_presigned_requests( - tokens, - )?, - ); - } - "site_id" => { - builder = builder.set_site_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "upload_id" => { - builder = builder.set_upload_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_create_game_namespace( - value: &[u8], - mut builder: crate::output::create_game_namespace_output::Builder, -) -> Result -{ - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "namespace_id" => { - builder = builder.set_namespace_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_create_game_namespace_token_development( - value: &[u8], - mut builder: crate::output::create_game_namespace_token_development_output::Builder, -) -> Result< - crate::output::create_game_namespace_token_development_output::Builder, - aws_smithy_json::deserialize::Error, -> { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "token" => { - builder = builder.set_token( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_create_game_namespace_token_public( - value: &[u8], - mut builder: crate::output::create_game_namespace_token_public_output::Builder, -) -> Result< - crate::output::create_game_namespace_token_public_output::Builder, - aws_smithy_json::deserialize::Error, -> { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "token" => { - builder = builder.set_token( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_create_game_version( - value: &[u8], - mut builder: crate::output::create_game_version_output::Builder, -) -> Result -{ - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "version_id" => { - builder = builder.set_version_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_delete_matchmaker_lobby( - value: &[u8], - mut builder: crate::output::delete_matchmaker_lobby_output::Builder, -) -> Result< - crate::output::delete_matchmaker_lobby_output::Builder, - aws_smithy_json::deserialize::Error, -> { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "did_remove" => { - builder = builder.set_did_remove( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_export_lobby_logs( - value: &[u8], - mut builder: crate::output::export_lobby_logs_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "url" => { - builder = builder.set_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_export_matchmaker_lobby_history( - value: &[u8], - mut builder: crate::output::export_matchmaker_lobby_history_output::Builder, -) -> Result< - crate::output::export_matchmaker_lobby_history_output::Builder, - aws_smithy_json::deserialize::Error, -> { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "url" => { - builder = builder.set_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_game_banner_upload_prepare( - value: &[u8], - mut builder: crate::output::game_banner_upload_prepare_output::Builder, -) -> Result< - crate::output::game_banner_upload_prepare_output::Builder, - aws_smithy_json::deserialize::Error, -> { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "presigned_request" => { - builder = builder.set_presigned_request( - crate::json_deser::deser_structure_crate_model_upload_presigned_request(tokens)? - ); - } - "upload_id" => { - builder = builder.set_upload_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_game_logo_upload_prepare( - value: &[u8], - mut builder: crate::output::game_logo_upload_prepare_output::Builder, -) -> Result< - crate::output::game_logo_upload_prepare_output::Builder, - aws_smithy_json::deserialize::Error, -> { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "presigned_request" => { - builder = builder.set_presigned_request( - crate::json_deser::deser_structure_crate_model_upload_presigned_request(tokens)? - ); - } - "upload_id" => { - builder = builder.set_upload_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_get_game_billing( - value: &[u8], - mut builder: crate::output::get_game_billing_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "available_regions" => { - builder = builder.set_available_regions( - crate::json_deser::deser_list_rivet_cloud_region_summaries(tokens)?, - ); - } - "game" => { - builder = builder.set_game( - crate::json_deser::deser_structure_crate_model_game_handle(tokens)?, - ); - } - "group_active" => { - builder = builder.set_group_active( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - "group_status" => { - builder = builder.set_group_status( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| { - s.to_unescaped() - .map(|u| crate::model::GroupStatus::from(u.as_ref())) - }) - .transpose()?, - ); - } - "metrics" => { - builder = builder.set_metrics( - crate::json_deser::deser_list_rivet_cloud_multiple_region_tier_metrics( - tokens, - )?, - ); - } - "namespaces" => { - builder = builder.set_namespaces( - crate::json_deser::deser_list_rivet_cloud_namespace_summaries(tokens)?, - ); - } - "plan" => { - builder = builder.set_plan( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| { - s.to_unescaped() - .map(|u| crate::model::GameBillingPlanCode::from(u.as_ref())) - }) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_get_game_billing_plans( - value: &[u8], - mut builder: crate::output::get_game_billing_plans_output::Builder, -) -> Result< - crate::output::get_game_billing_plans_output::Builder, - aws_smithy_json::deserialize::Error, -> { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "plans" => { - builder = builder.set_plans( - crate::json_deser::deser_list_rivet_cloud_game_billing_plans(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_get_game_by_id( - value: &[u8], - mut builder: crate::output::get_game_by_id_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "game" => { - builder = builder.set_game( - crate::json_deser::deser_structure_crate_model_game_full(tokens)?, - ); - } - "watch" => { - builder = builder.set_watch( - crate::json_deser::deser_structure_crate_model_watch_response(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_get_game_namespace_by_id( - value: &[u8], - mut builder: crate::output::get_game_namespace_by_id_output::Builder, -) -> Result< - crate::output::get_game_namespace_by_id_output::Builder, - aws_smithy_json::deserialize::Error, -> { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "namespace" => { - builder = builder.set_namespace( - crate::json_deser::deser_structure_crate_model_namespace_full(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_get_games( - value: &[u8], - mut builder: crate::output::get_games_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "games" => { - builder = builder.set_games( - crate::json_deser::deser_list_rivet_cloud_game_summaries(tokens)?, - ); - } - "groups" => { - builder = builder.set_groups( - crate::json_deser::deser_list_rivet_group_group_summaries(tokens)?, - ); - } - "watch" => { - builder = builder.set_watch( - crate::json_deser::deser_structure_crate_model_watch_response(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_get_game_version_by_id( - value: &[u8], - mut builder: crate::output::get_game_version_by_id_output::Builder, -) -> Result< - crate::output::get_game_version_by_id_output::Builder, - aws_smithy_json::deserialize::Error, -> { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "version" => { - builder = builder.set_version( - crate::json_deser::deser_structure_crate_model_version_full(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_get_group_billing( - value: &[u8], - mut builder: crate::output::get_group_billing_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "active" => { - builder = builder.set_active( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - "status" => { - builder = builder.set_status( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| { - s.to_unescaped() - .map(|u| crate::model::GroupStatus::from(u.as_ref())) - }) - .transpose()?, - ); - } - "usage" => { - builder = builder.set_usage( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i64()), - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_get_group_invoices_list( - value: &[u8], - mut builder: crate::output::get_group_invoices_list_output::Builder, -) -> Result< - crate::output::get_group_invoices_list_output::Builder, - aws_smithy_json::deserialize::Error, -> { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "invoices" => { - builder = builder.set_invoices( - crate::json_deser::deser_list_rivet_cloud_group_billing_invoices( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_get_lobby_logs( - value: &[u8], - mut builder: crate::output::get_lobby_logs_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "lines" => { - builder = builder.set_lines( - crate::json_deser::deser_list_rivet_api_cloud_lobby_log_lines(tokens)?, - ); - } - "timestamps" => { - builder = builder.set_timestamps( - crate::json_deser::deser_list_rivet_api_cloud_lobby_log_timestamps( - tokens, - )?, - ); - } - "watch" => { - builder = builder.set_watch( - crate::json_deser::deser_structure_crate_model_watch_response(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_get_namespace_analytics_matchmaker_live( - value: &[u8], - mut builder: crate::output::get_namespace_analytics_matchmaker_live_output::Builder, -) -> Result< - crate::output::get_namespace_analytics_matchmaker_live_output::Builder, - aws_smithy_json::deserialize::Error, -> { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "lobbies" => { - builder = builder.set_lobbies( - crate::json_deser::deser_list_rivet_api_cloud_common_analytics_lobby_summaries(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_get_namespace_lobby( - value: &[u8], - mut builder: crate::output::get_namespace_lobby_output::Builder, -) -> Result -{ - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "lobby" => { - builder = builder.set_lobby( - crate::json_deser::deser_structure_crate_model_logs_lobby_summary( - tokens, - )?, - ); - } - "metrics" => { - builder = builder.set_metrics( - crate::json_deser::deser_structure_crate_model_svc_metrics(tokens)?, - ); - } - "perf_lists" => { - builder = builder.set_perf_lists( - crate::json_deser::deser_list_rivet_api_cloud_common_svc_perfs(tokens)?, - ); - } - "stderr_presigned_urls" => { - builder = builder.set_stderr_presigned_urls( - crate::json_deser::deser_list_rivet_api_cloud_common_urls(tokens)?, - ); - } - "stdout_presigned_urls" => { - builder = builder.set_stdout_presigned_urls( - crate::json_deser::deser_list_rivet_api_cloud_common_urls(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_get_ray_perf_logs( - value: &[u8], - mut builder: crate::output::get_ray_perf_logs_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "perf_lists" => { - builder = builder.set_perf_lists( - crate::json_deser::deser_list_rivet_api_cloud_common_svc_perfs(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_get_region_tiers( - value: &[u8], - mut builder: crate::output::get_region_tiers_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "tiers" => { - builder = builder.set_tiers( - crate::json_deser::deser_list_rivet_cloud_region_tiers(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_group_billing_checkout( - value: &[u8], - mut builder: crate::output::group_billing_checkout_output::Builder, -) -> Result< - crate::output::group_billing_checkout_output::Builder, - aws_smithy_json::deserialize::Error, -> { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "url" => { - builder = builder.set_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_inspect( - value: &[u8], - mut builder: crate::output::inspect_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "agent" => { - builder = builder.set_agent( - crate::json_deser::deser_union_crate_model_auth_agent(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_list_game_builds( - value: &[u8], - mut builder: crate::output::list_game_builds_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "builds" => { - builder = builder.set_builds( - crate::json_deser::deser_list_rivet_cloud_build_summaries(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_list_game_cdn_sites( - value: &[u8], - mut builder: crate::output::list_game_cdn_sites_output::Builder, -) -> Result -{ - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "sites" => { - builder = builder.set_sites( - crate::json_deser::deser_list_rivet_cloud_cdn_site_summaries(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_list_game_custom_avatars( - value: &[u8], - mut builder: crate::output::list_game_custom_avatars_output::Builder, -) -> Result< - crate::output::list_game_custom_avatars_output::Builder, - aws_smithy_json::deserialize::Error, -> { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "custom_avatars" => { - builder = builder.set_custom_avatars( - crate::json_deser::deser_list_rivet_cloud_custom_avatar_summaries( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_list_namespace_lobbies( - value: &[u8], - mut builder: crate::output::list_namespace_lobbies_output::Builder, -) -> Result< - crate::output::list_namespace_lobbies_output::Builder, - aws_smithy_json::deserialize::Error, -> { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "lobbies" => { - builder = builder.set_lobbies( - crate::json_deser::deser_list_rivet_api_cloud_common_logs_lobby_summaries(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_prepare_custom_avatar_upload( - value: &[u8], - mut builder: crate::output::prepare_custom_avatar_upload_output::Builder, -) -> Result< - crate::output::prepare_custom_avatar_upload_output::Builder, - aws_smithy_json::deserialize::Error, -> { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "presigned_request" => { - builder = builder.set_presigned_request( - crate::json_deser::deser_structure_crate_model_upload_presigned_request(tokens)? - ); - } - "upload_id" => { - builder = builder.set_upload_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_validate_game( - value: &[u8], - mut builder: crate::output::validate_game_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "errors" => { - builder = builder.set_errors( - crate::json_deser::deser_list_rivet_common_validation_errors(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_validate_game_namespace( - value: &[u8], - mut builder: crate::output::validate_game_namespace_output::Builder, -) -> Result< - crate::output::validate_game_namespace_output::Builder, - aws_smithy_json::deserialize::Error, -> { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "errors" => { - builder = builder.set_errors( - crate::json_deser::deser_list_rivet_common_validation_errors(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_validate_game_namespace_matchmaker_config( - value: &[u8], - mut builder: crate::output::validate_game_namespace_matchmaker_config_output::Builder, -) -> Result< - crate::output::validate_game_namespace_matchmaker_config_output::Builder, - aws_smithy_json::deserialize::Error, -> { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "errors" => { - builder = builder.set_errors( - crate::json_deser::deser_list_rivet_common_validation_errors(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_validate_game_namespace_token_development( - value: &[u8], - mut builder: crate::output::validate_game_namespace_token_development_output::Builder, -) -> Result< - crate::output::validate_game_namespace_token_development_output::Builder, - aws_smithy_json::deserialize::Error, -> { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "errors" => { - builder = builder.set_errors( - crate::json_deser::deser_list_rivet_common_validation_errors(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_validate_game_version( - value: &[u8], - mut builder: crate::output::validate_game_version_output::Builder, -) -> Result -{ - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "errors" => { - builder = builder.set_errors( - crate::json_deser::deser_list_rivet_common_validation_errors(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_validate_group( - value: &[u8], - mut builder: crate::output::validate_group_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "errors" => { - builder = builder.set_errors( - crate::json_deser::deser_list_rivet_common_validation_errors(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn or_empty_doc(data: &[u8]) -> &[u8] { - if data.is_empty() { - b"{}" - } else { - data - } -} - -pub fn deser_structure_crate_model_upload_presigned_request<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::UploadPresignedRequest::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "path" => { - builder = builder.set_path( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "url" => { - builder = builder.set_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_upload_upload_presigned_requests<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option>, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_upload_presigned_request(tokens)? - ; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_cloud_region_summaries<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_region_summary(tokens)?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_structure_crate_model_game_handle<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GameHandle::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "game_id" => { - builder = builder.set_game_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "name_id" => { - builder = builder.set_name_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "display_name" => { - builder = builder.set_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "logo_url" => { - builder = builder.set_logo_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "banner_url" => { - builder = builder.set_banner_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_cloud_multiple_region_tier_metrics<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option>, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_region_tier_metrics( - tokens, - )?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_cloud_namespace_summaries<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option>, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_namespace_summary( - tokens, - )?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_cloud_game_billing_plans<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_game_billing_plan( - tokens, - )?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_structure_crate_model_game_full<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GameFull::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "game_id" => { - builder = builder.set_game_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "create_ts" => { - builder = builder.set_create_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "name_id" => { - builder = builder.set_name_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "display_name" => { - builder = builder.set_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "developer_group_id" => { - builder = builder.set_developer_group_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "total_player_count" => { - builder = builder.set_total_player_count( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "logo_url" => { - builder = builder.set_logo_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "banner_url" => { - builder = builder.set_banner_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "namespaces" => { - builder = builder.set_namespaces( - crate::json_deser::deser_list_rivet_cloud_namespace_summaries( - tokens, - )?, - ); - } - "versions" => { - builder = builder.set_versions( - crate::json_deser::deser_list_rivet_cloud_version_summaries( - tokens, - )?, - ); - } - "available_regions" => { - builder = builder.set_available_regions( - crate::json_deser::deser_list_rivet_cloud_region_summaries( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_watch_response<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::WatchResponse::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "index" => { - builder = builder.set_index( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_namespace_full<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::NamespaceFull::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "namespace_id" => { - builder = builder.set_namespace_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "create_ts" => { - builder = builder.set_create_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "display_name" => { - builder = builder.set_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "version_id" => { - builder = builder.set_version_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "name_id" => { - builder = builder.set_name_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "config" => { - builder = builder.set_config( - crate::json_deser::deser_structure_crate_model_cloud_namespace_config(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_cloud_game_summaries<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_game_summary(tokens)?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_group_group_summaries<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_group_summary(tokens)?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_structure_crate_model_version_full<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::VersionFull::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "version_id" => { - builder = builder.set_version_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "create_ts" => { - builder = builder.set_create_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "display_name" => { - builder = builder.set_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "config" => { - builder = builder.set_config( - crate::json_deser::deser_structure_crate_model_cloud_version_config(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_cloud_group_billing_invoices<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option>, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_group_billing_invoice( - tokens, - )?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_api_cloud_lobby_log_lines<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_api_cloud_lobby_log_timestamps<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_api_cloud_common_analytics_lobby_summaries<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option>, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_analytics_lobby_summary( - tokens, - )?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_structure_crate_model_logs_lobby_summary<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::LogsLobbySummary::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "lobby_id" => { - builder = builder.set_lobby_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "namespace_id" => { - builder = builder.set_namespace_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "lobby_group_name_id" => { - builder = builder.set_lobby_group_name_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "region_id" => { - builder = builder.set_region_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "create_ts" => { - builder = builder.set_create_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "start_ts" => { - builder = builder.set_start_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "ready_ts" => { - builder = builder.set_ready_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "status" => { - builder = builder.set_status( - crate::json_deser::deser_union_crate_model_logs_lobby_status( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_svc_metrics<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::SvcMetrics::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "job" => { - builder = builder.set_job( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "cpu" => { - builder = builder.set_cpu( - crate::json_deser::deser_list_rivet_api_cloud_common_float_metrics(tokens)? - ); - } - "memory" => { - builder = builder.set_memory( - crate::json_deser::deser_list_rivet_api_cloud_common_int_metrics(tokens)? - ); - } - "memory_max" => { - builder = builder.set_memory_max( - crate::json_deser::deser_list_rivet_api_cloud_common_int_metrics(tokens)? - ); - } - "allocated_memory" => { - builder = builder.set_allocated_memory( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i64()), - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_api_cloud_common_svc_perfs<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_svc_perf(tokens)?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_api_cloud_common_urls<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_cloud_region_tiers<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_region_tier(tokens)?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_union_crate_model_auth_agent<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - let mut variant = None; - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - if variant.is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "encountered mixed variants in union", - )); - } - variant = match key.to_unescaped()?.as_ref() { - "identity" => { - Some(crate::model::AuthAgent::Identity( - crate::json_deser::deser_structure_crate_model_auth_agent_identity(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'identity' cannot be null"))? - )) - } - "game_cloud" => { - Some(crate::model::AuthAgent::GameCloud( - crate::json_deser::deser_structure_crate_model_auth_agent_game_cloud(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'game_cloud' cannot be null"))? - )) - } - _ => { - aws_smithy_json::deserialize::token::skip_value(tokens)?; - Some(crate::model::AuthAgent::Unknown) - } - }; - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - } - _ => { - return Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )) - } - } - Ok(variant) -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_cloud_build_summaries<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_build_summary(tokens)?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_cloud_cdn_site_summaries<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_cdn_site_summary( - tokens, - )?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_cloud_custom_avatar_summaries<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option>, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_custom_avatar_summary( - tokens, - )?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_api_cloud_common_logs_lobby_summaries<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option>, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_logs_lobby_summary( - tokens, - )?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_common_validation_errors<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_validation_error( - tokens, - )?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_structure_crate_model_region_summary<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::RegionSummary::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "region_id" => { - builder = builder.set_region_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "region_name_id" => { - builder = builder.set_region_name_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "provider" => { - builder = builder.set_provider( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "universal_region" => { - builder = builder.set_universal_region( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i16()), - ); - } - "provider_display_name" => { - builder = builder.set_provider_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "region_display_name" => { - builder = builder.set_region_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_region_tier_metrics<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::RegionTierMetrics::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "namespace_id" => { - builder = builder.set_namespace_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "region_id" => { - builder = builder.set_region_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "tier_name_id" => { - builder = builder.set_tier_name_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "lobby_group_name_id" => { - builder = builder.set_lobby_group_name_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "uptime" => { - builder = builder.set_uptime( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i64()), - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_namespace_summary<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::NamespaceSummary::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "namespace_id" => { - builder = builder.set_namespace_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "create_ts" => { - builder = builder.set_create_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "display_name" => { - builder = builder.set_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "version_id" => { - builder = builder.set_version_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "name_id" => { - builder = builder.set_name_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_game_billing_plan<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GameBillingPlan::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| { - s.to_unescaped().map(|u| { - crate::model::GameBillingPlanCode::from(u.as_ref()) - }) - }) - .transpose()?, - ); - } - "name" => { - builder = builder.set_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "interval" => { - builder = builder.set_interval( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| { - s.to_unescaped().map(|u| { - crate::model::BillingInterval::from(u.as_ref()) - }) - }) - .transpose()?, - ); - } - "amount" => { - builder = builder.set_amount( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i64()), - ); - } - "currency" => { - builder = builder.set_currency( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_cloud_version_summaries<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_version_summary(tokens)?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_structure_crate_model_cloud_namespace_config<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::CloudNamespaceConfig::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "cdn" => { - builder = builder.set_cdn( - crate::json_deser::deser_structure_crate_model_cdn_namespace_config(tokens)? - ); - } - "matchmaker" => { - builder = builder.set_matchmaker( - crate::json_deser::deser_structure_crate_model_matchmaker_namespace_config(tokens)? - ); - } - "kv" => { - builder = builder.set_kv( - crate::json_deser::deser_structure_crate_model_kv_namespace_config(tokens)? - ); - } - "identity" => { - builder = builder.set_identity( - crate::json_deser::deser_structure_crate_model_identity_namespace_config(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_game_summary<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GameSummary::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "game_id" => { - builder = builder.set_game_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "create_ts" => { - builder = builder.set_create_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "name_id" => { - builder = builder.set_name_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "display_name" => { - builder = builder.set_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "developer_group_id" => { - builder = builder.set_developer_group_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "total_player_count" => { - builder = builder.set_total_player_count( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "logo_url" => { - builder = builder.set_logo_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "banner_url" => { - builder = builder.set_banner_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_group_summary<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GroupSummary::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "group_id" => { - builder = builder.set_group_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "display_name" => { - builder = builder.set_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "avatar_url" => { - builder = builder.set_avatar_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "external" => { - builder = builder.set_external( - crate::json_deser::deser_structure_crate_model_group_external_links(tokens)? - ); - } - "is_developer" => { - builder = builder.set_is_developer( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - "bio" => { - builder = builder.set_bio( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "is_current_identity_member" => { - builder = builder.set_is_current_identity_member( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - "publicity" => { - builder = builder.set_publicity( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| { - s.to_unescaped() - .map(|u| crate::model::GroupPublicity::from(u.as_ref())) - }) - .transpose()?, - ); - } - "member_count" => { - builder = builder.set_member_count( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "owner_identity_id" => { - builder = builder.set_owner_identity_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_cloud_version_config<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::CloudVersionConfig::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "cdn" => { - builder = builder.set_cdn( - crate::json_deser::deser_structure_crate_model_cdn_version_config(tokens)? - ); - } - "matchmaker" => { - builder = builder.set_matchmaker( - crate::json_deser::deser_structure_crate_model_matchmaker_version_config(tokens)? - ); - } - "kv" => { - builder = builder.set_kv( - crate::json_deser::deser_structure_crate_model_kv_version_config(tokens)? - ); - } - "identity" => { - builder = builder.set_identity( - crate::json_deser::deser_structure_crate_model_identity_version_config(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_group_billing_invoice<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GroupBillingInvoice::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "issuing_ts" => { - builder = builder.set_issuing_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "file_url" => { - builder = builder.set_file_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_analytics_lobby_summary<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::AnalyticsLobbySummary::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "lobby_id" => { - builder = builder.set_lobby_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "lobby_group_id" => { - builder = builder.set_lobby_group_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "lobby_group_name_id" => { - builder = builder.set_lobby_group_name_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "region_id" => { - builder = builder.set_region_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "create_ts" => { - builder = builder.set_create_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "is_ready" => { - builder = builder.set_is_ready( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - "is_idle" => { - builder = builder.set_is_idle( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - "is_closed" => { - builder = builder.set_is_closed( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - "is_outdated" => { - builder = builder.set_is_outdated( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - "max_players_normal" => { - builder = builder.set_max_players_normal( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "max_players_direct" => { - builder = builder.set_max_players_direct( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "max_players_party" => { - builder = builder.set_max_players_party( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "total_player_count" => { - builder = builder.set_total_player_count( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "registered_player_count" => { - builder = builder.set_registered_player_count( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_union_crate_model_logs_lobby_status<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - let mut variant = None; - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - if variant.is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "encountered mixed variants in union", - )); - } - variant = match key.to_unescaped()?.as_ref() { - "running" => { - Some(crate::model::LogsLobbyStatus::Running( - crate::json_deser::deser_structure_crate_model_unit(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'running' cannot be null"))? - )) - } - "stopped" => { - Some(crate::model::LogsLobbyStatus::Stopped( - crate::json_deser::deser_structure_crate_model_logs_lobby_status_stopped(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'stopped' cannot be null"))? - )) - } - _ => { - aws_smithy_json::deserialize::token::skip_value(tokens)?; - Some(crate::model::LogsLobbyStatus::Unknown) - } - }; - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - }, - _ => { - return Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )) - } - } - Ok(variant) -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_api_cloud_common_float_metrics<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_f32()); - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_api_cloud_common_int_metrics<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i64()); - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_structure_crate_model_svc_perf<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::SvcPerf::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "svc_name" => { - builder = builder.set_svc_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "ts" => { - builder = builder.set_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "duration" => { - builder = builder.set_duration( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i64()), - ); - } - "req_id" => { - builder = builder.set_req_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "spans" => { - builder = builder.set_spans( - crate::json_deser::deser_list_rivet_api_cloud_common_logs_perf_spans(tokens)? - ); - } - "marks" => { - builder = builder.set_marks( - crate::json_deser::deser_list_rivet_api_cloud_common_logs_perf_marks(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_region_tier<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::RegionTier::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "tier_name_id" => { - builder = builder.set_tier_name_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "rivet_cores_numerator" => { - builder = builder.set_rivet_cores_numerator( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "rivet_cores_denominator" => { - builder = builder.set_rivet_cores_denominator( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "cpu" => { - builder = builder.set_cpu( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i64()), - ); - } - "memory" => { - builder = builder.set_memory( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i64()), - ); - } - "disk" => { - builder = builder.set_disk( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i64()), - ); - } - "bandwidth" => { - builder = builder.set_bandwidth( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i64()), - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_auth_agent_identity<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::AuthAgentIdentity::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "identity_id" => { - builder = builder.set_identity_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_auth_agent_game_cloud<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::AuthAgentGameCloud::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "game_id" => { - builder = builder.set_game_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_build_summary<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::BuildSummary::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "build_id" => { - builder = builder.set_build_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "upload_id" => { - builder = builder.set_upload_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "display_name" => { - builder = builder.set_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "create_ts" => { - builder = builder.set_create_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "content_length" => { - builder = builder.set_content_length( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i64()), - ); - } - "complete" => { - builder = builder.set_complete( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_cdn_site_summary<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::CdnSiteSummary::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "site_id" => { - builder = builder.set_site_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "upload_id" => { - builder = builder.set_upload_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "display_name" => { - builder = builder.set_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "create_ts" => { - builder = builder.set_create_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "content_length" => { - builder = builder.set_content_length( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i64()), - ); - } - "complete" => { - builder = builder.set_complete( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_custom_avatar_summary<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::CustomAvatarSummary::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "upload_id" => { - builder = builder.set_upload_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "display_name" => { - builder = builder.set_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "create_ts" => { - builder = builder.set_create_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "url" => { - builder = builder.set_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "content_length" => { - builder = builder.set_content_length( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i64()), - ); - } - "complete" => { - builder = builder.set_complete( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_validation_error<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::ValidationError::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "path" => { - builder = builder.set_path( - crate::json_deser::deser_list_rivet_common_validation_error_path(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_version_summary<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::VersionSummary::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "version_id" => { - builder = builder.set_version_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "create_ts" => { - builder = builder.set_create_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "display_name" => { - builder = builder.set_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_cdn_namespace_config<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::CdnNamespaceConfig::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "enable_domain_public_auth" => { - builder = builder.set_enable_domain_public_auth( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - "domains" => { - builder = builder.set_domains( - crate::json_deser::deser_list_rivet_cloud_cdn_namespace_domains(tokens)? - ); - } - "auth_type" => { - builder = builder.set_auth_type( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| { - s.to_unescaped() - .map(|u| crate::model::CdnAuthType::from(u.as_ref())) - }) - .transpose()?, - ); - } - "auth_user_list" => { - builder = builder.set_auth_user_list( - crate::json_deser::deser_list_rivet_cloud_cdn_namespace_auth_users(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_matchmaker_namespace_config<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::MatchmakerNamespaceConfig::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "lobby_count_max" => { - builder = builder.set_lobby_count_max( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "max_players_per_client" => { - builder = builder.set_max_players_per_client( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "max_players_per_client_vpn" => { - builder = builder.set_max_players_per_client_vpn( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "max_players_per_client_proxy" => { - builder = builder.set_max_players_per_client_proxy( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "max_players_per_client_tor" => { - builder = builder.set_max_players_per_client_tor( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "max_players_per_client_hosting" => { - builder = builder.set_max_players_per_client_hosting( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_kv_namespace_config<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::KvNamespaceConfig::builder(); - aws_smithy_json::deserialize::token::skip_to_end(tokens)?; - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_identity_namespace_config<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::IdentityNamespaceConfig::builder(); - aws_smithy_json::deserialize::token::skip_to_end(tokens)?; - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_group_external_links<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GroupExternalLinks::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "profile" => { - builder = builder.set_profile( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "chat" => { - builder = builder.set_chat( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_cdn_version_config<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::CdnVersionConfig::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "site_id" => { - builder = builder.set_site_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "build_command" => { - builder = builder.set_build_command( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "build_output" => { - builder = builder.set_build_output( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "routes" => { - builder = builder.set_routes( - crate::json_deser::deser_list_rivet_cloud_cdn_version_routes( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_matchmaker_version_config<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::MatchmakerVersionConfig::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "lobby_groups" => { - builder = builder.set_lobby_groups( - crate::json_deser::deser_list_rivet_cloud_lobby_groups(tokens)?, - ); - } - "captcha" => { - builder = builder.set_captcha( - crate::json_deser::deser_structure_crate_model_matchmaker_captcha(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_kv_version_config<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::KvVersionConfig::builder(); - aws_smithy_json::deserialize::token::skip_to_end(tokens)?; - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_identity_version_config<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::IdentityVersionConfig::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "custom_display_names" => { - builder = builder.set_custom_display_names( - crate::json_deser::deser_list_rivet_cloud_custom_display_names( - tokens, - )?, - ); - } - "custom_avatars" => { - builder = builder.set_custom_avatars( - crate::json_deser::deser_list_rivet_cloud_custom_avatars( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_unit<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::Unit::builder(); - aws_smithy_json::deserialize::token::skip_to_end(tokens)?; - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_logs_lobby_status_stopped<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::LogsLobbyStatusStopped::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "stop_ts" => { - builder = builder.set_stop_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "failed" => { - builder = builder.set_failed( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - "exit_code" => { - builder = builder.set_exit_code( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_api_cloud_common_logs_perf_spans<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_logs_perf_span(tokens)?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_api_cloud_common_logs_perf_marks<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_logs_perf_mark(tokens)?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_common_validation_error_path<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_cloud_cdn_namespace_domains<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option>, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_cdn_namespace_domain( - tokens, - )?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_cloud_cdn_namespace_auth_users<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option>, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_cdn_namespace_auth_user( - tokens, - )?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_cloud_cdn_version_routes<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_cdn_version_route( - tokens, - )?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_cloud_lobby_groups<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_lobby_group(tokens)?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_structure_crate_model_matchmaker_captcha<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::MatchmakerCaptcha::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "requests_before_reverify" => { - builder = builder.set_requests_before_reverify( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "verification_ttl" => { - builder = builder.set_verification_ttl( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i64()), - ); - } - "hcaptcha" => { - builder = builder.set_hcaptcha( - crate::json_deser::deser_structure_crate_model_matchmaker_captcha_hcaptcha(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_cloud_custom_display_names<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option>, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_custom_display_name( - tokens, - )?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_cloud_custom_avatars<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_custom_avatar(tokens)?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_structure_crate_model_logs_perf_span<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::LogsPerfSpan::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "label" => { - builder = builder.set_label( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "start_ts" => { - builder = builder.set_start_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "finish_ts" => { - builder = builder.set_finish_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "req_id" => { - builder = builder.set_req_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_logs_perf_mark<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::LogsPerfMark::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "label" => { - builder = builder.set_label( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "ts" => { - builder = builder.set_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "ray_id" => { - builder = builder.set_ray_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "req_id" => { - builder = builder.set_req_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_cdn_namespace_domain<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::CdnNamespaceDomain::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "domain" => { - builder = builder.set_domain( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "create_ts" => { - builder = builder.set_create_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "verification_status" => { - builder = - builder.set_verification_status( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| { - s.to_unescaped().map(|u| { - crate::model::CdnNamespaceDomainVerificationStatus::from(u.as_ref()) - }) - }) - .transpose()?, - ); - } - "verification_method" => { - builder = builder.set_verification_method( - crate::json_deser::deser_union_crate_model_cdn_namespace_domain_verification_method(tokens)? - ); - } - "verification_errors" => { - builder = builder.set_verification_errors( - crate::json_deser::deser_list_rivet_cloud_cdn_namespace_domain_verification_errors(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_cdn_namespace_auth_user<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::CdnNamespaceAuthUser::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "user" => { - builder = builder.set_user( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_cdn_version_route<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::CdnVersionRoute::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "glob" => { - builder = builder.set_glob( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "priority" => { - builder = builder.set_priority( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "middlewares" => { - builder = builder.set_middlewares( - crate::json_deser::deser_list_rivet_cloud_cdn_version_middlewares(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_lobby_group<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::LobbyGroup::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "name_id" => { - builder = builder.set_name_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "regions" => { - builder = builder.set_regions( - crate::json_deser::deser_list_rivet_cloud_lobby_group_regions( - tokens, - )?, - ); - } - "max_players_normal" => { - builder = builder.set_max_players_normal( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "max_players_direct" => { - builder = builder.set_max_players_direct( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "max_players_party" => { - builder = builder.set_max_players_party( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "runtime" => { - builder = builder.set_runtime( - crate::json_deser::deser_union_crate_model_lobby_group_runtime( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_matchmaker_captcha_hcaptcha<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::MatchmakerCaptchaHcaptcha::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "level" => { - builder = builder.set_level( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| { - s.to_unescaped() - .map(|u| crate::model::CaptchaLevel::from(u.as_ref())) - }) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_custom_display_name<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::CustomDisplayName::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "display_name" => { - builder = builder.set_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_custom_avatar<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::CustomAvatar::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "upload_id" => { - builder = builder.set_upload_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_union_crate_model_cdn_namespace_domain_verification_method<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - let mut variant = None; - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - if variant.is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "encountered mixed variants in union", - )); - } - variant = match key.to_unescaped()?.as_ref() { - "invalid" => { - Some(crate::model::CdnNamespaceDomainVerificationMethod::Invalid( - crate::json_deser::deser_structure_crate_model_cdn_namespace_domain_verification_method_invalid(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'invalid' cannot be null"))? - )) - } - "http" => { - Some(crate::model::CdnNamespaceDomainVerificationMethod::Http( - crate::json_deser::deser_structure_crate_model_cdn_namespace_domain_verification_method_http(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'http' cannot be null"))? - )) - } - _ => { - aws_smithy_json::deserialize::token::skip_value(tokens)?; - Some(crate::model::CdnNamespaceDomainVerificationMethod::Unknown) - } - }; - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - }, - _ => { - return Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )) - } - } - Ok(variant) -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_cloud_cdn_namespace_domain_verification_errors<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_cloud_cdn_version_middlewares<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option>, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_cdn_version_middleware( - tokens, - )?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_cloud_lobby_group_regions<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option>, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_lobby_group_region( - tokens, - )?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_union_crate_model_lobby_group_runtime<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - let mut variant = None; - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - if variant.is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "encountered mixed variants in union", - )); - } - variant = match key.to_unescaped()?.as_ref() { - "docker" => { - Some(crate::model::LobbyGroupRuntime::Docker( - crate::json_deser::deser_structure_crate_model_lobby_group_runtime_docker(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'docker' cannot be null"))? - )) - } - _ => { - aws_smithy_json::deserialize::token::skip_value(tokens)?; - Some(crate::model::LobbyGroupRuntime::Unknown) - } - }; - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - }, - _ => { - return Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )) - } - } - Ok(variant) -} - -pub fn deser_structure_crate_model_cdn_namespace_domain_verification_method_invalid<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::CdnNamespaceDomainVerificationMethodInvalid::builder(); - aws_smithy_json::deserialize::token::skip_to_end(tokens)?; - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_cdn_namespace_domain_verification_method_http<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::CdnNamespaceDomainVerificationMethodHttp::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "cname_record" => { - builder = builder.set_cname_record( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_cdn_version_middleware<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::CdnVersionMiddleware::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "kind" => { - builder = builder.set_kind( - crate::json_deser::deser_union_crate_model_cdn_version_middleware_kind(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_lobby_group_region<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::LobbyGroupRegion::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "region_id" => { - builder = builder.set_region_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "tier_name_id" => { - builder = builder.set_tier_name_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "idle_lobbies" => { - builder = builder.set_idle_lobbies( - crate::json_deser::deser_structure_crate_model_idle_lobbies_config(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_lobby_group_runtime_docker<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::LobbyGroupRuntimeDocker::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "build_id" => { - builder = builder.set_build_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "args" => { - builder = builder.set_args( - crate::json_deser::deser_list_rivet_cloud_lobby_group_runtime_docker_args(tokens)? - ); - } - "env_vars" => { - builder = builder.set_env_vars( - crate::json_deser::deser_list_rivet_cloud_lobby_group_runtime_docker_env_vars(tokens)? - ); - } - "network_mode" => { - builder = builder.set_network_mode( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| { - s.to_unescaped() - .map(|u| crate::model::NetworkMode::from(u.as_ref())) - }) - .transpose()?, - ); - } - "ports" => { - builder = builder.set_ports( - crate::json_deser::deser_list_rivet_cloud_lobby_group_runtime_docker_ports(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_union_crate_model_cdn_version_middleware_kind<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - let mut variant = None; - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - if variant.is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "encountered mixed variants in union", - )); - } - variant = match key.to_unescaped()?.as_ref() { - "custom_headers" => { - Some(crate::model::CdnVersionMiddlewareKind::CustomHeaders( - crate::json_deser::deser_structure_crate_model_cdn_version_custom_headers_middleware(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'custom_headers' cannot be null"))? - )) - } - _ => { - aws_smithy_json::deserialize::token::skip_value(tokens)?; - Some(crate::model::CdnVersionMiddlewareKind::Unknown) - } - }; - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - }, - _ => { - return Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )) - } - } - Ok(variant) -} - -pub fn deser_structure_crate_model_idle_lobbies_config<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::IdleLobbiesConfig::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "min_idle_lobbies" => { - builder = builder.set_min_idle_lobbies( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "max_idle_lobbies" => { - builder = builder.set_max_idle_lobbies( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_cloud_lobby_group_runtime_docker_args<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_cloud_lobby_group_runtime_docker_env_vars<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option>, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_lobby_group_runtime_docker_env_var(tokens)? - ; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_cloud_lobby_group_runtime_docker_ports<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option>, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_lobby_group_runtime_docker_port(tokens)? - ; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_structure_crate_model_cdn_version_custom_headers_middleware<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::CdnVersionCustomHeadersMiddleware::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "headers" => { - builder = builder.set_headers( - crate::json_deser::deser_list_rivet_cloud_cdn_version_headers( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_lobby_group_runtime_docker_env_var<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::LobbyGroupRuntimeDockerEnvVar::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "key" => { - builder = builder.set_key( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "value" => { - builder = builder.set_value( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_lobby_group_runtime_docker_port<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::LobbyGroupRuntimeDockerPort::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "label" => { - builder = builder.set_label( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "target_port" => { - builder = builder.set_target_port( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "port_range" => { - builder = builder.set_port_range( - crate::json_deser::deser_structure_crate_model_port_range( - tokens, - )?, - ); - } - "proxy_protocol" => { - builder = builder.set_proxy_protocol( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| { - s.to_unescaped() - .map(|u| crate::model::ProxyProtocol::from(u.as_ref())) - }) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_cloud_cdn_version_headers<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option>, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_cdn_version_header( - tokens, - )?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_structure_crate_model_port_range<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PortRange::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "min" => { - builder = builder.set_min( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "max" => { - builder = builder.set_max( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_cdn_version_header<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::CdnVersionHeader::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "name" => { - builder = builder.set_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "value" => { - builder = builder.set_value( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} diff --git a/lib/smithy-output/api-cloud/rust/rust/src/json_errors.rs b/lib/smithy-output/api-cloud/rust/rust/src/json_errors.rs deleted file mode 100644 index 7b7574319..000000000 --- a/lib/smithy-output/api-cloud/rust/rust/src/json_errors.rs +++ /dev/null @@ -1,220 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -use aws_smithy_json::deserialize::token::skip_value; -use aws_smithy_json::deserialize::{json_token_iter, Error as DeserializeError, Token}; -use aws_smithy_types::Error as SmithyError; -use bytes::Bytes; -use http::header::ToStrError; -use http::{HeaderMap, HeaderValue}; -use std::borrow::Cow; - -// currently only used by AwsJson -#[allow(unused)] -pub fn is_error(response: &http::Response) -> bool { - !response.status().is_success() -} - -fn sanitize_error_code(error_code: &str) -> &str { - // Trim a trailing URL from the error code, beginning with a `:` - let error_code = match error_code.find(':') { - Some(idx) => &error_code[..idx], - None => error_code, - }; - - // Trim a prefixing namespace from the error code, beginning with a `#` - match error_code.find('#') { - Some(idx) => &error_code[idx + 1..], - None => error_code, - } -} - -struct ErrorBody<'a> { - code: Option>, - message: Option>, -} - -fn parse_error_body(bytes: &[u8]) -> Result { - let mut tokens = json_token_iter(bytes).peekable(); - let (mut typ, mut code, mut message) = (None, None, None); - if let Some(Token::StartObject { .. }) = tokens.next().transpose()? { - loop { - match tokens.next().transpose()? { - Some(Token::EndObject { .. }) => break, - Some(Token::ObjectKey { key, .. }) => { - if let Some(Ok(Token::ValueString { value, .. })) = tokens.peek() { - match key.as_escaped_str() { - "code" => code = Some(value.to_unescaped()?), - "__type" => typ = Some(value.to_unescaped()?), - "message" | "Message" | "errorMessage" => { - message = Some(value.to_unescaped()?) - } - _ => {} - } - } - skip_value(&mut tokens)?; - } - _ => { - return Err(DeserializeError::custom( - "expected object key or end object", - )) - } - } - } - if tokens.next().is_some() { - return Err(DeserializeError::custom( - "found more JSON tokens after completing parsing", - )); - } - } - Ok(ErrorBody { - code: code.or(typ), - message, - }) -} - -fn error_type_from_header(headers: &HeaderMap) -> Result, ToStrError> { - headers - .get("X-Amzn-Errortype") - .map(|v| v.to_str()) - .transpose() -} - -fn request_id(headers: &HeaderMap) -> Option<&str> { - headers - .get("X-Amzn-Requestid") - .and_then(|v| v.to_str().ok()) -} - -pub fn parse_generic_error( - payload: &Bytes, - headers: &HeaderMap, -) -> Result { - let ErrorBody { code, message } = parse_error_body(payload.as_ref())?; - - let mut err_builder = SmithyError::builder(); - if let Some(code) = error_type_from_header(headers) - .map_err(|_| DeserializeError::custom("X-Amzn-Errortype header was not valid UTF-8"))? - .or_else(|| code.as_deref()) - .map(sanitize_error_code) - { - err_builder.code(code); - } - if let Some(message) = message { - err_builder.message(message); - } - if let Some(request_id) = request_id(headers) { - err_builder.request_id(request_id); - } - Ok(err_builder.build()) -} - -#[cfg(test)] -mod test { - use crate::json_errors::{parse_error_body, parse_generic_error, sanitize_error_code}; - use aws_smithy_types::Error; - use bytes::Bytes; - use std::borrow::Cow; - - #[test] - fn generic_error() { - let response = http::Response::builder() - .header("X-Amzn-Requestid", "1234") - .body(Bytes::from_static( - br#"{ "__type": "FooError", "message": "Go to foo" }"#, - )) - .unwrap(); - assert_eq!( - parse_generic_error(response.body(), response.headers()).unwrap(), - Error::builder() - .code("FooError") - .message("Go to foo") - .request_id("1234") - .build() - ) - } - - #[test] - fn error_type() { - assert_eq!( - Some(Cow::Borrowed("FooError")), - parse_error_body(br#"{ "__type": "FooError" }"#) - .unwrap() - .code - ); - } - - #[test] - fn code_takes_priority() { - assert_eq!( - Some(Cow::Borrowed("BarError")), - parse_error_body(br#"{ "code": "BarError", "__type": "FooError" }"#) - .unwrap() - .code - ); - } - - #[test] - fn ignore_unrecognized_fields() { - assert_eq!( - Some(Cow::Borrowed("FooError")), - parse_error_body(br#"{ "__type": "FooError", "asdf": 5, "fdsa": {}, "foo": "1" }"#) - .unwrap() - .code - ); - } - - #[test] - fn sanitize_namespace_and_url() { - assert_eq!( - sanitize_error_code("aws.protocoltests.restjson#FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/"), - "FooError"); - } - - #[test] - fn sanitize_noop() { - assert_eq!(sanitize_error_code("FooError"), "FooError"); - } - - #[test] - fn sanitize_url() { - assert_eq!( - sanitize_error_code( - "FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/" - ), - "FooError" - ); - } - - #[test] - fn sanitize_namespace() { - assert_eq!( - sanitize_error_code("aws.protocoltests.restjson#FooError"), - "FooError" - ); - } - - // services like lambda use an alternate `Message` instead of `message` - #[test] - fn alternative_error_message_names() { - let response = http::Response::builder() - .header("x-amzn-errortype", "ResourceNotFoundException") - .body(Bytes::from_static( - br#"{ - "Type": "User", - "Message": "Functions from 'us-west-2' are not reachable from us-east-1" - }"#, - )) - .unwrap(); - assert_eq!( - parse_generic_error(response.body(), response.headers()).unwrap(), - Error::builder() - .code("ResourceNotFoundException") - .message("Functions from 'us-west-2' are not reachable from us-east-1") - .build() - ); - } -} diff --git a/lib/smithy-output/api-cloud/rust/rust/src/json_ser.rs b/lib/smithy-output/api-cloud/rust/rust/src/json_ser.rs deleted file mode 100644 index 709d20719..000000000 --- a/lib/smithy-output/api-cloud/rust/rust/src/json_ser.rs +++ /dev/null @@ -1,912 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub fn serialize_structure_crate_input_add_namespace_domain_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::AddNamespaceDomainInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_1) = &input.domain { - object.key("domain").string(var_1.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_create_game_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::CreateGameInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_2) = &input.developer_group_id { - object.key("developer_group_id").string(var_2.as_str()); - } - if let Some(var_3) = &input.display_name { - object.key("display_name").string(var_3.as_str()); - } - if let Some(var_4) = &input.name_id { - object.key("name_id").string(var_4.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_create_game_build_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::CreateGameBuildInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_5) = &input.display_name { - object.key("display_name").string(var_5.as_str()); - } - if let Some(var_6) = &input.image_file { - let mut object_7 = object.key("image_file").start_object(); - crate::json_ser::serialize_structure_crate_model_upload_prepare_file(&mut object_7, var_6)?; - object_7.finish(); - } - if let Some(var_8) = &input.image_tag { - object.key("image_tag").string(var_8.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_create_game_cdn_site_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::CreateGameCdnSiteInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_9) = &input.display_name { - object.key("display_name").string(var_9.as_str()); - } - if let Some(var_10) = &input.files { - let mut array_11 = object.key("files").start_array(); - for item_12 in var_10 { - { - let mut object_13 = array_11.value().start_object(); - crate::json_ser::serialize_structure_crate_model_upload_prepare_file( - &mut object_13, - item_12, - )?; - object_13.finish(); - } - } - array_11.finish(); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_create_game_namespace_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::CreateGameNamespaceInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_14) = &input.display_name { - object.key("display_name").string(var_14.as_str()); - } - if let Some(var_15) = &input.name_id { - object.key("name_id").string(var_15.as_str()); - } - if let Some(var_16) = &input.version_id { - object.key("version_id").string(var_16.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_create_game_namespace_token_development_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::CreateGameNamespaceTokenDevelopmentInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_17) = &input.hostname { - object.key("hostname").string(var_17.as_str()); - } - if let Some(var_18) = &input.lobby_ports { - let mut array_19 = object.key("lobby_ports").start_array(); - for item_20 in var_18 { - { - let mut object_21 = array_19.value().start_object(); - crate::json_ser::serialize_structure_crate_model_lobby_group_runtime_docker_port( - &mut object_21, - item_20, - )?; - object_21.finish(); - } - } - array_19.finish(); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_create_game_version_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::CreateGameVersionInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_22) = &input.config { - let mut object_23 = object.key("config").start_object(); - crate::json_ser::serialize_structure_crate_model_cloud_version_config( - &mut object_23, - var_22, - )?; - object_23.finish(); - } - if let Some(var_24) = &input.display_name { - object.key("display_name").string(var_24.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_export_lobby_logs_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::ExportLobbyLogsInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_25) = &input.stream { - object.key("stream").string(var_25.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_export_matchmaker_lobby_history_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::ExportMatchmakerLobbyHistoryInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_26) = &input.query_end { - object.key("query_end").number( - #[allow(clippy::useless_conversion)] - aws_smithy_types::Number::NegInt((*var_26).into()), - ); - } - if let Some(var_27) = &input.query_start { - object.key("query_start").number( - #[allow(clippy::useless_conversion)] - aws_smithy_types::Number::NegInt((*var_27).into()), - ); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_game_banner_upload_prepare_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::GameBannerUploadPrepareInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_28) = &input.content_length { - object.key("content_length").number( - #[allow(clippy::useless_conversion)] - aws_smithy_types::Number::NegInt((*var_28).into()), - ); - } - if let Some(var_29) = &input.mime { - object.key("mime").string(var_29.as_str()); - } - if let Some(var_30) = &input.path { - object.key("path").string(var_30.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_game_logo_upload_prepare_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::GameLogoUploadPrepareInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_31) = &input.content_length { - object.key("content_length").number( - #[allow(clippy::useless_conversion)] - aws_smithy_types::Number::NegInt((*var_31).into()), - ); - } - if let Some(var_32) = &input.mime { - object.key("mime").string(var_32.as_str()); - } - if let Some(var_33) = &input.path { - object.key("path").string(var_33.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_prepare_custom_avatar_upload_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::PrepareCustomAvatarUploadInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_34) = &input.content_length { - object.key("content_length").number( - #[allow(clippy::useless_conversion)] - aws_smithy_types::Number::NegInt((*var_34).into()), - ); - } - if let Some(var_35) = &input.mime { - object.key("mime").string(var_35.as_str()); - } - if let Some(var_36) = &input.path { - object.key("path").string(var_36.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_set_game_billing_plan_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::SetGameBillingPlanInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_37) = &input.plan { - object.key("plan").string(var_37.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_set_namespace_cdn_auth_type_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::SetNamespaceCdnAuthTypeInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_38) = &input.auth_type { - object.key("auth_type").string(var_38.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_toggle_namespace_domain_public_auth_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::ToggleNamespaceDomainPublicAuthInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_39) = &input.enabled { - object.key("enabled").boolean(*var_39); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_update_game_namespace_matchmaker_config_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::UpdateGameNamespaceMatchmakerConfigInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_40) = &input.lobby_count_max { - object.key("lobby_count_max").number( - #[allow(clippy::useless_conversion)] - aws_smithy_types::Number::NegInt((*var_40).into()), - ); - } - if let Some(var_41) = &input.max_players { - object.key("max_players").number( - #[allow(clippy::useless_conversion)] - aws_smithy_types::Number::NegInt((*var_41).into()), - ); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_update_game_namespace_version_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::UpdateGameNamespaceVersionInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_42) = &input.version_id { - object.key("version_id").string(var_42.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_update_namespace_cdn_auth_user_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::UpdateNamespaceCdnAuthUserInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_43) = &input.password { - object.key("password").string(var_43.as_str()); - } - if let Some(var_44) = &input.user { - object.key("user").string(var_44.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_validate_game_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::ValidateGameInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_45) = &input.display_name { - object.key("display_name").string(var_45.as_str()); - } - if let Some(var_46) = &input.name_id { - object.key("name_id").string(var_46.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_validate_game_namespace_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::ValidateGameNamespaceInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_47) = &input.display_name { - object.key("display_name").string(var_47.as_str()); - } - if let Some(var_48) = &input.name_id { - object.key("name_id").string(var_48.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_validate_game_namespace_matchmaker_config_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::ValidateGameNamespaceMatchmakerConfigInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_49) = &input.lobby_count_max { - object.key("lobby_count_max").number( - #[allow(clippy::useless_conversion)] - aws_smithy_types::Number::NegInt((*var_49).into()), - ); - } - if let Some(var_50) = &input.max_players { - object.key("max_players").number( - #[allow(clippy::useless_conversion)] - aws_smithy_types::Number::NegInt((*var_50).into()), - ); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_validate_game_namespace_token_development_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::ValidateGameNamespaceTokenDevelopmentInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_51) = &input.hostname { - object.key("hostname").string(var_51.as_str()); - } - if let Some(var_52) = &input.lobby_ports { - let mut array_53 = object.key("lobby_ports").start_array(); - for item_54 in var_52 { - { - let mut object_55 = array_53.value().start_object(); - crate::json_ser::serialize_structure_crate_model_lobby_group_runtime_docker_port( - &mut object_55, - item_54, - )?; - object_55.finish(); - } - } - array_53.finish(); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_validate_game_version_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::ValidateGameVersionInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_56) = &input.config { - let mut object_57 = object.key("config").start_object(); - crate::json_ser::serialize_structure_crate_model_cloud_version_config( - &mut object_57, - var_56, - )?; - object_57.finish(); - } - if let Some(var_58) = &input.display_name { - object.key("display_name").string(var_58.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_validate_group_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::ValidateGroupInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_59) = &input.display_name { - object.key("display_name").string(var_59.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_model_upload_prepare_file( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::UploadPrepareFile, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_60) = &input.path { - object.key("path").string(var_60.as_str()); - } - if let Some(var_61) = &input.content_type { - object.key("content_type").string(var_61.as_str()); - } - if let Some(var_62) = &input.content_length { - object.key("content_length").number( - #[allow(clippy::useless_conversion)] - aws_smithy_types::Number::NegInt((*var_62).into()), - ); - } - Ok(()) -} - -pub fn serialize_structure_crate_model_lobby_group_runtime_docker_port( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::LobbyGroupRuntimeDockerPort, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_63) = &input.label { - object.key("label").string(var_63.as_str()); - } - if let Some(var_64) = &input.target_port { - object.key("target_port").number( - #[allow(clippy::useless_conversion)] - aws_smithy_types::Number::NegInt((*var_64).into()), - ); - } - if let Some(var_65) = &input.port_range { - let mut object_66 = object.key("port_range").start_object(); - crate::json_ser::serialize_structure_crate_model_port_range(&mut object_66, var_65)?; - object_66.finish(); - } - if let Some(var_67) = &input.proxy_protocol { - object.key("proxy_protocol").string(var_67.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_model_cloud_version_config( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::CloudVersionConfig, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_68) = &input.cdn { - let mut object_69 = object.key("cdn").start_object(); - crate::json_ser::serialize_structure_crate_model_cdn_version_config( - &mut object_69, - var_68, - )?; - object_69.finish(); - } - if let Some(var_70) = &input.matchmaker { - let mut object_71 = object.key("matchmaker").start_object(); - crate::json_ser::serialize_structure_crate_model_matchmaker_version_config( - &mut object_71, - var_70, - )?; - object_71.finish(); - } - if let Some(var_72) = &input.kv { - let mut object_73 = object.key("kv").start_object(); - crate::json_ser::serialize_structure_crate_model_kv_version_config(&mut object_73, var_72)?; - object_73.finish(); - } - if let Some(var_74) = &input.identity { - let mut object_75 = object.key("identity").start_object(); - crate::json_ser::serialize_structure_crate_model_identity_version_config( - &mut object_75, - var_74, - )?; - object_75.finish(); - } - Ok(()) -} - -pub fn serialize_structure_crate_model_port_range( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::PortRange, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_76) = &input.min { - object.key("min").number( - #[allow(clippy::useless_conversion)] - aws_smithy_types::Number::NegInt((*var_76).into()), - ); - } - if let Some(var_77) = &input.max { - object.key("max").number( - #[allow(clippy::useless_conversion)] - aws_smithy_types::Number::NegInt((*var_77).into()), - ); - } - Ok(()) -} - -pub fn serialize_structure_crate_model_cdn_version_config( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::CdnVersionConfig, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_78) = &input.site_id { - object.key("site_id").string(var_78.as_str()); - } - if let Some(var_79) = &input.build_command { - object.key("build_command").string(var_79.as_str()); - } - if let Some(var_80) = &input.build_output { - object.key("build_output").string(var_80.as_str()); - } - if let Some(var_81) = &input.routes { - let mut array_82 = object.key("routes").start_array(); - for item_83 in var_81 { - { - let mut object_84 = array_82.value().start_object(); - crate::json_ser::serialize_structure_crate_model_cdn_version_route( - &mut object_84, - item_83, - )?; - object_84.finish(); - } - } - array_82.finish(); - } - Ok(()) -} - -pub fn serialize_structure_crate_model_matchmaker_version_config( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::MatchmakerVersionConfig, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_85) = &input.lobby_groups { - let mut array_86 = object.key("lobby_groups").start_array(); - for item_87 in var_85 { - { - let mut object_88 = array_86.value().start_object(); - crate::json_ser::serialize_structure_crate_model_lobby_group( - &mut object_88, - item_87, - )?; - object_88.finish(); - } - } - array_86.finish(); - } - if let Some(var_89) = &input.captcha { - let mut object_90 = object.key("captcha").start_object(); - crate::json_ser::serialize_structure_crate_model_matchmaker_captcha( - &mut object_90, - var_89, - )?; - object_90.finish(); - } - Ok(()) -} - -pub fn serialize_structure_crate_model_kv_version_config( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::KvVersionConfig, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - let (_, _) = (object, input); - Ok(()) -} - -pub fn serialize_structure_crate_model_identity_version_config( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::IdentityVersionConfig, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_91) = &input.custom_display_names { - let mut array_92 = object.key("custom_display_names").start_array(); - for item_93 in var_91 { - { - let mut object_94 = array_92.value().start_object(); - crate::json_ser::serialize_structure_crate_model_custom_display_name( - &mut object_94, - item_93, - )?; - object_94.finish(); - } - } - array_92.finish(); - } - if let Some(var_95) = &input.custom_avatars { - let mut array_96 = object.key("custom_avatars").start_array(); - for item_97 in var_95 { - { - let mut object_98 = array_96.value().start_object(); - crate::json_ser::serialize_structure_crate_model_custom_avatar( - &mut object_98, - item_97, - )?; - object_98.finish(); - } - } - array_96.finish(); - } - Ok(()) -} - -pub fn serialize_structure_crate_model_cdn_version_route( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::CdnVersionRoute, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_99) = &input.glob { - object.key("glob").string(var_99.as_str()); - } - if let Some(var_100) = &input.priority { - object.key("priority").number( - #[allow(clippy::useless_conversion)] - aws_smithy_types::Number::NegInt((*var_100).into()), - ); - } - if let Some(var_101) = &input.middlewares { - let mut array_102 = object.key("middlewares").start_array(); - for item_103 in var_101 { - { - let mut object_104 = array_102.value().start_object(); - crate::json_ser::serialize_structure_crate_model_cdn_version_middleware( - &mut object_104, - item_103, - )?; - object_104.finish(); - } - } - array_102.finish(); - } - Ok(()) -} - -pub fn serialize_structure_crate_model_lobby_group( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::LobbyGroup, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_105) = &input.name_id { - object.key("name_id").string(var_105.as_str()); - } - if let Some(var_106) = &input.regions { - let mut array_107 = object.key("regions").start_array(); - for item_108 in var_106 { - { - let mut object_109 = array_107.value().start_object(); - crate::json_ser::serialize_structure_crate_model_lobby_group_region( - &mut object_109, - item_108, - )?; - object_109.finish(); - } - } - array_107.finish(); - } - if let Some(var_110) = &input.max_players_normal { - object.key("max_players_normal").number( - #[allow(clippy::useless_conversion)] - aws_smithy_types::Number::NegInt((*var_110).into()), - ); - } - if let Some(var_111) = &input.max_players_direct { - object.key("max_players_direct").number( - #[allow(clippy::useless_conversion)] - aws_smithy_types::Number::NegInt((*var_111).into()), - ); - } - if let Some(var_112) = &input.max_players_party { - object.key("max_players_party").number( - #[allow(clippy::useless_conversion)] - aws_smithy_types::Number::NegInt((*var_112).into()), - ); - } - if let Some(var_113) = &input.runtime { - let mut object_114 = object.key("runtime").start_object(); - crate::json_ser::serialize_union_crate_model_lobby_group_runtime(&mut object_114, var_113)?; - object_114.finish(); - } - Ok(()) -} - -pub fn serialize_structure_crate_model_matchmaker_captcha( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::MatchmakerCaptcha, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_115) = &input.requests_before_reverify { - object.key("requests_before_reverify").number( - #[allow(clippy::useless_conversion)] - aws_smithy_types::Number::NegInt((*var_115).into()), - ); - } - if let Some(var_116) = &input.verification_ttl { - object.key("verification_ttl").number( - #[allow(clippy::useless_conversion)] - aws_smithy_types::Number::NegInt((*var_116).into()), - ); - } - if let Some(var_117) = &input.hcaptcha { - let mut object_118 = object.key("hcaptcha").start_object(); - crate::json_ser::serialize_structure_crate_model_matchmaker_captcha_hcaptcha( - &mut object_118, - var_117, - )?; - object_118.finish(); - } - Ok(()) -} - -pub fn serialize_structure_crate_model_custom_display_name( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::CustomDisplayName, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_119) = &input.display_name { - object.key("display_name").string(var_119.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_model_custom_avatar( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::CustomAvatar, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_120) = &input.upload_id { - object.key("upload_id").string(var_120.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_model_cdn_version_middleware( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::CdnVersionMiddleware, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_121) = &input.kind { - let mut object_122 = object.key("kind").start_object(); - crate::json_ser::serialize_union_crate_model_cdn_version_middleware_kind( - &mut object_122, - var_121, - )?; - object_122.finish(); - } - Ok(()) -} - -pub fn serialize_structure_crate_model_lobby_group_region( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::LobbyGroupRegion, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_123) = &input.region_id { - object.key("region_id").string(var_123.as_str()); - } - if let Some(var_124) = &input.tier_name_id { - object.key("tier_name_id").string(var_124.as_str()); - } - if let Some(var_125) = &input.idle_lobbies { - let mut object_126 = object.key("idle_lobbies").start_object(); - crate::json_ser::serialize_structure_crate_model_idle_lobbies_config( - &mut object_126, - var_125, - )?; - object_126.finish(); - } - Ok(()) -} - -pub fn serialize_union_crate_model_lobby_group_runtime( - object_114: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::LobbyGroupRuntime, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - match input { - crate::model::LobbyGroupRuntime::Docker(inner) => { - let mut object_127 = object_114.key("docker").start_object(); - crate::json_ser::serialize_structure_crate_model_lobby_group_runtime_docker( - &mut object_127, - inner, - )?; - object_127.finish(); - } - crate::model::LobbyGroupRuntime::Unknown => { - return Err( - aws_smithy_http::operation::SerializationError::unknown_variant( - "LobbyGroupRuntime", - ), - ) - } - } - Ok(()) -} - -pub fn serialize_structure_crate_model_matchmaker_captcha_hcaptcha( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::MatchmakerCaptchaHcaptcha, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_128) = &input.level { - object.key("level").string(var_128.as_str()); - } - Ok(()) -} - -pub fn serialize_union_crate_model_cdn_version_middleware_kind( - object_122: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::CdnVersionMiddlewareKind, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - match input { - crate::model::CdnVersionMiddlewareKind::CustomHeaders(inner) => { - let mut object_129 = object_122.key("custom_headers").start_object(); - crate::json_ser::serialize_structure_crate_model_cdn_version_custom_headers_middleware( - &mut object_129, - inner, - )?; - object_129.finish(); - } - crate::model::CdnVersionMiddlewareKind::Unknown => { - return Err( - aws_smithy_http::operation::SerializationError::unknown_variant( - "CdnVersionMiddlewareKind", - ), - ) - } - } - Ok(()) -} - -pub fn serialize_structure_crate_model_idle_lobbies_config( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::IdleLobbiesConfig, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_130) = &input.min_idle_lobbies { - object.key("min_idle_lobbies").number( - #[allow(clippy::useless_conversion)] - aws_smithy_types::Number::NegInt((*var_130).into()), - ); - } - if let Some(var_131) = &input.max_idle_lobbies { - object.key("max_idle_lobbies").number( - #[allow(clippy::useless_conversion)] - aws_smithy_types::Number::NegInt((*var_131).into()), - ); - } - Ok(()) -} - -pub fn serialize_structure_crate_model_lobby_group_runtime_docker( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::LobbyGroupRuntimeDocker, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_132) = &input.build_id { - object.key("build_id").string(var_132.as_str()); - } - if let Some(var_133) = &input.args { - let mut array_134 = object.key("args").start_array(); - for item_135 in var_133 { - { - array_134.value().string(item_135.as_str()); - } - } - array_134.finish(); - } - if let Some(var_136) = &input.env_vars { - let mut array_137 = object.key("env_vars").start_array(); - for item_138 in var_136 { - { - let mut object_139 = array_137.value().start_object(); - crate::json_ser::serialize_structure_crate_model_lobby_group_runtime_docker_env_var(&mut object_139, item_138)?; - object_139.finish(); - } - } - array_137.finish(); - } - if let Some(var_140) = &input.network_mode { - object.key("network_mode").string(var_140.as_str()); - } - if let Some(var_141) = &input.ports { - let mut array_142 = object.key("ports").start_array(); - for item_143 in var_141 { - { - let mut object_144 = array_142.value().start_object(); - crate::json_ser::serialize_structure_crate_model_lobby_group_runtime_docker_port( - &mut object_144, - item_143, - )?; - object_144.finish(); - } - } - array_142.finish(); - } - Ok(()) -} - -pub fn serialize_structure_crate_model_cdn_version_custom_headers_middleware( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::CdnVersionCustomHeadersMiddleware, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_145) = &input.headers { - let mut array_146 = object.key("headers").start_array(); - for item_147 in var_145 { - { - let mut object_148 = array_146.value().start_object(); - crate::json_ser::serialize_structure_crate_model_cdn_version_header( - &mut object_148, - item_147, - )?; - object_148.finish(); - } - } - array_146.finish(); - } - Ok(()) -} - -pub fn serialize_structure_crate_model_lobby_group_runtime_docker_env_var( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::LobbyGroupRuntimeDockerEnvVar, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_149) = &input.key { - object.key("key").string(var_149.as_str()); - } - if let Some(var_150) = &input.value { - object.key("value").string(var_150.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_model_cdn_version_header( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::CdnVersionHeader, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_151) = &input.name { - object.key("name").string(var_151.as_str()); - } - if let Some(var_152) = &input.value { - object.key("value").string(var_152.as_str()); - } - Ok(()) -} diff --git a/lib/smithy-output/api-cloud/rust/rust/src/lib.rs b/lib/smithy-output/api-cloud/rust/rust/src/lib.rs deleted file mode 100644 index 131bae0d0..000000000 --- a/lib/smithy-output/api-cloud/rust/rust/src/lib.rs +++ /dev/null @@ -1,57 +0,0 @@ -#![allow(clippy::module_inception)] -#![allow(clippy::upper_case_acronyms)] -#![allow(clippy::large_enum_variant)] -#![allow(clippy::wrong_self_convention)] -#![allow(clippy::should_implement_trait)] -#![allow(clippy::blacklisted_name)] -#![allow(clippy::vec_init_then_push)] -#![allow(rustdoc::bare_urls)] -#![warn(missing_docs)] -//! rivet-cloud -//! -//! # Crate Organization -//! -//! The entry point for most customers will be [`Client`]. [`Client`] exposes one method for each API offered -//! by the service. -//! -//! Some APIs require complex or nested arguments. These exist in [`model`](crate::model). -//! -//! Lastly, errors that can be returned by the service are contained within [`error`]. [`Error`] defines a meta -//! error encompassing all possible errors that can be returned by the service. -//! -//! The other modules within this crate are not required for normal usage. - -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use error_meta::Error; - -#[doc(inline)] -pub use config::Config; - -/// Client and fluent builders for calling the service. -pub mod client; -/// Configuration for the service. -pub mod config; -/// Errors that can occur when calling the service. -pub mod error; -mod error_meta; -/// Input structures for operations. -pub mod input; -mod json_deser; -mod json_errors; -mod json_ser; -/// Data structures used by operation inputs/outputs. -pub mod model; -/// All operations that this crate can perform. -pub mod operation; -mod operation_deser; -mod operation_ser; -/// Output structures for operations. -pub mod output; -pub use client::{Builder, Client, ClientWrapper}; -/// Crate version number. -pub static PKG_VERSION: &str = env!("CARGO_PKG_VERSION"); -/// Re-exported types from supporting crates. -pub mod types { - pub use aws_smithy_http::result::SdkError; - pub use aws_smithy_types::DateTime; -} diff --git a/lib/smithy-output/api-cloud/rust/rust/src/model.rs b/lib/smithy-output/api-cloud/rust/rust/src/model.rs deleted file mode 100644 index 06fc5fe4a..000000000 --- a/lib/smithy-output/api-cloud/rust/rust/src/model.rs +++ /dev/null @@ -1,7465 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// A presigned request used to upload files. Upload your file to the given URL via a PUT request. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UploadPresignedRequest { - /// The name of the file to upload. This is the same as the one given in the upload prepare file. - pub path: std::option::Option, - /// The URL of the presigned request for which to upload your file to. - pub url: std::option::Option, -} -impl UploadPresignedRequest { - /// The name of the file to upload. This is the same as the one given in the upload prepare file. - pub fn path(&self) -> std::option::Option<&str> { - self.path.as_deref() - } - /// The URL of the presigned request for which to upload your file to. - pub fn url(&self) -> std::option::Option<&str> { - self.url.as_deref() - } -} -impl std::fmt::Debug for UploadPresignedRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UploadPresignedRequest"); - formatter.field("path", &self.path); - formatter.field("url", &self.url); - formatter.finish() - } -} -/// See [`UploadPresignedRequest`](crate::model::UploadPresignedRequest) -pub mod upload_presigned_request { - /// A builder for [`UploadPresignedRequest`](crate::model::UploadPresignedRequest) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) path: std::option::Option, - pub(crate) url: std::option::Option, - } - impl Builder { - /// The name of the file to upload. This is the same as the one given in the upload prepare file. - pub fn path(mut self, input: impl Into) -> Self { - self.path = Some(input.into()); - self - } - /// The name of the file to upload. This is the same as the one given in the upload prepare file. - pub fn set_path(mut self, input: std::option::Option) -> Self { - self.path = input; - self - } - /// The URL of the presigned request for which to upload your file to. - pub fn url(mut self, input: impl Into) -> Self { - self.url = Some(input.into()); - self - } - /// The URL of the presigned request for which to upload your file to. - pub fn set_url(mut self, input: std::option::Option) -> Self { - self.url = input; - self - } - /// Consumes the builder and constructs a [`UploadPresignedRequest`](crate::model::UploadPresignedRequest) - pub fn build(self) -> crate::model::UploadPresignedRequest { - crate::model::UploadPresignedRequest { - path: self.path, - url: self.url, - } - } - } -} -impl UploadPresignedRequest { - /// Creates a new builder-style object to manufacture [`UploadPresignedRequest`](crate::model::UploadPresignedRequest) - pub fn builder() -> crate::model::upload_presigned_request::Builder { - crate::model::upload_presigned_request::Builder::default() - } -} - -/// A custom avatar summary. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CustomAvatarSummary { - /// A universally unique identifier. - pub upload_id: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// RFC3339 timestamp. - pub create_ts: std::option::Option, - /// The URL of this custom avatar image. Only present if upload is complete. - pub url: std::option::Option, - /// Unsigned 64 bit integer. - pub content_length: std::option::Option, - /// Whether or not this custom avatar has completely been uploaded. - pub complete: std::option::Option, -} -impl CustomAvatarSummary { - /// A universally unique identifier. - pub fn upload_id(&self) -> std::option::Option<&str> { - self.upload_id.as_deref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// RFC3339 timestamp. - pub fn create_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.create_ts.as_ref() - } - /// The URL of this custom avatar image. Only present if upload is complete. - pub fn url(&self) -> std::option::Option<&str> { - self.url.as_deref() - } - /// Unsigned 64 bit integer. - pub fn content_length(&self) -> std::option::Option { - self.content_length - } - /// Whether or not this custom avatar has completely been uploaded. - pub fn complete(&self) -> std::option::Option { - self.complete - } -} -impl std::fmt::Debug for CustomAvatarSummary { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CustomAvatarSummary"); - formatter.field("upload_id", &self.upload_id); - formatter.field("display_name", &self.display_name); - formatter.field("create_ts", &self.create_ts); - formatter.field("url", &self.url); - formatter.field("content_length", &self.content_length); - formatter.field("complete", &self.complete); - formatter.finish() - } -} -/// See [`CustomAvatarSummary`](crate::model::CustomAvatarSummary) -pub mod custom_avatar_summary { - /// A builder for [`CustomAvatarSummary`](crate::model::CustomAvatarSummary) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) upload_id: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) create_ts: std::option::Option, - pub(crate) url: std::option::Option, - pub(crate) content_length: std::option::Option, - pub(crate) complete: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn upload_id(mut self, input: impl Into) -> Self { - self.upload_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_upload_id(mut self, input: std::option::Option) -> Self { - self.upload_id = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// RFC3339 timestamp. - pub fn create_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.create_ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_create_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.create_ts = input; - self - } - /// The URL of this custom avatar image. Only present if upload is complete. - pub fn url(mut self, input: impl Into) -> Self { - self.url = Some(input.into()); - self - } - /// The URL of this custom avatar image. Only present if upload is complete. - pub fn set_url(mut self, input: std::option::Option) -> Self { - self.url = input; - self - } - /// Unsigned 64 bit integer. - pub fn content_length(mut self, input: i64) -> Self { - self.content_length = Some(input); - self - } - /// Unsigned 64 bit integer. - pub fn set_content_length(mut self, input: std::option::Option) -> Self { - self.content_length = input; - self - } - /// Whether or not this custom avatar has completely been uploaded. - pub fn complete(mut self, input: bool) -> Self { - self.complete = Some(input); - self - } - /// Whether or not this custom avatar has completely been uploaded. - pub fn set_complete(mut self, input: std::option::Option) -> Self { - self.complete = input; - self - } - /// Consumes the builder and constructs a [`CustomAvatarSummary`](crate::model::CustomAvatarSummary) - pub fn build(self) -> crate::model::CustomAvatarSummary { - crate::model::CustomAvatarSummary { - upload_id: self.upload_id, - display_name: self.display_name, - create_ts: self.create_ts, - url: self.url, - content_length: self.content_length, - complete: self.complete, - } - } - } -} -impl CustomAvatarSummary { - /// Creates a new builder-style object to manufacture [`CustomAvatarSummary`](crate::model::CustomAvatarSummary) - pub fn builder() -> crate::model::custom_avatar_summary::Builder { - crate::model::custom_avatar_summary::Builder::default() - } -} - -/// A service performance summary. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct SvcPerf { - /// The name of the service. - pub svc_name: std::option::Option, - /// RFC3339 timestamp. - pub ts: std::option::Option, - /// Unsigned 64 bit integer. - pub duration: std::option::Option, - /// A universally unique identifier. - pub req_id: std::option::Option, - /// A list of performance spans. - pub spans: std::option::Option>, - /// A list of performance marks. - pub marks: std::option::Option>, -} -impl SvcPerf { - /// The name of the service. - pub fn svc_name(&self) -> std::option::Option<&str> { - self.svc_name.as_deref() - } - /// RFC3339 timestamp. - pub fn ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.ts.as_ref() - } - /// Unsigned 64 bit integer. - pub fn duration(&self) -> std::option::Option { - self.duration - } - /// A universally unique identifier. - pub fn req_id(&self) -> std::option::Option<&str> { - self.req_id.as_deref() - } - /// A list of performance spans. - pub fn spans(&self) -> std::option::Option<&[crate::model::LogsPerfSpan]> { - self.spans.as_deref() - } - /// A list of performance marks. - pub fn marks(&self) -> std::option::Option<&[crate::model::LogsPerfMark]> { - self.marks.as_deref() - } -} -impl std::fmt::Debug for SvcPerf { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("SvcPerf"); - formatter.field("svc_name", &self.svc_name); - formatter.field("ts", &self.ts); - formatter.field("duration", &self.duration); - formatter.field("req_id", &self.req_id); - formatter.field("spans", &self.spans); - formatter.field("marks", &self.marks); - formatter.finish() - } -} -/// See [`SvcPerf`](crate::model::SvcPerf) -pub mod svc_perf { - /// A builder for [`SvcPerf`](crate::model::SvcPerf) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) svc_name: std::option::Option, - pub(crate) ts: std::option::Option, - pub(crate) duration: std::option::Option, - pub(crate) req_id: std::option::Option, - pub(crate) spans: std::option::Option>, - pub(crate) marks: std::option::Option>, - } - impl Builder { - /// The name of the service. - pub fn svc_name(mut self, input: impl Into) -> Self { - self.svc_name = Some(input.into()); - self - } - /// The name of the service. - pub fn set_svc_name(mut self, input: std::option::Option) -> Self { - self.svc_name = input; - self - } - /// RFC3339 timestamp. - pub fn ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_ts(mut self, input: std::option::Option) -> Self { - self.ts = input; - self - } - /// Unsigned 64 bit integer. - pub fn duration(mut self, input: i64) -> Self { - self.duration = Some(input); - self - } - /// Unsigned 64 bit integer. - pub fn set_duration(mut self, input: std::option::Option) -> Self { - self.duration = input; - self - } - /// A universally unique identifier. - pub fn req_id(mut self, input: impl Into) -> Self { - self.req_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_req_id(mut self, input: std::option::Option) -> Self { - self.req_id = input; - self - } - /// Appends an item to `spans`. - /// - /// To override the contents of this collection use [`set_spans`](Self::set_spans). - /// - /// A list of performance spans. - pub fn spans(mut self, input: crate::model::LogsPerfSpan) -> Self { - let mut v = self.spans.unwrap_or_default(); - v.push(input); - self.spans = Some(v); - self - } - /// A list of performance spans. - pub fn set_spans( - mut self, - input: std::option::Option>, - ) -> Self { - self.spans = input; - self - } - /// Appends an item to `marks`. - /// - /// To override the contents of this collection use [`set_marks`](Self::set_marks). - /// - /// A list of performance marks. - pub fn marks(mut self, input: crate::model::LogsPerfMark) -> Self { - let mut v = self.marks.unwrap_or_default(); - v.push(input); - self.marks = Some(v); - self - } - /// A list of performance marks. - pub fn set_marks( - mut self, - input: std::option::Option>, - ) -> Self { - self.marks = input; - self - } - /// Consumes the builder and constructs a [`SvcPerf`](crate::model::SvcPerf) - pub fn build(self) -> crate::model::SvcPerf { - crate::model::SvcPerf { - svc_name: self.svc_name, - ts: self.ts, - duration: self.duration, - req_id: self.req_id, - spans: self.spans, - marks: self.marks, - } - } - } -} -impl SvcPerf { - /// Creates a new builder-style object to manufacture [`SvcPerf`](crate::model::SvcPerf) - pub fn builder() -> crate::model::svc_perf::Builder { - crate::model::svc_perf::Builder::default() - } -} - -/// A performance mark. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct LogsPerfMark { - /// The label given to this performance mark. - pub label: std::option::Option, - /// RFC3339 timestamp. - pub ts: std::option::Option, - /// A universally unique identifier. - pub ray_id: std::option::Option, - /// A universally unique identifier. - pub req_id: std::option::Option, -} -impl LogsPerfMark { - /// The label given to this performance mark. - pub fn label(&self) -> std::option::Option<&str> { - self.label.as_deref() - } - /// RFC3339 timestamp. - pub fn ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.ts.as_ref() - } - /// A universally unique identifier. - pub fn ray_id(&self) -> std::option::Option<&str> { - self.ray_id.as_deref() - } - /// A universally unique identifier. - pub fn req_id(&self) -> std::option::Option<&str> { - self.req_id.as_deref() - } -} -impl std::fmt::Debug for LogsPerfMark { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("LogsPerfMark"); - formatter.field("label", &self.label); - formatter.field("ts", &self.ts); - formatter.field("ray_id", &self.ray_id); - formatter.field("req_id", &self.req_id); - formatter.finish() - } -} -/// See [`LogsPerfMark`](crate::model::LogsPerfMark) -pub mod logs_perf_mark { - /// A builder for [`LogsPerfMark`](crate::model::LogsPerfMark) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) label: std::option::Option, - pub(crate) ts: std::option::Option, - pub(crate) ray_id: std::option::Option, - pub(crate) req_id: std::option::Option, - } - impl Builder { - /// The label given to this performance mark. - pub fn label(mut self, input: impl Into) -> Self { - self.label = Some(input.into()); - self - } - /// The label given to this performance mark. - pub fn set_label(mut self, input: std::option::Option) -> Self { - self.label = input; - self - } - /// RFC3339 timestamp. - pub fn ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_ts(mut self, input: std::option::Option) -> Self { - self.ts = input; - self - } - /// A universally unique identifier. - pub fn ray_id(mut self, input: impl Into) -> Self { - self.ray_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_ray_id(mut self, input: std::option::Option) -> Self { - self.ray_id = input; - self - } - /// A universally unique identifier. - pub fn req_id(mut self, input: impl Into) -> Self { - self.req_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_req_id(mut self, input: std::option::Option) -> Self { - self.req_id = input; - self - } - /// Consumes the builder and constructs a [`LogsPerfMark`](crate::model::LogsPerfMark) - pub fn build(self) -> crate::model::LogsPerfMark { - crate::model::LogsPerfMark { - label: self.label, - ts: self.ts, - ray_id: self.ray_id, - req_id: self.req_id, - } - } - } -} -impl LogsPerfMark { - /// Creates a new builder-style object to manufacture [`LogsPerfMark`](crate::model::LogsPerfMark) - pub fn builder() -> crate::model::logs_perf_mark::Builder { - crate::model::logs_perf_mark::Builder::default() - } -} - -/// A performance span. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct LogsPerfSpan { - /// The label given to this performance span. - pub label: std::option::Option, - /// RFC3339 timestamp. - pub start_ts: std::option::Option, - /// RFC3339 timestamp. - pub finish_ts: std::option::Option, - /// A universally unique identifier. - pub req_id: std::option::Option, -} -impl LogsPerfSpan { - /// The label given to this performance span. - pub fn label(&self) -> std::option::Option<&str> { - self.label.as_deref() - } - /// RFC3339 timestamp. - pub fn start_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.start_ts.as_ref() - } - /// RFC3339 timestamp. - pub fn finish_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.finish_ts.as_ref() - } - /// A universally unique identifier. - pub fn req_id(&self) -> std::option::Option<&str> { - self.req_id.as_deref() - } -} -impl std::fmt::Debug for LogsPerfSpan { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("LogsPerfSpan"); - formatter.field("label", &self.label); - formatter.field("start_ts", &self.start_ts); - formatter.field("finish_ts", &self.finish_ts); - formatter.field("req_id", &self.req_id); - formatter.finish() - } -} -/// See [`LogsPerfSpan`](crate::model::LogsPerfSpan) -pub mod logs_perf_span { - /// A builder for [`LogsPerfSpan`](crate::model::LogsPerfSpan) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) label: std::option::Option, - pub(crate) start_ts: std::option::Option, - pub(crate) finish_ts: std::option::Option, - pub(crate) req_id: std::option::Option, - } - impl Builder { - /// The label given to this performance span. - pub fn label(mut self, input: impl Into) -> Self { - self.label = Some(input.into()); - self - } - /// The label given to this performance span. - pub fn set_label(mut self, input: std::option::Option) -> Self { - self.label = input; - self - } - /// RFC3339 timestamp. - pub fn start_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.start_ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_start_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.start_ts = input; - self - } - /// RFC3339 timestamp. - pub fn finish_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.finish_ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_finish_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.finish_ts = input; - self - } - /// A universally unique identifier. - pub fn req_id(mut self, input: impl Into) -> Self { - self.req_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_req_id(mut self, input: std::option::Option) -> Self { - self.req_id = input; - self - } - /// Consumes the builder and constructs a [`LogsPerfSpan`](crate::model::LogsPerfSpan) - pub fn build(self) -> crate::model::LogsPerfSpan { - crate::model::LogsPerfSpan { - label: self.label, - start_ts: self.start_ts, - finish_ts: self.finish_ts, - req_id: self.req_id, - } - } - } -} -impl LogsPerfSpan { - /// Creates a new builder-style object to manufacture [`LogsPerfSpan`](crate::model::LogsPerfSpan) - pub fn builder() -> crate::model::logs_perf_span::Builder { - crate::model::logs_perf_span::Builder::default() - } -} - -/// An error given by failed content validation. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ValidationError { - /// A list of strings denoting the origin of a validation error. - pub path: std::option::Option>, -} -impl ValidationError { - /// A list of strings denoting the origin of a validation error. - pub fn path(&self) -> std::option::Option<&[std::string::String]> { - self.path.as_deref() - } -} -impl std::fmt::Debug for ValidationError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ValidationError"); - formatter.field("path", &self.path); - formatter.finish() - } -} -/// See [`ValidationError`](crate::model::ValidationError) -pub mod validation_error { - /// A builder for [`ValidationError`](crate::model::ValidationError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) path: std::option::Option>, - } - impl Builder { - /// Appends an item to `path`. - /// - /// To override the contents of this collection use [`set_path`](Self::set_path). - /// - /// A list of strings denoting the origin of a validation error. - pub fn path(mut self, input: impl Into) -> Self { - let mut v = self.path.unwrap_or_default(); - v.push(input.into()); - self.path = Some(v); - self - } - /// A list of strings denoting the origin of a validation error. - pub fn set_path( - mut self, - input: std::option::Option>, - ) -> Self { - self.path = input; - self - } - /// Consumes the builder and constructs a [`ValidationError`](crate::model::ValidationError) - pub fn build(self) -> crate::model::ValidationError { - crate::model::ValidationError { path: self.path } - } - } -} -impl ValidationError { - /// Creates a new builder-style object to manufacture [`ValidationError`](crate::model::ValidationError) - pub fn builder() -> crate::model::validation_error::Builder { - crate::model::validation_error::Builder::default() - } -} - -/// A group's billing invoice. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GroupBillingInvoice { - /// RFC3339 timestamp. - pub issuing_ts: std::option::Option, - /// A URL to this invoice's PDF document. - pub file_url: std::option::Option, -} -impl GroupBillingInvoice { - /// RFC3339 timestamp. - pub fn issuing_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.issuing_ts.as_ref() - } - /// A URL to this invoice's PDF document. - pub fn file_url(&self) -> std::option::Option<&str> { - self.file_url.as_deref() - } -} -impl std::fmt::Debug for GroupBillingInvoice { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GroupBillingInvoice"); - formatter.field("issuing_ts", &self.issuing_ts); - formatter.field("file_url", &self.file_url); - formatter.finish() - } -} -/// See [`GroupBillingInvoice`](crate::model::GroupBillingInvoice) -pub mod group_billing_invoice { - /// A builder for [`GroupBillingInvoice`](crate::model::GroupBillingInvoice) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) issuing_ts: std::option::Option, - pub(crate) file_url: std::option::Option, - } - impl Builder { - /// RFC3339 timestamp. - pub fn issuing_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.issuing_ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_issuing_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.issuing_ts = input; - self - } - /// A URL to this invoice's PDF document. - pub fn file_url(mut self, input: impl Into) -> Self { - self.file_url = Some(input.into()); - self - } - /// A URL to this invoice's PDF document. - pub fn set_file_url(mut self, input: std::option::Option) -> Self { - self.file_url = input; - self - } - /// Consumes the builder and constructs a [`GroupBillingInvoice`](crate::model::GroupBillingInvoice) - pub fn build(self) -> crate::model::GroupBillingInvoice { - crate::model::GroupBillingInvoice { - issuing_ts: self.issuing_ts, - file_url: self.file_url, - } - } - } -} -impl GroupBillingInvoice { - /// Creates a new builder-style object to manufacture [`GroupBillingInvoice`](crate::model::GroupBillingInvoice) - pub fn builder() -> crate::model::group_billing_invoice::Builder { - crate::model::group_billing_invoice::Builder::default() - } -} - -/// The status of a developer group. -#[non_exhaustive] -#[derive( - std::clone::Clone, - std::cmp::Eq, - std::cmp::Ord, - std::cmp::PartialEq, - std::cmp::PartialOrd, - std::fmt::Debug, - std::hash::Hash, -)] -pub enum GroupStatus { - #[allow(missing_docs)] // documentation missing in model - Active, - #[allow(missing_docs)] // documentation missing in model - PaymentFailed, - #[allow(missing_docs)] // documentation missing in model - SetupIncomplete, - #[allow(missing_docs)] // documentation missing in model - SpendingLimitReached, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for GroupStatus { - fn from(s: &str) -> Self { - match s { - "active" => GroupStatus::Active, - "payment_failed" => GroupStatus::PaymentFailed, - "setup_incomplete" => GroupStatus::SetupIncomplete, - "spending_limit_reached" => GroupStatus::SpendingLimitReached, - other => GroupStatus::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for GroupStatus { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(GroupStatus::from(s)) - } -} -impl GroupStatus { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - GroupStatus::Active => "active", - GroupStatus::PaymentFailed => "payment_failed", - GroupStatus::SetupIncomplete => "setup_incomplete", - GroupStatus::SpendingLimitReached => "spending_limit_reached", - GroupStatus::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &[ - "active", - "payment_failed", - "setup_incomplete", - "spending_limit_reached", - ] - } -} -impl AsRef for GroupStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// A region server tier. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct RegionTier { - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub tier_name_id: std::option::Option, - /// Together with the denominator, denotes the portion of the CPU a given server uses. - pub rivet_cores_numerator: std::option::Option, - /// Together with the numerator, denotes the portion of the CPU a given server uses. - pub rivet_cores_denominator: std::option::Option, - /// CPU frequency (MHz). - pub cpu: std::option::Option, - /// Allocated memory (MB). - pub memory: std::option::Option, - /// Allocated disk space (MB). - pub disk: std::option::Option, - /// Internet bandwidth (MB). - pub bandwidth: std::option::Option, -} -impl RegionTier { - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn tier_name_id(&self) -> std::option::Option<&str> { - self.tier_name_id.as_deref() - } - /// Together with the denominator, denotes the portion of the CPU a given server uses. - pub fn rivet_cores_numerator(&self) -> std::option::Option { - self.rivet_cores_numerator - } - /// Together with the numerator, denotes the portion of the CPU a given server uses. - pub fn rivet_cores_denominator(&self) -> std::option::Option { - self.rivet_cores_denominator - } - /// CPU frequency (MHz). - pub fn cpu(&self) -> std::option::Option { - self.cpu - } - /// Allocated memory (MB). - pub fn memory(&self) -> std::option::Option { - self.memory - } - /// Allocated disk space (MB). - pub fn disk(&self) -> std::option::Option { - self.disk - } - /// Internet bandwidth (MB). - pub fn bandwidth(&self) -> std::option::Option { - self.bandwidth - } -} -impl std::fmt::Debug for RegionTier { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("RegionTier"); - formatter.field("tier_name_id", &self.tier_name_id); - formatter.field("rivet_cores_numerator", &self.rivet_cores_numerator); - formatter.field("rivet_cores_denominator", &self.rivet_cores_denominator); - formatter.field("cpu", &self.cpu); - formatter.field("memory", &self.memory); - formatter.field("disk", &self.disk); - formatter.field("bandwidth", &self.bandwidth); - formatter.finish() - } -} -/// See [`RegionTier`](crate::model::RegionTier) -pub mod region_tier { - /// A builder for [`RegionTier`](crate::model::RegionTier) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) tier_name_id: std::option::Option, - pub(crate) rivet_cores_numerator: std::option::Option, - pub(crate) rivet_cores_denominator: std::option::Option, - pub(crate) cpu: std::option::Option, - pub(crate) memory: std::option::Option, - pub(crate) disk: std::option::Option, - pub(crate) bandwidth: std::option::Option, - } - impl Builder { - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn tier_name_id(mut self, input: impl Into) -> Self { - self.tier_name_id = Some(input.into()); - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn set_tier_name_id(mut self, input: std::option::Option) -> Self { - self.tier_name_id = input; - self - } - /// Together with the denominator, denotes the portion of the CPU a given server uses. - pub fn rivet_cores_numerator(mut self, input: i32) -> Self { - self.rivet_cores_numerator = Some(input); - self - } - /// Together with the denominator, denotes the portion of the CPU a given server uses. - pub fn set_rivet_cores_numerator(mut self, input: std::option::Option) -> Self { - self.rivet_cores_numerator = input; - self - } - /// Together with the numerator, denotes the portion of the CPU a given server uses. - pub fn rivet_cores_denominator(mut self, input: i32) -> Self { - self.rivet_cores_denominator = Some(input); - self - } - /// Together with the numerator, denotes the portion of the CPU a given server uses. - pub fn set_rivet_cores_denominator(mut self, input: std::option::Option) -> Self { - self.rivet_cores_denominator = input; - self - } - /// CPU frequency (MHz). - pub fn cpu(mut self, input: i64) -> Self { - self.cpu = Some(input); - self - } - /// CPU frequency (MHz). - pub fn set_cpu(mut self, input: std::option::Option) -> Self { - self.cpu = input; - self - } - /// Allocated memory (MB). - pub fn memory(mut self, input: i64) -> Self { - self.memory = Some(input); - self - } - /// Allocated memory (MB). - pub fn set_memory(mut self, input: std::option::Option) -> Self { - self.memory = input; - self - } - /// Allocated disk space (MB). - pub fn disk(mut self, input: i64) -> Self { - self.disk = Some(input); - self - } - /// Allocated disk space (MB). - pub fn set_disk(mut self, input: std::option::Option) -> Self { - self.disk = input; - self - } - /// Internet bandwidth (MB). - pub fn bandwidth(mut self, input: i64) -> Self { - self.bandwidth = Some(input); - self - } - /// Internet bandwidth (MB). - pub fn set_bandwidth(mut self, input: std::option::Option) -> Self { - self.bandwidth = input; - self - } - /// Consumes the builder and constructs a [`RegionTier`](crate::model::RegionTier) - pub fn build(self) -> crate::model::RegionTier { - crate::model::RegionTier { - tier_name_id: self.tier_name_id, - rivet_cores_numerator: self.rivet_cores_numerator, - rivet_cores_denominator: self.rivet_cores_denominator, - cpu: self.cpu, - memory: self.memory, - disk: self.disk, - bandwidth: self.bandwidth, - } - } - } -} -impl RegionTier { - /// Creates a new builder-style object to manufacture [`RegionTier`](crate::model::RegionTier) - pub fn builder() -> crate::model::region_tier::Builder { - crate::model::region_tier::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive( - std::clone::Clone, - std::cmp::Eq, - std::cmp::Ord, - std::cmp::PartialEq, - std::cmp::PartialOrd, - std::fmt::Debug, - std::hash::Hash, -)] -pub enum LogStream { - /// Stderrs tream from the given process. - StdErr, - /// Stdout stream from the given processs. - StdOut, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for LogStream { - fn from(s: &str) -> Self { - match s { - "std_err" => LogStream::StdErr, - "std_out" => LogStream::StdOut, - other => LogStream::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for LogStream { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(LogStream::from(s)) - } -} -impl LogStream { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - LogStream::StdErr => "std_err", - LogStream::StdOut => "std_out", - LogStream::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["std_err", "std_out"] - } -} -impl AsRef for LogStream { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// Provided by watchable endpoints used in blocking loops. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct WatchResponse { - /// Index indicating the version of the data responded. Pas this to `rivet.common#WatchQuery` to block and wait for the next response. - pub index: std::option::Option, -} -impl WatchResponse { - /// Index indicating the version of the data responded. Pas this to `rivet.common#WatchQuery` to block and wait for the next response. - pub fn index(&self) -> std::option::Option<&str> { - self.index.as_deref() - } -} -impl std::fmt::Debug for WatchResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("WatchResponse"); - formatter.field("index", &self.index); - formatter.finish() - } -} -/// See [`WatchResponse`](crate::model::WatchResponse) -pub mod watch_response { - /// A builder for [`WatchResponse`](crate::model::WatchResponse) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) index: std::option::Option, - } - impl Builder { - /// Index indicating the version of the data responded. Pas this to `rivet.common#WatchQuery` to block and wait for the next response. - pub fn index(mut self, input: impl Into) -> Self { - self.index = Some(input.into()); - self - } - /// Index indicating the version of the data responded. Pas this to `rivet.common#WatchQuery` to block and wait for the next response. - pub fn set_index(mut self, input: std::option::Option) -> Self { - self.index = input; - self - } - /// Consumes the builder and constructs a [`WatchResponse`](crate::model::WatchResponse) - pub fn build(self) -> crate::model::WatchResponse { - crate::model::WatchResponse { index: self.index } - } - } -} -impl WatchResponse { - /// Creates a new builder-style object to manufacture [`WatchResponse`](crate::model::WatchResponse) - pub fn builder() -> crate::model::watch_response::Builder { - crate::model::watch_response::Builder::default() - } -} - -/// A file being prepared to upload. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UploadPrepareFile { - /// The path/filename of the file. - pub path: std::option::Option, - /// The MIME type of the file. - pub content_type: std::option::Option, - /// Unsigned 64 bit integer. - pub content_length: std::option::Option, -} -impl UploadPrepareFile { - /// The path/filename of the file. - pub fn path(&self) -> std::option::Option<&str> { - self.path.as_deref() - } - /// The MIME type of the file. - pub fn content_type(&self) -> std::option::Option<&str> { - self.content_type.as_deref() - } - /// Unsigned 64 bit integer. - pub fn content_length(&self) -> std::option::Option { - self.content_length - } -} -impl std::fmt::Debug for UploadPrepareFile { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UploadPrepareFile"); - formatter.field("path", &self.path); - formatter.field("content_type", &self.content_type); - formatter.field("content_length", &self.content_length); - formatter.finish() - } -} -/// See [`UploadPrepareFile`](crate::model::UploadPrepareFile) -pub mod upload_prepare_file { - /// A builder for [`UploadPrepareFile`](crate::model::UploadPrepareFile) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) path: std::option::Option, - pub(crate) content_type: std::option::Option, - pub(crate) content_length: std::option::Option, - } - impl Builder { - /// The path/filename of the file. - pub fn path(mut self, input: impl Into) -> Self { - self.path = Some(input.into()); - self - } - /// The path/filename of the file. - pub fn set_path(mut self, input: std::option::Option) -> Self { - self.path = input; - self - } - /// The MIME type of the file. - pub fn content_type(mut self, input: impl Into) -> Self { - self.content_type = Some(input.into()); - self - } - /// The MIME type of the file. - pub fn set_content_type(mut self, input: std::option::Option) -> Self { - self.content_type = input; - self - } - /// Unsigned 64 bit integer. - pub fn content_length(mut self, input: i64) -> Self { - self.content_length = Some(input); - self - } - /// Unsigned 64 bit integer. - pub fn set_content_length(mut self, input: std::option::Option) -> Self { - self.content_length = input; - self - } - /// Consumes the builder and constructs a [`UploadPrepareFile`](crate::model::UploadPrepareFile) - pub fn build(self) -> crate::model::UploadPrepareFile { - crate::model::UploadPrepareFile { - path: self.path, - content_type: self.content_type, - content_length: self.content_length, - } - } - } -} -impl UploadPrepareFile { - /// Creates a new builder-style object to manufacture [`UploadPrepareFile`](crate::model::UploadPrepareFile) - pub fn builder() -> crate::model::upload_prepare_file::Builder { - crate::model::upload_prepare_file::Builder::default() - } -} - -/// A CDN site summary. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CdnSiteSummary { - /// A universally unique identifier. - pub site_id: std::option::Option, - /// A universally unique identifier. - pub upload_id: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// RFC3339 timestamp. - pub create_ts: std::option::Option, - /// Unsigned 64 bit integer. - pub content_length: std::option::Option, - /// Whether or not this site has completely been uploaded. - pub complete: std::option::Option, -} -impl CdnSiteSummary { - /// A universally unique identifier. - pub fn site_id(&self) -> std::option::Option<&str> { - self.site_id.as_deref() - } - /// A universally unique identifier. - pub fn upload_id(&self) -> std::option::Option<&str> { - self.upload_id.as_deref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// RFC3339 timestamp. - pub fn create_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.create_ts.as_ref() - } - /// Unsigned 64 bit integer. - pub fn content_length(&self) -> std::option::Option { - self.content_length - } - /// Whether or not this site has completely been uploaded. - pub fn complete(&self) -> std::option::Option { - self.complete - } -} -impl std::fmt::Debug for CdnSiteSummary { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CdnSiteSummary"); - formatter.field("site_id", &self.site_id); - formatter.field("upload_id", &self.upload_id); - formatter.field("display_name", &self.display_name); - formatter.field("create_ts", &self.create_ts); - formatter.field("content_length", &self.content_length); - formatter.field("complete", &self.complete); - formatter.finish() - } -} -/// See [`CdnSiteSummary`](crate::model::CdnSiteSummary) -pub mod cdn_site_summary { - /// A builder for [`CdnSiteSummary`](crate::model::CdnSiteSummary) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) site_id: std::option::Option, - pub(crate) upload_id: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) create_ts: std::option::Option, - pub(crate) content_length: std::option::Option, - pub(crate) complete: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn site_id(mut self, input: impl Into) -> Self { - self.site_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_site_id(mut self, input: std::option::Option) -> Self { - self.site_id = input; - self - } - /// A universally unique identifier. - pub fn upload_id(mut self, input: impl Into) -> Self { - self.upload_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_upload_id(mut self, input: std::option::Option) -> Self { - self.upload_id = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// RFC3339 timestamp. - pub fn create_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.create_ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_create_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.create_ts = input; - self - } - /// Unsigned 64 bit integer. - pub fn content_length(mut self, input: i64) -> Self { - self.content_length = Some(input); - self - } - /// Unsigned 64 bit integer. - pub fn set_content_length(mut self, input: std::option::Option) -> Self { - self.content_length = input; - self - } - /// Whether or not this site has completely been uploaded. - pub fn complete(mut self, input: bool) -> Self { - self.complete = Some(input); - self - } - /// Whether or not this site has completely been uploaded. - pub fn set_complete(mut self, input: std::option::Option) -> Self { - self.complete = input; - self - } - /// Consumes the builder and constructs a [`CdnSiteSummary`](crate::model::CdnSiteSummary) - pub fn build(self) -> crate::model::CdnSiteSummary { - crate::model::CdnSiteSummary { - site_id: self.site_id, - upload_id: self.upload_id, - display_name: self.display_name, - create_ts: self.create_ts, - content_length: self.content_length, - complete: self.complete, - } - } - } -} -impl CdnSiteSummary { - /// Creates a new builder-style object to manufacture [`CdnSiteSummary`](crate::model::CdnSiteSummary) - pub fn builder() -> crate::model::cdn_site_summary::Builder { - crate::model::cdn_site_summary::Builder::default() - } -} - -/// A build summary. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct BuildSummary { - /// A universally unique identifier. - pub build_id: std::option::Option, - /// A universally unique identifier. - pub upload_id: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// RFC3339 timestamp. - pub create_ts: std::option::Option, - /// Unsigned 64 bit integer. - pub content_length: std::option::Option, - /// Whether or not this build has completely been uploaded. - pub complete: std::option::Option, -} -impl BuildSummary { - /// A universally unique identifier. - pub fn build_id(&self) -> std::option::Option<&str> { - self.build_id.as_deref() - } - /// A universally unique identifier. - pub fn upload_id(&self) -> std::option::Option<&str> { - self.upload_id.as_deref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// RFC3339 timestamp. - pub fn create_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.create_ts.as_ref() - } - /// Unsigned 64 bit integer. - pub fn content_length(&self) -> std::option::Option { - self.content_length - } - /// Whether or not this build has completely been uploaded. - pub fn complete(&self) -> std::option::Option { - self.complete - } -} -impl std::fmt::Debug for BuildSummary { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("BuildSummary"); - formatter.field("build_id", &self.build_id); - formatter.field("upload_id", &self.upload_id); - formatter.field("display_name", &self.display_name); - formatter.field("create_ts", &self.create_ts); - formatter.field("content_length", &self.content_length); - formatter.field("complete", &self.complete); - formatter.finish() - } -} -/// See [`BuildSummary`](crate::model::BuildSummary) -pub mod build_summary { - /// A builder for [`BuildSummary`](crate::model::BuildSummary) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) build_id: std::option::Option, - pub(crate) upload_id: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) create_ts: std::option::Option, - pub(crate) content_length: std::option::Option, - pub(crate) complete: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn build_id(mut self, input: impl Into) -> Self { - self.build_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_build_id(mut self, input: std::option::Option) -> Self { - self.build_id = input; - self - } - /// A universally unique identifier. - pub fn upload_id(mut self, input: impl Into) -> Self { - self.upload_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_upload_id(mut self, input: std::option::Option) -> Self { - self.upload_id = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// RFC3339 timestamp. - pub fn create_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.create_ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_create_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.create_ts = input; - self - } - /// Unsigned 64 bit integer. - pub fn content_length(mut self, input: i64) -> Self { - self.content_length = Some(input); - self - } - /// Unsigned 64 bit integer. - pub fn set_content_length(mut self, input: std::option::Option) -> Self { - self.content_length = input; - self - } - /// Whether or not this build has completely been uploaded. - pub fn complete(mut self, input: bool) -> Self { - self.complete = Some(input); - self - } - /// Whether or not this build has completely been uploaded. - pub fn set_complete(mut self, input: std::option::Option) -> Self { - self.complete = input; - self - } - /// Consumes the builder and constructs a [`BuildSummary`](crate::model::BuildSummary) - pub fn build(self) -> crate::model::BuildSummary { - crate::model::BuildSummary { - build_id: self.build_id, - upload_id: self.upload_id, - display_name: self.display_name, - create_ts: self.create_ts, - content_length: self.content_length, - complete: self.complete, - } - } - } -} -impl BuildSummary { - /// Creates a new builder-style object to manufacture [`BuildSummary`](crate::model::BuildSummary) - pub fn builder() -> crate::model::build_summary::Builder { - crate::model::build_summary::Builder::default() - } -} - -/// Metrics relating to a job service. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct SvcMetrics { - /// The job name. - pub job: std::option::Option, - /// CPU metrics. - pub cpu: std::option::Option>, - /// Memory metrics. - pub memory: std::option::Option>, - /// Peak memory metrics. - pub memory_max: std::option::Option>, - /// Total allocated memory (MB). - pub allocated_memory: std::option::Option, -} -impl SvcMetrics { - /// The job name. - pub fn job(&self) -> std::option::Option<&str> { - self.job.as_deref() - } - /// CPU metrics. - pub fn cpu(&self) -> std::option::Option<&[f32]> { - self.cpu.as_deref() - } - /// Memory metrics. - pub fn memory(&self) -> std::option::Option<&[i64]> { - self.memory.as_deref() - } - /// Peak memory metrics. - pub fn memory_max(&self) -> std::option::Option<&[i64]> { - self.memory_max.as_deref() - } - /// Total allocated memory (MB). - pub fn allocated_memory(&self) -> std::option::Option { - self.allocated_memory - } -} -impl std::fmt::Debug for SvcMetrics { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("SvcMetrics"); - formatter.field("job", &self.job); - formatter.field("cpu", &self.cpu); - formatter.field("memory", &self.memory); - formatter.field("memory_max", &self.memory_max); - formatter.field("allocated_memory", &self.allocated_memory); - formatter.finish() - } -} -/// See [`SvcMetrics`](crate::model::SvcMetrics) -pub mod svc_metrics { - /// A builder for [`SvcMetrics`](crate::model::SvcMetrics) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) job: std::option::Option, - pub(crate) cpu: std::option::Option>, - pub(crate) memory: std::option::Option>, - pub(crate) memory_max: std::option::Option>, - pub(crate) allocated_memory: std::option::Option, - } - impl Builder { - /// The job name. - pub fn job(mut self, input: impl Into) -> Self { - self.job = Some(input.into()); - self - } - /// The job name. - pub fn set_job(mut self, input: std::option::Option) -> Self { - self.job = input; - self - } - /// Appends an item to `cpu`. - /// - /// To override the contents of this collection use [`set_cpu`](Self::set_cpu). - /// - /// CPU metrics. - pub fn cpu(mut self, input: f32) -> Self { - let mut v = self.cpu.unwrap_or_default(); - v.push(input); - self.cpu = Some(v); - self - } - /// CPU metrics. - pub fn set_cpu(mut self, input: std::option::Option>) -> Self { - self.cpu = input; - self - } - /// Appends an item to `memory`. - /// - /// To override the contents of this collection use [`set_memory`](Self::set_memory). - /// - /// Memory metrics. - pub fn memory(mut self, input: i64) -> Self { - let mut v = self.memory.unwrap_or_default(); - v.push(input); - self.memory = Some(v); - self - } - /// Memory metrics. - pub fn set_memory(mut self, input: std::option::Option>) -> Self { - self.memory = input; - self - } - /// Appends an item to `memory_max`. - /// - /// To override the contents of this collection use [`set_memory_max`](Self::set_memory_max). - /// - /// Peak memory metrics. - pub fn memory_max(mut self, input: i64) -> Self { - let mut v = self.memory_max.unwrap_or_default(); - v.push(input); - self.memory_max = Some(v); - self - } - /// Peak memory metrics. - pub fn set_memory_max(mut self, input: std::option::Option>) -> Self { - self.memory_max = input; - self - } - /// Total allocated memory (MB). - pub fn allocated_memory(mut self, input: i64) -> Self { - self.allocated_memory = Some(input); - self - } - /// Total allocated memory (MB). - pub fn set_allocated_memory(mut self, input: std::option::Option) -> Self { - self.allocated_memory = input; - self - } - /// Consumes the builder and constructs a [`SvcMetrics`](crate::model::SvcMetrics) - pub fn build(self) -> crate::model::SvcMetrics { - crate::model::SvcMetrics { - job: self.job, - cpu: self.cpu, - memory: self.memory, - memory_max: self.memory_max, - allocated_memory: self.allocated_memory, - } - } - } -} -impl SvcMetrics { - /// Creates a new builder-style object to manufacture [`SvcMetrics`](crate::model::SvcMetrics) - pub fn builder() -> crate::model::svc_metrics::Builder { - crate::model::svc_metrics::Builder::default() - } -} - -/// A logs summary for a lobby. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct LogsLobbySummary { - /// A universally unique identifier. - pub lobby_id: std::option::Option, - /// A universally unique identifier. - pub namespace_id: std::option::Option, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub lobby_group_name_id: std::option::Option, - /// A universally unique identifier. - pub region_id: std::option::Option, - /// RFC3339 timestamp. - pub create_ts: std::option::Option, - /// RFC3339 timestamp. - pub start_ts: std::option::Option, - /// RFC3339 timestamp. - pub ready_ts: std::option::Option, - /// A union representing the state of a lobby. - pub status: std::option::Option, -} -impl LogsLobbySummary { - /// A universally unique identifier. - pub fn lobby_id(&self) -> std::option::Option<&str> { - self.lobby_id.as_deref() - } - /// A universally unique identifier. - pub fn namespace_id(&self) -> std::option::Option<&str> { - self.namespace_id.as_deref() - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn lobby_group_name_id(&self) -> std::option::Option<&str> { - self.lobby_group_name_id.as_deref() - } - /// A universally unique identifier. - pub fn region_id(&self) -> std::option::Option<&str> { - self.region_id.as_deref() - } - /// RFC3339 timestamp. - pub fn create_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.create_ts.as_ref() - } - /// RFC3339 timestamp. - pub fn start_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.start_ts.as_ref() - } - /// RFC3339 timestamp. - pub fn ready_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.ready_ts.as_ref() - } - /// A union representing the state of a lobby. - pub fn status(&self) -> std::option::Option<&crate::model::LogsLobbyStatus> { - self.status.as_ref() - } -} -impl std::fmt::Debug for LogsLobbySummary { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("LogsLobbySummary"); - formatter.field("lobby_id", &self.lobby_id); - formatter.field("namespace_id", &self.namespace_id); - formatter.field("lobby_group_name_id", &self.lobby_group_name_id); - formatter.field("region_id", &self.region_id); - formatter.field("create_ts", &self.create_ts); - formatter.field("start_ts", &self.start_ts); - formatter.field("ready_ts", &self.ready_ts); - formatter.field("status", &self.status); - formatter.finish() - } -} -/// See [`LogsLobbySummary`](crate::model::LogsLobbySummary) -pub mod logs_lobby_summary { - /// A builder for [`LogsLobbySummary`](crate::model::LogsLobbySummary) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) lobby_id: std::option::Option, - pub(crate) namespace_id: std::option::Option, - pub(crate) lobby_group_name_id: std::option::Option, - pub(crate) region_id: std::option::Option, - pub(crate) create_ts: std::option::Option, - pub(crate) start_ts: std::option::Option, - pub(crate) ready_ts: std::option::Option, - pub(crate) status: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn lobby_id(mut self, input: impl Into) -> Self { - self.lobby_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_lobby_id(mut self, input: std::option::Option) -> Self { - self.lobby_id = input; - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.namespace_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.namespace_id = input; - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn lobby_group_name_id(mut self, input: impl Into) -> Self { - self.lobby_group_name_id = Some(input.into()); - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn set_lobby_group_name_id( - mut self, - input: std::option::Option, - ) -> Self { - self.lobby_group_name_id = input; - self - } - /// A universally unique identifier. - pub fn region_id(mut self, input: impl Into) -> Self { - self.region_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_region_id(mut self, input: std::option::Option) -> Self { - self.region_id = input; - self - } - /// RFC3339 timestamp. - pub fn create_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.create_ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_create_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.create_ts = input; - self - } - /// RFC3339 timestamp. - pub fn start_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.start_ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_start_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.start_ts = input; - self - } - /// RFC3339 timestamp. - pub fn ready_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.ready_ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_ready_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.ready_ts = input; - self - } - /// A union representing the state of a lobby. - pub fn status(mut self, input: crate::model::LogsLobbyStatus) -> Self { - self.status = Some(input); - self - } - /// A union representing the state of a lobby. - pub fn set_status( - mut self, - input: std::option::Option, - ) -> Self { - self.status = input; - self - } - /// Consumes the builder and constructs a [`LogsLobbySummary`](crate::model::LogsLobbySummary) - pub fn build(self) -> crate::model::LogsLobbySummary { - crate::model::LogsLobbySummary { - lobby_id: self.lobby_id, - namespace_id: self.namespace_id, - lobby_group_name_id: self.lobby_group_name_id, - region_id: self.region_id, - create_ts: self.create_ts, - start_ts: self.start_ts, - ready_ts: self.ready_ts, - status: self.status, - } - } - } -} -impl LogsLobbySummary { - /// Creates a new builder-style object to manufacture [`LogsLobbySummary`](crate::model::LogsLobbySummary) - pub fn builder() -> crate::model::logs_lobby_summary::Builder { - crate::model::logs_lobby_summary::Builder::default() - } -} - -/// A union representing the state of a lobby. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] -pub enum LogsLobbyStatus { - /// A running lobby. - Running(crate::model::Unit), - /// The status of a stopped lobby. - Stopped(crate::model::LogsLobbyStatusStopped), - /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version. - /// An unknown enum variant - /// - /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._ - /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized - /// by the client. This can happen when the server adds new functionality, but the client has not been updated. - /// To investigate this, consider turning on debug logging to print the raw HTTP response. - #[non_exhaustive] - Unknown, -} -impl LogsLobbyStatus { - /// Tries to convert the enum instance into [`Running`](crate::model::LogsLobbyStatus::Running), extracting the inner [`Unit`](crate::model::Unit). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_running(&self) -> std::result::Result<&crate::model::Unit, &Self> { - if let LogsLobbyStatus::Running(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`Running`](crate::model::LogsLobbyStatus::Running). - pub fn is_running(&self) -> bool { - self.as_running().is_ok() - } - /// Tries to convert the enum instance into [`Stopped`](crate::model::LogsLobbyStatus::Stopped), extracting the inner [`LogsLobbyStatusStopped`](crate::model::LogsLobbyStatusStopped). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_stopped(&self) -> std::result::Result<&crate::model::LogsLobbyStatusStopped, &Self> { - if let LogsLobbyStatus::Stopped(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`Stopped`](crate::model::LogsLobbyStatus::Stopped). - pub fn is_stopped(&self) -> bool { - self.as_stopped().is_ok() - } - /// Returns true if the enum instance is the `Unknown` variant. - pub fn is_unknown(&self) -> bool { - matches!(self, Self::Unknown) - } -} - -/// The status of a stopped lobby. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct LogsLobbyStatusStopped { - /// RFC3339 timestamp. - pub stop_ts: std::option::Option, - /// Whether or not the lobby failed or stopped successfully. - pub failed: std::option::Option, - /// The exit code returned by the lobby's main process when stopped. - pub exit_code: std::option::Option, -} -impl LogsLobbyStatusStopped { - /// RFC3339 timestamp. - pub fn stop_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.stop_ts.as_ref() - } - /// Whether or not the lobby failed or stopped successfully. - pub fn failed(&self) -> std::option::Option { - self.failed - } - /// The exit code returned by the lobby's main process when stopped. - pub fn exit_code(&self) -> std::option::Option { - self.exit_code - } -} -impl std::fmt::Debug for LogsLobbyStatusStopped { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("LogsLobbyStatusStopped"); - formatter.field("stop_ts", &self.stop_ts); - formatter.field("failed", &self.failed); - formatter.field("exit_code", &self.exit_code); - formatter.finish() - } -} -/// See [`LogsLobbyStatusStopped`](crate::model::LogsLobbyStatusStopped) -pub mod logs_lobby_status_stopped { - /// A builder for [`LogsLobbyStatusStopped`](crate::model::LogsLobbyStatusStopped) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) stop_ts: std::option::Option, - pub(crate) failed: std::option::Option, - pub(crate) exit_code: std::option::Option, - } - impl Builder { - /// RFC3339 timestamp. - pub fn stop_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.stop_ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_stop_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.stop_ts = input; - self - } - /// Whether or not the lobby failed or stopped successfully. - pub fn failed(mut self, input: bool) -> Self { - self.failed = Some(input); - self - } - /// Whether or not the lobby failed or stopped successfully. - pub fn set_failed(mut self, input: std::option::Option) -> Self { - self.failed = input; - self - } - /// The exit code returned by the lobby's main process when stopped. - pub fn exit_code(mut self, input: i32) -> Self { - self.exit_code = Some(input); - self - } - /// The exit code returned by the lobby's main process when stopped. - pub fn set_exit_code(mut self, input: std::option::Option) -> Self { - self.exit_code = input; - self - } - /// Consumes the builder and constructs a [`LogsLobbyStatusStopped`](crate::model::LogsLobbyStatusStopped) - pub fn build(self) -> crate::model::LogsLobbyStatusStopped { - crate::model::LogsLobbyStatusStopped { - stop_ts: self.stop_ts, - failed: self.failed, - exit_code: self.exit_code, - } - } - } -} -impl LogsLobbyStatusStopped { - /// Creates a new builder-style object to manufacture [`LogsLobbyStatusStopped`](crate::model::LogsLobbyStatusStopped) - pub fn builder() -> crate::model::logs_lobby_status_stopped::Builder { - crate::model::logs_lobby_status_stopped::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct Unit {} -impl std::fmt::Debug for Unit { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("Unit"); - formatter.finish() - } -} -/// See [`Unit`](crate::model::Unit) -pub mod unit { - /// A builder for [`Unit`](crate::model::Unit) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`Unit`](crate::model::Unit) - pub fn build(self) -> crate::model::Unit { - crate::model::Unit {} - } - } -} -impl Unit { - /// Creates a new builder-style object to manufacture [`Unit`](crate::model::Unit) - pub fn builder() -> crate::model::unit::Builder { - crate::model::unit::Builder::default() - } -} - -/// Analyical information about a lobby. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct AnalyticsLobbySummary { - /// A universally unique identifier. - pub lobby_id: std::option::Option, - /// A universally unique identifier. - pub lobby_group_id: std::option::Option, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub lobby_group_name_id: std::option::Option, - /// A universally unique identifier. - pub region_id: std::option::Option, - /// RFC3339 timestamp. - pub create_ts: std::option::Option, - /// Whether or not this lobby is ready. - pub is_ready: std::option::Option, - /// Whether or not this lobby is idle. - pub is_idle: std::option::Option, - /// Whether or not this lobby is in a closed state. - pub is_closed: std::option::Option, - /// Whether or not this lobby is outdated. - pub is_outdated: std::option::Option, - /// Unsigned 32 bit integer. - pub max_players_normal: std::option::Option, - /// Unsigned 32 bit integer. - pub max_players_direct: std::option::Option, - /// Unsigned 32 bit integer. - pub max_players_party: std::option::Option, - /// Unsigned 32 bit integer. - pub total_player_count: std::option::Option, - /// Unsigned 32 bit integer. - pub registered_player_count: std::option::Option, -} -impl AnalyticsLobbySummary { - /// A universally unique identifier. - pub fn lobby_id(&self) -> std::option::Option<&str> { - self.lobby_id.as_deref() - } - /// A universally unique identifier. - pub fn lobby_group_id(&self) -> std::option::Option<&str> { - self.lobby_group_id.as_deref() - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn lobby_group_name_id(&self) -> std::option::Option<&str> { - self.lobby_group_name_id.as_deref() - } - /// A universally unique identifier. - pub fn region_id(&self) -> std::option::Option<&str> { - self.region_id.as_deref() - } - /// RFC3339 timestamp. - pub fn create_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.create_ts.as_ref() - } - /// Whether or not this lobby is ready. - pub fn is_ready(&self) -> std::option::Option { - self.is_ready - } - /// Whether or not this lobby is idle. - pub fn is_idle(&self) -> std::option::Option { - self.is_idle - } - /// Whether or not this lobby is in a closed state. - pub fn is_closed(&self) -> std::option::Option { - self.is_closed - } - /// Whether or not this lobby is outdated. - pub fn is_outdated(&self) -> std::option::Option { - self.is_outdated - } - /// Unsigned 32 bit integer. - pub fn max_players_normal(&self) -> std::option::Option { - self.max_players_normal - } - /// Unsigned 32 bit integer. - pub fn max_players_direct(&self) -> std::option::Option { - self.max_players_direct - } - /// Unsigned 32 bit integer. - pub fn max_players_party(&self) -> std::option::Option { - self.max_players_party - } - /// Unsigned 32 bit integer. - pub fn total_player_count(&self) -> std::option::Option { - self.total_player_count - } - /// Unsigned 32 bit integer. - pub fn registered_player_count(&self) -> std::option::Option { - self.registered_player_count - } -} -impl std::fmt::Debug for AnalyticsLobbySummary { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("AnalyticsLobbySummary"); - formatter.field("lobby_id", &self.lobby_id); - formatter.field("lobby_group_id", &self.lobby_group_id); - formatter.field("lobby_group_name_id", &self.lobby_group_name_id); - formatter.field("region_id", &self.region_id); - formatter.field("create_ts", &self.create_ts); - formatter.field("is_ready", &self.is_ready); - formatter.field("is_idle", &self.is_idle); - formatter.field("is_closed", &self.is_closed); - formatter.field("is_outdated", &self.is_outdated); - formatter.field("max_players_normal", &self.max_players_normal); - formatter.field("max_players_direct", &self.max_players_direct); - formatter.field("max_players_party", &self.max_players_party); - formatter.field("total_player_count", &self.total_player_count); - formatter.field("registered_player_count", &self.registered_player_count); - formatter.finish() - } -} -/// See [`AnalyticsLobbySummary`](crate::model::AnalyticsLobbySummary) -pub mod analytics_lobby_summary { - /// A builder for [`AnalyticsLobbySummary`](crate::model::AnalyticsLobbySummary) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) lobby_id: std::option::Option, - pub(crate) lobby_group_id: std::option::Option, - pub(crate) lobby_group_name_id: std::option::Option, - pub(crate) region_id: std::option::Option, - pub(crate) create_ts: std::option::Option, - pub(crate) is_ready: std::option::Option, - pub(crate) is_idle: std::option::Option, - pub(crate) is_closed: std::option::Option, - pub(crate) is_outdated: std::option::Option, - pub(crate) max_players_normal: std::option::Option, - pub(crate) max_players_direct: std::option::Option, - pub(crate) max_players_party: std::option::Option, - pub(crate) total_player_count: std::option::Option, - pub(crate) registered_player_count: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn lobby_id(mut self, input: impl Into) -> Self { - self.lobby_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_lobby_id(mut self, input: std::option::Option) -> Self { - self.lobby_id = input; - self - } - /// A universally unique identifier. - pub fn lobby_group_id(mut self, input: impl Into) -> Self { - self.lobby_group_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_lobby_group_id( - mut self, - input: std::option::Option, - ) -> Self { - self.lobby_group_id = input; - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn lobby_group_name_id(mut self, input: impl Into) -> Self { - self.lobby_group_name_id = Some(input.into()); - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn set_lobby_group_name_id( - mut self, - input: std::option::Option, - ) -> Self { - self.lobby_group_name_id = input; - self - } - /// A universally unique identifier. - pub fn region_id(mut self, input: impl Into) -> Self { - self.region_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_region_id(mut self, input: std::option::Option) -> Self { - self.region_id = input; - self - } - /// RFC3339 timestamp. - pub fn create_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.create_ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_create_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.create_ts = input; - self - } - /// Whether or not this lobby is ready. - pub fn is_ready(mut self, input: bool) -> Self { - self.is_ready = Some(input); - self - } - /// Whether or not this lobby is ready. - pub fn set_is_ready(mut self, input: std::option::Option) -> Self { - self.is_ready = input; - self - } - /// Whether or not this lobby is idle. - pub fn is_idle(mut self, input: bool) -> Self { - self.is_idle = Some(input); - self - } - /// Whether or not this lobby is idle. - pub fn set_is_idle(mut self, input: std::option::Option) -> Self { - self.is_idle = input; - self - } - /// Whether or not this lobby is in a closed state. - pub fn is_closed(mut self, input: bool) -> Self { - self.is_closed = Some(input); - self - } - /// Whether or not this lobby is in a closed state. - pub fn set_is_closed(mut self, input: std::option::Option) -> Self { - self.is_closed = input; - self - } - /// Whether or not this lobby is outdated. - pub fn is_outdated(mut self, input: bool) -> Self { - self.is_outdated = Some(input); - self - } - /// Whether or not this lobby is outdated. - pub fn set_is_outdated(mut self, input: std::option::Option) -> Self { - self.is_outdated = input; - self - } - /// Unsigned 32 bit integer. - pub fn max_players_normal(mut self, input: i32) -> Self { - self.max_players_normal = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_max_players_normal(mut self, input: std::option::Option) -> Self { - self.max_players_normal = input; - self - } - /// Unsigned 32 bit integer. - pub fn max_players_direct(mut self, input: i32) -> Self { - self.max_players_direct = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_max_players_direct(mut self, input: std::option::Option) -> Self { - self.max_players_direct = input; - self - } - /// Unsigned 32 bit integer. - pub fn max_players_party(mut self, input: i32) -> Self { - self.max_players_party = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_max_players_party(mut self, input: std::option::Option) -> Self { - self.max_players_party = input; - self - } - /// Unsigned 32 bit integer. - pub fn total_player_count(mut self, input: i32) -> Self { - self.total_player_count = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_total_player_count(mut self, input: std::option::Option) -> Self { - self.total_player_count = input; - self - } - /// Unsigned 32 bit integer. - pub fn registered_player_count(mut self, input: i32) -> Self { - self.registered_player_count = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_registered_player_count(mut self, input: std::option::Option) -> Self { - self.registered_player_count = input; - self - } - /// Consumes the builder and constructs a [`AnalyticsLobbySummary`](crate::model::AnalyticsLobbySummary) - pub fn build(self) -> crate::model::AnalyticsLobbySummary { - crate::model::AnalyticsLobbySummary { - lobby_id: self.lobby_id, - lobby_group_id: self.lobby_group_id, - lobby_group_name_id: self.lobby_group_name_id, - region_id: self.region_id, - create_ts: self.create_ts, - is_ready: self.is_ready, - is_idle: self.is_idle, - is_closed: self.is_closed, - is_outdated: self.is_outdated, - max_players_normal: self.max_players_normal, - max_players_direct: self.max_players_direct, - max_players_party: self.max_players_party, - total_player_count: self.total_player_count, - registered_player_count: self.registered_player_count, - } - } - } -} -impl AnalyticsLobbySummary { - /// Creates a new builder-style object to manufacture [`AnalyticsLobbySummary`](crate::model::AnalyticsLobbySummary) - pub fn builder() -> crate::model::analytics_lobby_summary::Builder { - crate::model::analytics_lobby_summary::Builder::default() - } -} - -/// A value denoting what type of authentication to use for a game namespace's CDN. -#[non_exhaustive] -#[derive( - std::clone::Clone, - std::cmp::Eq, - std::cmp::Ord, - std::cmp::PartialEq, - std::cmp::PartialOrd, - std::fmt::Debug, - std::hash::Hash, -)] -pub enum CdnAuthType { - #[allow(missing_docs)] // documentation missing in model - Basic, - #[allow(missing_docs)] // documentation missing in model - None, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for CdnAuthType { - fn from(s: &str) -> Self { - match s { - "basic" => CdnAuthType::Basic, - "none" => CdnAuthType::None, - other => CdnAuthType::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for CdnAuthType { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(CdnAuthType::from(s)) - } -} -impl CdnAuthType { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - CdnAuthType::Basic => "basic", - CdnAuthType::None => "none", - CdnAuthType::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["basic", "none"] - } -} -impl AsRef for CdnAuthType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// A docker port. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct LobbyGroupRuntimeDockerPort { - /// The label of this docker port. - pub label: std::option::Option, - /// The port number to connect to. - pub target_port: std::option::Option, - /// The port range to connect to for UDP. - pub port_range: std::option::Option, - /// A proxy protocol. - pub proxy_protocol: std::option::Option, -} -impl LobbyGroupRuntimeDockerPort { - /// The label of this docker port. - pub fn label(&self) -> std::option::Option<&str> { - self.label.as_deref() - } - /// The port number to connect to. - pub fn target_port(&self) -> std::option::Option { - self.target_port - } - /// The port range to connect to for UDP. - pub fn port_range(&self) -> std::option::Option<&crate::model::PortRange> { - self.port_range.as_ref() - } - /// A proxy protocol. - pub fn proxy_protocol(&self) -> std::option::Option<&crate::model::ProxyProtocol> { - self.proxy_protocol.as_ref() - } -} -impl std::fmt::Debug for LobbyGroupRuntimeDockerPort { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("LobbyGroupRuntimeDockerPort"); - formatter.field("label", &self.label); - formatter.field("target_port", &self.target_port); - formatter.field("port_range", &self.port_range); - formatter.field("proxy_protocol", &self.proxy_protocol); - formatter.finish() - } -} -/// See [`LobbyGroupRuntimeDockerPort`](crate::model::LobbyGroupRuntimeDockerPort) -pub mod lobby_group_runtime_docker_port { - /// A builder for [`LobbyGroupRuntimeDockerPort`](crate::model::LobbyGroupRuntimeDockerPort) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) label: std::option::Option, - pub(crate) target_port: std::option::Option, - pub(crate) port_range: std::option::Option, - pub(crate) proxy_protocol: std::option::Option, - } - impl Builder { - /// The label of this docker port. - pub fn label(mut self, input: impl Into) -> Self { - self.label = Some(input.into()); - self - } - /// The label of this docker port. - pub fn set_label(mut self, input: std::option::Option) -> Self { - self.label = input; - self - } - /// The port number to connect to. - pub fn target_port(mut self, input: i32) -> Self { - self.target_port = Some(input); - self - } - /// The port number to connect to. - pub fn set_target_port(mut self, input: std::option::Option) -> Self { - self.target_port = input; - self - } - /// The port range to connect to for UDP. - pub fn port_range(mut self, input: crate::model::PortRange) -> Self { - self.port_range = Some(input); - self - } - /// The port range to connect to for UDP. - pub fn set_port_range( - mut self, - input: std::option::Option, - ) -> Self { - self.port_range = input; - self - } - /// A proxy protocol. - pub fn proxy_protocol(mut self, input: crate::model::ProxyProtocol) -> Self { - self.proxy_protocol = Some(input); - self - } - /// A proxy protocol. - pub fn set_proxy_protocol( - mut self, - input: std::option::Option, - ) -> Self { - self.proxy_protocol = input; - self - } - /// Consumes the builder and constructs a [`LobbyGroupRuntimeDockerPort`](crate::model::LobbyGroupRuntimeDockerPort) - pub fn build(self) -> crate::model::LobbyGroupRuntimeDockerPort { - crate::model::LobbyGroupRuntimeDockerPort { - label: self.label, - target_port: self.target_port, - port_range: self.port_range, - proxy_protocol: self.proxy_protocol, - } - } - } -} -impl LobbyGroupRuntimeDockerPort { - /// Creates a new builder-style object to manufacture [`LobbyGroupRuntimeDockerPort`](crate::model::LobbyGroupRuntimeDockerPort) - pub fn builder() -> crate::model::lobby_group_runtime_docker_port::Builder { - crate::model::lobby_group_runtime_docker_port::Builder::default() - } -} - -/// A proxy protocol. -#[non_exhaustive] -#[derive( - std::clone::Clone, - std::cmp::Eq, - std::cmp::Ord, - std::cmp::PartialEq, - std::cmp::PartialOrd, - std::fmt::Debug, - std::hash::Hash, -)] -pub enum ProxyProtocol { - #[allow(missing_docs)] // documentation missing in model - Http, - #[allow(missing_docs)] // documentation missing in model - Https, - #[allow(missing_docs)] // documentation missing in model - Udp, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for ProxyProtocol { - fn from(s: &str) -> Self { - match s { - "http" => ProxyProtocol::Http, - "https" => ProxyProtocol::Https, - "udp" => ProxyProtocol::Udp, - other => ProxyProtocol::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for ProxyProtocol { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(ProxyProtocol::from(s)) - } -} -impl ProxyProtocol { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - ProxyProtocol::Http => "http", - ProxyProtocol::Https => "https", - ProxyProtocol::Udp => "udp", - ProxyProtocol::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["http", "https", "udp"] - } -} -impl AsRef for ProxyProtocol { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// Range of ports that can be connected to. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PortRange { - /// Unsigned 32 bit integer. - pub min: std::option::Option, - /// Unsigned 32 bit integer. - pub max: std::option::Option, -} -impl PortRange { - /// Unsigned 32 bit integer. - pub fn min(&self) -> std::option::Option { - self.min - } - /// Unsigned 32 bit integer. - pub fn max(&self) -> std::option::Option { - self.max - } -} -impl std::fmt::Debug for PortRange { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PortRange"); - formatter.field("min", &self.min); - formatter.field("max", &self.max); - formatter.finish() - } -} -/// See [`PortRange`](crate::model::PortRange) -pub mod port_range { - /// A builder for [`PortRange`](crate::model::PortRange) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) min: std::option::Option, - pub(crate) max: std::option::Option, - } - impl Builder { - /// Unsigned 32 bit integer. - pub fn min(mut self, input: i32) -> Self { - self.min = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_min(mut self, input: std::option::Option) -> Self { - self.min = input; - self - } - /// Unsigned 32 bit integer. - pub fn max(mut self, input: i32) -> Self { - self.max = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_max(mut self, input: std::option::Option) -> Self { - self.max = input; - self - } - /// Consumes the builder and constructs a [`PortRange`](crate::model::PortRange) - pub fn build(self) -> crate::model::PortRange { - crate::model::PortRange { - min: self.min, - max: self.max, - } - } - } -} -impl PortRange { - /// Creates a new builder-style object to manufacture [`PortRange`](crate::model::PortRange) - pub fn builder() -> crate::model::port_range::Builder { - crate::model::port_range::Builder::default() - } -} - -/// A full namespace. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct NamespaceFull { - /// A universally unique identifier. - pub namespace_id: std::option::Option, - /// RFC3339 timestamp. - pub create_ts: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// A universally unique identifier. - pub version_id: std::option::Option, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub name_id: std::option::Option, - /// Cloud configuration for a given namespace. - pub config: std::option::Option, -} -impl NamespaceFull { - /// A universally unique identifier. - pub fn namespace_id(&self) -> std::option::Option<&str> { - self.namespace_id.as_deref() - } - /// RFC3339 timestamp. - pub fn create_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.create_ts.as_ref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// A universally unique identifier. - pub fn version_id(&self) -> std::option::Option<&str> { - self.version_id.as_deref() - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn name_id(&self) -> std::option::Option<&str> { - self.name_id.as_deref() - } - /// Cloud configuration for a given namespace. - pub fn config(&self) -> std::option::Option<&crate::model::CloudNamespaceConfig> { - self.config.as_ref() - } -} -impl std::fmt::Debug for NamespaceFull { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("NamespaceFull"); - formatter.field("namespace_id", &self.namespace_id); - formatter.field("create_ts", &self.create_ts); - formatter.field("display_name", &self.display_name); - formatter.field("version_id", &self.version_id); - formatter.field("name_id", &self.name_id); - formatter.field("config", &self.config); - formatter.finish() - } -} -/// See [`NamespaceFull`](crate::model::NamespaceFull) -pub mod namespace_full { - /// A builder for [`NamespaceFull`](crate::model::NamespaceFull) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) namespace_id: std::option::Option, - pub(crate) create_ts: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) version_id: std::option::Option, - pub(crate) name_id: std::option::Option, - pub(crate) config: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.namespace_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.namespace_id = input; - self - } - /// RFC3339 timestamp. - pub fn create_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.create_ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_create_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.create_ts = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// A universally unique identifier. - pub fn version_id(mut self, input: impl Into) -> Self { - self.version_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_version_id(mut self, input: std::option::Option) -> Self { - self.version_id = input; - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn name_id(mut self, input: impl Into) -> Self { - self.name_id = Some(input.into()); - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn set_name_id(mut self, input: std::option::Option) -> Self { - self.name_id = input; - self - } - /// Cloud configuration for a given namespace. - pub fn config(mut self, input: crate::model::CloudNamespaceConfig) -> Self { - self.config = Some(input); - self - } - /// Cloud configuration for a given namespace. - pub fn set_config( - mut self, - input: std::option::Option, - ) -> Self { - self.config = input; - self - } - /// Consumes the builder and constructs a [`NamespaceFull`](crate::model::NamespaceFull) - pub fn build(self) -> crate::model::NamespaceFull { - crate::model::NamespaceFull { - namespace_id: self.namespace_id, - create_ts: self.create_ts, - display_name: self.display_name, - version_id: self.version_id, - name_id: self.name_id, - config: self.config, - } - } - } -} -impl NamespaceFull { - /// Creates a new builder-style object to manufacture [`NamespaceFull`](crate::model::NamespaceFull) - pub fn builder() -> crate::model::namespace_full::Builder { - crate::model::namespace_full::Builder::default() - } -} - -/// Cloud configuration for a given namespace. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CloudNamespaceConfig { - /// CDN configuration for a given namespace. - pub cdn: std::option::Option, - /// Matchmaker configuration for a given namespace. - pub matchmaker: std::option::Option, - /// KV configuration for a given namespace. - pub kv: std::option::Option, - /// Identity configuration for a given namespace. - pub identity: std::option::Option, -} -impl CloudNamespaceConfig { - /// CDN configuration for a given namespace. - pub fn cdn(&self) -> std::option::Option<&crate::model::CdnNamespaceConfig> { - self.cdn.as_ref() - } - /// Matchmaker configuration for a given namespace. - pub fn matchmaker(&self) -> std::option::Option<&crate::model::MatchmakerNamespaceConfig> { - self.matchmaker.as_ref() - } - /// KV configuration for a given namespace. - pub fn kv(&self) -> std::option::Option<&crate::model::KvNamespaceConfig> { - self.kv.as_ref() - } - /// Identity configuration for a given namespace. - pub fn identity(&self) -> std::option::Option<&crate::model::IdentityNamespaceConfig> { - self.identity.as_ref() - } -} -impl std::fmt::Debug for CloudNamespaceConfig { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CloudNamespaceConfig"); - formatter.field("cdn", &self.cdn); - formatter.field("matchmaker", &self.matchmaker); - formatter.field("kv", &self.kv); - formatter.field("identity", &self.identity); - formatter.finish() - } -} -/// See [`CloudNamespaceConfig`](crate::model::CloudNamespaceConfig) -pub mod cloud_namespace_config { - /// A builder for [`CloudNamespaceConfig`](crate::model::CloudNamespaceConfig) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) cdn: std::option::Option, - pub(crate) matchmaker: std::option::Option, - pub(crate) kv: std::option::Option, - pub(crate) identity: std::option::Option, - } - impl Builder { - /// CDN configuration for a given namespace. - pub fn cdn(mut self, input: crate::model::CdnNamespaceConfig) -> Self { - self.cdn = Some(input); - self - } - /// CDN configuration for a given namespace. - pub fn set_cdn( - mut self, - input: std::option::Option, - ) -> Self { - self.cdn = input; - self - } - /// Matchmaker configuration for a given namespace. - pub fn matchmaker(mut self, input: crate::model::MatchmakerNamespaceConfig) -> Self { - self.matchmaker = Some(input); - self - } - /// Matchmaker configuration for a given namespace. - pub fn set_matchmaker( - mut self, - input: std::option::Option, - ) -> Self { - self.matchmaker = input; - self - } - /// KV configuration for a given namespace. - pub fn kv(mut self, input: crate::model::KvNamespaceConfig) -> Self { - self.kv = Some(input); - self - } - /// KV configuration for a given namespace. - pub fn set_kv( - mut self, - input: std::option::Option, - ) -> Self { - self.kv = input; - self - } - /// Identity configuration for a given namespace. - pub fn identity(mut self, input: crate::model::IdentityNamespaceConfig) -> Self { - self.identity = Some(input); - self - } - /// Identity configuration for a given namespace. - pub fn set_identity( - mut self, - input: std::option::Option, - ) -> Self { - self.identity = input; - self - } - /// Consumes the builder and constructs a [`CloudNamespaceConfig`](crate::model::CloudNamespaceConfig) - pub fn build(self) -> crate::model::CloudNamespaceConfig { - crate::model::CloudNamespaceConfig { - cdn: self.cdn, - matchmaker: self.matchmaker, - kv: self.kv, - identity: self.identity, - } - } - } -} -impl CloudNamespaceConfig { - /// Creates a new builder-style object to manufacture [`CloudNamespaceConfig`](crate::model::CloudNamespaceConfig) - pub fn builder() -> crate::model::cloud_namespace_config::Builder { - crate::model::cloud_namespace_config::Builder::default() - } -} - -/// Identity configuration for a given namespace. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct IdentityNamespaceConfig {} -impl std::fmt::Debug for IdentityNamespaceConfig { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("IdentityNamespaceConfig"); - formatter.finish() - } -} -/// See [`IdentityNamespaceConfig`](crate::model::IdentityNamespaceConfig) -pub mod identity_namespace_config { - /// A builder for [`IdentityNamespaceConfig`](crate::model::IdentityNamespaceConfig) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`IdentityNamespaceConfig`](crate::model::IdentityNamespaceConfig) - pub fn build(self) -> crate::model::IdentityNamespaceConfig { - crate::model::IdentityNamespaceConfig {} - } - } -} -impl IdentityNamespaceConfig { - /// Creates a new builder-style object to manufacture [`IdentityNamespaceConfig`](crate::model::IdentityNamespaceConfig) - pub fn builder() -> crate::model::identity_namespace_config::Builder { - crate::model::identity_namespace_config::Builder::default() - } -} - -/// KV configuration for a given namespace. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct KvNamespaceConfig {} -impl std::fmt::Debug for KvNamespaceConfig { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("KvNamespaceConfig"); - formatter.finish() - } -} -/// See [`KvNamespaceConfig`](crate::model::KvNamespaceConfig) -pub mod kv_namespace_config { - /// A builder for [`KvNamespaceConfig`](crate::model::KvNamespaceConfig) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`KvNamespaceConfig`](crate::model::KvNamespaceConfig) - pub fn build(self) -> crate::model::KvNamespaceConfig { - crate::model::KvNamespaceConfig {} - } - } -} -impl KvNamespaceConfig { - /// Creates a new builder-style object to manufacture [`KvNamespaceConfig`](crate::model::KvNamespaceConfig) - pub fn builder() -> crate::model::kv_namespace_config::Builder { - crate::model::kv_namespace_config::Builder::default() - } -} - -/// Matchmaker configuration for a given namespace. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct MatchmakerNamespaceConfig { - /// Unsigned 32 bit integer. - pub lobby_count_max: std::option::Option, - /// Unsigned 32 bit integer. - pub max_players_per_client: std::option::Option, - /// Unsigned 32 bit integer. - pub max_players_per_client_vpn: std::option::Option, - /// Unsigned 32 bit integer. - pub max_players_per_client_proxy: std::option::Option, - /// Unsigned 32 bit integer. - pub max_players_per_client_tor: std::option::Option, - /// Unsigned 32 bit integer. - pub max_players_per_client_hosting: std::option::Option, -} -impl MatchmakerNamespaceConfig { - /// Unsigned 32 bit integer. - pub fn lobby_count_max(&self) -> std::option::Option { - self.lobby_count_max - } - /// Unsigned 32 bit integer. - pub fn max_players_per_client(&self) -> std::option::Option { - self.max_players_per_client - } - /// Unsigned 32 bit integer. - pub fn max_players_per_client_vpn(&self) -> std::option::Option { - self.max_players_per_client_vpn - } - /// Unsigned 32 bit integer. - pub fn max_players_per_client_proxy(&self) -> std::option::Option { - self.max_players_per_client_proxy - } - /// Unsigned 32 bit integer. - pub fn max_players_per_client_tor(&self) -> std::option::Option { - self.max_players_per_client_tor - } - /// Unsigned 32 bit integer. - pub fn max_players_per_client_hosting(&self) -> std::option::Option { - self.max_players_per_client_hosting - } -} -impl std::fmt::Debug for MatchmakerNamespaceConfig { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("MatchmakerNamespaceConfig"); - formatter.field("lobby_count_max", &self.lobby_count_max); - formatter.field("max_players_per_client", &self.max_players_per_client); - formatter.field( - "max_players_per_client_vpn", - &self.max_players_per_client_vpn, - ); - formatter.field( - "max_players_per_client_proxy", - &self.max_players_per_client_proxy, - ); - formatter.field( - "max_players_per_client_tor", - &self.max_players_per_client_tor, - ); - formatter.field( - "max_players_per_client_hosting", - &self.max_players_per_client_hosting, - ); - formatter.finish() - } -} -/// See [`MatchmakerNamespaceConfig`](crate::model::MatchmakerNamespaceConfig) -pub mod matchmaker_namespace_config { - /// A builder for [`MatchmakerNamespaceConfig`](crate::model::MatchmakerNamespaceConfig) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) lobby_count_max: std::option::Option, - pub(crate) max_players_per_client: std::option::Option, - pub(crate) max_players_per_client_vpn: std::option::Option, - pub(crate) max_players_per_client_proxy: std::option::Option, - pub(crate) max_players_per_client_tor: std::option::Option, - pub(crate) max_players_per_client_hosting: std::option::Option, - } - impl Builder { - /// Unsigned 32 bit integer. - pub fn lobby_count_max(mut self, input: i32) -> Self { - self.lobby_count_max = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_lobby_count_max(mut self, input: std::option::Option) -> Self { - self.lobby_count_max = input; - self - } - /// Unsigned 32 bit integer. - pub fn max_players_per_client(mut self, input: i32) -> Self { - self.max_players_per_client = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_max_players_per_client(mut self, input: std::option::Option) -> Self { - self.max_players_per_client = input; - self - } - /// Unsigned 32 bit integer. - pub fn max_players_per_client_vpn(mut self, input: i32) -> Self { - self.max_players_per_client_vpn = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_max_players_per_client_vpn(mut self, input: std::option::Option) -> Self { - self.max_players_per_client_vpn = input; - self - } - /// Unsigned 32 bit integer. - pub fn max_players_per_client_proxy(mut self, input: i32) -> Self { - self.max_players_per_client_proxy = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_max_players_per_client_proxy(mut self, input: std::option::Option) -> Self { - self.max_players_per_client_proxy = input; - self - } - /// Unsigned 32 bit integer. - pub fn max_players_per_client_tor(mut self, input: i32) -> Self { - self.max_players_per_client_tor = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_max_players_per_client_tor(mut self, input: std::option::Option) -> Self { - self.max_players_per_client_tor = input; - self - } - /// Unsigned 32 bit integer. - pub fn max_players_per_client_hosting(mut self, input: i32) -> Self { - self.max_players_per_client_hosting = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_max_players_per_client_hosting( - mut self, - input: std::option::Option, - ) -> Self { - self.max_players_per_client_hosting = input; - self - } - /// Consumes the builder and constructs a [`MatchmakerNamespaceConfig`](crate::model::MatchmakerNamespaceConfig) - pub fn build(self) -> crate::model::MatchmakerNamespaceConfig { - crate::model::MatchmakerNamespaceConfig { - lobby_count_max: self.lobby_count_max, - max_players_per_client: self.max_players_per_client, - max_players_per_client_vpn: self.max_players_per_client_vpn, - max_players_per_client_proxy: self.max_players_per_client_proxy, - max_players_per_client_tor: self.max_players_per_client_tor, - max_players_per_client_hosting: self.max_players_per_client_hosting, - } - } - } -} -impl MatchmakerNamespaceConfig { - /// Creates a new builder-style object to manufacture [`MatchmakerNamespaceConfig`](crate::model::MatchmakerNamespaceConfig) - pub fn builder() -> crate::model::matchmaker_namespace_config::Builder { - crate::model::matchmaker_namespace_config::Builder::default() - } -} - -/// CDN configuration for a given namespace. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CdnNamespaceConfig { - /// Whether or not to allow users to connect to the given namespace via domain name. - pub enable_domain_public_auth: std::option::Option, - /// A list of CDN domains for a given namespace. - pub domains: std::option::Option>, - /// A value denoting what type of authentication to use for a game namespace's CDN. - pub auth_type: std::option::Option, - /// A list of CDN authenticated users for a given namespace. - pub auth_user_list: std::option::Option>, -} -impl CdnNamespaceConfig { - /// Whether or not to allow users to connect to the given namespace via domain name. - pub fn enable_domain_public_auth(&self) -> std::option::Option { - self.enable_domain_public_auth - } - /// A list of CDN domains for a given namespace. - pub fn domains(&self) -> std::option::Option<&[crate::model::CdnNamespaceDomain]> { - self.domains.as_deref() - } - /// A value denoting what type of authentication to use for a game namespace's CDN. - pub fn auth_type(&self) -> std::option::Option<&crate::model::CdnAuthType> { - self.auth_type.as_ref() - } - /// A list of CDN authenticated users for a given namespace. - pub fn auth_user_list(&self) -> std::option::Option<&[crate::model::CdnNamespaceAuthUser]> { - self.auth_user_list.as_deref() - } -} -impl std::fmt::Debug for CdnNamespaceConfig { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CdnNamespaceConfig"); - formatter.field("enable_domain_public_auth", &self.enable_domain_public_auth); - formatter.field("domains", &self.domains); - formatter.field("auth_type", &self.auth_type); - formatter.field("auth_user_list", &self.auth_user_list); - formatter.finish() - } -} -/// See [`CdnNamespaceConfig`](crate::model::CdnNamespaceConfig) -pub mod cdn_namespace_config { - /// A builder for [`CdnNamespaceConfig`](crate::model::CdnNamespaceConfig) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) enable_domain_public_auth: std::option::Option, - pub(crate) domains: std::option::Option>, - pub(crate) auth_type: std::option::Option, - pub(crate) auth_user_list: - std::option::Option>, - } - impl Builder { - /// Whether or not to allow users to connect to the given namespace via domain name. - pub fn enable_domain_public_auth(mut self, input: bool) -> Self { - self.enable_domain_public_auth = Some(input); - self - } - /// Whether or not to allow users to connect to the given namespace via domain name. - pub fn set_enable_domain_public_auth(mut self, input: std::option::Option) -> Self { - self.enable_domain_public_auth = input; - self - } - /// Appends an item to `domains`. - /// - /// To override the contents of this collection use [`set_domains`](Self::set_domains). - /// - /// A list of CDN domains for a given namespace. - pub fn domains(mut self, input: crate::model::CdnNamespaceDomain) -> Self { - let mut v = self.domains.unwrap_or_default(); - v.push(input); - self.domains = Some(v); - self - } - /// A list of CDN domains for a given namespace. - pub fn set_domains( - mut self, - input: std::option::Option>, - ) -> Self { - self.domains = input; - self - } - /// A value denoting what type of authentication to use for a game namespace's CDN. - pub fn auth_type(mut self, input: crate::model::CdnAuthType) -> Self { - self.auth_type = Some(input); - self - } - /// A value denoting what type of authentication to use for a game namespace's CDN. - pub fn set_auth_type( - mut self, - input: std::option::Option, - ) -> Self { - self.auth_type = input; - self - } - /// Appends an item to `auth_user_list`. - /// - /// To override the contents of this collection use [`set_auth_user_list`](Self::set_auth_user_list). - /// - /// A list of CDN authenticated users for a given namespace. - pub fn auth_user_list(mut self, input: crate::model::CdnNamespaceAuthUser) -> Self { - let mut v = self.auth_user_list.unwrap_or_default(); - v.push(input); - self.auth_user_list = Some(v); - self - } - /// A list of CDN authenticated users for a given namespace. - pub fn set_auth_user_list( - mut self, - input: std::option::Option>, - ) -> Self { - self.auth_user_list = input; - self - } - /// Consumes the builder and constructs a [`CdnNamespaceConfig`](crate::model::CdnNamespaceConfig) - pub fn build(self) -> crate::model::CdnNamespaceConfig { - crate::model::CdnNamespaceConfig { - enable_domain_public_auth: self.enable_domain_public_auth, - domains: self.domains, - auth_type: self.auth_type, - auth_user_list: self.auth_user_list, - } - } - } -} -impl CdnNamespaceConfig { - /// Creates a new builder-style object to manufacture [`CdnNamespaceConfig`](crate::model::CdnNamespaceConfig) - pub fn builder() -> crate::model::cdn_namespace_config::Builder { - crate::model::cdn_namespace_config::Builder::default() - } -} - -/// An authenticated CDN user for a given namespace. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CdnNamespaceAuthUser { - /// A user name. - pub user: std::option::Option, -} -impl CdnNamespaceAuthUser { - /// A user name. - pub fn user(&self) -> std::option::Option<&str> { - self.user.as_deref() - } -} -impl std::fmt::Debug for CdnNamespaceAuthUser { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CdnNamespaceAuthUser"); - formatter.field("user", &self.user); - formatter.finish() - } -} -/// See [`CdnNamespaceAuthUser`](crate::model::CdnNamespaceAuthUser) -pub mod cdn_namespace_auth_user { - /// A builder for [`CdnNamespaceAuthUser`](crate::model::CdnNamespaceAuthUser) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) user: std::option::Option, - } - impl Builder { - /// A user name. - pub fn user(mut self, input: impl Into) -> Self { - self.user = Some(input.into()); - self - } - /// A user name. - pub fn set_user(mut self, input: std::option::Option) -> Self { - self.user = input; - self - } - /// Consumes the builder and constructs a [`CdnNamespaceAuthUser`](crate::model::CdnNamespaceAuthUser) - pub fn build(self) -> crate::model::CdnNamespaceAuthUser { - crate::model::CdnNamespaceAuthUser { user: self.user } - } - } -} -impl CdnNamespaceAuthUser { - /// Creates a new builder-style object to manufacture [`CdnNamespaceAuthUser`](crate::model::CdnNamespaceAuthUser) - pub fn builder() -> crate::model::cdn_namespace_auth_user::Builder { - crate::model::cdn_namespace_auth_user::Builder::default() - } -} - -/// A CDN domain for a given namespace. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CdnNamespaceDomain { - /// A valid domain name (no protocol). - pub domain: std::option::Option, - /// RFC3339 timestamp. - pub create_ts: std::option::Option, - /// A value denoting the status of a CDN domain's verification status. - pub verification_status: - std::option::Option, - /// A union representing the verification method used for this CDN domain. - pub verification_method: - std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub verification_errors: std::option::Option>, -} -impl CdnNamespaceDomain { - /// A valid domain name (no protocol). - pub fn domain(&self) -> std::option::Option<&str> { - self.domain.as_deref() - } - /// RFC3339 timestamp. - pub fn create_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.create_ts.as_ref() - } - /// A value denoting the status of a CDN domain's verification status. - pub fn verification_status( - &self, - ) -> std::option::Option<&crate::model::CdnNamespaceDomainVerificationStatus> { - self.verification_status.as_ref() - } - /// A union representing the verification method used for this CDN domain. - pub fn verification_method( - &self, - ) -> std::option::Option<&crate::model::CdnNamespaceDomainVerificationMethod> { - self.verification_method.as_ref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn verification_errors(&self) -> std::option::Option<&[std::string::String]> { - self.verification_errors.as_deref() - } -} -impl std::fmt::Debug for CdnNamespaceDomain { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CdnNamespaceDomain"); - formatter.field("domain", &self.domain); - formatter.field("create_ts", &self.create_ts); - formatter.field("verification_status", &self.verification_status); - formatter.field("verification_method", &self.verification_method); - formatter.field("verification_errors", &self.verification_errors); - formatter.finish() - } -} -/// See [`CdnNamespaceDomain`](crate::model::CdnNamespaceDomain) -pub mod cdn_namespace_domain { - /// A builder for [`CdnNamespaceDomain`](crate::model::CdnNamespaceDomain) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) domain: std::option::Option, - pub(crate) create_ts: std::option::Option, - pub(crate) verification_status: - std::option::Option, - pub(crate) verification_method: - std::option::Option, - pub(crate) verification_errors: std::option::Option>, - } - impl Builder { - /// A valid domain name (no protocol). - pub fn domain(mut self, input: impl Into) -> Self { - self.domain = Some(input.into()); - self - } - /// A valid domain name (no protocol). - pub fn set_domain(mut self, input: std::option::Option) -> Self { - self.domain = input; - self - } - /// RFC3339 timestamp. - pub fn create_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.create_ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_create_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.create_ts = input; - self - } - /// A value denoting the status of a CDN domain's verification status. - pub fn verification_status( - mut self, - input: crate::model::CdnNamespaceDomainVerificationStatus, - ) -> Self { - self.verification_status = Some(input); - self - } - /// A value denoting the status of a CDN domain's verification status. - pub fn set_verification_status( - mut self, - input: std::option::Option, - ) -> Self { - self.verification_status = input; - self - } - /// A union representing the verification method used for this CDN domain. - pub fn verification_method( - mut self, - input: crate::model::CdnNamespaceDomainVerificationMethod, - ) -> Self { - self.verification_method = Some(input); - self - } - /// A union representing the verification method used for this CDN domain. - pub fn set_verification_method( - mut self, - input: std::option::Option, - ) -> Self { - self.verification_method = input; - self - } - /// Appends an item to `verification_errors`. - /// - /// To override the contents of this collection use [`set_verification_errors`](Self::set_verification_errors). - /// - pub fn verification_errors(mut self, input: impl Into) -> Self { - let mut v = self.verification_errors.unwrap_or_default(); - v.push(input.into()); - self.verification_errors = Some(v); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_verification_errors( - mut self, - input: std::option::Option>, - ) -> Self { - self.verification_errors = input; - self - } - /// Consumes the builder and constructs a [`CdnNamespaceDomain`](crate::model::CdnNamespaceDomain) - pub fn build(self) -> crate::model::CdnNamespaceDomain { - crate::model::CdnNamespaceDomain { - domain: self.domain, - create_ts: self.create_ts, - verification_status: self.verification_status, - verification_method: self.verification_method, - verification_errors: self.verification_errors, - } - } - } -} -impl CdnNamespaceDomain { - /// Creates a new builder-style object to manufacture [`CdnNamespaceDomain`](crate::model::CdnNamespaceDomain) - pub fn builder() -> crate::model::cdn_namespace_domain::Builder { - crate::model::cdn_namespace_domain::Builder::default() - } -} - -/// A union representing the verification method used for this CDN domain. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] -pub enum CdnNamespaceDomainVerificationMethod { - /// CDN Namespace domain verification method HTTP variant. - Http(crate::model::CdnNamespaceDomainVerificationMethodHttp), - /// CDN Namespace domain verification method variant denoting that this record is invalid. - Invalid(crate::model::CdnNamespaceDomainVerificationMethodInvalid), - /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version. - /// An unknown enum variant - /// - /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._ - /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized - /// by the client. This can happen when the server adds new functionality, but the client has not been updated. - /// To investigate this, consider turning on debug logging to print the raw HTTP response. - #[non_exhaustive] - Unknown, -} -impl CdnNamespaceDomainVerificationMethod { - /// Tries to convert the enum instance into [`Http`](crate::model::CdnNamespaceDomainVerificationMethod::Http), extracting the inner [`CdnNamespaceDomainVerificationMethodHttp`](crate::model::CdnNamespaceDomainVerificationMethodHttp). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_http( - &self, - ) -> std::result::Result<&crate::model::CdnNamespaceDomainVerificationMethodHttp, &Self> { - if let CdnNamespaceDomainVerificationMethod::Http(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`Http`](crate::model::CdnNamespaceDomainVerificationMethod::Http). - pub fn is_http(&self) -> bool { - self.as_http().is_ok() - } - /// Tries to convert the enum instance into [`Invalid`](crate::model::CdnNamespaceDomainVerificationMethod::Invalid), extracting the inner [`CdnNamespaceDomainVerificationMethodInvalid`](crate::model::CdnNamespaceDomainVerificationMethodInvalid). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_invalid( - &self, - ) -> std::result::Result<&crate::model::CdnNamespaceDomainVerificationMethodInvalid, &Self> { - if let CdnNamespaceDomainVerificationMethod::Invalid(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`Invalid`](crate::model::CdnNamespaceDomainVerificationMethod::Invalid). - pub fn is_invalid(&self) -> bool { - self.as_invalid().is_ok() - } - /// Returns true if the enum instance is the `Unknown` variant. - pub fn is_unknown(&self) -> bool { - matches!(self, Self::Unknown) - } -} - -/// CDN Namespace domain verification method HTTP variant. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CdnNamespaceDomainVerificationMethodHttp { - /// The CNAME record this domain should point to. - pub cname_record: std::option::Option, -} -impl CdnNamespaceDomainVerificationMethodHttp { - /// The CNAME record this domain should point to. - pub fn cname_record(&self) -> std::option::Option<&str> { - self.cname_record.as_deref() - } -} -impl std::fmt::Debug for CdnNamespaceDomainVerificationMethodHttp { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CdnNamespaceDomainVerificationMethodHttp"); - formatter.field("cname_record", &self.cname_record); - formatter.finish() - } -} -/// See [`CdnNamespaceDomainVerificationMethodHttp`](crate::model::CdnNamespaceDomainVerificationMethodHttp) -pub mod cdn_namespace_domain_verification_method_http { - /// A builder for [`CdnNamespaceDomainVerificationMethodHttp`](crate::model::CdnNamespaceDomainVerificationMethodHttp) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) cname_record: std::option::Option, - } - impl Builder { - /// The CNAME record this domain should point to. - pub fn cname_record(mut self, input: impl Into) -> Self { - self.cname_record = Some(input.into()); - self - } - /// The CNAME record this domain should point to. - pub fn set_cname_record(mut self, input: std::option::Option) -> Self { - self.cname_record = input; - self - } - /// Consumes the builder and constructs a [`CdnNamespaceDomainVerificationMethodHttp`](crate::model::CdnNamespaceDomainVerificationMethodHttp) - pub fn build(self) -> crate::model::CdnNamespaceDomainVerificationMethodHttp { - crate::model::CdnNamespaceDomainVerificationMethodHttp { - cname_record: self.cname_record, - } - } - } -} -impl CdnNamespaceDomainVerificationMethodHttp { - /// Creates a new builder-style object to manufacture [`CdnNamespaceDomainVerificationMethodHttp`](crate::model::CdnNamespaceDomainVerificationMethodHttp) - pub fn builder() -> crate::model::cdn_namespace_domain_verification_method_http::Builder { - crate::model::cdn_namespace_domain_verification_method_http::Builder::default() - } -} - -/// CDN Namespace domain verification method variant denoting that this record is invalid. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CdnNamespaceDomainVerificationMethodInvalid {} -impl std::fmt::Debug for CdnNamespaceDomainVerificationMethodInvalid { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CdnNamespaceDomainVerificationMethodInvalid"); - formatter.finish() - } -} -/// See [`CdnNamespaceDomainVerificationMethodInvalid`](crate::model::CdnNamespaceDomainVerificationMethodInvalid) -pub mod cdn_namespace_domain_verification_method_invalid { - /// A builder for [`CdnNamespaceDomainVerificationMethodInvalid`](crate::model::CdnNamespaceDomainVerificationMethodInvalid) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`CdnNamespaceDomainVerificationMethodInvalid`](crate::model::CdnNamespaceDomainVerificationMethodInvalid) - pub fn build(self) -> crate::model::CdnNamespaceDomainVerificationMethodInvalid { - crate::model::CdnNamespaceDomainVerificationMethodInvalid {} - } - } -} -impl CdnNamespaceDomainVerificationMethodInvalid { - /// Creates a new builder-style object to manufacture [`CdnNamespaceDomainVerificationMethodInvalid`](crate::model::CdnNamespaceDomainVerificationMethodInvalid) - pub fn builder() -> crate::model::cdn_namespace_domain_verification_method_invalid::Builder { - crate::model::cdn_namespace_domain_verification_method_invalid::Builder::default() - } -} - -/// A value denoting the status of a CDN domain's verification status. -#[non_exhaustive] -#[derive( - std::clone::Clone, - std::cmp::Eq, - std::cmp::Ord, - std::cmp::PartialEq, - std::cmp::PartialOrd, - std::fmt::Debug, - std::hash::Hash, -)] -pub enum CdnNamespaceDomainVerificationStatus { - #[allow(missing_docs)] // documentation missing in model - Active, - #[allow(missing_docs)] // documentation missing in model - Failed, - #[allow(missing_docs)] // documentation missing in model - Pending, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for CdnNamespaceDomainVerificationStatus { - fn from(s: &str) -> Self { - match s { - "active" => CdnNamespaceDomainVerificationStatus::Active, - "failed" => CdnNamespaceDomainVerificationStatus::Failed, - "pending" => CdnNamespaceDomainVerificationStatus::Pending, - other => CdnNamespaceDomainVerificationStatus::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for CdnNamespaceDomainVerificationStatus { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(CdnNamespaceDomainVerificationStatus::from(s)) - } -} -impl CdnNamespaceDomainVerificationStatus { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - CdnNamespaceDomainVerificationStatus::Active => "active", - CdnNamespaceDomainVerificationStatus::Failed => "failed", - CdnNamespaceDomainVerificationStatus::Pending => "pending", - CdnNamespaceDomainVerificationStatus::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["active", "failed", "pending"] - } -} -impl AsRef for CdnNamespaceDomainVerificationStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// Cloud configuration for a given version. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CloudVersionConfig { - /// CDN configuration for a given version. - pub cdn: std::option::Option, - /// Matchmaker configuration for a given version. - pub matchmaker: std::option::Option, - /// KV configuration for a given version. - pub kv: std::option::Option, - /// Identity configuration for a given version. - pub identity: std::option::Option, -} -impl CloudVersionConfig { - /// CDN configuration for a given version. - pub fn cdn(&self) -> std::option::Option<&crate::model::CdnVersionConfig> { - self.cdn.as_ref() - } - /// Matchmaker configuration for a given version. - pub fn matchmaker(&self) -> std::option::Option<&crate::model::MatchmakerVersionConfig> { - self.matchmaker.as_ref() - } - /// KV configuration for a given version. - pub fn kv(&self) -> std::option::Option<&crate::model::KvVersionConfig> { - self.kv.as_ref() - } - /// Identity configuration for a given version. - pub fn identity(&self) -> std::option::Option<&crate::model::IdentityVersionConfig> { - self.identity.as_ref() - } -} -impl std::fmt::Debug for CloudVersionConfig { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CloudVersionConfig"); - formatter.field("cdn", &self.cdn); - formatter.field("matchmaker", &self.matchmaker); - formatter.field("kv", &self.kv); - formatter.field("identity", &self.identity); - formatter.finish() - } -} -/// See [`CloudVersionConfig`](crate::model::CloudVersionConfig) -pub mod cloud_version_config { - /// A builder for [`CloudVersionConfig`](crate::model::CloudVersionConfig) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) cdn: std::option::Option, - pub(crate) matchmaker: std::option::Option, - pub(crate) kv: std::option::Option, - pub(crate) identity: std::option::Option, - } - impl Builder { - /// CDN configuration for a given version. - pub fn cdn(mut self, input: crate::model::CdnVersionConfig) -> Self { - self.cdn = Some(input); - self - } - /// CDN configuration for a given version. - pub fn set_cdn( - mut self, - input: std::option::Option, - ) -> Self { - self.cdn = input; - self - } - /// Matchmaker configuration for a given version. - pub fn matchmaker(mut self, input: crate::model::MatchmakerVersionConfig) -> Self { - self.matchmaker = Some(input); - self - } - /// Matchmaker configuration for a given version. - pub fn set_matchmaker( - mut self, - input: std::option::Option, - ) -> Self { - self.matchmaker = input; - self - } - /// KV configuration for a given version. - pub fn kv(mut self, input: crate::model::KvVersionConfig) -> Self { - self.kv = Some(input); - self - } - /// KV configuration for a given version. - pub fn set_kv(mut self, input: std::option::Option) -> Self { - self.kv = input; - self - } - /// Identity configuration for a given version. - pub fn identity(mut self, input: crate::model::IdentityVersionConfig) -> Self { - self.identity = Some(input); - self - } - /// Identity configuration for a given version. - pub fn set_identity( - mut self, - input: std::option::Option, - ) -> Self { - self.identity = input; - self - } - /// Consumes the builder and constructs a [`CloudVersionConfig`](crate::model::CloudVersionConfig) - pub fn build(self) -> crate::model::CloudVersionConfig { - crate::model::CloudVersionConfig { - cdn: self.cdn, - matchmaker: self.matchmaker, - kv: self.kv, - identity: self.identity, - } - } - } -} -impl CloudVersionConfig { - /// Creates a new builder-style object to manufacture [`CloudVersionConfig`](crate::model::CloudVersionConfig) - pub fn builder() -> crate::model::cloud_version_config::Builder { - crate::model::cloud_version_config::Builder::default() - } -} - -/// Identity configuration for a given version. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct IdentityVersionConfig { - #[allow(missing_docs)] // documentation missing in model - pub custom_display_names: std::option::Option>, - #[allow(missing_docs)] // documentation missing in model - pub custom_avatars: std::option::Option>, -} -impl IdentityVersionConfig { - #[allow(missing_docs)] // documentation missing in model - pub fn custom_display_names(&self) -> std::option::Option<&[crate::model::CustomDisplayName]> { - self.custom_display_names.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn custom_avatars(&self) -> std::option::Option<&[crate::model::CustomAvatar]> { - self.custom_avatars.as_deref() - } -} -impl std::fmt::Debug for IdentityVersionConfig { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("IdentityVersionConfig"); - formatter.field("custom_display_names", &self.custom_display_names); - formatter.field("custom_avatars", &self.custom_avatars); - formatter.finish() - } -} -/// See [`IdentityVersionConfig`](crate::model::IdentityVersionConfig) -pub mod identity_version_config { - /// A builder for [`IdentityVersionConfig`](crate::model::IdentityVersionConfig) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) custom_display_names: - std::option::Option>, - pub(crate) custom_avatars: std::option::Option>, - } - impl Builder { - /// Appends an item to `custom_display_names`. - /// - /// To override the contents of this collection use [`set_custom_display_names`](Self::set_custom_display_names). - /// - pub fn custom_display_names(mut self, input: crate::model::CustomDisplayName) -> Self { - let mut v = self.custom_display_names.unwrap_or_default(); - v.push(input); - self.custom_display_names = Some(v); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_custom_display_names( - mut self, - input: std::option::Option>, - ) -> Self { - self.custom_display_names = input; - self - } - /// Appends an item to `custom_avatars`. - /// - /// To override the contents of this collection use [`set_custom_avatars`](Self::set_custom_avatars). - /// - pub fn custom_avatars(mut self, input: crate::model::CustomAvatar) -> Self { - let mut v = self.custom_avatars.unwrap_or_default(); - v.push(input); - self.custom_avatars = Some(v); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_custom_avatars( - mut self, - input: std::option::Option>, - ) -> Self { - self.custom_avatars = input; - self - } - /// Consumes the builder and constructs a [`IdentityVersionConfig`](crate::model::IdentityVersionConfig) - pub fn build(self) -> crate::model::IdentityVersionConfig { - crate::model::IdentityVersionConfig { - custom_display_names: self.custom_display_names, - custom_avatars: self.custom_avatars, - } - } - } -} -impl IdentityVersionConfig { - /// Creates a new builder-style object to manufacture [`IdentityVersionConfig`](crate::model::IdentityVersionConfig) - pub fn builder() -> crate::model::identity_version_config::Builder { - crate::model::identity_version_config::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CustomAvatar { - /// A universally unique identifier. - pub upload_id: std::option::Option, -} -impl CustomAvatar { - /// A universally unique identifier. - pub fn upload_id(&self) -> std::option::Option<&str> { - self.upload_id.as_deref() - } -} -impl std::fmt::Debug for CustomAvatar { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CustomAvatar"); - formatter.field("upload_id", &self.upload_id); - formatter.finish() - } -} -/// See [`CustomAvatar`](crate::model::CustomAvatar) -pub mod custom_avatar { - /// A builder for [`CustomAvatar`](crate::model::CustomAvatar) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) upload_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn upload_id(mut self, input: impl Into) -> Self { - self.upload_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_upload_id(mut self, input: std::option::Option) -> Self { - self.upload_id = input; - self - } - /// Consumes the builder and constructs a [`CustomAvatar`](crate::model::CustomAvatar) - pub fn build(self) -> crate::model::CustomAvatar { - crate::model::CustomAvatar { - upload_id: self.upload_id, - } - } - } -} -impl CustomAvatar { - /// Creates a new builder-style object to manufacture [`CustomAvatar`](crate::model::CustomAvatar) - pub fn builder() -> crate::model::custom_avatar::Builder { - crate::model::custom_avatar::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CustomDisplayName { - #[allow(missing_docs)] // documentation missing in model - pub display_name: std::option::Option, -} -impl CustomDisplayName { - #[allow(missing_docs)] // documentation missing in model - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } -} -impl std::fmt::Debug for CustomDisplayName { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CustomDisplayName"); - formatter.field("display_name", &self.display_name); - formatter.finish() - } -} -/// See [`CustomDisplayName`](crate::model::CustomDisplayName) -pub mod custom_display_name { - /// A builder for [`CustomDisplayName`](crate::model::CustomDisplayName) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) display_name: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// Consumes the builder and constructs a [`CustomDisplayName`](crate::model::CustomDisplayName) - pub fn build(self) -> crate::model::CustomDisplayName { - crate::model::CustomDisplayName { - display_name: self.display_name, - } - } - } -} -impl CustomDisplayName { - /// Creates a new builder-style object to manufacture [`CustomDisplayName`](crate::model::CustomDisplayName) - pub fn builder() -> crate::model::custom_display_name::Builder { - crate::model::custom_display_name::Builder::default() - } -} - -/// KV configuration for a given version. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct KvVersionConfig {} -impl std::fmt::Debug for KvVersionConfig { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("KvVersionConfig"); - formatter.finish() - } -} -/// See [`KvVersionConfig`](crate::model::KvVersionConfig) -pub mod kv_version_config { - /// A builder for [`KvVersionConfig`](crate::model::KvVersionConfig) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`KvVersionConfig`](crate::model::KvVersionConfig) - pub fn build(self) -> crate::model::KvVersionConfig { - crate::model::KvVersionConfig {} - } - } -} -impl KvVersionConfig { - /// Creates a new builder-style object to manufacture [`KvVersionConfig`](crate::model::KvVersionConfig) - pub fn builder() -> crate::model::kv_version_config::Builder { - crate::model::kv_version_config::Builder::default() - } -} - -/// Matchmaker configuration for a given version. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct MatchmakerVersionConfig { - /// A list of game modes. - pub lobby_groups: std::option::Option>, - /// Matchmaker captcha configuration. - pub captcha: std::option::Option, -} -impl MatchmakerVersionConfig { - /// A list of game modes. - pub fn lobby_groups(&self) -> std::option::Option<&[crate::model::LobbyGroup]> { - self.lobby_groups.as_deref() - } - /// Matchmaker captcha configuration. - pub fn captcha(&self) -> std::option::Option<&crate::model::MatchmakerCaptcha> { - self.captcha.as_ref() - } -} -impl std::fmt::Debug for MatchmakerVersionConfig { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("MatchmakerVersionConfig"); - formatter.field("lobby_groups", &self.lobby_groups); - formatter.field("captcha", &self.captcha); - formatter.finish() - } -} -/// See [`MatchmakerVersionConfig`](crate::model::MatchmakerVersionConfig) -pub mod matchmaker_version_config { - /// A builder for [`MatchmakerVersionConfig`](crate::model::MatchmakerVersionConfig) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) lobby_groups: std::option::Option>, - pub(crate) captcha: std::option::Option, - } - impl Builder { - /// Appends an item to `lobby_groups`. - /// - /// To override the contents of this collection use [`set_lobby_groups`](Self::set_lobby_groups). - /// - /// A list of game modes. - pub fn lobby_groups(mut self, input: crate::model::LobbyGroup) -> Self { - let mut v = self.lobby_groups.unwrap_or_default(); - v.push(input); - self.lobby_groups = Some(v); - self - } - /// A list of game modes. - pub fn set_lobby_groups( - mut self, - input: std::option::Option>, - ) -> Self { - self.lobby_groups = input; - self - } - /// Matchmaker captcha configuration. - pub fn captcha(mut self, input: crate::model::MatchmakerCaptcha) -> Self { - self.captcha = Some(input); - self - } - /// Matchmaker captcha configuration. - pub fn set_captcha( - mut self, - input: std::option::Option, - ) -> Self { - self.captcha = input; - self - } - /// Consumes the builder and constructs a [`MatchmakerVersionConfig`](crate::model::MatchmakerVersionConfig) - pub fn build(self) -> crate::model::MatchmakerVersionConfig { - crate::model::MatchmakerVersionConfig { - lobby_groups: self.lobby_groups, - captcha: self.captcha, - } - } - } -} -impl MatchmakerVersionConfig { - /// Creates a new builder-style object to manufacture [`MatchmakerVersionConfig`](crate::model::MatchmakerVersionConfig) - pub fn builder() -> crate::model::matchmaker_version_config::Builder { - crate::model::matchmaker_version_config::Builder::default() - } -} - -/// Matchmaker captcha configuration. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct MatchmakerCaptcha { - /// Denotes how many requests a connection can make before it is required to reverify a captcha. - pub requests_before_reverify: std::option::Option, - /// Denotes how long a connection can continue to reconnect without having to reverify a captcha (in milliseconds). - pub verification_ttl: std::option::Option, - /// hCpatcha configuration. - pub hcaptcha: std::option::Option, -} -impl MatchmakerCaptcha { - /// Denotes how many requests a connection can make before it is required to reverify a captcha. - pub fn requests_before_reverify(&self) -> std::option::Option { - self.requests_before_reverify - } - /// Denotes how long a connection can continue to reconnect without having to reverify a captcha (in milliseconds). - pub fn verification_ttl(&self) -> std::option::Option { - self.verification_ttl - } - /// hCpatcha configuration. - pub fn hcaptcha(&self) -> std::option::Option<&crate::model::MatchmakerCaptchaHcaptcha> { - self.hcaptcha.as_ref() - } -} -impl std::fmt::Debug for MatchmakerCaptcha { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("MatchmakerCaptcha"); - formatter.field("requests_before_reverify", &self.requests_before_reverify); - formatter.field("verification_ttl", &self.verification_ttl); - formatter.field("hcaptcha", &self.hcaptcha); - formatter.finish() - } -} -/// See [`MatchmakerCaptcha`](crate::model::MatchmakerCaptcha) -pub mod matchmaker_captcha { - /// A builder for [`MatchmakerCaptcha`](crate::model::MatchmakerCaptcha) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) requests_before_reverify: std::option::Option, - pub(crate) verification_ttl: std::option::Option, - pub(crate) hcaptcha: std::option::Option, - } - impl Builder { - /// Denotes how many requests a connection can make before it is required to reverify a captcha. - pub fn requests_before_reverify(mut self, input: i32) -> Self { - self.requests_before_reverify = Some(input); - self - } - /// Denotes how many requests a connection can make before it is required to reverify a captcha. - pub fn set_requests_before_reverify(mut self, input: std::option::Option) -> Self { - self.requests_before_reverify = input; - self - } - /// Denotes how long a connection can continue to reconnect without having to reverify a captcha (in milliseconds). - pub fn verification_ttl(mut self, input: i64) -> Self { - self.verification_ttl = Some(input); - self - } - /// Denotes how long a connection can continue to reconnect without having to reverify a captcha (in milliseconds). - pub fn set_verification_ttl(mut self, input: std::option::Option) -> Self { - self.verification_ttl = input; - self - } - /// hCpatcha configuration. - pub fn hcaptcha(mut self, input: crate::model::MatchmakerCaptchaHcaptcha) -> Self { - self.hcaptcha = Some(input); - self - } - /// hCpatcha configuration. - pub fn set_hcaptcha( - mut self, - input: std::option::Option, - ) -> Self { - self.hcaptcha = input; - self - } - /// Consumes the builder and constructs a [`MatchmakerCaptcha`](crate::model::MatchmakerCaptcha) - pub fn build(self) -> crate::model::MatchmakerCaptcha { - crate::model::MatchmakerCaptcha { - requests_before_reverify: self.requests_before_reverify, - verification_ttl: self.verification_ttl, - hcaptcha: self.hcaptcha, - } - } - } -} -impl MatchmakerCaptcha { - /// Creates a new builder-style object to manufacture [`MatchmakerCaptcha`](crate::model::MatchmakerCaptcha) - pub fn builder() -> crate::model::matchmaker_captcha::Builder { - crate::model::matchmaker_captcha::Builder::default() - } -} - -/// hCpatcha configuration. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct MatchmakerCaptchaHcaptcha { - /// How hard a captcha should be. - pub level: std::option::Option, -} -impl MatchmakerCaptchaHcaptcha { - /// How hard a captcha should be. - pub fn level(&self) -> std::option::Option<&crate::model::CaptchaLevel> { - self.level.as_ref() - } -} -impl std::fmt::Debug for MatchmakerCaptchaHcaptcha { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("MatchmakerCaptchaHcaptcha"); - formatter.field("level", &self.level); - formatter.finish() - } -} -/// See [`MatchmakerCaptchaHcaptcha`](crate::model::MatchmakerCaptchaHcaptcha) -pub mod matchmaker_captcha_hcaptcha { - /// A builder for [`MatchmakerCaptchaHcaptcha`](crate::model::MatchmakerCaptchaHcaptcha) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) level: std::option::Option, - } - impl Builder { - /// How hard a captcha should be. - pub fn level(mut self, input: crate::model::CaptchaLevel) -> Self { - self.level = Some(input); - self - } - /// How hard a captcha should be. - pub fn set_level(mut self, input: std::option::Option) -> Self { - self.level = input; - self - } - /// Consumes the builder and constructs a [`MatchmakerCaptchaHcaptcha`](crate::model::MatchmakerCaptchaHcaptcha) - pub fn build(self) -> crate::model::MatchmakerCaptchaHcaptcha { - crate::model::MatchmakerCaptchaHcaptcha { level: self.level } - } - } -} -impl MatchmakerCaptchaHcaptcha { - /// Creates a new builder-style object to manufacture [`MatchmakerCaptchaHcaptcha`](crate::model::MatchmakerCaptchaHcaptcha) - pub fn builder() -> crate::model::matchmaker_captcha_hcaptcha::Builder { - crate::model::matchmaker_captcha_hcaptcha::Builder::default() - } -} - -/// How hard a captcha should be. -#[non_exhaustive] -#[derive( - std::clone::Clone, - std::cmp::Eq, - std::cmp::Ord, - std::cmp::PartialEq, - std::cmp::PartialOrd, - std::fmt::Debug, - std::hash::Hash, -)] -pub enum CaptchaLevel { - #[allow(missing_docs)] // documentation missing in model - AlwaysOn, - #[allow(missing_docs)] // documentation missing in model - Difficult, - #[allow(missing_docs)] // documentation missing in model - Easy, - #[allow(missing_docs)] // documentation missing in model - Moderate, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for CaptchaLevel { - fn from(s: &str) -> Self { - match s { - "always_on" => CaptchaLevel::AlwaysOn, - "difficult" => CaptchaLevel::Difficult, - "easy" => CaptchaLevel::Easy, - "moderate" => CaptchaLevel::Moderate, - other => CaptchaLevel::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for CaptchaLevel { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(CaptchaLevel::from(s)) - } -} -impl CaptchaLevel { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - CaptchaLevel::AlwaysOn => "always_on", - CaptchaLevel::Difficult => "difficult", - CaptchaLevel::Easy => "easy", - CaptchaLevel::Moderate => "moderate", - CaptchaLevel::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["always_on", "difficult", "easy", "moderate"] - } -} -impl AsRef for CaptchaLevel { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// A game mode. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct LobbyGroup { - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub name_id: std::option::Option, - /// A list of game mode regions. - pub regions: std::option::Option>, - /// Unsigned 32 bit integer. - pub max_players_normal: std::option::Option, - /// Unsigned 32 bit integer. - pub max_players_direct: std::option::Option, - /// Unsigned 32 bit integer. - pub max_players_party: std::option::Option, - /// A union representing the runtime a game mode runs on. - pub runtime: std::option::Option, -} -impl LobbyGroup { - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn name_id(&self) -> std::option::Option<&str> { - self.name_id.as_deref() - } - /// A list of game mode regions. - pub fn regions(&self) -> std::option::Option<&[crate::model::LobbyGroupRegion]> { - self.regions.as_deref() - } - /// Unsigned 32 bit integer. - pub fn max_players_normal(&self) -> std::option::Option { - self.max_players_normal - } - /// Unsigned 32 bit integer. - pub fn max_players_direct(&self) -> std::option::Option { - self.max_players_direct - } - /// Unsigned 32 bit integer. - pub fn max_players_party(&self) -> std::option::Option { - self.max_players_party - } - /// A union representing the runtime a game mode runs on. - pub fn runtime(&self) -> std::option::Option<&crate::model::LobbyGroupRuntime> { - self.runtime.as_ref() - } -} -impl std::fmt::Debug for LobbyGroup { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("LobbyGroup"); - formatter.field("name_id", &self.name_id); - formatter.field("regions", &self.regions); - formatter.field("max_players_normal", &self.max_players_normal); - formatter.field("max_players_direct", &self.max_players_direct); - formatter.field("max_players_party", &self.max_players_party); - formatter.field("runtime", &self.runtime); - formatter.finish() - } -} -/// See [`LobbyGroup`](crate::model::LobbyGroup) -pub mod lobby_group { - /// A builder for [`LobbyGroup`](crate::model::LobbyGroup) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) name_id: std::option::Option, - pub(crate) regions: std::option::Option>, - pub(crate) max_players_normal: std::option::Option, - pub(crate) max_players_direct: std::option::Option, - pub(crate) max_players_party: std::option::Option, - pub(crate) runtime: std::option::Option, - } - impl Builder { - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn name_id(mut self, input: impl Into) -> Self { - self.name_id = Some(input.into()); - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn set_name_id(mut self, input: std::option::Option) -> Self { - self.name_id = input; - self - } - /// Appends an item to `regions`. - /// - /// To override the contents of this collection use [`set_regions`](Self::set_regions). - /// - /// A list of game mode regions. - pub fn regions(mut self, input: crate::model::LobbyGroupRegion) -> Self { - let mut v = self.regions.unwrap_or_default(); - v.push(input); - self.regions = Some(v); - self - } - /// A list of game mode regions. - pub fn set_regions( - mut self, - input: std::option::Option>, - ) -> Self { - self.regions = input; - self - } - /// Unsigned 32 bit integer. - pub fn max_players_normal(mut self, input: i32) -> Self { - self.max_players_normal = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_max_players_normal(mut self, input: std::option::Option) -> Self { - self.max_players_normal = input; - self - } - /// Unsigned 32 bit integer. - pub fn max_players_direct(mut self, input: i32) -> Self { - self.max_players_direct = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_max_players_direct(mut self, input: std::option::Option) -> Self { - self.max_players_direct = input; - self - } - /// Unsigned 32 bit integer. - pub fn max_players_party(mut self, input: i32) -> Self { - self.max_players_party = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_max_players_party(mut self, input: std::option::Option) -> Self { - self.max_players_party = input; - self - } - /// A union representing the runtime a game mode runs on. - pub fn runtime(mut self, input: crate::model::LobbyGroupRuntime) -> Self { - self.runtime = Some(input); - self - } - /// A union representing the runtime a game mode runs on. - pub fn set_runtime( - mut self, - input: std::option::Option, - ) -> Self { - self.runtime = input; - self - } - /// Consumes the builder and constructs a [`LobbyGroup`](crate::model::LobbyGroup) - pub fn build(self) -> crate::model::LobbyGroup { - crate::model::LobbyGroup { - name_id: self.name_id, - regions: self.regions, - max_players_normal: self.max_players_normal, - max_players_direct: self.max_players_direct, - max_players_party: self.max_players_party, - runtime: self.runtime, - } - } - } -} -impl LobbyGroup { - /// Creates a new builder-style object to manufacture [`LobbyGroup`](crate::model::LobbyGroup) - pub fn builder() -> crate::model::lobby_group::Builder { - crate::model::lobby_group::Builder::default() - } -} - -/// A union representing the runtime a game mode runs on. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] -pub enum LobbyGroupRuntime { - /// A game mode runtime running through Docker. - Docker(crate::model::LobbyGroupRuntimeDocker), - /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version. - /// An unknown enum variant - /// - /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._ - /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized - /// by the client. This can happen when the server adds new functionality, but the client has not been updated. - /// To investigate this, consider turning on debug logging to print the raw HTTP response. - #[non_exhaustive] - Unknown, -} -impl LobbyGroupRuntime { - #[allow(irrefutable_let_patterns)] - /// Tries to convert the enum instance into [`Docker`](crate::model::LobbyGroupRuntime::Docker), extracting the inner [`LobbyGroupRuntimeDocker`](crate::model::LobbyGroupRuntimeDocker). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_docker(&self) -> std::result::Result<&crate::model::LobbyGroupRuntimeDocker, &Self> { - if let LobbyGroupRuntime::Docker(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`Docker`](crate::model::LobbyGroupRuntime::Docker). - pub fn is_docker(&self) -> bool { - self.as_docker().is_ok() - } - /// Returns true if the enum instance is the `Unknown` variant. - pub fn is_unknown(&self) -> bool { - matches!(self, Self::Unknown) - } -} - -/// A game mode runtime running through Docker. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct LobbyGroupRuntimeDocker { - /// A universally unique identifier. - pub build_id: std::option::Option, - /// A list of docker arguments. - pub args: std::option::Option>, - /// A list of docker environment variables. - pub env_vars: std::option::Option>, - /// The network mode the job should run on. - pub network_mode: std::option::Option, - /// A list of docker ports. - pub ports: std::option::Option>, -} -impl LobbyGroupRuntimeDocker { - /// A universally unique identifier. - pub fn build_id(&self) -> std::option::Option<&str> { - self.build_id.as_deref() - } - /// A list of docker arguments. - pub fn args(&self) -> std::option::Option<&[std::string::String]> { - self.args.as_deref() - } - /// A list of docker environment variables. - pub fn env_vars(&self) -> std::option::Option<&[crate::model::LobbyGroupRuntimeDockerEnvVar]> { - self.env_vars.as_deref() - } - /// The network mode the job should run on. - pub fn network_mode(&self) -> std::option::Option<&crate::model::NetworkMode> { - self.network_mode.as_ref() - } - /// A list of docker ports. - pub fn ports(&self) -> std::option::Option<&[crate::model::LobbyGroupRuntimeDockerPort]> { - self.ports.as_deref() - } -} -impl std::fmt::Debug for LobbyGroupRuntimeDocker { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("LobbyGroupRuntimeDocker"); - formatter.field("build_id", &self.build_id); - formatter.field("args", &self.args); - formatter.field("env_vars", &self.env_vars); - formatter.field("network_mode", &self.network_mode); - formatter.field("ports", &self.ports); - formatter.finish() - } -} -/// See [`LobbyGroupRuntimeDocker`](crate::model::LobbyGroupRuntimeDocker) -pub mod lobby_group_runtime_docker { - /// A builder for [`LobbyGroupRuntimeDocker`](crate::model::LobbyGroupRuntimeDocker) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) build_id: std::option::Option, - pub(crate) args: std::option::Option>, - pub(crate) env_vars: - std::option::Option>, - pub(crate) network_mode: std::option::Option, - pub(crate) ports: - std::option::Option>, - } - impl Builder { - /// A universally unique identifier. - pub fn build_id(mut self, input: impl Into) -> Self { - self.build_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_build_id(mut self, input: std::option::Option) -> Self { - self.build_id = input; - self - } - /// Appends an item to `args`. - /// - /// To override the contents of this collection use [`set_args`](Self::set_args). - /// - /// A list of docker arguments. - pub fn args(mut self, input: impl Into) -> Self { - let mut v = self.args.unwrap_or_default(); - v.push(input.into()); - self.args = Some(v); - self - } - /// A list of docker arguments. - pub fn set_args( - mut self, - input: std::option::Option>, - ) -> Self { - self.args = input; - self - } - /// Appends an item to `env_vars`. - /// - /// To override the contents of this collection use [`set_env_vars`](Self::set_env_vars). - /// - /// A list of docker environment variables. - pub fn env_vars(mut self, input: crate::model::LobbyGroupRuntimeDockerEnvVar) -> Self { - let mut v = self.env_vars.unwrap_or_default(); - v.push(input); - self.env_vars = Some(v); - self - } - /// A list of docker environment variables. - pub fn set_env_vars( - mut self, - input: std::option::Option>, - ) -> Self { - self.env_vars = input; - self - } - /// The network mode the job should run on. - pub fn network_mode(mut self, input: crate::model::NetworkMode) -> Self { - self.network_mode = Some(input); - self - } - /// The network mode the job should run on. - pub fn set_network_mode( - mut self, - input: std::option::Option, - ) -> Self { - self.network_mode = input; - self - } - /// Appends an item to `ports`. - /// - /// To override the contents of this collection use [`set_ports`](Self::set_ports). - /// - /// A list of docker ports. - pub fn ports(mut self, input: crate::model::LobbyGroupRuntimeDockerPort) -> Self { - let mut v = self.ports.unwrap_or_default(); - v.push(input); - self.ports = Some(v); - self - } - /// A list of docker ports. - pub fn set_ports( - mut self, - input: std::option::Option>, - ) -> Self { - self.ports = input; - self - } - /// Consumes the builder and constructs a [`LobbyGroupRuntimeDocker`](crate::model::LobbyGroupRuntimeDocker) - pub fn build(self) -> crate::model::LobbyGroupRuntimeDocker { - crate::model::LobbyGroupRuntimeDocker { - build_id: self.build_id, - args: self.args, - env_vars: self.env_vars, - network_mode: self.network_mode, - ports: self.ports, - } - } - } -} -impl LobbyGroupRuntimeDocker { - /// Creates a new builder-style object to manufacture [`LobbyGroupRuntimeDocker`](crate::model::LobbyGroupRuntimeDocker) - pub fn builder() -> crate::model::lobby_group_runtime_docker::Builder { - crate::model::lobby_group_runtime_docker::Builder::default() - } -} - -/// The network mode the job should run on. -#[non_exhaustive] -#[derive( - std::clone::Clone, - std::cmp::Eq, - std::cmp::Ord, - std::cmp::PartialEq, - std::cmp::PartialOrd, - std::fmt::Debug, - std::hash::Hash, -)] -pub enum NetworkMode { - #[allow(missing_docs)] // documentation missing in model - Bridge, - #[allow(missing_docs)] // documentation missing in model - Host, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for NetworkMode { - fn from(s: &str) -> Self { - match s { - "bridge" => NetworkMode::Bridge, - "host" => NetworkMode::Host, - other => NetworkMode::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for NetworkMode { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(NetworkMode::from(s)) - } -} -impl NetworkMode { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - NetworkMode::Bridge => "bridge", - NetworkMode::Host => "host", - NetworkMode::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["bridge", "host"] - } -} -impl AsRef for NetworkMode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// A docker environment variable. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct LobbyGroupRuntimeDockerEnvVar { - /// The key of this environment variable. - pub key: std::option::Option, - /// The value of this environment variable. - pub value: std::option::Option, -} -impl LobbyGroupRuntimeDockerEnvVar { - /// The key of this environment variable. - pub fn key(&self) -> std::option::Option<&str> { - self.key.as_deref() - } - /// The value of this environment variable. - pub fn value(&self) -> std::option::Option<&str> { - self.value.as_deref() - } -} -impl std::fmt::Debug for LobbyGroupRuntimeDockerEnvVar { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("LobbyGroupRuntimeDockerEnvVar"); - formatter.field("key", &self.key); - formatter.field("value", &self.value); - formatter.finish() - } -} -/// See [`LobbyGroupRuntimeDockerEnvVar`](crate::model::LobbyGroupRuntimeDockerEnvVar) -pub mod lobby_group_runtime_docker_env_var { - /// A builder for [`LobbyGroupRuntimeDockerEnvVar`](crate::model::LobbyGroupRuntimeDockerEnvVar) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) key: std::option::Option, - pub(crate) value: std::option::Option, - } - impl Builder { - /// The key of this environment variable. - pub fn key(mut self, input: impl Into) -> Self { - self.key = Some(input.into()); - self - } - /// The key of this environment variable. - pub fn set_key(mut self, input: std::option::Option) -> Self { - self.key = input; - self - } - /// The value of this environment variable. - pub fn value(mut self, input: impl Into) -> Self { - self.value = Some(input.into()); - self - } - /// The value of this environment variable. - pub fn set_value(mut self, input: std::option::Option) -> Self { - self.value = input; - self - } - /// Consumes the builder and constructs a [`LobbyGroupRuntimeDockerEnvVar`](crate::model::LobbyGroupRuntimeDockerEnvVar) - pub fn build(self) -> crate::model::LobbyGroupRuntimeDockerEnvVar { - crate::model::LobbyGroupRuntimeDockerEnvVar { - key: self.key, - value: self.value, - } - } - } -} -impl LobbyGroupRuntimeDockerEnvVar { - /// Creates a new builder-style object to manufacture [`LobbyGroupRuntimeDockerEnvVar`](crate::model::LobbyGroupRuntimeDockerEnvVar) - pub fn builder() -> crate::model::lobby_group_runtime_docker_env_var::Builder { - crate::model::lobby_group_runtime_docker_env_var::Builder::default() - } -} - -/// A game mode region. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct LobbyGroupRegion { - /// A universally unique identifier. - pub region_id: std::option::Option, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub tier_name_id: std::option::Option, - /// Configuration for how many idle lobbies a game version should have. - pub idle_lobbies: std::option::Option, -} -impl LobbyGroupRegion { - /// A universally unique identifier. - pub fn region_id(&self) -> std::option::Option<&str> { - self.region_id.as_deref() - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn tier_name_id(&self) -> std::option::Option<&str> { - self.tier_name_id.as_deref() - } - /// Configuration for how many idle lobbies a game version should have. - pub fn idle_lobbies(&self) -> std::option::Option<&crate::model::IdleLobbiesConfig> { - self.idle_lobbies.as_ref() - } -} -impl std::fmt::Debug for LobbyGroupRegion { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("LobbyGroupRegion"); - formatter.field("region_id", &self.region_id); - formatter.field("tier_name_id", &self.tier_name_id); - formatter.field("idle_lobbies", &self.idle_lobbies); - formatter.finish() - } -} -/// See [`LobbyGroupRegion`](crate::model::LobbyGroupRegion) -pub mod lobby_group_region { - /// A builder for [`LobbyGroupRegion`](crate::model::LobbyGroupRegion) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) region_id: std::option::Option, - pub(crate) tier_name_id: std::option::Option, - pub(crate) idle_lobbies: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn region_id(mut self, input: impl Into) -> Self { - self.region_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_region_id(mut self, input: std::option::Option) -> Self { - self.region_id = input; - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn tier_name_id(mut self, input: impl Into) -> Self { - self.tier_name_id = Some(input.into()); - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn set_tier_name_id(mut self, input: std::option::Option) -> Self { - self.tier_name_id = input; - self - } - /// Configuration for how many idle lobbies a game version should have. - pub fn idle_lobbies(mut self, input: crate::model::IdleLobbiesConfig) -> Self { - self.idle_lobbies = Some(input); - self - } - /// Configuration for how many idle lobbies a game version should have. - pub fn set_idle_lobbies( - mut self, - input: std::option::Option, - ) -> Self { - self.idle_lobbies = input; - self - } - /// Consumes the builder and constructs a [`LobbyGroupRegion`](crate::model::LobbyGroupRegion) - pub fn build(self) -> crate::model::LobbyGroupRegion { - crate::model::LobbyGroupRegion { - region_id: self.region_id, - tier_name_id: self.tier_name_id, - idle_lobbies: self.idle_lobbies, - } - } - } -} -impl LobbyGroupRegion { - /// Creates a new builder-style object to manufacture [`LobbyGroupRegion`](crate::model::LobbyGroupRegion) - pub fn builder() -> crate::model::lobby_group_region::Builder { - crate::model::lobby_group_region::Builder::default() - } -} - -/// Configuration for how many idle lobbies a game version should have. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct IdleLobbiesConfig { - /// Unsigned 32 bit integer. - pub min_idle_lobbies: std::option::Option, - /// Unsigned 32 bit integer. - pub max_idle_lobbies: std::option::Option, -} -impl IdleLobbiesConfig { - /// Unsigned 32 bit integer. - pub fn min_idle_lobbies(&self) -> std::option::Option { - self.min_idle_lobbies - } - /// Unsigned 32 bit integer. - pub fn max_idle_lobbies(&self) -> std::option::Option { - self.max_idle_lobbies - } -} -impl std::fmt::Debug for IdleLobbiesConfig { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("IdleLobbiesConfig"); - formatter.field("min_idle_lobbies", &self.min_idle_lobbies); - formatter.field("max_idle_lobbies", &self.max_idle_lobbies); - formatter.finish() - } -} -/// See [`IdleLobbiesConfig`](crate::model::IdleLobbiesConfig) -pub mod idle_lobbies_config { - /// A builder for [`IdleLobbiesConfig`](crate::model::IdleLobbiesConfig) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) min_idle_lobbies: std::option::Option, - pub(crate) max_idle_lobbies: std::option::Option, - } - impl Builder { - /// Unsigned 32 bit integer. - pub fn min_idle_lobbies(mut self, input: i32) -> Self { - self.min_idle_lobbies = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_min_idle_lobbies(mut self, input: std::option::Option) -> Self { - self.min_idle_lobbies = input; - self - } - /// Unsigned 32 bit integer. - pub fn max_idle_lobbies(mut self, input: i32) -> Self { - self.max_idle_lobbies = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_max_idle_lobbies(mut self, input: std::option::Option) -> Self { - self.max_idle_lobbies = input; - self - } - /// Consumes the builder and constructs a [`IdleLobbiesConfig`](crate::model::IdleLobbiesConfig) - pub fn build(self) -> crate::model::IdleLobbiesConfig { - crate::model::IdleLobbiesConfig { - min_idle_lobbies: self.min_idle_lobbies, - max_idle_lobbies: self.max_idle_lobbies, - } - } - } -} -impl IdleLobbiesConfig { - /// Creates a new builder-style object to manufacture [`IdleLobbiesConfig`](crate::model::IdleLobbiesConfig) - pub fn builder() -> crate::model::idle_lobbies_config::Builder { - crate::model::idle_lobbies_config::Builder::default() - } -} - -/// CDN configuration for a given version. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CdnVersionConfig { - /// A universally unique identifier. - pub site_id: std::option::Option, - /// Client-side configuration - pub build_command: std::option::Option, - /// Client-side configuration - pub build_output: std::option::Option, - /// Multiple CDN version routes. - pub routes: std::option::Option>, -} -impl CdnVersionConfig { - /// A universally unique identifier. - pub fn site_id(&self) -> std::option::Option<&str> { - self.site_id.as_deref() - } - /// Client-side configuration - pub fn build_command(&self) -> std::option::Option<&str> { - self.build_command.as_deref() - } - /// Client-side configuration - pub fn build_output(&self) -> std::option::Option<&str> { - self.build_output.as_deref() - } - /// Multiple CDN version routes. - pub fn routes(&self) -> std::option::Option<&[crate::model::CdnVersionRoute]> { - self.routes.as_deref() - } -} -impl std::fmt::Debug for CdnVersionConfig { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CdnVersionConfig"); - formatter.field("site_id", &self.site_id); - formatter.field("build_command", &self.build_command); - formatter.field("build_output", &self.build_output); - formatter.field("routes", &self.routes); - formatter.finish() - } -} -/// See [`CdnVersionConfig`](crate::model::CdnVersionConfig) -pub mod cdn_version_config { - /// A builder for [`CdnVersionConfig`](crate::model::CdnVersionConfig) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) site_id: std::option::Option, - pub(crate) build_command: std::option::Option, - pub(crate) build_output: std::option::Option, - pub(crate) routes: std::option::Option>, - } - impl Builder { - /// A universally unique identifier. - pub fn site_id(mut self, input: impl Into) -> Self { - self.site_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_site_id(mut self, input: std::option::Option) -> Self { - self.site_id = input; - self - } - /// Client-side configuration - pub fn build_command(mut self, input: impl Into) -> Self { - self.build_command = Some(input.into()); - self - } - /// Client-side configuration - pub fn set_build_command( - mut self, - input: std::option::Option, - ) -> Self { - self.build_command = input; - self - } - /// Client-side configuration - pub fn build_output(mut self, input: impl Into) -> Self { - self.build_output = Some(input.into()); - self - } - /// Client-side configuration - pub fn set_build_output(mut self, input: std::option::Option) -> Self { - self.build_output = input; - self - } - /// Appends an item to `routes`. - /// - /// To override the contents of this collection use [`set_routes`](Self::set_routes). - /// - /// Multiple CDN version routes. - pub fn routes(mut self, input: crate::model::CdnVersionRoute) -> Self { - let mut v = self.routes.unwrap_or_default(); - v.push(input); - self.routes = Some(v); - self - } - /// Multiple CDN version routes. - pub fn set_routes( - mut self, - input: std::option::Option>, - ) -> Self { - self.routes = input; - self - } - /// Consumes the builder and constructs a [`CdnVersionConfig`](crate::model::CdnVersionConfig) - pub fn build(self) -> crate::model::CdnVersionConfig { - crate::model::CdnVersionConfig { - site_id: self.site_id, - build_command: self.build_command, - build_output: self.build_output, - routes: self.routes, - } - } - } -} -impl CdnVersionConfig { - /// Creates a new builder-style object to manufacture [`CdnVersionConfig`](crate::model::CdnVersionConfig) - pub fn builder() -> crate::model::cdn_version_config::Builder { - crate::model::cdn_version_config::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CdnVersionRoute { - #[allow(missing_docs)] // documentation missing in model - pub glob: std::option::Option, - /// Unsigned 32 bit integer. - pub priority: std::option::Option, - /// Multiple CDN version middleware. - pub middlewares: std::option::Option>, -} -impl CdnVersionRoute { - #[allow(missing_docs)] // documentation missing in model - pub fn glob(&self) -> std::option::Option<&str> { - self.glob.as_deref() - } - /// Unsigned 32 bit integer. - pub fn priority(&self) -> std::option::Option { - self.priority - } - /// Multiple CDN version middleware. - pub fn middlewares(&self) -> std::option::Option<&[crate::model::CdnVersionMiddleware]> { - self.middlewares.as_deref() - } -} -impl std::fmt::Debug for CdnVersionRoute { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CdnVersionRoute"); - formatter.field("glob", &self.glob); - formatter.field("priority", &self.priority); - formatter.field("middlewares", &self.middlewares); - formatter.finish() - } -} -/// See [`CdnVersionRoute`](crate::model::CdnVersionRoute) -pub mod cdn_version_route { - /// A builder for [`CdnVersionRoute`](crate::model::CdnVersionRoute) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) glob: std::option::Option, - pub(crate) priority: std::option::Option, - pub(crate) middlewares: - std::option::Option>, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn glob(mut self, input: impl Into) -> Self { - self.glob = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_glob(mut self, input: std::option::Option) -> Self { - self.glob = input; - self - } - /// Unsigned 32 bit integer. - pub fn priority(mut self, input: i32) -> Self { - self.priority = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_priority(mut self, input: std::option::Option) -> Self { - self.priority = input; - self - } - /// Appends an item to `middlewares`. - /// - /// To override the contents of this collection use [`set_middlewares`](Self::set_middlewares). - /// - /// Multiple CDN version middleware. - pub fn middlewares(mut self, input: crate::model::CdnVersionMiddleware) -> Self { - let mut v = self.middlewares.unwrap_or_default(); - v.push(input); - self.middlewares = Some(v); - self - } - /// Multiple CDN version middleware. - pub fn set_middlewares( - mut self, - input: std::option::Option>, - ) -> Self { - self.middlewares = input; - self - } - /// Consumes the builder and constructs a [`CdnVersionRoute`](crate::model::CdnVersionRoute) - pub fn build(self) -> crate::model::CdnVersionRoute { - crate::model::CdnVersionRoute { - glob: self.glob, - priority: self.priority, - middlewares: self.middlewares, - } - } - } -} -impl CdnVersionRoute { - /// Creates a new builder-style object to manufacture [`CdnVersionRoute`](crate::model::CdnVersionRoute) - pub fn builder() -> crate::model::cdn_version_route::Builder { - crate::model::cdn_version_route::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CdnVersionMiddleware { - #[allow(missing_docs)] // documentation missing in model - pub kind: std::option::Option, -} -impl CdnVersionMiddleware { - #[allow(missing_docs)] // documentation missing in model - pub fn kind(&self) -> std::option::Option<&crate::model::CdnVersionMiddlewareKind> { - self.kind.as_ref() - } -} -impl std::fmt::Debug for CdnVersionMiddleware { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CdnVersionMiddleware"); - formatter.field("kind", &self.kind); - formatter.finish() - } -} -/// See [`CdnVersionMiddleware`](crate::model::CdnVersionMiddleware) -pub mod cdn_version_middleware { - /// A builder for [`CdnVersionMiddleware`](crate::model::CdnVersionMiddleware) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) kind: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn kind(mut self, input: crate::model::CdnVersionMiddlewareKind) -> Self { - self.kind = Some(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_kind( - mut self, - input: std::option::Option, - ) -> Self { - self.kind = input; - self - } - /// Consumes the builder and constructs a [`CdnVersionMiddleware`](crate::model::CdnVersionMiddleware) - pub fn build(self) -> crate::model::CdnVersionMiddleware { - crate::model::CdnVersionMiddleware { kind: self.kind } - } - } -} -impl CdnVersionMiddleware { - /// Creates a new builder-style object to manufacture [`CdnVersionMiddleware`](crate::model::CdnVersionMiddleware) - pub fn builder() -> crate::model::cdn_version_middleware::Builder { - crate::model::cdn_version_middleware::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] -pub enum CdnVersionMiddlewareKind { - #[allow(missing_docs)] // documentation missing in model - CustomHeaders(crate::model::CdnVersionCustomHeadersMiddleware), - /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version. - /// An unknown enum variant - /// - /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._ - /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized - /// by the client. This can happen when the server adds new functionality, but the client has not been updated. - /// To investigate this, consider turning on debug logging to print the raw HTTP response. - #[non_exhaustive] - Unknown, -} -impl CdnVersionMiddlewareKind { - #[allow(irrefutable_let_patterns)] - /// Tries to convert the enum instance into [`CustomHeaders`](crate::model::CdnVersionMiddlewareKind::CustomHeaders), extracting the inner [`CdnVersionCustomHeadersMiddleware`](crate::model::CdnVersionCustomHeadersMiddleware). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_custom_headers( - &self, - ) -> std::result::Result<&crate::model::CdnVersionCustomHeadersMiddleware, &Self> { - if let CdnVersionMiddlewareKind::CustomHeaders(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`CustomHeaders`](crate::model::CdnVersionMiddlewareKind::CustomHeaders). - pub fn is_custom_headers(&self) -> bool { - self.as_custom_headers().is_ok() - } - /// Returns true if the enum instance is the `Unknown` variant. - pub fn is_unknown(&self) -> bool { - matches!(self, Self::Unknown) - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CdnVersionCustomHeadersMiddleware { - #[allow(missing_docs)] // documentation missing in model - pub headers: std::option::Option>, -} -impl CdnVersionCustomHeadersMiddleware { - #[allow(missing_docs)] // documentation missing in model - pub fn headers(&self) -> std::option::Option<&[crate::model::CdnVersionHeader]> { - self.headers.as_deref() - } -} -impl std::fmt::Debug for CdnVersionCustomHeadersMiddleware { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CdnVersionCustomHeadersMiddleware"); - formatter.field("headers", &self.headers); - formatter.finish() - } -} -/// See [`CdnVersionCustomHeadersMiddleware`](crate::model::CdnVersionCustomHeadersMiddleware) -pub mod cdn_version_custom_headers_middleware { - /// A builder for [`CdnVersionCustomHeadersMiddleware`](crate::model::CdnVersionCustomHeadersMiddleware) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) headers: std::option::Option>, - } - impl Builder { - /// Appends an item to `headers`. - /// - /// To override the contents of this collection use [`set_headers`](Self::set_headers). - /// - pub fn headers(mut self, input: crate::model::CdnVersionHeader) -> Self { - let mut v = self.headers.unwrap_or_default(); - v.push(input); - self.headers = Some(v); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_headers( - mut self, - input: std::option::Option>, - ) -> Self { - self.headers = input; - self - } - /// Consumes the builder and constructs a [`CdnVersionCustomHeadersMiddleware`](crate::model::CdnVersionCustomHeadersMiddleware) - pub fn build(self) -> crate::model::CdnVersionCustomHeadersMiddleware { - crate::model::CdnVersionCustomHeadersMiddleware { - headers: self.headers, - } - } - } -} -impl CdnVersionCustomHeadersMiddleware { - /// Creates a new builder-style object to manufacture [`CdnVersionCustomHeadersMiddleware`](crate::model::CdnVersionCustomHeadersMiddleware) - pub fn builder() -> crate::model::cdn_version_custom_headers_middleware::Builder { - crate::model::cdn_version_custom_headers_middleware::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CdnVersionHeader { - #[allow(missing_docs)] // documentation missing in model - pub name: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub value: std::option::Option, -} -impl CdnVersionHeader { - #[allow(missing_docs)] // documentation missing in model - pub fn name(&self) -> std::option::Option<&str> { - self.name.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn value(&self) -> std::option::Option<&str> { - self.value.as_deref() - } -} -impl std::fmt::Debug for CdnVersionHeader { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CdnVersionHeader"); - formatter.field("name", &self.name); - formatter.field("value", &self.value); - formatter.finish() - } -} -/// See [`CdnVersionHeader`](crate::model::CdnVersionHeader) -pub mod cdn_version_header { - /// A builder for [`CdnVersionHeader`](crate::model::CdnVersionHeader) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) name: std::option::Option, - pub(crate) value: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn name(mut self, input: impl Into) -> Self { - self.name = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_name(mut self, input: std::option::Option) -> Self { - self.name = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn value(mut self, input: impl Into) -> Self { - self.value = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_value(mut self, input: std::option::Option) -> Self { - self.value = input; - self - } - /// Consumes the builder and constructs a [`CdnVersionHeader`](crate::model::CdnVersionHeader) - pub fn build(self) -> crate::model::CdnVersionHeader { - crate::model::CdnVersionHeader { - name: self.name, - value: self.value, - } - } - } -} -impl CdnVersionHeader { - /// Creates a new builder-style object to manufacture [`CdnVersionHeader`](crate::model::CdnVersionHeader) - pub fn builder() -> crate::model::cdn_version_header::Builder { - crate::model::cdn_version_header::Builder::default() - } -} - -/// A full version. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct VersionFull { - /// A universally unique identifier. - pub version_id: std::option::Option, - /// RFC3339 timestamp. - pub create_ts: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// Cloud configuration for a given version. - pub config: std::option::Option, -} -impl VersionFull { - /// A universally unique identifier. - pub fn version_id(&self) -> std::option::Option<&str> { - self.version_id.as_deref() - } - /// RFC3339 timestamp. - pub fn create_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.create_ts.as_ref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// Cloud configuration for a given version. - pub fn config(&self) -> std::option::Option<&crate::model::CloudVersionConfig> { - self.config.as_ref() - } -} -impl std::fmt::Debug for VersionFull { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("VersionFull"); - formatter.field("version_id", &self.version_id); - formatter.field("create_ts", &self.create_ts); - formatter.field("display_name", &self.display_name); - formatter.field("config", &self.config); - formatter.finish() - } -} -/// See [`VersionFull`](crate::model::VersionFull) -pub mod version_full { - /// A builder for [`VersionFull`](crate::model::VersionFull) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) version_id: std::option::Option, - pub(crate) create_ts: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) config: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn version_id(mut self, input: impl Into) -> Self { - self.version_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_version_id(mut self, input: std::option::Option) -> Self { - self.version_id = input; - self - } - /// RFC3339 timestamp. - pub fn create_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.create_ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_create_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.create_ts = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// Cloud configuration for a given version. - pub fn config(mut self, input: crate::model::CloudVersionConfig) -> Self { - self.config = Some(input); - self - } - /// Cloud configuration for a given version. - pub fn set_config( - mut self, - input: std::option::Option, - ) -> Self { - self.config = input; - self - } - /// Consumes the builder and constructs a [`VersionFull`](crate::model::VersionFull) - pub fn build(self) -> crate::model::VersionFull { - crate::model::VersionFull { - version_id: self.version_id, - create_ts: self.create_ts, - display_name: self.display_name, - config: self.config, - } - } - } -} -impl VersionFull { - /// Creates a new builder-style object to manufacture [`VersionFull`](crate::model::VersionFull) - pub fn builder() -> crate::model::version_full::Builder { - crate::model::version_full::Builder::default() - } -} - -/// A billing plan. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GameBillingPlan { - /// A value denoting a game's billing plan. - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub name: std::option::Option, - /// The interval a billing plan acts on. - pub interval: std::option::Option, - /// Signed 64 bit integer. - pub amount: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub currency: std::option::Option, -} -impl GameBillingPlan { - /// A value denoting a game's billing plan. - pub fn code(&self) -> std::option::Option<&crate::model::GameBillingPlanCode> { - self.code.as_ref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn name(&self) -> std::option::Option<&str> { - self.name.as_deref() - } - /// The interval a billing plan acts on. - pub fn interval(&self) -> std::option::Option<&crate::model::BillingInterval> { - self.interval.as_ref() - } - /// Signed 64 bit integer. - pub fn amount(&self) -> std::option::Option { - self.amount - } - #[allow(missing_docs)] // documentation missing in model - pub fn currency(&self) -> std::option::Option<&str> { - self.currency.as_deref() - } -} -impl std::fmt::Debug for GameBillingPlan { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GameBillingPlan"); - formatter.field("code", &self.code); - formatter.field("name", &self.name); - formatter.field("interval", &self.interval); - formatter.field("amount", &self.amount); - formatter.field("currency", &self.currency); - formatter.finish() - } -} -/// See [`GameBillingPlan`](crate::model::GameBillingPlan) -pub mod game_billing_plan { - /// A builder for [`GameBillingPlan`](crate::model::GameBillingPlan) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) name: std::option::Option, - pub(crate) interval: std::option::Option, - pub(crate) amount: std::option::Option, - pub(crate) currency: std::option::Option, - } - impl Builder { - /// A value denoting a game's billing plan. - pub fn code(mut self, input: crate::model::GameBillingPlanCode) -> Self { - self.code = Some(input); - self - } - /// A value denoting a game's billing plan. - pub fn set_code( - mut self, - input: std::option::Option, - ) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn name(mut self, input: impl Into) -> Self { - self.name = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_name(mut self, input: std::option::Option) -> Self { - self.name = input; - self - } - /// The interval a billing plan acts on. - pub fn interval(mut self, input: crate::model::BillingInterval) -> Self { - self.interval = Some(input); - self - } - /// The interval a billing plan acts on. - pub fn set_interval( - mut self, - input: std::option::Option, - ) -> Self { - self.interval = input; - self - } - /// Signed 64 bit integer. - pub fn amount(mut self, input: i64) -> Self { - self.amount = Some(input); - self - } - /// Signed 64 bit integer. - pub fn set_amount(mut self, input: std::option::Option) -> Self { - self.amount = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn currency(mut self, input: impl Into) -> Self { - self.currency = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_currency(mut self, input: std::option::Option) -> Self { - self.currency = input; - self - } - /// Consumes the builder and constructs a [`GameBillingPlan`](crate::model::GameBillingPlan) - pub fn build(self) -> crate::model::GameBillingPlan { - crate::model::GameBillingPlan { - code: self.code, - name: self.name, - interval: self.interval, - amount: self.amount, - currency: self.currency, - } - } - } -} -impl GameBillingPlan { - /// Creates a new builder-style object to manufacture [`GameBillingPlan`](crate::model::GameBillingPlan) - pub fn builder() -> crate::model::game_billing_plan::Builder { - crate::model::game_billing_plan::Builder::default() - } -} - -/// The interval a billing plan acts on. -#[non_exhaustive] -#[derive( - std::clone::Clone, - std::cmp::Eq, - std::cmp::Ord, - std::cmp::PartialEq, - std::cmp::PartialOrd, - std::fmt::Debug, - std::hash::Hash, -)] -pub enum BillingInterval { - #[allow(missing_docs)] // documentation missing in model - Monthly, - #[allow(missing_docs)] // documentation missing in model - Yearly, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for BillingInterval { - fn from(s: &str) -> Self { - match s { - "monthly" => BillingInterval::Monthly, - "yearly" => BillingInterval::Yearly, - other => BillingInterval::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for BillingInterval { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(BillingInterval::from(s)) - } -} -impl BillingInterval { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - BillingInterval::Monthly => "monthly", - BillingInterval::Yearly => "yearly", - BillingInterval::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["monthly", "yearly"] - } -} -impl AsRef for BillingInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// A value denoting a game's billing plan. -#[non_exhaustive] -#[derive( - std::clone::Clone, - std::cmp::Eq, - std::cmp::Ord, - std::cmp::PartialEq, - std::cmp::PartialOrd, - std::fmt::Debug, - std::hash::Hash, -)] -pub enum GameBillingPlanCode { - #[allow(missing_docs)] // documentation missing in model - Enterprise, - #[allow(missing_docs)] // documentation missing in model - Free, - #[allow(missing_docs)] // documentation missing in model - GameHobbyMonthly, - #[allow(missing_docs)] // documentation missing in model - GameHobbyYearly, - #[allow(missing_docs)] // documentation missing in model - GameStudioMonthly, - #[allow(missing_docs)] // documentation missing in model - GameStudioYearly, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for GameBillingPlanCode { - fn from(s: &str) -> Self { - match s { - "enterprise" => GameBillingPlanCode::Enterprise, - "free" => GameBillingPlanCode::Free, - "game_hobby_monthly" => GameBillingPlanCode::GameHobbyMonthly, - "game_hobby_yearly" => GameBillingPlanCode::GameHobbyYearly, - "game_studio_monthly" => GameBillingPlanCode::GameStudioMonthly, - "game_studio_yearly" => GameBillingPlanCode::GameStudioYearly, - other => GameBillingPlanCode::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for GameBillingPlanCode { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(GameBillingPlanCode::from(s)) - } -} -impl GameBillingPlanCode { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - GameBillingPlanCode::Enterprise => "enterprise", - GameBillingPlanCode::Free => "free", - GameBillingPlanCode::GameHobbyMonthly => "game_hobby_monthly", - GameBillingPlanCode::GameHobbyYearly => "game_hobby_yearly", - GameBillingPlanCode::GameStudioMonthly => "game_studio_monthly", - GameBillingPlanCode::GameStudioYearly => "game_studio_yearly", - GameBillingPlanCode::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &[ - "enterprise", - "free", - "game_hobby_monthly", - "game_hobby_yearly", - "game_studio_monthly", - "game_studio_yearly", - ] - } -} -impl AsRef for GameBillingPlanCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// A region summary. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct RegionSummary { - /// A universally unique identifier. - pub region_id: std::option::Option, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub region_name_id: std::option::Option, - /// The server provider of this region. - pub provider: std::option::Option, - /// A universal number given to this region. - pub universal_region: std::option::Option, - /// Represent a resource's readable display name. - pub provider_display_name: std::option::Option, - /// Represent a resource's readable display name. - pub region_display_name: std::option::Option, -} -impl RegionSummary { - /// A universally unique identifier. - pub fn region_id(&self) -> std::option::Option<&str> { - self.region_id.as_deref() - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn region_name_id(&self) -> std::option::Option<&str> { - self.region_name_id.as_deref() - } - /// The server provider of this region. - pub fn provider(&self) -> std::option::Option<&str> { - self.provider.as_deref() - } - /// A universal number given to this region. - pub fn universal_region(&self) -> std::option::Option { - self.universal_region - } - /// Represent a resource's readable display name. - pub fn provider_display_name(&self) -> std::option::Option<&str> { - self.provider_display_name.as_deref() - } - /// Represent a resource's readable display name. - pub fn region_display_name(&self) -> std::option::Option<&str> { - self.region_display_name.as_deref() - } -} -impl std::fmt::Debug for RegionSummary { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("RegionSummary"); - formatter.field("region_id", &self.region_id); - formatter.field("region_name_id", &self.region_name_id); - formatter.field("provider", &self.provider); - formatter.field("universal_region", &self.universal_region); - formatter.field("provider_display_name", &self.provider_display_name); - formatter.field("region_display_name", &self.region_display_name); - formatter.finish() - } -} -/// See [`RegionSummary`](crate::model::RegionSummary) -pub mod region_summary { - /// A builder for [`RegionSummary`](crate::model::RegionSummary) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) region_id: std::option::Option, - pub(crate) region_name_id: std::option::Option, - pub(crate) provider: std::option::Option, - pub(crate) universal_region: std::option::Option, - pub(crate) provider_display_name: std::option::Option, - pub(crate) region_display_name: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn region_id(mut self, input: impl Into) -> Self { - self.region_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_region_id(mut self, input: std::option::Option) -> Self { - self.region_id = input; - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn region_name_id(mut self, input: impl Into) -> Self { - self.region_name_id = Some(input.into()); - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn set_region_name_id( - mut self, - input: std::option::Option, - ) -> Self { - self.region_name_id = input; - self - } - /// The server provider of this region. - pub fn provider(mut self, input: impl Into) -> Self { - self.provider = Some(input.into()); - self - } - /// The server provider of this region. - pub fn set_provider(mut self, input: std::option::Option) -> Self { - self.provider = input; - self - } - /// A universal number given to this region. - pub fn universal_region(mut self, input: i16) -> Self { - self.universal_region = Some(input); - self - } - /// A universal number given to this region. - pub fn set_universal_region(mut self, input: std::option::Option) -> Self { - self.universal_region = input; - self - } - /// Represent a resource's readable display name. - pub fn provider_display_name(mut self, input: impl Into) -> Self { - self.provider_display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_provider_display_name( - mut self, - input: std::option::Option, - ) -> Self { - self.provider_display_name = input; - self - } - /// Represent a resource's readable display name. - pub fn region_display_name(mut self, input: impl Into) -> Self { - self.region_display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_region_display_name( - mut self, - input: std::option::Option, - ) -> Self { - self.region_display_name = input; - self - } - /// Consumes the builder and constructs a [`RegionSummary`](crate::model::RegionSummary) - pub fn build(self) -> crate::model::RegionSummary { - crate::model::RegionSummary { - region_id: self.region_id, - region_name_id: self.region_name_id, - provider: self.provider, - universal_region: self.universal_region, - provider_display_name: self.provider_display_name, - region_display_name: self.region_display_name, - } - } - } -} -impl RegionSummary { - /// Creates a new builder-style object to manufacture [`RegionSummary`](crate::model::RegionSummary) - pub fn builder() -> crate::model::region_summary::Builder { - crate::model::region_summary::Builder::default() - } -} - -/// Region tier metrics. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct RegionTierMetrics { - /// A universally unique identifier. - pub namespace_id: std::option::Option, - /// A universally unique identifier. - pub region_id: std::option::Option, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub tier_name_id: std::option::Option, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub lobby_group_name_id: std::option::Option, - /// How long a region tier has been active (in seconds). - pub uptime: std::option::Option, -} -impl RegionTierMetrics { - /// A universally unique identifier. - pub fn namespace_id(&self) -> std::option::Option<&str> { - self.namespace_id.as_deref() - } - /// A universally unique identifier. - pub fn region_id(&self) -> std::option::Option<&str> { - self.region_id.as_deref() - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn tier_name_id(&self) -> std::option::Option<&str> { - self.tier_name_id.as_deref() - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn lobby_group_name_id(&self) -> std::option::Option<&str> { - self.lobby_group_name_id.as_deref() - } - /// How long a region tier has been active (in seconds). - pub fn uptime(&self) -> std::option::Option { - self.uptime - } -} -impl std::fmt::Debug for RegionTierMetrics { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("RegionTierMetrics"); - formatter.field("namespace_id", &self.namespace_id); - formatter.field("region_id", &self.region_id); - formatter.field("tier_name_id", &self.tier_name_id); - formatter.field("lobby_group_name_id", &self.lobby_group_name_id); - formatter.field("uptime", &self.uptime); - formatter.finish() - } -} -/// See [`RegionTierMetrics`](crate::model::RegionTierMetrics) -pub mod region_tier_metrics { - /// A builder for [`RegionTierMetrics`](crate::model::RegionTierMetrics) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) namespace_id: std::option::Option, - pub(crate) region_id: std::option::Option, - pub(crate) tier_name_id: std::option::Option, - pub(crate) lobby_group_name_id: std::option::Option, - pub(crate) uptime: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.namespace_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.namespace_id = input; - self - } - /// A universally unique identifier. - pub fn region_id(mut self, input: impl Into) -> Self { - self.region_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_region_id(mut self, input: std::option::Option) -> Self { - self.region_id = input; - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn tier_name_id(mut self, input: impl Into) -> Self { - self.tier_name_id = Some(input.into()); - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn set_tier_name_id(mut self, input: std::option::Option) -> Self { - self.tier_name_id = input; - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn lobby_group_name_id(mut self, input: impl Into) -> Self { - self.lobby_group_name_id = Some(input.into()); - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn set_lobby_group_name_id( - mut self, - input: std::option::Option, - ) -> Self { - self.lobby_group_name_id = input; - self - } - /// How long a region tier has been active (in seconds). - pub fn uptime(mut self, input: i64) -> Self { - self.uptime = Some(input); - self - } - /// How long a region tier has been active (in seconds). - pub fn set_uptime(mut self, input: std::option::Option) -> Self { - self.uptime = input; - self - } - /// Consumes the builder and constructs a [`RegionTierMetrics`](crate::model::RegionTierMetrics) - pub fn build(self) -> crate::model::RegionTierMetrics { - crate::model::RegionTierMetrics { - namespace_id: self.namespace_id, - region_id: self.region_id, - tier_name_id: self.tier_name_id, - lobby_group_name_id: self.lobby_group_name_id, - uptime: self.uptime, - } - } - } -} -impl RegionTierMetrics { - /// Creates a new builder-style object to manufacture [`RegionTierMetrics`](crate::model::RegionTierMetrics) - pub fn builder() -> crate::model::region_tier_metrics::Builder { - crate::model::region_tier_metrics::Builder::default() - } -} - -/// A namespace summary. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct NamespaceSummary { - /// A universally unique identifier. - pub namespace_id: std::option::Option, - /// RFC3339 timestamp. - pub create_ts: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// A universally unique identifier. - pub version_id: std::option::Option, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub name_id: std::option::Option, -} -impl NamespaceSummary { - /// A universally unique identifier. - pub fn namespace_id(&self) -> std::option::Option<&str> { - self.namespace_id.as_deref() - } - /// RFC3339 timestamp. - pub fn create_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.create_ts.as_ref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// A universally unique identifier. - pub fn version_id(&self) -> std::option::Option<&str> { - self.version_id.as_deref() - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn name_id(&self) -> std::option::Option<&str> { - self.name_id.as_deref() - } -} -impl std::fmt::Debug for NamespaceSummary { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("NamespaceSummary"); - formatter.field("namespace_id", &self.namespace_id); - formatter.field("create_ts", &self.create_ts); - formatter.field("display_name", &self.display_name); - formatter.field("version_id", &self.version_id); - formatter.field("name_id", &self.name_id); - formatter.finish() - } -} -/// See [`NamespaceSummary`](crate::model::NamespaceSummary) -pub mod namespace_summary { - /// A builder for [`NamespaceSummary`](crate::model::NamespaceSummary) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) namespace_id: std::option::Option, - pub(crate) create_ts: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) version_id: std::option::Option, - pub(crate) name_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.namespace_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.namespace_id = input; - self - } - /// RFC3339 timestamp. - pub fn create_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.create_ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_create_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.create_ts = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// A universally unique identifier. - pub fn version_id(mut self, input: impl Into) -> Self { - self.version_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_version_id(mut self, input: std::option::Option) -> Self { - self.version_id = input; - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn name_id(mut self, input: impl Into) -> Self { - self.name_id = Some(input.into()); - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn set_name_id(mut self, input: std::option::Option) -> Self { - self.name_id = input; - self - } - /// Consumes the builder and constructs a [`NamespaceSummary`](crate::model::NamespaceSummary) - pub fn build(self) -> crate::model::NamespaceSummary { - crate::model::NamespaceSummary { - namespace_id: self.namespace_id, - create_ts: self.create_ts, - display_name: self.display_name, - version_id: self.version_id, - name_id: self.name_id, - } - } - } -} -impl NamespaceSummary { - /// Creates a new builder-style object to manufacture [`NamespaceSummary`](crate::model::NamespaceSummary) - pub fn builder() -> crate::model::namespace_summary::Builder { - crate::model::namespace_summary::Builder::default() - } -} - -/// A game handle. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GameHandle { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub name_id: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// The URL of this game's logo image. - pub logo_url: std::option::Option, - /// The URL of this game's banner image. - pub banner_url: std::option::Option, -} -impl GameHandle { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn name_id(&self) -> std::option::Option<&str> { - self.name_id.as_deref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// The URL of this game's logo image. - pub fn logo_url(&self) -> std::option::Option<&str> { - self.logo_url.as_deref() - } - /// The URL of this game's banner image. - pub fn banner_url(&self) -> std::option::Option<&str> { - self.banner_url.as_deref() - } -} -impl std::fmt::Debug for GameHandle { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GameHandle"); - formatter.field("game_id", &self.game_id); - formatter.field("name_id", &self.name_id); - formatter.field("display_name", &self.display_name); - formatter.field("logo_url", &self.logo_url); - formatter.field("banner_url", &self.banner_url); - formatter.finish() - } -} -/// See [`GameHandle`](crate::model::GameHandle) -pub mod game_handle { - /// A builder for [`GameHandle`](crate::model::GameHandle) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) name_id: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) logo_url: std::option::Option, - pub(crate) banner_url: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn name_id(mut self, input: impl Into) -> Self { - self.name_id = Some(input.into()); - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn set_name_id(mut self, input: std::option::Option) -> Self { - self.name_id = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// The URL of this game's logo image. - pub fn logo_url(mut self, input: impl Into) -> Self { - self.logo_url = Some(input.into()); - self - } - /// The URL of this game's logo image. - pub fn set_logo_url(mut self, input: std::option::Option) -> Self { - self.logo_url = input; - self - } - /// The URL of this game's banner image. - pub fn banner_url(mut self, input: impl Into) -> Self { - self.banner_url = Some(input.into()); - self - } - /// The URL of this game's banner image. - pub fn set_banner_url(mut self, input: std::option::Option) -> Self { - self.banner_url = input; - self - } - /// Consumes the builder and constructs a [`GameHandle`](crate::model::GameHandle) - pub fn build(self) -> crate::model::GameHandle { - crate::model::GameHandle { - game_id: self.game_id, - name_id: self.name_id, - display_name: self.display_name, - logo_url: self.logo_url, - banner_url: self.banner_url, - } - } - } -} -impl GameHandle { - /// Creates a new builder-style object to manufacture [`GameHandle`](crate::model::GameHandle) - pub fn builder() -> crate::model::game_handle::Builder { - crate::model::game_handle::Builder::default() - } -} - -/// A full game. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GameFull { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// RFC3339 timestamp. - pub create_ts: std::option::Option, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub name_id: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// A universally unique identifier. - pub developer_group_id: std::option::Option, - /// Unsigned 32 bit integer. - pub total_player_count: std::option::Option, - /// The URL of this game's logo image. - pub logo_url: std::option::Option, - /// The URL of this game's banner image. - pub banner_url: std::option::Option, - /// A list of namespace summaries. - pub namespaces: std::option::Option>, - /// A list of version summaries. - pub versions: std::option::Option>, - /// A list of region summaries. - pub available_regions: std::option::Option>, -} -impl GameFull { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// RFC3339 timestamp. - pub fn create_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.create_ts.as_ref() - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn name_id(&self) -> std::option::Option<&str> { - self.name_id.as_deref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// A universally unique identifier. - pub fn developer_group_id(&self) -> std::option::Option<&str> { - self.developer_group_id.as_deref() - } - /// Unsigned 32 bit integer. - pub fn total_player_count(&self) -> std::option::Option { - self.total_player_count - } - /// The URL of this game's logo image. - pub fn logo_url(&self) -> std::option::Option<&str> { - self.logo_url.as_deref() - } - /// The URL of this game's banner image. - pub fn banner_url(&self) -> std::option::Option<&str> { - self.banner_url.as_deref() - } - /// A list of namespace summaries. - pub fn namespaces(&self) -> std::option::Option<&[crate::model::NamespaceSummary]> { - self.namespaces.as_deref() - } - /// A list of version summaries. - pub fn versions(&self) -> std::option::Option<&[crate::model::VersionSummary]> { - self.versions.as_deref() - } - /// A list of region summaries. - pub fn available_regions(&self) -> std::option::Option<&[crate::model::RegionSummary]> { - self.available_regions.as_deref() - } -} -impl std::fmt::Debug for GameFull { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GameFull"); - formatter.field("game_id", &self.game_id); - formatter.field("create_ts", &self.create_ts); - formatter.field("name_id", &self.name_id); - formatter.field("display_name", &self.display_name); - formatter.field("developer_group_id", &self.developer_group_id); - formatter.field("total_player_count", &self.total_player_count); - formatter.field("logo_url", &self.logo_url); - formatter.field("banner_url", &self.banner_url); - formatter.field("namespaces", &self.namespaces); - formatter.field("versions", &self.versions); - formatter.field("available_regions", &self.available_regions); - formatter.finish() - } -} -/// See [`GameFull`](crate::model::GameFull) -pub mod game_full { - /// A builder for [`GameFull`](crate::model::GameFull) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) create_ts: std::option::Option, - pub(crate) name_id: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) developer_group_id: std::option::Option, - pub(crate) total_player_count: std::option::Option, - pub(crate) logo_url: std::option::Option, - pub(crate) banner_url: std::option::Option, - pub(crate) namespaces: std::option::Option>, - pub(crate) versions: std::option::Option>, - pub(crate) available_regions: - std::option::Option>, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// RFC3339 timestamp. - pub fn create_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.create_ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_create_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.create_ts = input; - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn name_id(mut self, input: impl Into) -> Self { - self.name_id = Some(input.into()); - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn set_name_id(mut self, input: std::option::Option) -> Self { - self.name_id = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// A universally unique identifier. - pub fn developer_group_id(mut self, input: impl Into) -> Self { - self.developer_group_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_developer_group_id( - mut self, - input: std::option::Option, - ) -> Self { - self.developer_group_id = input; - self - } - /// Unsigned 32 bit integer. - pub fn total_player_count(mut self, input: i32) -> Self { - self.total_player_count = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_total_player_count(mut self, input: std::option::Option) -> Self { - self.total_player_count = input; - self - } - /// The URL of this game's logo image. - pub fn logo_url(mut self, input: impl Into) -> Self { - self.logo_url = Some(input.into()); - self - } - /// The URL of this game's logo image. - pub fn set_logo_url(mut self, input: std::option::Option) -> Self { - self.logo_url = input; - self - } - /// The URL of this game's banner image. - pub fn banner_url(mut self, input: impl Into) -> Self { - self.banner_url = Some(input.into()); - self - } - /// The URL of this game's banner image. - pub fn set_banner_url(mut self, input: std::option::Option) -> Self { - self.banner_url = input; - self - } - /// Appends an item to `namespaces`. - /// - /// To override the contents of this collection use [`set_namespaces`](Self::set_namespaces). - /// - /// A list of namespace summaries. - pub fn namespaces(mut self, input: crate::model::NamespaceSummary) -> Self { - let mut v = self.namespaces.unwrap_or_default(); - v.push(input); - self.namespaces = Some(v); - self - } - /// A list of namespace summaries. - pub fn set_namespaces( - mut self, - input: std::option::Option>, - ) -> Self { - self.namespaces = input; - self - } - /// Appends an item to `versions`. - /// - /// To override the contents of this collection use [`set_versions`](Self::set_versions). - /// - /// A list of version summaries. - pub fn versions(mut self, input: crate::model::VersionSummary) -> Self { - let mut v = self.versions.unwrap_or_default(); - v.push(input); - self.versions = Some(v); - self - } - /// A list of version summaries. - pub fn set_versions( - mut self, - input: std::option::Option>, - ) -> Self { - self.versions = input; - self - } - /// Appends an item to `available_regions`. - /// - /// To override the contents of this collection use [`set_available_regions`](Self::set_available_regions). - /// - /// A list of region summaries. - pub fn available_regions(mut self, input: crate::model::RegionSummary) -> Self { - let mut v = self.available_regions.unwrap_or_default(); - v.push(input); - self.available_regions = Some(v); - self - } - /// A list of region summaries. - pub fn set_available_regions( - mut self, - input: std::option::Option>, - ) -> Self { - self.available_regions = input; - self - } - /// Consumes the builder and constructs a [`GameFull`](crate::model::GameFull) - pub fn build(self) -> crate::model::GameFull { - crate::model::GameFull { - game_id: self.game_id, - create_ts: self.create_ts, - name_id: self.name_id, - display_name: self.display_name, - developer_group_id: self.developer_group_id, - total_player_count: self.total_player_count, - logo_url: self.logo_url, - banner_url: self.banner_url, - namespaces: self.namespaces, - versions: self.versions, - available_regions: self.available_regions, - } - } - } -} -impl GameFull { - /// Creates a new builder-style object to manufacture [`GameFull`](crate::model::GameFull) - pub fn builder() -> crate::model::game_full::Builder { - crate::model::game_full::Builder::default() - } -} - -/// A version summary. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct VersionSummary { - /// A universally unique identifier. - pub version_id: std::option::Option, - /// RFC3339 timestamp. - pub create_ts: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, -} -impl VersionSummary { - /// A universally unique identifier. - pub fn version_id(&self) -> std::option::Option<&str> { - self.version_id.as_deref() - } - /// RFC3339 timestamp. - pub fn create_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.create_ts.as_ref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } -} -impl std::fmt::Debug for VersionSummary { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("VersionSummary"); - formatter.field("version_id", &self.version_id); - formatter.field("create_ts", &self.create_ts); - formatter.field("display_name", &self.display_name); - formatter.finish() - } -} -/// See [`VersionSummary`](crate::model::VersionSummary) -pub mod version_summary { - /// A builder for [`VersionSummary`](crate::model::VersionSummary) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) version_id: std::option::Option, - pub(crate) create_ts: std::option::Option, - pub(crate) display_name: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn version_id(mut self, input: impl Into) -> Self { - self.version_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_version_id(mut self, input: std::option::Option) -> Self { - self.version_id = input; - self - } - /// RFC3339 timestamp. - pub fn create_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.create_ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_create_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.create_ts = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// Consumes the builder and constructs a [`VersionSummary`](crate::model::VersionSummary) - pub fn build(self) -> crate::model::VersionSummary { - crate::model::VersionSummary { - version_id: self.version_id, - create_ts: self.create_ts, - display_name: self.display_name, - } - } - } -} -impl VersionSummary { - /// Creates a new builder-style object to manufacture [`VersionSummary`](crate::model::VersionSummary) - pub fn builder() -> crate::model::version_summary::Builder { - crate::model::version_summary::Builder::default() - } -} - -/// A group summary. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GroupSummary { - /// A universally unique identifier. - pub group_id: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// The URL of this group's avatar image. - pub avatar_url: std::option::Option, - /// External links for this group. - pub external: std::option::Option, - /// Whether or not this group is a developer. - pub is_developer: std::option::Option, - /// Detailed information about a profile. - pub bio: std::option::Option, - /// Whether or not the current identity is a member of this group. - pub is_current_identity_member: std::option::Option, - /// The current publicity value for the given group. - pub publicity: std::option::Option, - /// Unsigned 32 bit integer. - pub member_count: std::option::Option, - /// A universally unique identifier. - pub owner_identity_id: std::option::Option, -} -impl GroupSummary { - /// A universally unique identifier. - pub fn group_id(&self) -> std::option::Option<&str> { - self.group_id.as_deref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// The URL of this group's avatar image. - pub fn avatar_url(&self) -> std::option::Option<&str> { - self.avatar_url.as_deref() - } - /// External links for this group. - pub fn external(&self) -> std::option::Option<&crate::model::GroupExternalLinks> { - self.external.as_ref() - } - /// Whether or not this group is a developer. - pub fn is_developer(&self) -> std::option::Option { - self.is_developer - } - /// Detailed information about a profile. - pub fn bio(&self) -> std::option::Option<&str> { - self.bio.as_deref() - } - /// Whether or not the current identity is a member of this group. - pub fn is_current_identity_member(&self) -> std::option::Option { - self.is_current_identity_member - } - /// The current publicity value for the given group. - pub fn publicity(&self) -> std::option::Option<&crate::model::GroupPublicity> { - self.publicity.as_ref() - } - /// Unsigned 32 bit integer. - pub fn member_count(&self) -> std::option::Option { - self.member_count - } - /// A universally unique identifier. - pub fn owner_identity_id(&self) -> std::option::Option<&str> { - self.owner_identity_id.as_deref() - } -} -impl std::fmt::Debug for GroupSummary { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GroupSummary"); - formatter.field("group_id", &self.group_id); - formatter.field("display_name", &self.display_name); - formatter.field("avatar_url", &self.avatar_url); - formatter.field("external", &self.external); - formatter.field("is_developer", &self.is_developer); - formatter.field("bio", &self.bio); - formatter.field( - "is_current_identity_member", - &self.is_current_identity_member, - ); - formatter.field("publicity", &self.publicity); - formatter.field("member_count", &self.member_count); - formatter.field("owner_identity_id", &self.owner_identity_id); - formatter.finish() - } -} -/// See [`GroupSummary`](crate::model::GroupSummary) -pub mod group_summary { - /// A builder for [`GroupSummary`](crate::model::GroupSummary) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) group_id: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) avatar_url: std::option::Option, - pub(crate) external: std::option::Option, - pub(crate) is_developer: std::option::Option, - pub(crate) bio: std::option::Option, - pub(crate) is_current_identity_member: std::option::Option, - pub(crate) publicity: std::option::Option, - pub(crate) member_count: std::option::Option, - pub(crate) owner_identity_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.group_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.group_id = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// The URL of this group's avatar image. - pub fn avatar_url(mut self, input: impl Into) -> Self { - self.avatar_url = Some(input.into()); - self - } - /// The URL of this group's avatar image. - pub fn set_avatar_url(mut self, input: std::option::Option) -> Self { - self.avatar_url = input; - self - } - /// External links for this group. - pub fn external(mut self, input: crate::model::GroupExternalLinks) -> Self { - self.external = Some(input); - self - } - /// External links for this group. - pub fn set_external( - mut self, - input: std::option::Option, - ) -> Self { - self.external = input; - self - } - /// Whether or not this group is a developer. - pub fn is_developer(mut self, input: bool) -> Self { - self.is_developer = Some(input); - self - } - /// Whether or not this group is a developer. - pub fn set_is_developer(mut self, input: std::option::Option) -> Self { - self.is_developer = input; - self - } - /// Detailed information about a profile. - pub fn bio(mut self, input: impl Into) -> Self { - self.bio = Some(input.into()); - self - } - /// Detailed information about a profile. - pub fn set_bio(mut self, input: std::option::Option) -> Self { - self.bio = input; - self - } - /// Whether or not the current identity is a member of this group. - pub fn is_current_identity_member(mut self, input: bool) -> Self { - self.is_current_identity_member = Some(input); - self - } - /// Whether or not the current identity is a member of this group. - pub fn set_is_current_identity_member(mut self, input: std::option::Option) -> Self { - self.is_current_identity_member = input; - self - } - /// The current publicity value for the given group. - pub fn publicity(mut self, input: crate::model::GroupPublicity) -> Self { - self.publicity = Some(input); - self - } - /// The current publicity value for the given group. - pub fn set_publicity( - mut self, - input: std::option::Option, - ) -> Self { - self.publicity = input; - self - } - /// Unsigned 32 bit integer. - pub fn member_count(mut self, input: i32) -> Self { - self.member_count = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_member_count(mut self, input: std::option::Option) -> Self { - self.member_count = input; - self - } - /// A universally unique identifier. - pub fn owner_identity_id(mut self, input: impl Into) -> Self { - self.owner_identity_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_owner_identity_id( - mut self, - input: std::option::Option, - ) -> Self { - self.owner_identity_id = input; - self - } - /// Consumes the builder and constructs a [`GroupSummary`](crate::model::GroupSummary) - pub fn build(self) -> crate::model::GroupSummary { - crate::model::GroupSummary { - group_id: self.group_id, - display_name: self.display_name, - avatar_url: self.avatar_url, - external: self.external, - is_developer: self.is_developer, - bio: self.bio, - is_current_identity_member: self.is_current_identity_member, - publicity: self.publicity, - member_count: self.member_count, - owner_identity_id: self.owner_identity_id, - } - } - } -} -impl GroupSummary { - /// Creates a new builder-style object to manufacture [`GroupSummary`](crate::model::GroupSummary) - pub fn builder() -> crate::model::group_summary::Builder { - crate::model::group_summary::Builder::default() - } -} - -/// The current publicity value for the given group. -#[non_exhaustive] -#[derive( - std::clone::Clone, - std::cmp::Eq, - std::cmp::Ord, - std::cmp::PartialEq, - std::cmp::PartialOrd, - std::fmt::Debug, - std::hash::Hash, -)] -pub enum GroupPublicity { - #[allow(missing_docs)] // documentation missing in model - Closed, - #[allow(missing_docs)] // documentation missing in model - Open, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for GroupPublicity { - fn from(s: &str) -> Self { - match s { - "closed" => GroupPublicity::Closed, - "open" => GroupPublicity::Open, - other => GroupPublicity::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for GroupPublicity { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(GroupPublicity::from(s)) - } -} -impl GroupPublicity { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - GroupPublicity::Closed => "closed", - GroupPublicity::Open => "open", - GroupPublicity::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["closed", "open"] - } -} -impl AsRef for GroupPublicity { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// External links for this group. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GroupExternalLinks { - /// A link to this group's profile page. - pub profile: std::option::Option, - /// A link to this group's chat page. - pub chat: std::option::Option, -} -impl GroupExternalLinks { - /// A link to this group's profile page. - pub fn profile(&self) -> std::option::Option<&str> { - self.profile.as_deref() - } - /// A link to this group's chat page. - pub fn chat(&self) -> std::option::Option<&str> { - self.chat.as_deref() - } -} -impl std::fmt::Debug for GroupExternalLinks { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GroupExternalLinks"); - formatter.field("profile", &self.profile); - formatter.field("chat", &self.chat); - formatter.finish() - } -} -/// See [`GroupExternalLinks`](crate::model::GroupExternalLinks) -pub mod group_external_links { - /// A builder for [`GroupExternalLinks`](crate::model::GroupExternalLinks) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) profile: std::option::Option, - pub(crate) chat: std::option::Option, - } - impl Builder { - /// A link to this group's profile page. - pub fn profile(mut self, input: impl Into) -> Self { - self.profile = Some(input.into()); - self - } - /// A link to this group's profile page. - pub fn set_profile(mut self, input: std::option::Option) -> Self { - self.profile = input; - self - } - /// A link to this group's chat page. - pub fn chat(mut self, input: impl Into) -> Self { - self.chat = Some(input.into()); - self - } - /// A link to this group's chat page. - pub fn set_chat(mut self, input: std::option::Option) -> Self { - self.chat = input; - self - } - /// Consumes the builder and constructs a [`GroupExternalLinks`](crate::model::GroupExternalLinks) - pub fn build(self) -> crate::model::GroupExternalLinks { - crate::model::GroupExternalLinks { - profile: self.profile, - chat: self.chat, - } - } - } -} -impl GroupExternalLinks { - /// Creates a new builder-style object to manufacture [`GroupExternalLinks`](crate::model::GroupExternalLinks) - pub fn builder() -> crate::model::group_external_links::Builder { - crate::model::group_external_links::Builder::default() - } -} - -/// A game summary. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GameSummary { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// RFC3339 timestamp. - pub create_ts: std::option::Option, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub name_id: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// A universally unique identifier. - pub developer_group_id: std::option::Option, - /// Unsigned 32 bit integer. - pub total_player_count: std::option::Option, - /// The URL of this game's logo image. - pub logo_url: std::option::Option, - /// The URL of this game's banner image. - pub banner_url: std::option::Option, -} -impl GameSummary { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// RFC3339 timestamp. - pub fn create_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.create_ts.as_ref() - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn name_id(&self) -> std::option::Option<&str> { - self.name_id.as_deref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// A universally unique identifier. - pub fn developer_group_id(&self) -> std::option::Option<&str> { - self.developer_group_id.as_deref() - } - /// Unsigned 32 bit integer. - pub fn total_player_count(&self) -> std::option::Option { - self.total_player_count - } - /// The URL of this game's logo image. - pub fn logo_url(&self) -> std::option::Option<&str> { - self.logo_url.as_deref() - } - /// The URL of this game's banner image. - pub fn banner_url(&self) -> std::option::Option<&str> { - self.banner_url.as_deref() - } -} -impl std::fmt::Debug for GameSummary { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GameSummary"); - formatter.field("game_id", &self.game_id); - formatter.field("create_ts", &self.create_ts); - formatter.field("name_id", &self.name_id); - formatter.field("display_name", &self.display_name); - formatter.field("developer_group_id", &self.developer_group_id); - formatter.field("total_player_count", &self.total_player_count); - formatter.field("logo_url", &self.logo_url); - formatter.field("banner_url", &self.banner_url); - formatter.finish() - } -} -/// See [`GameSummary`](crate::model::GameSummary) -pub mod game_summary { - /// A builder for [`GameSummary`](crate::model::GameSummary) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) create_ts: std::option::Option, - pub(crate) name_id: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) developer_group_id: std::option::Option, - pub(crate) total_player_count: std::option::Option, - pub(crate) logo_url: std::option::Option, - pub(crate) banner_url: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// RFC3339 timestamp. - pub fn create_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.create_ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_create_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.create_ts = input; - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn name_id(mut self, input: impl Into) -> Self { - self.name_id = Some(input.into()); - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn set_name_id(mut self, input: std::option::Option) -> Self { - self.name_id = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// A universally unique identifier. - pub fn developer_group_id(mut self, input: impl Into) -> Self { - self.developer_group_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_developer_group_id( - mut self, - input: std::option::Option, - ) -> Self { - self.developer_group_id = input; - self - } - /// Unsigned 32 bit integer. - pub fn total_player_count(mut self, input: i32) -> Self { - self.total_player_count = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_total_player_count(mut self, input: std::option::Option) -> Self { - self.total_player_count = input; - self - } - /// The URL of this game's logo image. - pub fn logo_url(mut self, input: impl Into) -> Self { - self.logo_url = Some(input.into()); - self - } - /// The URL of this game's logo image. - pub fn set_logo_url(mut self, input: std::option::Option) -> Self { - self.logo_url = input; - self - } - /// The URL of this game's banner image. - pub fn banner_url(mut self, input: impl Into) -> Self { - self.banner_url = Some(input.into()); - self - } - /// The URL of this game's banner image. - pub fn set_banner_url(mut self, input: std::option::Option) -> Self { - self.banner_url = input; - self - } - /// Consumes the builder and constructs a [`GameSummary`](crate::model::GameSummary) - pub fn build(self) -> crate::model::GameSummary { - crate::model::GameSummary { - game_id: self.game_id, - create_ts: self.create_ts, - name_id: self.name_id, - display_name: self.display_name, - developer_group_id: self.developer_group_id, - total_player_count: self.total_player_count, - logo_url: self.logo_url, - banner_url: self.banner_url, - } - } - } -} -impl GameSummary { - /// Creates a new builder-style object to manufacture [`GameSummary`](crate::model::GameSummary) - pub fn builder() -> crate::model::game_summary::Builder { - crate::model::game_summary::Builder::default() - } -} - -/// The current authenticated agent. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] -pub enum AuthAgent { - /// The current authenticated game cloud. - GameCloud(crate::model::AuthAgentGameCloud), - /// The current authenticated identity. - Identity(crate::model::AuthAgentIdentity), - /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version. - /// An unknown enum variant - /// - /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._ - /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized - /// by the client. This can happen when the server adds new functionality, but the client has not been updated. - /// To investigate this, consider turning on debug logging to print the raw HTTP response. - #[non_exhaustive] - Unknown, -} -impl AuthAgent { - /// Tries to convert the enum instance into [`GameCloud`](crate::model::AuthAgent::GameCloud), extracting the inner [`AuthAgentGameCloud`](crate::model::AuthAgentGameCloud). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_game_cloud(&self) -> std::result::Result<&crate::model::AuthAgentGameCloud, &Self> { - if let AuthAgent::GameCloud(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`GameCloud`](crate::model::AuthAgent::GameCloud). - pub fn is_game_cloud(&self) -> bool { - self.as_game_cloud().is_ok() - } - /// Tries to convert the enum instance into [`Identity`](crate::model::AuthAgent::Identity), extracting the inner [`AuthAgentIdentity`](crate::model::AuthAgentIdentity). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_identity(&self) -> std::result::Result<&crate::model::AuthAgentIdentity, &Self> { - if let AuthAgent::Identity(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`Identity`](crate::model::AuthAgent::Identity). - pub fn is_identity(&self) -> bool { - self.as_identity().is_ok() - } - /// Returns true if the enum instance is the `Unknown` variant. - pub fn is_unknown(&self) -> bool { - matches!(self, Self::Unknown) - } -} - -/// The current authenticated game cloud. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct AuthAgentGameCloud { - /// A universally unique identifier. - pub game_id: std::option::Option, -} -impl AuthAgentGameCloud { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } -} -impl std::fmt::Debug for AuthAgentGameCloud { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("AuthAgentGameCloud"); - formatter.field("game_id", &self.game_id); - formatter.finish() - } -} -/// See [`AuthAgentGameCloud`](crate::model::AuthAgentGameCloud) -pub mod auth_agent_game_cloud { - /// A builder for [`AuthAgentGameCloud`](crate::model::AuthAgentGameCloud) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// Consumes the builder and constructs a [`AuthAgentGameCloud`](crate::model::AuthAgentGameCloud) - pub fn build(self) -> crate::model::AuthAgentGameCloud { - crate::model::AuthAgentGameCloud { - game_id: self.game_id, - } - } - } -} -impl AuthAgentGameCloud { - /// Creates a new builder-style object to manufacture [`AuthAgentGameCloud`](crate::model::AuthAgentGameCloud) - pub fn builder() -> crate::model::auth_agent_game_cloud::Builder { - crate::model::auth_agent_game_cloud::Builder::default() - } -} - -/// The current authenticated identity. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct AuthAgentIdentity { - /// A universally unique identifier. - pub identity_id: std::option::Option, -} -impl AuthAgentIdentity { - /// A universally unique identifier. - pub fn identity_id(&self) -> std::option::Option<&str> { - self.identity_id.as_deref() - } -} -impl std::fmt::Debug for AuthAgentIdentity { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("AuthAgentIdentity"); - formatter.field("identity_id", &self.identity_id); - formatter.finish() - } -} -/// See [`AuthAgentIdentity`](crate::model::AuthAgentIdentity) -pub mod auth_agent_identity { - /// A builder for [`AuthAgentIdentity`](crate::model::AuthAgentIdentity) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.identity_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.identity_id = input; - self - } - /// Consumes the builder and constructs a [`AuthAgentIdentity`](crate::model::AuthAgentIdentity) - pub fn build(self) -> crate::model::AuthAgentIdentity { - crate::model::AuthAgentIdentity { - identity_id: self.identity_id, - } - } - } -} -impl AuthAgentIdentity { - /// Creates a new builder-style object to manufacture [`AuthAgentIdentity`](crate::model::AuthAgentIdentity) - pub fn builder() -> crate::model::auth_agent_identity::Builder { - crate::model::auth_agent_identity::Builder::default() - } -} diff --git a/lib/smithy-output/api-cloud/rust/rust/src/operation.rs b/lib/smithy-output/api-cloud/rust/rust/src/operation.rs deleted file mode 100644 index 891d9fedd..000000000 --- a/lib/smithy-output/api-cloud/rust/rust/src/operation.rs +++ /dev/null @@ -1,1778 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Operation shape for `AddNamespaceDomain`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`add_namespace_domain`](crate::client::Client::add_namespace_domain). -/// -/// See [`crate::client::fluent_builders::AddNamespaceDomain`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct AddNamespaceDomain { - _private: (), -} -impl AddNamespaceDomain { - /// Creates a new builder-style object to manufacture [`AddNamespaceDomainInput`](crate::input::AddNamespaceDomainInput) - pub fn builder() -> crate::input::add_namespace_domain_input::Builder { - crate::input::add_namespace_domain_input::Builder::default() - } - /// Creates a new `AddNamespaceDomain` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for AddNamespaceDomain { - type Output = std::result::Result< - crate::output::AddNamespaceDomainOutput, - crate::error::AddNamespaceDomainError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_add_namespace_domain_error(response) - } else { - crate::operation_deser::parse_add_namespace_domain_response(response) - } - } -} - -/// Operation shape for `CompleteCustomAvatarUpload`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`complete_custom_avatar_upload`](crate::client::Client::complete_custom_avatar_upload). -/// -/// See [`crate::client::fluent_builders::CompleteCustomAvatarUpload`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct CompleteCustomAvatarUpload { - _private: (), -} -impl CompleteCustomAvatarUpload { - /// Creates a new builder-style object to manufacture [`CompleteCustomAvatarUploadInput`](crate::input::CompleteCustomAvatarUploadInput) - pub fn builder() -> crate::input::complete_custom_avatar_upload_input::Builder { - crate::input::complete_custom_avatar_upload_input::Builder::default() - } - /// Creates a new `CompleteCustomAvatarUpload` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for CompleteCustomAvatarUpload { - type Output = std::result::Result< - crate::output::CompleteCustomAvatarUploadOutput, - crate::error::CompleteCustomAvatarUploadError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_complete_custom_avatar_upload_error(response) - } else { - crate::operation_deser::parse_complete_custom_avatar_upload_response(response) - } - } -} - -/// Operation shape for `CompleteUpload`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`complete_upload`](crate::client::Client::complete_upload). -/// -/// See [`crate::client::fluent_builders::CompleteUpload`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct CompleteUpload { - _private: (), -} -impl CompleteUpload { - /// Creates a new builder-style object to manufacture [`CompleteUploadInput`](crate::input::CompleteUploadInput) - pub fn builder() -> crate::input::complete_upload_input::Builder { - crate::input::complete_upload_input::Builder::default() - } - /// Creates a new `CompleteUpload` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for CompleteUpload { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_complete_upload_error(response) - } else { - crate::operation_deser::parse_complete_upload_response(response) - } - } -} - -/// Operation shape for `ConvertGroup`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`convert_group`](crate::client::Client::convert_group). -/// -/// See [`crate::client::fluent_builders::ConvertGroup`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct ConvertGroup { - _private: (), -} -impl ConvertGroup { - /// Creates a new builder-style object to manufacture [`ConvertGroupInput`](crate::input::ConvertGroupInput) - pub fn builder() -> crate::input::convert_group_input::Builder { - crate::input::convert_group_input::Builder::default() - } - /// Creates a new `ConvertGroup` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for ConvertGroup { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_convert_group_error(response) - } else { - crate::operation_deser::parse_convert_group_response(response) - } - } -} - -/// Operation shape for `CreateCloudToken`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`create_cloud_token`](crate::client::Client::create_cloud_token). -/// -/// See [`crate::client::fluent_builders::CreateCloudToken`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct CreateCloudToken { - _private: (), -} -impl CreateCloudToken { - /// Creates a new builder-style object to manufacture [`CreateCloudTokenInput`](crate::input::CreateCloudTokenInput) - pub fn builder() -> crate::input::create_cloud_token_input::Builder { - crate::input::create_cloud_token_input::Builder::default() - } - /// Creates a new `CreateCloudToken` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for CreateCloudToken { - type Output = std::result::Result< - crate::output::CreateCloudTokenOutput, - crate::error::CreateCloudTokenError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_create_cloud_token_error(response) - } else { - crate::operation_deser::parse_create_cloud_token_response(response) - } - } -} - -/// Operation shape for `CreateGame`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`create_game`](crate::client::Client::create_game). -/// -/// See [`crate::client::fluent_builders::CreateGame`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct CreateGame { - _private: (), -} -impl CreateGame { - /// Creates a new builder-style object to manufacture [`CreateGameInput`](crate::input::CreateGameInput) - pub fn builder() -> crate::input::create_game_input::Builder { - crate::input::create_game_input::Builder::default() - } - /// Creates a new `CreateGame` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for CreateGame { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_create_game_error(response) - } else { - crate::operation_deser::parse_create_game_response(response) - } - } -} - -/// Operation shape for `CreateGameBuild`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`create_game_build`](crate::client::Client::create_game_build). -/// -/// See [`crate::client::fluent_builders::CreateGameBuild`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct CreateGameBuild { - _private: (), -} -impl CreateGameBuild { - /// Creates a new builder-style object to manufacture [`CreateGameBuildInput`](crate::input::CreateGameBuildInput) - pub fn builder() -> crate::input::create_game_build_input::Builder { - crate::input::create_game_build_input::Builder::default() - } - /// Creates a new `CreateGameBuild` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for CreateGameBuild { - type Output = std::result::Result< - crate::output::CreateGameBuildOutput, - crate::error::CreateGameBuildError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_create_game_build_error(response) - } else { - crate::operation_deser::parse_create_game_build_response(response) - } - } -} - -/// Operation shape for `CreateGameCdnSite`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`create_game_cdn_site`](crate::client::Client::create_game_cdn_site). -/// -/// See [`crate::client::fluent_builders::CreateGameCdnSite`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct CreateGameCdnSite { - _private: (), -} -impl CreateGameCdnSite { - /// Creates a new builder-style object to manufacture [`CreateGameCdnSiteInput`](crate::input::CreateGameCdnSiteInput) - pub fn builder() -> crate::input::create_game_cdn_site_input::Builder { - crate::input::create_game_cdn_site_input::Builder::default() - } - /// Creates a new `CreateGameCdnSite` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for CreateGameCdnSite { - type Output = std::result::Result< - crate::output::CreateGameCdnSiteOutput, - crate::error::CreateGameCdnSiteError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_create_game_cdn_site_error(response) - } else { - crate::operation_deser::parse_create_game_cdn_site_response(response) - } - } -} - -/// Operation shape for `CreateGameNamespace`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`create_game_namespace`](crate::client::Client::create_game_namespace). -/// -/// See [`crate::client::fluent_builders::CreateGameNamespace`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct CreateGameNamespace { - _private: (), -} -impl CreateGameNamespace { - /// Creates a new builder-style object to manufacture [`CreateGameNamespaceInput`](crate::input::CreateGameNamespaceInput) - pub fn builder() -> crate::input::create_game_namespace_input::Builder { - crate::input::create_game_namespace_input::Builder::default() - } - /// Creates a new `CreateGameNamespace` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for CreateGameNamespace { - type Output = std::result::Result< - crate::output::CreateGameNamespaceOutput, - crate::error::CreateGameNamespaceError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_create_game_namespace_error(response) - } else { - crate::operation_deser::parse_create_game_namespace_response(response) - } - } -} - -/// Operation shape for `CreateGameNamespaceTokenDevelopment`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`create_game_namespace_token_development`](crate::client::Client::create_game_namespace_token_development). -/// -/// See [`crate::client::fluent_builders::CreateGameNamespaceTokenDevelopment`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct CreateGameNamespaceTokenDevelopment { - _private: (), -} -impl CreateGameNamespaceTokenDevelopment { - /// Creates a new builder-style object to manufacture [`CreateGameNamespaceTokenDevelopmentInput`](crate::input::CreateGameNamespaceTokenDevelopmentInput) - pub fn builder() -> crate::input::create_game_namespace_token_development_input::Builder { - crate::input::create_game_namespace_token_development_input::Builder::default() - } - /// Creates a new `CreateGameNamespaceTokenDevelopment` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for CreateGameNamespaceTokenDevelopment { - type Output = std::result::Result< - crate::output::CreateGameNamespaceTokenDevelopmentOutput, - crate::error::CreateGameNamespaceTokenDevelopmentError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_create_game_namespace_token_development_error(response) - } else { - crate::operation_deser::parse_create_game_namespace_token_development_response(response) - } - } -} - -/// Operation shape for `CreateGameNamespaceTokenPublic`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`create_game_namespace_token_public`](crate::client::Client::create_game_namespace_token_public). -/// -/// See [`crate::client::fluent_builders::CreateGameNamespaceTokenPublic`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct CreateGameNamespaceTokenPublic { - _private: (), -} -impl CreateGameNamespaceTokenPublic { - /// Creates a new builder-style object to manufacture [`CreateGameNamespaceTokenPublicInput`](crate::input::CreateGameNamespaceTokenPublicInput) - pub fn builder() -> crate::input::create_game_namespace_token_public_input::Builder { - crate::input::create_game_namespace_token_public_input::Builder::default() - } - /// Creates a new `CreateGameNamespaceTokenPublic` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for CreateGameNamespaceTokenPublic { - type Output = std::result::Result< - crate::output::CreateGameNamespaceTokenPublicOutput, - crate::error::CreateGameNamespaceTokenPublicError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_create_game_namespace_token_public_error(response) - } else { - crate::operation_deser::parse_create_game_namespace_token_public_response(response) - } - } -} - -/// Operation shape for `CreateGameVersion`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`create_game_version`](crate::client::Client::create_game_version). -/// -/// See [`crate::client::fluent_builders::CreateGameVersion`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct CreateGameVersion { - _private: (), -} -impl CreateGameVersion { - /// Creates a new builder-style object to manufacture [`CreateGameVersionInput`](crate::input::CreateGameVersionInput) - pub fn builder() -> crate::input::create_game_version_input::Builder { - crate::input::create_game_version_input::Builder::default() - } - /// Creates a new `CreateGameVersion` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for CreateGameVersion { - type Output = std::result::Result< - crate::output::CreateGameVersionOutput, - crate::error::CreateGameVersionError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_create_game_version_error(response) - } else { - crate::operation_deser::parse_create_game_version_response(response) - } - } -} - -/// Operation shape for `DeleteMatchmakerLobby`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`delete_matchmaker_lobby`](crate::client::Client::delete_matchmaker_lobby). -/// -/// See [`crate::client::fluent_builders::DeleteMatchmakerLobby`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct DeleteMatchmakerLobby { - _private: (), -} -impl DeleteMatchmakerLobby { - /// Creates a new builder-style object to manufacture [`DeleteMatchmakerLobbyInput`](crate::input::DeleteMatchmakerLobbyInput) - pub fn builder() -> crate::input::delete_matchmaker_lobby_input::Builder { - crate::input::delete_matchmaker_lobby_input::Builder::default() - } - /// Creates a new `DeleteMatchmakerLobby` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for DeleteMatchmakerLobby { - type Output = std::result::Result< - crate::output::DeleteMatchmakerLobbyOutput, - crate::error::DeleteMatchmakerLobbyError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_delete_matchmaker_lobby_error(response) - } else { - crate::operation_deser::parse_delete_matchmaker_lobby_response(response) - } - } -} - -/// Operation shape for `ExportLobbyLogs`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`export_lobby_logs`](crate::client::Client::export_lobby_logs). -/// -/// See [`crate::client::fluent_builders::ExportLobbyLogs`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct ExportLobbyLogs { - _private: (), -} -impl ExportLobbyLogs { - /// Creates a new builder-style object to manufacture [`ExportLobbyLogsInput`](crate::input::ExportLobbyLogsInput) - pub fn builder() -> crate::input::export_lobby_logs_input::Builder { - crate::input::export_lobby_logs_input::Builder::default() - } - /// Creates a new `ExportLobbyLogs` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for ExportLobbyLogs { - type Output = std::result::Result< - crate::output::ExportLobbyLogsOutput, - crate::error::ExportLobbyLogsError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_export_lobby_logs_error(response) - } else { - crate::operation_deser::parse_export_lobby_logs_response(response) - } - } -} - -/// Operation shape for `ExportMatchmakerLobbyHistory`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`export_matchmaker_lobby_history`](crate::client::Client::export_matchmaker_lobby_history). -/// -/// See [`crate::client::fluent_builders::ExportMatchmakerLobbyHistory`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct ExportMatchmakerLobbyHistory { - _private: (), -} -impl ExportMatchmakerLobbyHistory { - /// Creates a new builder-style object to manufacture [`ExportMatchmakerLobbyHistoryInput`](crate::input::ExportMatchmakerLobbyHistoryInput) - pub fn builder() -> crate::input::export_matchmaker_lobby_history_input::Builder { - crate::input::export_matchmaker_lobby_history_input::Builder::default() - } - /// Creates a new `ExportMatchmakerLobbyHistory` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for ExportMatchmakerLobbyHistory { - type Output = std::result::Result< - crate::output::ExportMatchmakerLobbyHistoryOutput, - crate::error::ExportMatchmakerLobbyHistoryError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_export_matchmaker_lobby_history_error(response) - } else { - crate::operation_deser::parse_export_matchmaker_lobby_history_response(response) - } - } -} - -/// Operation shape for `GameBannerUploadComplete`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`game_banner_upload_complete`](crate::client::Client::game_banner_upload_complete). -/// -/// See [`crate::client::fluent_builders::GameBannerUploadComplete`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GameBannerUploadComplete { - _private: (), -} -impl GameBannerUploadComplete { - /// Creates a new builder-style object to manufacture [`GameBannerUploadCompleteInput`](crate::input::GameBannerUploadCompleteInput) - pub fn builder() -> crate::input::game_banner_upload_complete_input::Builder { - crate::input::game_banner_upload_complete_input::Builder::default() - } - /// Creates a new `GameBannerUploadComplete` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GameBannerUploadComplete { - type Output = std::result::Result< - crate::output::GameBannerUploadCompleteOutput, - crate::error::GameBannerUploadCompleteError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_game_banner_upload_complete_error(response) - } else { - crate::operation_deser::parse_game_banner_upload_complete_response(response) - } - } -} - -/// Operation shape for `GameBannerUploadPrepare`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`game_banner_upload_prepare`](crate::client::Client::game_banner_upload_prepare). -/// -/// See [`crate::client::fluent_builders::GameBannerUploadPrepare`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GameBannerUploadPrepare { - _private: (), -} -impl GameBannerUploadPrepare { - /// Creates a new builder-style object to manufacture [`GameBannerUploadPrepareInput`](crate::input::GameBannerUploadPrepareInput) - pub fn builder() -> crate::input::game_banner_upload_prepare_input::Builder { - crate::input::game_banner_upload_prepare_input::Builder::default() - } - /// Creates a new `GameBannerUploadPrepare` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GameBannerUploadPrepare { - type Output = std::result::Result< - crate::output::GameBannerUploadPrepareOutput, - crate::error::GameBannerUploadPrepareError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_game_banner_upload_prepare_error(response) - } else { - crate::operation_deser::parse_game_banner_upload_prepare_response(response) - } - } -} - -/// Operation shape for `GameLogoUploadComplete`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`game_logo_upload_complete`](crate::client::Client::game_logo_upload_complete). -/// -/// See [`crate::client::fluent_builders::GameLogoUploadComplete`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GameLogoUploadComplete { - _private: (), -} -impl GameLogoUploadComplete { - /// Creates a new builder-style object to manufacture [`GameLogoUploadCompleteInput`](crate::input::GameLogoUploadCompleteInput) - pub fn builder() -> crate::input::game_logo_upload_complete_input::Builder { - crate::input::game_logo_upload_complete_input::Builder::default() - } - /// Creates a new `GameLogoUploadComplete` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GameLogoUploadComplete { - type Output = std::result::Result< - crate::output::GameLogoUploadCompleteOutput, - crate::error::GameLogoUploadCompleteError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_game_logo_upload_complete_error(response) - } else { - crate::operation_deser::parse_game_logo_upload_complete_response(response) - } - } -} - -/// Operation shape for `GameLogoUploadPrepare`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`game_logo_upload_prepare`](crate::client::Client::game_logo_upload_prepare). -/// -/// See [`crate::client::fluent_builders::GameLogoUploadPrepare`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GameLogoUploadPrepare { - _private: (), -} -impl GameLogoUploadPrepare { - /// Creates a new builder-style object to manufacture [`GameLogoUploadPrepareInput`](crate::input::GameLogoUploadPrepareInput) - pub fn builder() -> crate::input::game_logo_upload_prepare_input::Builder { - crate::input::game_logo_upload_prepare_input::Builder::default() - } - /// Creates a new `GameLogoUploadPrepare` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GameLogoUploadPrepare { - type Output = std::result::Result< - crate::output::GameLogoUploadPrepareOutput, - crate::error::GameLogoUploadPrepareError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_game_logo_upload_prepare_error(response) - } else { - crate::operation_deser::parse_game_logo_upload_prepare_response(response) - } - } -} - -/// Operation shape for `GetGameBilling`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`get_game_billing`](crate::client::Client::get_game_billing). -/// -/// See [`crate::client::fluent_builders::GetGameBilling`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GetGameBilling { - _private: (), -} -impl GetGameBilling { - /// Creates a new builder-style object to manufacture [`GetGameBillingInput`](crate::input::GetGameBillingInput) - pub fn builder() -> crate::input::get_game_billing_input::Builder { - crate::input::get_game_billing_input::Builder::default() - } - /// Creates a new `GetGameBilling` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GetGameBilling { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_get_game_billing_error(response) - } else { - crate::operation_deser::parse_get_game_billing_response(response) - } - } -} - -/// Operation shape for `GetGameBillingPlans`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`get_game_billing_plans`](crate::client::Client::get_game_billing_plans). -/// -/// See [`crate::client::fluent_builders::GetGameBillingPlans`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GetGameBillingPlans { - _private: (), -} -impl GetGameBillingPlans { - /// Creates a new builder-style object to manufacture [`GetGameBillingPlansInput`](crate::input::GetGameBillingPlansInput) - pub fn builder() -> crate::input::get_game_billing_plans_input::Builder { - crate::input::get_game_billing_plans_input::Builder::default() - } - /// Creates a new `GetGameBillingPlans` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GetGameBillingPlans { - type Output = std::result::Result< - crate::output::GetGameBillingPlansOutput, - crate::error::GetGameBillingPlansError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_get_game_billing_plans_error(response) - } else { - crate::operation_deser::parse_get_game_billing_plans_response(response) - } - } -} - -/// Operation shape for `GetGameById`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`get_game_by_id`](crate::client::Client::get_game_by_id). -/// -/// See [`crate::client::fluent_builders::GetGameById`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GetGameById { - _private: (), -} -impl GetGameById { - /// Creates a new builder-style object to manufacture [`GetGameByIdInput`](crate::input::GetGameByIdInput) - pub fn builder() -> crate::input::get_game_by_id_input::Builder { - crate::input::get_game_by_id_input::Builder::default() - } - /// Creates a new `GetGameById` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GetGameById { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_get_game_by_id_error(response) - } else { - crate::operation_deser::parse_get_game_by_id_response(response) - } - } -} - -/// Operation shape for `GetGameNamespaceById`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`get_game_namespace_by_id`](crate::client::Client::get_game_namespace_by_id). -/// -/// See [`crate::client::fluent_builders::GetGameNamespaceById`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GetGameNamespaceById { - _private: (), -} -impl GetGameNamespaceById { - /// Creates a new builder-style object to manufacture [`GetGameNamespaceByIdInput`](crate::input::GetGameNamespaceByIdInput) - pub fn builder() -> crate::input::get_game_namespace_by_id_input::Builder { - crate::input::get_game_namespace_by_id_input::Builder::default() - } - /// Creates a new `GetGameNamespaceById` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GetGameNamespaceById { - type Output = std::result::Result< - crate::output::GetGameNamespaceByIdOutput, - crate::error::GetGameNamespaceByIdError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_get_game_namespace_by_id_error(response) - } else { - crate::operation_deser::parse_get_game_namespace_by_id_response(response) - } - } -} - -/// Operation shape for `GetGames`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`get_games`](crate::client::Client::get_games). -/// -/// See [`crate::client::fluent_builders::GetGames`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GetGames { - _private: (), -} -impl GetGames { - /// Creates a new builder-style object to manufacture [`GetGamesInput`](crate::input::GetGamesInput) - pub fn builder() -> crate::input::get_games_input::Builder { - crate::input::get_games_input::Builder::default() - } - /// Creates a new `GetGames` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GetGames { - type Output = std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_get_games_error(response) - } else { - crate::operation_deser::parse_get_games_response(response) - } - } -} - -/// Operation shape for `GetGameVersionById`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`get_game_version_by_id`](crate::client::Client::get_game_version_by_id). -/// -/// See [`crate::client::fluent_builders::GetGameVersionById`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GetGameVersionById { - _private: (), -} -impl GetGameVersionById { - /// Creates a new builder-style object to manufacture [`GetGameVersionByIdInput`](crate::input::GetGameVersionByIdInput) - pub fn builder() -> crate::input::get_game_version_by_id_input::Builder { - crate::input::get_game_version_by_id_input::Builder::default() - } - /// Creates a new `GetGameVersionById` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GetGameVersionById { - type Output = std::result::Result< - crate::output::GetGameVersionByIdOutput, - crate::error::GetGameVersionByIdError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_get_game_version_by_id_error(response) - } else { - crate::operation_deser::parse_get_game_version_by_id_response(response) - } - } -} - -/// Operation shape for `GetGroupBilling`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`get_group_billing`](crate::client::Client::get_group_billing). -/// -/// See [`crate::client::fluent_builders::GetGroupBilling`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GetGroupBilling { - _private: (), -} -impl GetGroupBilling { - /// Creates a new builder-style object to manufacture [`GetGroupBillingInput`](crate::input::GetGroupBillingInput) - pub fn builder() -> crate::input::get_group_billing_input::Builder { - crate::input::get_group_billing_input::Builder::default() - } - /// Creates a new `GetGroupBilling` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GetGroupBilling { - type Output = std::result::Result< - crate::output::GetGroupBillingOutput, - crate::error::GetGroupBillingError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_get_group_billing_error(response) - } else { - crate::operation_deser::parse_get_group_billing_response(response) - } - } -} - -/// Operation shape for `GetGroupInvoicesList`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`get_group_invoices_list`](crate::client::Client::get_group_invoices_list). -/// -/// See [`crate::client::fluent_builders::GetGroupInvoicesList`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GetGroupInvoicesList { - _private: (), -} -impl GetGroupInvoicesList { - /// Creates a new builder-style object to manufacture [`GetGroupInvoicesListInput`](crate::input::GetGroupInvoicesListInput) - pub fn builder() -> crate::input::get_group_invoices_list_input::Builder { - crate::input::get_group_invoices_list_input::Builder::default() - } - /// Creates a new `GetGroupInvoicesList` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GetGroupInvoicesList { - type Output = std::result::Result< - crate::output::GetGroupInvoicesListOutput, - crate::error::GetGroupInvoicesListError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_get_group_invoices_list_error(response) - } else { - crate::operation_deser::parse_get_group_invoices_list_response(response) - } - } -} - -/// Operation shape for `GetLobbyLogs`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`get_lobby_logs`](crate::client::Client::get_lobby_logs). -/// -/// See [`crate::client::fluent_builders::GetLobbyLogs`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GetLobbyLogs { - _private: (), -} -impl GetLobbyLogs { - /// Creates a new builder-style object to manufacture [`GetLobbyLogsInput`](crate::input::GetLobbyLogsInput) - pub fn builder() -> crate::input::get_lobby_logs_input::Builder { - crate::input::get_lobby_logs_input::Builder::default() - } - /// Creates a new `GetLobbyLogs` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GetLobbyLogs { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_get_lobby_logs_error(response) - } else { - crate::operation_deser::parse_get_lobby_logs_response(response) - } - } -} - -/// Operation shape for `GetNamespaceAnalyticsMatchmakerLive`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`get_namespace_analytics_matchmaker_live`](crate::client::Client::get_namespace_analytics_matchmaker_live). -/// -/// See [`crate::client::fluent_builders::GetNamespaceAnalyticsMatchmakerLive`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GetNamespaceAnalyticsMatchmakerLive { - _private: (), -} -impl GetNamespaceAnalyticsMatchmakerLive { - /// Creates a new builder-style object to manufacture [`GetNamespaceAnalyticsMatchmakerLiveInput`](crate::input::GetNamespaceAnalyticsMatchmakerLiveInput) - pub fn builder() -> crate::input::get_namespace_analytics_matchmaker_live_input::Builder { - crate::input::get_namespace_analytics_matchmaker_live_input::Builder::default() - } - /// Creates a new `GetNamespaceAnalyticsMatchmakerLive` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GetNamespaceAnalyticsMatchmakerLive { - type Output = std::result::Result< - crate::output::GetNamespaceAnalyticsMatchmakerLiveOutput, - crate::error::GetNamespaceAnalyticsMatchmakerLiveError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_get_namespace_analytics_matchmaker_live_error(response) - } else { - crate::operation_deser::parse_get_namespace_analytics_matchmaker_live_response(response) - } - } -} - -/// Operation shape for `GetNamespaceLobby`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`get_namespace_lobby`](crate::client::Client::get_namespace_lobby). -/// -/// See [`crate::client::fluent_builders::GetNamespaceLobby`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GetNamespaceLobby { - _private: (), -} -impl GetNamespaceLobby { - /// Creates a new builder-style object to manufacture [`GetNamespaceLobbyInput`](crate::input::GetNamespaceLobbyInput) - pub fn builder() -> crate::input::get_namespace_lobby_input::Builder { - crate::input::get_namespace_lobby_input::Builder::default() - } - /// Creates a new `GetNamespaceLobby` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GetNamespaceLobby { - type Output = std::result::Result< - crate::output::GetNamespaceLobbyOutput, - crate::error::GetNamespaceLobbyError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_get_namespace_lobby_error(response) - } else { - crate::operation_deser::parse_get_namespace_lobby_response(response) - } - } -} - -/// Operation shape for `GetRayPerfLogs`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`get_ray_perf_logs`](crate::client::Client::get_ray_perf_logs). -/// -/// See [`crate::client::fluent_builders::GetRayPerfLogs`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GetRayPerfLogs { - _private: (), -} -impl GetRayPerfLogs { - /// Creates a new builder-style object to manufacture [`GetRayPerfLogsInput`](crate::input::GetRayPerfLogsInput) - pub fn builder() -> crate::input::get_ray_perf_logs_input::Builder { - crate::input::get_ray_perf_logs_input::Builder::default() - } - /// Creates a new `GetRayPerfLogs` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GetRayPerfLogs { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_get_ray_perf_logs_error(response) - } else { - crate::operation_deser::parse_get_ray_perf_logs_response(response) - } - } -} - -/// Operation shape for `GetRegionTiers`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`get_region_tiers`](crate::client::Client::get_region_tiers). -/// -/// See [`crate::client::fluent_builders::GetRegionTiers`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GetRegionTiers { - _private: (), -} -impl GetRegionTiers { - /// Creates a new builder-style object to manufacture [`GetRegionTiersInput`](crate::input::GetRegionTiersInput) - pub fn builder() -> crate::input::get_region_tiers_input::Builder { - crate::input::get_region_tiers_input::Builder::default() - } - /// Creates a new `GetRegionTiers` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GetRegionTiers { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_get_region_tiers_error(response) - } else { - crate::operation_deser::parse_get_region_tiers_response(response) - } - } -} - -/// Operation shape for `GroupBillingCheckout`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`group_billing_checkout`](crate::client::Client::group_billing_checkout). -/// -/// See [`crate::client::fluent_builders::GroupBillingCheckout`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GroupBillingCheckout { - _private: (), -} -impl GroupBillingCheckout { - /// Creates a new builder-style object to manufacture [`GroupBillingCheckoutInput`](crate::input::GroupBillingCheckoutInput) - pub fn builder() -> crate::input::group_billing_checkout_input::Builder { - crate::input::group_billing_checkout_input::Builder::default() - } - /// Creates a new `GroupBillingCheckout` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GroupBillingCheckout { - type Output = std::result::Result< - crate::output::GroupBillingCheckoutOutput, - crate::error::GroupBillingCheckoutError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_group_billing_checkout_error(response) - } else { - crate::operation_deser::parse_group_billing_checkout_response(response) - } - } -} - -/// Operation shape for `Inspect`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`inspect`](crate::client::Client::inspect). -/// -/// See [`crate::client::fluent_builders::Inspect`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct Inspect { - _private: (), -} -impl Inspect { - /// Creates a new builder-style object to manufacture [`InspectInput`](crate::input::InspectInput) - pub fn builder() -> crate::input::inspect_input::Builder { - crate::input::inspect_input::Builder::default() - } - /// Creates a new `Inspect` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for Inspect { - type Output = std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_inspect_error(response) - } else { - crate::operation_deser::parse_inspect_response(response) - } - } -} - -/// Operation shape for `ListGameBuilds`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`list_game_builds`](crate::client::Client::list_game_builds). -/// -/// See [`crate::client::fluent_builders::ListGameBuilds`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct ListGameBuilds { - _private: (), -} -impl ListGameBuilds { - /// Creates a new builder-style object to manufacture [`ListGameBuildsInput`](crate::input::ListGameBuildsInput) - pub fn builder() -> crate::input::list_game_builds_input::Builder { - crate::input::list_game_builds_input::Builder::default() - } - /// Creates a new `ListGameBuilds` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for ListGameBuilds { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_list_game_builds_error(response) - } else { - crate::operation_deser::parse_list_game_builds_response(response) - } - } -} - -/// Operation shape for `ListGameCdnSites`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`list_game_cdn_sites`](crate::client::Client::list_game_cdn_sites). -/// -/// See [`crate::client::fluent_builders::ListGameCdnSites`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct ListGameCdnSites { - _private: (), -} -impl ListGameCdnSites { - /// Creates a new builder-style object to manufacture [`ListGameCdnSitesInput`](crate::input::ListGameCdnSitesInput) - pub fn builder() -> crate::input::list_game_cdn_sites_input::Builder { - crate::input::list_game_cdn_sites_input::Builder::default() - } - /// Creates a new `ListGameCdnSites` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for ListGameCdnSites { - type Output = std::result::Result< - crate::output::ListGameCdnSitesOutput, - crate::error::ListGameCdnSitesError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_list_game_cdn_sites_error(response) - } else { - crate::operation_deser::parse_list_game_cdn_sites_response(response) - } - } -} - -/// Operation shape for `ListGameCustomAvatars`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`list_game_custom_avatars`](crate::client::Client::list_game_custom_avatars). -/// -/// See [`crate::client::fluent_builders::ListGameCustomAvatars`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct ListGameCustomAvatars { - _private: (), -} -impl ListGameCustomAvatars { - /// Creates a new builder-style object to manufacture [`ListGameCustomAvatarsInput`](crate::input::ListGameCustomAvatarsInput) - pub fn builder() -> crate::input::list_game_custom_avatars_input::Builder { - crate::input::list_game_custom_avatars_input::Builder::default() - } - /// Creates a new `ListGameCustomAvatars` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for ListGameCustomAvatars { - type Output = std::result::Result< - crate::output::ListGameCustomAvatarsOutput, - crate::error::ListGameCustomAvatarsError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_list_game_custom_avatars_error(response) - } else { - crate::operation_deser::parse_list_game_custom_avatars_response(response) - } - } -} - -/// Operation shape for `ListNamespaceLobbies`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`list_namespace_lobbies`](crate::client::Client::list_namespace_lobbies). -/// -/// See [`crate::client::fluent_builders::ListNamespaceLobbies`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct ListNamespaceLobbies { - _private: (), -} -impl ListNamespaceLobbies { - /// Creates a new builder-style object to manufacture [`ListNamespaceLobbiesInput`](crate::input::ListNamespaceLobbiesInput) - pub fn builder() -> crate::input::list_namespace_lobbies_input::Builder { - crate::input::list_namespace_lobbies_input::Builder::default() - } - /// Creates a new `ListNamespaceLobbies` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for ListNamespaceLobbies { - type Output = std::result::Result< - crate::output::ListNamespaceLobbiesOutput, - crate::error::ListNamespaceLobbiesError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_list_namespace_lobbies_error(response) - } else { - crate::operation_deser::parse_list_namespace_lobbies_response(response) - } - } -} - -/// Operation shape for `PrepareCustomAvatarUpload`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`prepare_custom_avatar_upload`](crate::client::Client::prepare_custom_avatar_upload). -/// -/// See [`crate::client::fluent_builders::PrepareCustomAvatarUpload`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct PrepareCustomAvatarUpload { - _private: (), -} -impl PrepareCustomAvatarUpload { - /// Creates a new builder-style object to manufacture [`PrepareCustomAvatarUploadInput`](crate::input::PrepareCustomAvatarUploadInput) - pub fn builder() -> crate::input::prepare_custom_avatar_upload_input::Builder { - crate::input::prepare_custom_avatar_upload_input::Builder::default() - } - /// Creates a new `PrepareCustomAvatarUpload` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for PrepareCustomAvatarUpload { - type Output = std::result::Result< - crate::output::PrepareCustomAvatarUploadOutput, - crate::error::PrepareCustomAvatarUploadError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_prepare_custom_avatar_upload_error(response) - } else { - crate::operation_deser::parse_prepare_custom_avatar_upload_response(response) - } - } -} - -/// Operation shape for `RemoveNamespaceCdnAuthUser`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`remove_namespace_cdn_auth_user`](crate::client::Client::remove_namespace_cdn_auth_user). -/// -/// See [`crate::client::fluent_builders::RemoveNamespaceCdnAuthUser`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct RemoveNamespaceCdnAuthUser { - _private: (), -} -impl RemoveNamespaceCdnAuthUser { - /// Creates a new builder-style object to manufacture [`RemoveNamespaceCdnAuthUserInput`](crate::input::RemoveNamespaceCdnAuthUserInput) - pub fn builder() -> crate::input::remove_namespace_cdn_auth_user_input::Builder { - crate::input::remove_namespace_cdn_auth_user_input::Builder::default() - } - /// Creates a new `RemoveNamespaceCdnAuthUser` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for RemoveNamespaceCdnAuthUser { - type Output = std::result::Result< - crate::output::RemoveNamespaceCdnAuthUserOutput, - crate::error::RemoveNamespaceCdnAuthUserError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_remove_namespace_cdn_auth_user_error(response) - } else { - crate::operation_deser::parse_remove_namespace_cdn_auth_user_response(response) - } - } -} - -/// Operation shape for `RemoveNamespaceDomain`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`remove_namespace_domain`](crate::client::Client::remove_namespace_domain). -/// -/// See [`crate::client::fluent_builders::RemoveNamespaceDomain`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct RemoveNamespaceDomain { - _private: (), -} -impl RemoveNamespaceDomain { - /// Creates a new builder-style object to manufacture [`RemoveNamespaceDomainInput`](crate::input::RemoveNamespaceDomainInput) - pub fn builder() -> crate::input::remove_namespace_domain_input::Builder { - crate::input::remove_namespace_domain_input::Builder::default() - } - /// Creates a new `RemoveNamespaceDomain` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for RemoveNamespaceDomain { - type Output = std::result::Result< - crate::output::RemoveNamespaceDomainOutput, - crate::error::RemoveNamespaceDomainError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_remove_namespace_domain_error(response) - } else { - crate::operation_deser::parse_remove_namespace_domain_response(response) - } - } -} - -/// Operation shape for `SetGameBillingPlan`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`set_game_billing_plan`](crate::client::Client::set_game_billing_plan). -/// -/// See [`crate::client::fluent_builders::SetGameBillingPlan`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct SetGameBillingPlan { - _private: (), -} -impl SetGameBillingPlan { - /// Creates a new builder-style object to manufacture [`SetGameBillingPlanInput`](crate::input::SetGameBillingPlanInput) - pub fn builder() -> crate::input::set_game_billing_plan_input::Builder { - crate::input::set_game_billing_plan_input::Builder::default() - } - /// Creates a new `SetGameBillingPlan` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for SetGameBillingPlan { - type Output = std::result::Result< - crate::output::SetGameBillingPlanOutput, - crate::error::SetGameBillingPlanError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_set_game_billing_plan_error(response) - } else { - crate::operation_deser::parse_set_game_billing_plan_response(response) - } - } -} - -/// Operation shape for `SetNamespaceCdnAuthType`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`set_namespace_cdn_auth_type`](crate::client::Client::set_namespace_cdn_auth_type). -/// -/// See [`crate::client::fluent_builders::SetNamespaceCdnAuthType`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct SetNamespaceCdnAuthType { - _private: (), -} -impl SetNamespaceCdnAuthType { - /// Creates a new builder-style object to manufacture [`SetNamespaceCdnAuthTypeInput`](crate::input::SetNamespaceCdnAuthTypeInput) - pub fn builder() -> crate::input::set_namespace_cdn_auth_type_input::Builder { - crate::input::set_namespace_cdn_auth_type_input::Builder::default() - } - /// Creates a new `SetNamespaceCdnAuthType` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for SetNamespaceCdnAuthType { - type Output = std::result::Result< - crate::output::SetNamespaceCdnAuthTypeOutput, - crate::error::SetNamespaceCdnAuthTypeError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_set_namespace_cdn_auth_type_error(response) - } else { - crate::operation_deser::parse_set_namespace_cdn_auth_type_response(response) - } - } -} - -/// Operation shape for `ToggleNamespaceDomainPublicAuth`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`toggle_namespace_domain_public_auth`](crate::client::Client::toggle_namespace_domain_public_auth). -/// -/// See [`crate::client::fluent_builders::ToggleNamespaceDomainPublicAuth`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct ToggleNamespaceDomainPublicAuth { - _private: (), -} -impl ToggleNamespaceDomainPublicAuth { - /// Creates a new builder-style object to manufacture [`ToggleNamespaceDomainPublicAuthInput`](crate::input::ToggleNamespaceDomainPublicAuthInput) - pub fn builder() -> crate::input::toggle_namespace_domain_public_auth_input::Builder { - crate::input::toggle_namespace_domain_public_auth_input::Builder::default() - } - /// Creates a new `ToggleNamespaceDomainPublicAuth` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for ToggleNamespaceDomainPublicAuth { - type Output = std::result::Result< - crate::output::ToggleNamespaceDomainPublicAuthOutput, - crate::error::ToggleNamespaceDomainPublicAuthError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_toggle_namespace_domain_public_auth_error(response) - } else { - crate::operation_deser::parse_toggle_namespace_domain_public_auth_response(response) - } - } -} - -/// Operation shape for `UpdateGameNamespaceMatchmakerConfig`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`update_game_namespace_matchmaker_config`](crate::client::Client::update_game_namespace_matchmaker_config). -/// -/// See [`crate::client::fluent_builders::UpdateGameNamespaceMatchmakerConfig`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct UpdateGameNamespaceMatchmakerConfig { - _private: (), -} -impl UpdateGameNamespaceMatchmakerConfig { - /// Creates a new builder-style object to manufacture [`UpdateGameNamespaceMatchmakerConfigInput`](crate::input::UpdateGameNamespaceMatchmakerConfigInput) - pub fn builder() -> crate::input::update_game_namespace_matchmaker_config_input::Builder { - crate::input::update_game_namespace_matchmaker_config_input::Builder::default() - } - /// Creates a new `UpdateGameNamespaceMatchmakerConfig` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for UpdateGameNamespaceMatchmakerConfig { - type Output = std::result::Result< - crate::output::UpdateGameNamespaceMatchmakerConfigOutput, - crate::error::UpdateGameNamespaceMatchmakerConfigError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_update_game_namespace_matchmaker_config_error(response) - } else { - crate::operation_deser::parse_update_game_namespace_matchmaker_config_response(response) - } - } -} - -/// Operation shape for `UpdateGameNamespaceVersion`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`update_game_namespace_version`](crate::client::Client::update_game_namespace_version). -/// -/// See [`crate::client::fluent_builders::UpdateGameNamespaceVersion`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct UpdateGameNamespaceVersion { - _private: (), -} -impl UpdateGameNamespaceVersion { - /// Creates a new builder-style object to manufacture [`UpdateGameNamespaceVersionInput`](crate::input::UpdateGameNamespaceVersionInput) - pub fn builder() -> crate::input::update_game_namespace_version_input::Builder { - crate::input::update_game_namespace_version_input::Builder::default() - } - /// Creates a new `UpdateGameNamespaceVersion` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for UpdateGameNamespaceVersion { - type Output = std::result::Result< - crate::output::UpdateGameNamespaceVersionOutput, - crate::error::UpdateGameNamespaceVersionError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_update_game_namespace_version_error(response) - } else { - crate::operation_deser::parse_update_game_namespace_version_response(response) - } - } -} - -/// Operation shape for `UpdateNamespaceCdnAuthUser`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`update_namespace_cdn_auth_user`](crate::client::Client::update_namespace_cdn_auth_user). -/// -/// See [`crate::client::fluent_builders::UpdateNamespaceCdnAuthUser`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct UpdateNamespaceCdnAuthUser { - _private: (), -} -impl UpdateNamespaceCdnAuthUser { - /// Creates a new builder-style object to manufacture [`UpdateNamespaceCdnAuthUserInput`](crate::input::UpdateNamespaceCdnAuthUserInput) - pub fn builder() -> crate::input::update_namespace_cdn_auth_user_input::Builder { - crate::input::update_namespace_cdn_auth_user_input::Builder::default() - } - /// Creates a new `UpdateNamespaceCdnAuthUser` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for UpdateNamespaceCdnAuthUser { - type Output = std::result::Result< - crate::output::UpdateNamespaceCdnAuthUserOutput, - crate::error::UpdateNamespaceCdnAuthUserError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_update_namespace_cdn_auth_user_error(response) - } else { - crate::operation_deser::parse_update_namespace_cdn_auth_user_response(response) - } - } -} - -/// Operation shape for `ValidateGame`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`validate_game`](crate::client::Client::validate_game). -/// -/// See [`crate::client::fluent_builders::ValidateGame`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct ValidateGame { - _private: (), -} -impl ValidateGame { - /// Creates a new builder-style object to manufacture [`ValidateGameInput`](crate::input::ValidateGameInput) - pub fn builder() -> crate::input::validate_game_input::Builder { - crate::input::validate_game_input::Builder::default() - } - /// Creates a new `ValidateGame` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for ValidateGame { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_validate_game_error(response) - } else { - crate::operation_deser::parse_validate_game_response(response) - } - } -} - -/// Operation shape for `ValidateGameNamespace`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`validate_game_namespace`](crate::client::Client::validate_game_namespace). -/// -/// See [`crate::client::fluent_builders::ValidateGameNamespace`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct ValidateGameNamespace { - _private: (), -} -impl ValidateGameNamespace { - /// Creates a new builder-style object to manufacture [`ValidateGameNamespaceInput`](crate::input::ValidateGameNamespaceInput) - pub fn builder() -> crate::input::validate_game_namespace_input::Builder { - crate::input::validate_game_namespace_input::Builder::default() - } - /// Creates a new `ValidateGameNamespace` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for ValidateGameNamespace { - type Output = std::result::Result< - crate::output::ValidateGameNamespaceOutput, - crate::error::ValidateGameNamespaceError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_validate_game_namespace_error(response) - } else { - crate::operation_deser::parse_validate_game_namespace_response(response) - } - } -} - -/// Operation shape for `ValidateGameNamespaceMatchmakerConfig`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`validate_game_namespace_matchmaker_config`](crate::client::Client::validate_game_namespace_matchmaker_config). -/// -/// See [`crate::client::fluent_builders::ValidateGameNamespaceMatchmakerConfig`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct ValidateGameNamespaceMatchmakerConfig { - _private: (), -} -impl ValidateGameNamespaceMatchmakerConfig { - /// Creates a new builder-style object to manufacture [`ValidateGameNamespaceMatchmakerConfigInput`](crate::input::ValidateGameNamespaceMatchmakerConfigInput) - pub fn builder() -> crate::input::validate_game_namespace_matchmaker_config_input::Builder { - crate::input::validate_game_namespace_matchmaker_config_input::Builder::default() - } - /// Creates a new `ValidateGameNamespaceMatchmakerConfig` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for ValidateGameNamespaceMatchmakerConfig { - type Output = std::result::Result< - crate::output::ValidateGameNamespaceMatchmakerConfigOutput, - crate::error::ValidateGameNamespaceMatchmakerConfigError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_validate_game_namespace_matchmaker_config_error(response) - } else { - crate::operation_deser::parse_validate_game_namespace_matchmaker_config_response( - response, - ) - } - } -} - -/// Operation shape for `ValidateGameNamespaceTokenDevelopment`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`validate_game_namespace_token_development`](crate::client::Client::validate_game_namespace_token_development). -/// -/// See [`crate::client::fluent_builders::ValidateGameNamespaceTokenDevelopment`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct ValidateGameNamespaceTokenDevelopment { - _private: (), -} -impl ValidateGameNamespaceTokenDevelopment { - /// Creates a new builder-style object to manufacture [`ValidateGameNamespaceTokenDevelopmentInput`](crate::input::ValidateGameNamespaceTokenDevelopmentInput) - pub fn builder() -> crate::input::validate_game_namespace_token_development_input::Builder { - crate::input::validate_game_namespace_token_development_input::Builder::default() - } - /// Creates a new `ValidateGameNamespaceTokenDevelopment` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for ValidateGameNamespaceTokenDevelopment { - type Output = std::result::Result< - crate::output::ValidateGameNamespaceTokenDevelopmentOutput, - crate::error::ValidateGameNamespaceTokenDevelopmentError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_validate_game_namespace_token_development_error(response) - } else { - crate::operation_deser::parse_validate_game_namespace_token_development_response( - response, - ) - } - } -} - -/// Operation shape for `ValidateGameVersion`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`validate_game_version`](crate::client::Client::validate_game_version). -/// -/// See [`crate::client::fluent_builders::ValidateGameVersion`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct ValidateGameVersion { - _private: (), -} -impl ValidateGameVersion { - /// Creates a new builder-style object to manufacture [`ValidateGameVersionInput`](crate::input::ValidateGameVersionInput) - pub fn builder() -> crate::input::validate_game_version_input::Builder { - crate::input::validate_game_version_input::Builder::default() - } - /// Creates a new `ValidateGameVersion` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for ValidateGameVersion { - type Output = std::result::Result< - crate::output::ValidateGameVersionOutput, - crate::error::ValidateGameVersionError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_validate_game_version_error(response) - } else { - crate::operation_deser::parse_validate_game_version_response(response) - } - } -} - -/// Operation shape for `ValidateGroup`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`validate_group`](crate::client::Client::validate_group). -/// -/// See [`crate::client::fluent_builders::ValidateGroup`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct ValidateGroup { - _private: (), -} -impl ValidateGroup { - /// Creates a new builder-style object to manufacture [`ValidateGroupInput`](crate::input::ValidateGroupInput) - pub fn builder() -> crate::input::validate_group_input::Builder { - crate::input::validate_group_input::Builder::default() - } - /// Creates a new `ValidateGroup` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for ValidateGroup { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_validate_group_error(response) - } else { - crate::operation_deser::parse_validate_group_response(response) - } - } -} diff --git a/lib/smithy-output/api-cloud/rust/rust/src/operation_deser.rs b/lib/smithy-output/api-cloud/rust/rust/src/operation_deser.rs deleted file mode 100644 index 6d66d3917..000000000 --- a/lib/smithy-output/api-cloud/rust/rust/src/operation_deser.rs +++ /dev/null @@ -1,8209 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[allow(clippy::unnecessary_wraps)] -pub fn parse_add_namespace_domain_error( - response: &http::Response, -) -> std::result::Result< - crate::output::AddNamespaceDomainOutput, - crate::error::AddNamespaceDomainError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::AddNamespaceDomainError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::AddNamespaceDomainError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::AddNamespaceDomainError { - meta: generic, - kind: crate::error::AddNamespaceDomainErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::AddNamespaceDomainError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::AddNamespaceDomainError { - meta: generic, - kind: crate::error::AddNamespaceDomainErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::AddNamespaceDomainError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::AddNamespaceDomainError { - meta: generic, - kind: crate::error::AddNamespaceDomainErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::AddNamespaceDomainError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::AddNamespaceDomainError { - meta: generic, - kind: crate::error::AddNamespaceDomainErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::AddNamespaceDomainError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::AddNamespaceDomainError { - meta: generic, - kind: crate::error::AddNamespaceDomainErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::AddNamespaceDomainError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::AddNamespaceDomainError { - meta: generic, - kind: crate::error::AddNamespaceDomainErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::AddNamespaceDomainError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::AddNamespaceDomainError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_add_namespace_domain_response( - response: &http::Response, -) -> std::result::Result< - crate::output::AddNamespaceDomainOutput, - crate::error::AddNamespaceDomainError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::add_namespace_domain_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_complete_custom_avatar_upload_error( - response: &http::Response, -) -> std::result::Result< - crate::output::CompleteCustomAvatarUploadOutput, - crate::error::CompleteCustomAvatarUploadError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::CompleteCustomAvatarUploadError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => { - return Err(crate::error::CompleteCustomAvatarUploadError::unhandled( - generic, - )) - } - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::CompleteCustomAvatarUploadError { - meta: generic, - kind: crate::error::CompleteCustomAvatarUploadErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::CompleteCustomAvatarUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::CompleteCustomAvatarUploadError { - meta: generic, - kind: crate::error::CompleteCustomAvatarUploadErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::CompleteCustomAvatarUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::CompleteCustomAvatarUploadError { - meta: generic, - kind: crate::error::CompleteCustomAvatarUploadErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::CompleteCustomAvatarUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::CompleteCustomAvatarUploadError { - meta: generic, - kind: crate::error::CompleteCustomAvatarUploadErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::CompleteCustomAvatarUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::CompleteCustomAvatarUploadError { - meta: generic, - kind: crate::error::CompleteCustomAvatarUploadErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::CompleteCustomAvatarUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::CompleteCustomAvatarUploadError { - meta: generic, - kind: crate::error::CompleteCustomAvatarUploadErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::CompleteCustomAvatarUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::CompleteCustomAvatarUploadError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_complete_custom_avatar_upload_response( - response: &http::Response, -) -> std::result::Result< - crate::output::CompleteCustomAvatarUploadOutput, - crate::error::CompleteCustomAvatarUploadError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::complete_custom_avatar_upload_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_complete_upload_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::CompleteUploadError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::CompleteUploadError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::CompleteUploadError { - meta: generic, - kind: crate::error::CompleteUploadErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::CompleteUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::CompleteUploadError { - meta: generic, - kind: crate::error::CompleteUploadErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::CompleteUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::CompleteUploadError { - meta: generic, - kind: crate::error::CompleteUploadErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::CompleteUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::CompleteUploadError { - meta: generic, - kind: crate::error::CompleteUploadErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::CompleteUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::CompleteUploadError { - meta: generic, - kind: crate::error::CompleteUploadErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::CompleteUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::CompleteUploadError { - meta: generic, - kind: crate::error::CompleteUploadErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::CompleteUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::CompleteUploadError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_complete_upload_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::complete_upload_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_convert_group_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::ConvertGroupError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::ConvertGroupError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::ConvertGroupError { - meta: generic, - kind: crate::error::ConvertGroupErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ConvertGroupError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::ConvertGroupError { - meta: generic, - kind: crate::error::ConvertGroupErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::ConvertGroupError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::ConvertGroupError { - meta: generic, - kind: crate::error::ConvertGroupErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::ConvertGroupError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::ConvertGroupError { - meta: generic, - kind: crate::error::ConvertGroupErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::ConvertGroupError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::ConvertGroupError { - meta: generic, - kind: crate::error::ConvertGroupErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::ConvertGroupError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::ConvertGroupError { - meta: generic, - kind: crate::error::ConvertGroupErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::ConvertGroupError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::ConvertGroupError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_convert_group_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::convert_group_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_create_cloud_token_error( - response: &http::Response, -) -> std::result::Result -{ - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::CreateCloudTokenError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::CreateCloudTokenError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::CreateCloudTokenError { - meta: generic, - kind: crate::error::CreateCloudTokenErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::CreateCloudTokenError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::CreateCloudTokenError { - meta: generic, - kind: crate::error::CreateCloudTokenErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateCloudTokenError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::CreateCloudTokenError { - meta: generic, - kind: crate::error::CreateCloudTokenErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateCloudTokenError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::CreateCloudTokenError { - meta: generic, - kind: crate::error::CreateCloudTokenErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateCloudTokenError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::CreateCloudTokenError { - meta: generic, - kind: crate::error::CreateCloudTokenErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateCloudTokenError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::CreateCloudTokenError { - meta: generic, - kind: crate::error::CreateCloudTokenErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateCloudTokenError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::CreateCloudTokenError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_create_cloud_token_response( - response: &http::Response, -) -> std::result::Result -{ - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::create_cloud_token_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_create_cloud_token( - response.body().as_ref(), - output, - ) - .map_err(crate::error::CreateCloudTokenError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_create_game_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::CreateGameError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::CreateGameError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::CreateGameError { - meta: generic, - kind: crate::error::CreateGameErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::CreateGameError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::CreateGameError { - meta: generic, - kind: crate::error::CreateGameErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGameError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::CreateGameError { - meta: generic, - kind: crate::error::CreateGameErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGameError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::CreateGameError { - meta: generic, - kind: crate::error::CreateGameErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGameError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::CreateGameError { - meta: generic, - kind: crate::error::CreateGameErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGameError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::CreateGameError { - meta: generic, - kind: crate::error::CreateGameErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGameError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::CreateGameError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_create_game_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::create_game_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_create_game( - response.body().as_ref(), - output, - ) - .map_err(crate::error::CreateGameError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_create_game_build_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::CreateGameBuildError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::CreateGameBuildError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::CreateGameBuildError { - meta: generic, - kind: crate::error::CreateGameBuildErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::CreateGameBuildError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::CreateGameBuildError { - meta: generic, - kind: crate::error::CreateGameBuildErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGameBuildError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::CreateGameBuildError { - meta: generic, - kind: crate::error::CreateGameBuildErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGameBuildError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::CreateGameBuildError { - meta: generic, - kind: crate::error::CreateGameBuildErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGameBuildError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::CreateGameBuildError { - meta: generic, - kind: crate::error::CreateGameBuildErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGameBuildError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::CreateGameBuildError { - meta: generic, - kind: crate::error::CreateGameBuildErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGameBuildError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::CreateGameBuildError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_create_game_build_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::create_game_build_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_create_game_build( - response.body().as_ref(), - output, - ) - .map_err(crate::error::CreateGameBuildError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_create_game_cdn_site_error( - response: &http::Response, -) -> std::result::Result -{ - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::CreateGameCdnSiteError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::CreateGameCdnSiteError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::CreateGameCdnSiteError { - meta: generic, - kind: crate::error::CreateGameCdnSiteErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::CreateGameCdnSiteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::CreateGameCdnSiteError { - meta: generic, - kind: crate::error::CreateGameCdnSiteErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGameCdnSiteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::CreateGameCdnSiteError { - meta: generic, - kind: crate::error::CreateGameCdnSiteErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGameCdnSiteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::CreateGameCdnSiteError { - meta: generic, - kind: crate::error::CreateGameCdnSiteErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGameCdnSiteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::CreateGameCdnSiteError { - meta: generic, - kind: crate::error::CreateGameCdnSiteErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGameCdnSiteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::CreateGameCdnSiteError { - meta: generic, - kind: crate::error::CreateGameCdnSiteErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGameCdnSiteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::CreateGameCdnSiteError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_create_game_cdn_site_response( - response: &http::Response, -) -> std::result::Result -{ - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::create_game_cdn_site_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_create_game_cdn_site( - response.body().as_ref(), - output, - ) - .map_err(crate::error::CreateGameCdnSiteError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_create_game_namespace_error( - response: &http::Response, -) -> std::result::Result< - crate::output::CreateGameNamespaceOutput, - crate::error::CreateGameNamespaceError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::CreateGameNamespaceError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::CreateGameNamespaceError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::CreateGameNamespaceError { - meta: generic, - kind: crate::error::CreateGameNamespaceErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::CreateGameNamespaceError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::CreateGameNamespaceError { - meta: generic, - kind: crate::error::CreateGameNamespaceErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGameNamespaceError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::CreateGameNamespaceError { - meta: generic, - kind: crate::error::CreateGameNamespaceErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGameNamespaceError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::CreateGameNamespaceError { - meta: generic, - kind: crate::error::CreateGameNamespaceErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGameNamespaceError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::CreateGameNamespaceError { - meta: generic, - kind: crate::error::CreateGameNamespaceErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGameNamespaceError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::CreateGameNamespaceError { - meta: generic, - kind: crate::error::CreateGameNamespaceErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGameNamespaceError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::CreateGameNamespaceError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_create_game_namespace_response( - response: &http::Response, -) -> std::result::Result< - crate::output::CreateGameNamespaceOutput, - crate::error::CreateGameNamespaceError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::create_game_namespace_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_create_game_namespace( - response.body().as_ref(), - output, - ) - .map_err(crate::error::CreateGameNamespaceError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_create_game_namespace_token_development_error( - response: &http::Response, -) -> std::result::Result< - crate::output::CreateGameNamespaceTokenDevelopmentOutput, - crate::error::CreateGameNamespaceTokenDevelopmentError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::CreateGameNamespaceTokenDevelopmentError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => { - return Err(crate::error::CreateGameNamespaceTokenDevelopmentError::unhandled(generic)) - } - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::CreateGameNamespaceTokenDevelopmentError { - meta: generic, - kind: crate::error::CreateGameNamespaceTokenDevelopmentErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err( - crate::error::CreateGameNamespaceTokenDevelopmentError::unhandled, - )?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::CreateGameNamespaceTokenDevelopmentError { - meta: generic, - kind: crate::error::CreateGameNamespaceTokenDevelopmentErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGameNamespaceTokenDevelopmentError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::CreateGameNamespaceTokenDevelopmentError { - meta: generic, - kind: crate::error::CreateGameNamespaceTokenDevelopmentErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGameNamespaceTokenDevelopmentError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::CreateGameNamespaceTokenDevelopmentError { - meta: generic, - kind: crate::error::CreateGameNamespaceTokenDevelopmentErrorKind::UnauthorizedError( - { - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGameNamespaceTokenDevelopmentError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }, - ), - } - } - "NotFoundError" => { - crate::error::CreateGameNamespaceTokenDevelopmentError { - meta: generic, - kind: crate::error::CreateGameNamespaceTokenDevelopmentErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGameNamespaceTokenDevelopmentError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::CreateGameNamespaceTokenDevelopmentError { - meta: generic, - kind: crate::error::CreateGameNamespaceTokenDevelopmentErrorKind::BadRequestError( - { - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGameNamespaceTokenDevelopmentError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }, - ), - } - } - _ => crate::error::CreateGameNamespaceTokenDevelopmentError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_create_game_namespace_token_development_response( - response: &http::Response, -) -> std::result::Result< - crate::output::CreateGameNamespaceTokenDevelopmentOutput, - crate::error::CreateGameNamespaceTokenDevelopmentError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::create_game_namespace_token_development_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_create_game_namespace_token_development(response.body().as_ref(), output).map_err(crate::error::CreateGameNamespaceTokenDevelopmentError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_create_game_namespace_token_public_error( - response: &http::Response, -) -> std::result::Result< - crate::output::CreateGameNamespaceTokenPublicOutput, - crate::error::CreateGameNamespaceTokenPublicError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::CreateGameNamespaceTokenPublicError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::CreateGameNamespaceTokenPublicError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::CreateGameNamespaceTokenPublicError { - meta: generic, - kind: crate::error::CreateGameNamespaceTokenPublicErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::CreateGameNamespaceTokenPublicError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::CreateGameNamespaceTokenPublicError { - meta: generic, - kind: crate::error::CreateGameNamespaceTokenPublicErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGameNamespaceTokenPublicError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::CreateGameNamespaceTokenPublicError { - meta: generic, - kind: crate::error::CreateGameNamespaceTokenPublicErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGameNamespaceTokenPublicError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::CreateGameNamespaceTokenPublicError { - meta: generic, - kind: crate::error::CreateGameNamespaceTokenPublicErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGameNamespaceTokenPublicError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::CreateGameNamespaceTokenPublicError { - meta: generic, - kind: crate::error::CreateGameNamespaceTokenPublicErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGameNamespaceTokenPublicError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::CreateGameNamespaceTokenPublicError { - meta: generic, - kind: crate::error::CreateGameNamespaceTokenPublicErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGameNamespaceTokenPublicError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::CreateGameNamespaceTokenPublicError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_create_game_namespace_token_public_response( - response: &http::Response, -) -> std::result::Result< - crate::output::CreateGameNamespaceTokenPublicOutput, - crate::error::CreateGameNamespaceTokenPublicError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::create_game_namespace_token_public_output::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_operation_crate_operation_create_game_namespace_token_public( - response.body().as_ref(), - output, - ) - .map_err(crate::error::CreateGameNamespaceTokenPublicError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_create_game_version_error( - response: &http::Response, -) -> std::result::Result -{ - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::CreateGameVersionError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::CreateGameVersionError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::CreateGameVersionError { - meta: generic, - kind: crate::error::CreateGameVersionErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::CreateGameVersionError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::CreateGameVersionError { - meta: generic, - kind: crate::error::CreateGameVersionErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGameVersionError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::CreateGameVersionError { - meta: generic, - kind: crate::error::CreateGameVersionErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGameVersionError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::CreateGameVersionError { - meta: generic, - kind: crate::error::CreateGameVersionErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGameVersionError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::CreateGameVersionError { - meta: generic, - kind: crate::error::CreateGameVersionErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGameVersionError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::CreateGameVersionError { - meta: generic, - kind: crate::error::CreateGameVersionErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGameVersionError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::CreateGameVersionError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_create_game_version_response( - response: &http::Response, -) -> std::result::Result -{ - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::create_game_version_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_create_game_version( - response.body().as_ref(), - output, - ) - .map_err(crate::error::CreateGameVersionError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_delete_matchmaker_lobby_error( - response: &http::Response, -) -> std::result::Result< - crate::output::DeleteMatchmakerLobbyOutput, - crate::error::DeleteMatchmakerLobbyError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::DeleteMatchmakerLobbyError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::DeleteMatchmakerLobbyError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::DeleteMatchmakerLobbyError { - meta: generic, - kind: crate::error::DeleteMatchmakerLobbyErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::DeleteMatchmakerLobbyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::DeleteMatchmakerLobbyError { - meta: generic, - kind: crate::error::DeleteMatchmakerLobbyErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteMatchmakerLobbyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::DeleteMatchmakerLobbyError { - meta: generic, - kind: crate::error::DeleteMatchmakerLobbyErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteMatchmakerLobbyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::DeleteMatchmakerLobbyError { - meta: generic, - kind: crate::error::DeleteMatchmakerLobbyErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteMatchmakerLobbyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::DeleteMatchmakerLobbyError { - meta: generic, - kind: crate::error::DeleteMatchmakerLobbyErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteMatchmakerLobbyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::DeleteMatchmakerLobbyError { - meta: generic, - kind: crate::error::DeleteMatchmakerLobbyErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteMatchmakerLobbyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::DeleteMatchmakerLobbyError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_delete_matchmaker_lobby_response( - response: &http::Response, -) -> std::result::Result< - crate::output::DeleteMatchmakerLobbyOutput, - crate::error::DeleteMatchmakerLobbyError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::delete_matchmaker_lobby_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_delete_matchmaker_lobby( - response.body().as_ref(), - output, - ) - .map_err(crate::error::DeleteMatchmakerLobbyError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_export_lobby_logs_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::ExportLobbyLogsError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::ExportLobbyLogsError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::ExportLobbyLogsError { - meta: generic, - kind: crate::error::ExportLobbyLogsErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ExportLobbyLogsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::ExportLobbyLogsError { - meta: generic, - kind: crate::error::ExportLobbyLogsErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::ExportLobbyLogsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::ExportLobbyLogsError { - meta: generic, - kind: crate::error::ExportLobbyLogsErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::ExportLobbyLogsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::ExportLobbyLogsError { - meta: generic, - kind: crate::error::ExportLobbyLogsErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::ExportLobbyLogsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::ExportLobbyLogsError { - meta: generic, - kind: crate::error::ExportLobbyLogsErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::ExportLobbyLogsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::ExportLobbyLogsError { - meta: generic, - kind: crate::error::ExportLobbyLogsErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::ExportLobbyLogsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::ExportLobbyLogsError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_export_lobby_logs_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::export_lobby_logs_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_export_lobby_logs( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ExportLobbyLogsError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_export_matchmaker_lobby_history_error( - response: &http::Response, -) -> std::result::Result< - crate::output::ExportMatchmakerLobbyHistoryOutput, - crate::error::ExportMatchmakerLobbyHistoryError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::ExportMatchmakerLobbyHistoryError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => { - return Err(crate::error::ExportMatchmakerLobbyHistoryError::unhandled( - generic, - )) - } - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::ExportMatchmakerLobbyHistoryError { - meta: generic, - kind: crate::error::ExportMatchmakerLobbyHistoryErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ExportMatchmakerLobbyHistoryError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::ExportMatchmakerLobbyHistoryError { - meta: generic, - kind: crate::error::ExportMatchmakerLobbyHistoryErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::ExportMatchmakerLobbyHistoryError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::ExportMatchmakerLobbyHistoryError { - meta: generic, - kind: crate::error::ExportMatchmakerLobbyHistoryErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::ExportMatchmakerLobbyHistoryError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::ExportMatchmakerLobbyHistoryError { - meta: generic, - kind: crate::error::ExportMatchmakerLobbyHistoryErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::ExportMatchmakerLobbyHistoryError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::ExportMatchmakerLobbyHistoryError { - meta: generic, - kind: crate::error::ExportMatchmakerLobbyHistoryErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::ExportMatchmakerLobbyHistoryError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::ExportMatchmakerLobbyHistoryError { - meta: generic, - kind: crate::error::ExportMatchmakerLobbyHistoryErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::ExportMatchmakerLobbyHistoryError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::ExportMatchmakerLobbyHistoryError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_export_matchmaker_lobby_history_response( - response: &http::Response, -) -> std::result::Result< - crate::output::ExportMatchmakerLobbyHistoryOutput, - crate::error::ExportMatchmakerLobbyHistoryError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::export_matchmaker_lobby_history_output::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_operation_crate_operation_export_matchmaker_lobby_history( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ExportMatchmakerLobbyHistoryError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_game_banner_upload_complete_error( - response: &http::Response, -) -> std::result::Result< - crate::output::GameBannerUploadCompleteOutput, - crate::error::GameBannerUploadCompleteError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GameBannerUploadCompleteError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => { - return Err(crate::error::GameBannerUploadCompleteError::unhandled( - generic, - )) - } - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GameBannerUploadCompleteError { - meta: generic, - kind: crate::error::GameBannerUploadCompleteErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GameBannerUploadCompleteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GameBannerUploadCompleteError { - meta: generic, - kind: crate::error::GameBannerUploadCompleteErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GameBannerUploadCompleteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GameBannerUploadCompleteError { - meta: generic, - kind: crate::error::GameBannerUploadCompleteErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GameBannerUploadCompleteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GameBannerUploadCompleteError { - meta: generic, - kind: crate::error::GameBannerUploadCompleteErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GameBannerUploadCompleteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GameBannerUploadCompleteError { - meta: generic, - kind: crate::error::GameBannerUploadCompleteErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GameBannerUploadCompleteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GameBannerUploadCompleteError { - meta: generic, - kind: crate::error::GameBannerUploadCompleteErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GameBannerUploadCompleteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GameBannerUploadCompleteError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_game_banner_upload_complete_response( - response: &http::Response, -) -> std::result::Result< - crate::output::GameBannerUploadCompleteOutput, - crate::error::GameBannerUploadCompleteError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::game_banner_upload_complete_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_game_banner_upload_prepare_error( - response: &http::Response, -) -> std::result::Result< - crate::output::GameBannerUploadPrepareOutput, - crate::error::GameBannerUploadPrepareError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GameBannerUploadPrepareError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => { - return Err(crate::error::GameBannerUploadPrepareError::unhandled( - generic, - )) - } - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GameBannerUploadPrepareError { - meta: generic, - kind: crate::error::GameBannerUploadPrepareErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GameBannerUploadPrepareError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GameBannerUploadPrepareError { - meta: generic, - kind: crate::error::GameBannerUploadPrepareErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GameBannerUploadPrepareError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GameBannerUploadPrepareError { - meta: generic, - kind: crate::error::GameBannerUploadPrepareErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GameBannerUploadPrepareError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GameBannerUploadPrepareError { - meta: generic, - kind: crate::error::GameBannerUploadPrepareErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GameBannerUploadPrepareError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GameBannerUploadPrepareError { - meta: generic, - kind: crate::error::GameBannerUploadPrepareErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GameBannerUploadPrepareError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GameBannerUploadPrepareError { - meta: generic, - kind: crate::error::GameBannerUploadPrepareErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GameBannerUploadPrepareError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GameBannerUploadPrepareError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_game_banner_upload_prepare_response( - response: &http::Response, -) -> std::result::Result< - crate::output::GameBannerUploadPrepareOutput, - crate::error::GameBannerUploadPrepareError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::game_banner_upload_prepare_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_game_banner_upload_prepare( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GameBannerUploadPrepareError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_game_logo_upload_complete_error( - response: &http::Response, -) -> std::result::Result< - crate::output::GameLogoUploadCompleteOutput, - crate::error::GameLogoUploadCompleteError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GameLogoUploadCompleteError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => { - return Err(crate::error::GameLogoUploadCompleteError::unhandled( - generic, - )) - } - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GameLogoUploadCompleteError { - meta: generic, - kind: crate::error::GameLogoUploadCompleteErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GameLogoUploadCompleteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GameLogoUploadCompleteError { - meta: generic, - kind: crate::error::GameLogoUploadCompleteErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GameLogoUploadCompleteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GameLogoUploadCompleteError { - meta: generic, - kind: crate::error::GameLogoUploadCompleteErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GameLogoUploadCompleteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GameLogoUploadCompleteError { - meta: generic, - kind: crate::error::GameLogoUploadCompleteErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GameLogoUploadCompleteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GameLogoUploadCompleteError { - meta: generic, - kind: crate::error::GameLogoUploadCompleteErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GameLogoUploadCompleteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GameLogoUploadCompleteError { - meta: generic, - kind: crate::error::GameLogoUploadCompleteErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GameLogoUploadCompleteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GameLogoUploadCompleteError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_game_logo_upload_complete_response( - response: &http::Response, -) -> std::result::Result< - crate::output::GameLogoUploadCompleteOutput, - crate::error::GameLogoUploadCompleteError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::game_logo_upload_complete_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_game_logo_upload_prepare_error( - response: &http::Response, -) -> std::result::Result< - crate::output::GameLogoUploadPrepareOutput, - crate::error::GameLogoUploadPrepareError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GameLogoUploadPrepareError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::GameLogoUploadPrepareError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GameLogoUploadPrepareError { - meta: generic, - kind: crate::error::GameLogoUploadPrepareErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GameLogoUploadPrepareError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GameLogoUploadPrepareError { - meta: generic, - kind: crate::error::GameLogoUploadPrepareErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GameLogoUploadPrepareError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GameLogoUploadPrepareError { - meta: generic, - kind: crate::error::GameLogoUploadPrepareErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GameLogoUploadPrepareError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GameLogoUploadPrepareError { - meta: generic, - kind: crate::error::GameLogoUploadPrepareErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GameLogoUploadPrepareError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GameLogoUploadPrepareError { - meta: generic, - kind: crate::error::GameLogoUploadPrepareErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GameLogoUploadPrepareError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GameLogoUploadPrepareError { - meta: generic, - kind: crate::error::GameLogoUploadPrepareErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GameLogoUploadPrepareError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GameLogoUploadPrepareError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_game_logo_upload_prepare_response( - response: &http::Response, -) -> std::result::Result< - crate::output::GameLogoUploadPrepareOutput, - crate::error::GameLogoUploadPrepareError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::game_logo_upload_prepare_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_game_logo_upload_prepare( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GameLogoUploadPrepareError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_game_billing_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GetGameBillingError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::GetGameBillingError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GetGameBillingError { - meta: generic, - kind: crate::error::GetGameBillingErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetGameBillingError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GetGameBillingError { - meta: generic, - kind: crate::error::GetGameBillingErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameBillingError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GetGameBillingError { - meta: generic, - kind: crate::error::GetGameBillingErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameBillingError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GetGameBillingError { - meta: generic, - kind: crate::error::GetGameBillingErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameBillingError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GetGameBillingError { - meta: generic, - kind: crate::error::GetGameBillingErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameBillingError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GetGameBillingError { - meta: generic, - kind: crate::error::GetGameBillingErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameBillingError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GetGameBillingError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_game_billing_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::get_game_billing_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_get_game_billing( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetGameBillingError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_game_billing_plans_error( - response: &http::Response, -) -> std::result::Result< - crate::output::GetGameBillingPlansOutput, - crate::error::GetGameBillingPlansError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GetGameBillingPlansError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::GetGameBillingPlansError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GetGameBillingPlansError { - meta: generic, - kind: crate::error::GetGameBillingPlansErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetGameBillingPlansError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GetGameBillingPlansError { - meta: generic, - kind: crate::error::GetGameBillingPlansErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameBillingPlansError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GetGameBillingPlansError { - meta: generic, - kind: crate::error::GetGameBillingPlansErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameBillingPlansError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GetGameBillingPlansError { - meta: generic, - kind: crate::error::GetGameBillingPlansErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameBillingPlansError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GetGameBillingPlansError { - meta: generic, - kind: crate::error::GetGameBillingPlansErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameBillingPlansError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GetGameBillingPlansError { - meta: generic, - kind: crate::error::GetGameBillingPlansErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameBillingPlansError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GetGameBillingPlansError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_game_billing_plans_response( - response: &http::Response, -) -> std::result::Result< - crate::output::GetGameBillingPlansOutput, - crate::error::GetGameBillingPlansError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::get_game_billing_plans_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_get_game_billing_plans( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetGameBillingPlansError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_game_by_id_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GetGameByIdError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::GetGameByIdError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GetGameByIdError { - meta: generic, - kind: crate::error::GetGameByIdErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetGameByIdError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GetGameByIdError { - meta: generic, - kind: crate::error::GetGameByIdErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameByIdError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GetGameByIdError { - meta: generic, - kind: crate::error::GetGameByIdErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameByIdError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GetGameByIdError { - meta: generic, - kind: crate::error::GetGameByIdErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameByIdError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GetGameByIdError { - meta: generic, - kind: crate::error::GetGameByIdErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameByIdError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GetGameByIdError { - meta: generic, - kind: crate::error::GetGameByIdErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameByIdError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GetGameByIdError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_game_by_id_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::get_game_by_id_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_get_game_by_id( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetGameByIdError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_game_namespace_by_id_error( - response: &http::Response, -) -> std::result::Result< - crate::output::GetGameNamespaceByIdOutput, - crate::error::GetGameNamespaceByIdError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GetGameNamespaceByIdError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::GetGameNamespaceByIdError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GetGameNamespaceByIdError { - meta: generic, - kind: crate::error::GetGameNamespaceByIdErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetGameNamespaceByIdError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GetGameNamespaceByIdError { - meta: generic, - kind: crate::error::GetGameNamespaceByIdErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameNamespaceByIdError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GetGameNamespaceByIdError { - meta: generic, - kind: crate::error::GetGameNamespaceByIdErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameNamespaceByIdError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GetGameNamespaceByIdError { - meta: generic, - kind: crate::error::GetGameNamespaceByIdErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameNamespaceByIdError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GetGameNamespaceByIdError { - meta: generic, - kind: crate::error::GetGameNamespaceByIdErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameNamespaceByIdError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GetGameNamespaceByIdError { - meta: generic, - kind: crate::error::GetGameNamespaceByIdErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameNamespaceByIdError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GetGameNamespaceByIdError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_game_namespace_by_id_response( - response: &http::Response, -) -> std::result::Result< - crate::output::GetGameNamespaceByIdOutput, - crate::error::GetGameNamespaceByIdError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::get_game_namespace_by_id_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_get_game_namespace_by_id( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetGameNamespaceByIdError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_games_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GetGamesError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::GetGamesError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GetGamesError { - meta: generic, - kind: crate::error::GetGamesErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetGamesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GetGamesError { - meta: generic, - kind: crate::error::GetGamesErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGamesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GetGamesError { - meta: generic, - kind: crate::error::GetGamesErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGamesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GetGamesError { - meta: generic, - kind: crate::error::GetGamesErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGamesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GetGamesError { - meta: generic, - kind: crate::error::GetGamesErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGamesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GetGamesError { - meta: generic, - kind: crate::error::GetGamesErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGamesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GetGamesError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_games_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::get_games_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_get_games( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetGamesError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_game_version_by_id_error( - response: &http::Response, -) -> std::result::Result< - crate::output::GetGameVersionByIdOutput, - crate::error::GetGameVersionByIdError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GetGameVersionByIdError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::GetGameVersionByIdError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GetGameVersionByIdError { - meta: generic, - kind: crate::error::GetGameVersionByIdErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetGameVersionByIdError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GetGameVersionByIdError { - meta: generic, - kind: crate::error::GetGameVersionByIdErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameVersionByIdError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GetGameVersionByIdError { - meta: generic, - kind: crate::error::GetGameVersionByIdErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameVersionByIdError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GetGameVersionByIdError { - meta: generic, - kind: crate::error::GetGameVersionByIdErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameVersionByIdError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GetGameVersionByIdError { - meta: generic, - kind: crate::error::GetGameVersionByIdErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameVersionByIdError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GetGameVersionByIdError { - meta: generic, - kind: crate::error::GetGameVersionByIdErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameVersionByIdError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GetGameVersionByIdError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_game_version_by_id_response( - response: &http::Response, -) -> std::result::Result< - crate::output::GetGameVersionByIdOutput, - crate::error::GetGameVersionByIdError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::get_game_version_by_id_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_get_game_version_by_id( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetGameVersionByIdError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_group_billing_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GetGroupBillingError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::GetGroupBillingError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GetGroupBillingError { - meta: generic, - kind: crate::error::GetGroupBillingErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetGroupBillingError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GetGroupBillingError { - meta: generic, - kind: crate::error::GetGroupBillingErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupBillingError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GetGroupBillingError { - meta: generic, - kind: crate::error::GetGroupBillingErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupBillingError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GetGroupBillingError { - meta: generic, - kind: crate::error::GetGroupBillingErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupBillingError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GetGroupBillingError { - meta: generic, - kind: crate::error::GetGroupBillingErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupBillingError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GetGroupBillingError { - meta: generic, - kind: crate::error::GetGroupBillingErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupBillingError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GetGroupBillingError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_group_billing_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::get_group_billing_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_get_group_billing( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetGroupBillingError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_group_invoices_list_error( - response: &http::Response, -) -> std::result::Result< - crate::output::GetGroupInvoicesListOutput, - crate::error::GetGroupInvoicesListError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GetGroupInvoicesListError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::GetGroupInvoicesListError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GetGroupInvoicesListError { - meta: generic, - kind: crate::error::GetGroupInvoicesListErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetGroupInvoicesListError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GetGroupInvoicesListError { - meta: generic, - kind: crate::error::GetGroupInvoicesListErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupInvoicesListError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GetGroupInvoicesListError { - meta: generic, - kind: crate::error::GetGroupInvoicesListErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupInvoicesListError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GetGroupInvoicesListError { - meta: generic, - kind: crate::error::GetGroupInvoicesListErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupInvoicesListError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GetGroupInvoicesListError { - meta: generic, - kind: crate::error::GetGroupInvoicesListErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupInvoicesListError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GetGroupInvoicesListError { - meta: generic, - kind: crate::error::GetGroupInvoicesListErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupInvoicesListError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GetGroupInvoicesListError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_group_invoices_list_response( - response: &http::Response, -) -> std::result::Result< - crate::output::GetGroupInvoicesListOutput, - crate::error::GetGroupInvoicesListError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::get_group_invoices_list_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_get_group_invoices_list( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetGroupInvoicesListError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_lobby_logs_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GetLobbyLogsError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::GetLobbyLogsError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GetLobbyLogsError { - meta: generic, - kind: crate::error::GetLobbyLogsErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetLobbyLogsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GetLobbyLogsError { - meta: generic, - kind: crate::error::GetLobbyLogsErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetLobbyLogsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GetLobbyLogsError { - meta: generic, - kind: crate::error::GetLobbyLogsErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetLobbyLogsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GetLobbyLogsError { - meta: generic, - kind: crate::error::GetLobbyLogsErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetLobbyLogsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GetLobbyLogsError { - meta: generic, - kind: crate::error::GetLobbyLogsErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetLobbyLogsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GetLobbyLogsError { - meta: generic, - kind: crate::error::GetLobbyLogsErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetLobbyLogsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GetLobbyLogsError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_lobby_logs_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::get_lobby_logs_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_get_lobby_logs( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetLobbyLogsError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_namespace_analytics_matchmaker_live_error( - response: &http::Response, -) -> std::result::Result< - crate::output::GetNamespaceAnalyticsMatchmakerLiveOutput, - crate::error::GetNamespaceAnalyticsMatchmakerLiveError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GetNamespaceAnalyticsMatchmakerLiveError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => { - return Err(crate::error::GetNamespaceAnalyticsMatchmakerLiveError::unhandled(generic)) - } - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GetNamespaceAnalyticsMatchmakerLiveError { - meta: generic, - kind: crate::error::GetNamespaceAnalyticsMatchmakerLiveErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err( - crate::error::GetNamespaceAnalyticsMatchmakerLiveError::unhandled, - )?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GetNamespaceAnalyticsMatchmakerLiveError { - meta: generic, - kind: crate::error::GetNamespaceAnalyticsMatchmakerLiveErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetNamespaceAnalyticsMatchmakerLiveError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GetNamespaceAnalyticsMatchmakerLiveError { - meta: generic, - kind: crate::error::GetNamespaceAnalyticsMatchmakerLiveErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetNamespaceAnalyticsMatchmakerLiveError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GetNamespaceAnalyticsMatchmakerLiveError { - meta: generic, - kind: crate::error::GetNamespaceAnalyticsMatchmakerLiveErrorKind::UnauthorizedError( - { - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetNamespaceAnalyticsMatchmakerLiveError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }, - ), - } - } - "NotFoundError" => { - crate::error::GetNamespaceAnalyticsMatchmakerLiveError { - meta: generic, - kind: crate::error::GetNamespaceAnalyticsMatchmakerLiveErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetNamespaceAnalyticsMatchmakerLiveError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GetNamespaceAnalyticsMatchmakerLiveError { - meta: generic, - kind: crate::error::GetNamespaceAnalyticsMatchmakerLiveErrorKind::BadRequestError( - { - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetNamespaceAnalyticsMatchmakerLiveError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }, - ), - } - } - _ => crate::error::GetNamespaceAnalyticsMatchmakerLiveError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_namespace_analytics_matchmaker_live_response( - response: &http::Response, -) -> std::result::Result< - crate::output::GetNamespaceAnalyticsMatchmakerLiveOutput, - crate::error::GetNamespaceAnalyticsMatchmakerLiveError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::get_namespace_analytics_matchmaker_live_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_get_namespace_analytics_matchmaker_live(response.body().as_ref(), output).map_err(crate::error::GetNamespaceAnalyticsMatchmakerLiveError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_namespace_lobby_error( - response: &http::Response, -) -> std::result::Result -{ - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GetNamespaceLobbyError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::GetNamespaceLobbyError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GetNamespaceLobbyError { - meta: generic, - kind: crate::error::GetNamespaceLobbyErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetNamespaceLobbyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GetNamespaceLobbyError { - meta: generic, - kind: crate::error::GetNamespaceLobbyErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetNamespaceLobbyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GetNamespaceLobbyError { - meta: generic, - kind: crate::error::GetNamespaceLobbyErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetNamespaceLobbyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GetNamespaceLobbyError { - meta: generic, - kind: crate::error::GetNamespaceLobbyErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetNamespaceLobbyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GetNamespaceLobbyError { - meta: generic, - kind: crate::error::GetNamespaceLobbyErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetNamespaceLobbyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GetNamespaceLobbyError { - meta: generic, - kind: crate::error::GetNamespaceLobbyErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetNamespaceLobbyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GetNamespaceLobbyError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_namespace_lobby_response( - response: &http::Response, -) -> std::result::Result -{ - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::get_namespace_lobby_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_get_namespace_lobby( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetNamespaceLobbyError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_ray_perf_logs_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GetRayPerfLogsError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::GetRayPerfLogsError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GetRayPerfLogsError { - meta: generic, - kind: crate::error::GetRayPerfLogsErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetRayPerfLogsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GetRayPerfLogsError { - meta: generic, - kind: crate::error::GetRayPerfLogsErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetRayPerfLogsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GetRayPerfLogsError { - meta: generic, - kind: crate::error::GetRayPerfLogsErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetRayPerfLogsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GetRayPerfLogsError { - meta: generic, - kind: crate::error::GetRayPerfLogsErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetRayPerfLogsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GetRayPerfLogsError { - meta: generic, - kind: crate::error::GetRayPerfLogsErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetRayPerfLogsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GetRayPerfLogsError { - meta: generic, - kind: crate::error::GetRayPerfLogsErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetRayPerfLogsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GetRayPerfLogsError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_ray_perf_logs_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::get_ray_perf_logs_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_get_ray_perf_logs( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetRayPerfLogsError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_region_tiers_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GetRegionTiersError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::GetRegionTiersError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GetRegionTiersError { - meta: generic, - kind: crate::error::GetRegionTiersErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetRegionTiersError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GetRegionTiersError { - meta: generic, - kind: crate::error::GetRegionTiersErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetRegionTiersError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GetRegionTiersError { - meta: generic, - kind: crate::error::GetRegionTiersErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetRegionTiersError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GetRegionTiersError { - meta: generic, - kind: crate::error::GetRegionTiersErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetRegionTiersError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GetRegionTiersError { - meta: generic, - kind: crate::error::GetRegionTiersErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetRegionTiersError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GetRegionTiersError { - meta: generic, - kind: crate::error::GetRegionTiersErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetRegionTiersError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GetRegionTiersError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_region_tiers_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::get_region_tiers_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_get_region_tiers( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetRegionTiersError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_group_billing_checkout_error( - response: &http::Response, -) -> std::result::Result< - crate::output::GroupBillingCheckoutOutput, - crate::error::GroupBillingCheckoutError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GroupBillingCheckoutError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::GroupBillingCheckoutError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GroupBillingCheckoutError { - meta: generic, - kind: crate::error::GroupBillingCheckoutErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GroupBillingCheckoutError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GroupBillingCheckoutError { - meta: generic, - kind: crate::error::GroupBillingCheckoutErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GroupBillingCheckoutError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GroupBillingCheckoutError { - meta: generic, - kind: crate::error::GroupBillingCheckoutErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GroupBillingCheckoutError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GroupBillingCheckoutError { - meta: generic, - kind: crate::error::GroupBillingCheckoutErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GroupBillingCheckoutError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GroupBillingCheckoutError { - meta: generic, - kind: crate::error::GroupBillingCheckoutErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GroupBillingCheckoutError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GroupBillingCheckoutError { - meta: generic, - kind: crate::error::GroupBillingCheckoutErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GroupBillingCheckoutError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GroupBillingCheckoutError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_group_billing_checkout_response( - response: &http::Response, -) -> std::result::Result< - crate::output::GroupBillingCheckoutOutput, - crate::error::GroupBillingCheckoutError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::group_billing_checkout_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_group_billing_checkout( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GroupBillingCheckoutError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_inspect_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::InspectError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::InspectError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::InspectError { - meta: generic, - kind: crate::error::InspectErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::InspectError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::InspectError { - meta: generic, - kind: crate::error::InspectErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::InspectError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::InspectError { - meta: generic, - kind: crate::error::InspectErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::InspectError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::InspectError { - meta: generic, - kind: crate::error::InspectErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::InspectError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::InspectError { - meta: generic, - kind: crate::error::InspectErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::InspectError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::InspectError { - meta: generic, - kind: crate::error::InspectErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::InspectError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::InspectError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_inspect_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::inspect_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_inspect( - response.body().as_ref(), - output, - ) - .map_err(crate::error::InspectError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_list_game_builds_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::ListGameBuildsError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::ListGameBuildsError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::ListGameBuildsError { - meta: generic, - kind: crate::error::ListGameBuildsErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ListGameBuildsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::ListGameBuildsError { - meta: generic, - kind: crate::error::ListGameBuildsErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListGameBuildsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::ListGameBuildsError { - meta: generic, - kind: crate::error::ListGameBuildsErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListGameBuildsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::ListGameBuildsError { - meta: generic, - kind: crate::error::ListGameBuildsErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListGameBuildsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::ListGameBuildsError { - meta: generic, - kind: crate::error::ListGameBuildsErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListGameBuildsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::ListGameBuildsError { - meta: generic, - kind: crate::error::ListGameBuildsErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListGameBuildsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::ListGameBuildsError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_list_game_builds_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::list_game_builds_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_list_game_builds( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ListGameBuildsError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_list_game_cdn_sites_error( - response: &http::Response, -) -> std::result::Result -{ - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::ListGameCdnSitesError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::ListGameCdnSitesError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::ListGameCdnSitesError { - meta: generic, - kind: crate::error::ListGameCdnSitesErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ListGameCdnSitesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::ListGameCdnSitesError { - meta: generic, - kind: crate::error::ListGameCdnSitesErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListGameCdnSitesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::ListGameCdnSitesError { - meta: generic, - kind: crate::error::ListGameCdnSitesErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListGameCdnSitesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::ListGameCdnSitesError { - meta: generic, - kind: crate::error::ListGameCdnSitesErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListGameCdnSitesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::ListGameCdnSitesError { - meta: generic, - kind: crate::error::ListGameCdnSitesErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListGameCdnSitesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::ListGameCdnSitesError { - meta: generic, - kind: crate::error::ListGameCdnSitesErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListGameCdnSitesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::ListGameCdnSitesError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_list_game_cdn_sites_response( - response: &http::Response, -) -> std::result::Result -{ - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::list_game_cdn_sites_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_list_game_cdn_sites( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ListGameCdnSitesError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_list_game_custom_avatars_error( - response: &http::Response, -) -> std::result::Result< - crate::output::ListGameCustomAvatarsOutput, - crate::error::ListGameCustomAvatarsError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::ListGameCustomAvatarsError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::ListGameCustomAvatarsError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::ListGameCustomAvatarsError { - meta: generic, - kind: crate::error::ListGameCustomAvatarsErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ListGameCustomAvatarsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::ListGameCustomAvatarsError { - meta: generic, - kind: crate::error::ListGameCustomAvatarsErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListGameCustomAvatarsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::ListGameCustomAvatarsError { - meta: generic, - kind: crate::error::ListGameCustomAvatarsErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListGameCustomAvatarsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::ListGameCustomAvatarsError { - meta: generic, - kind: crate::error::ListGameCustomAvatarsErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListGameCustomAvatarsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::ListGameCustomAvatarsError { - meta: generic, - kind: crate::error::ListGameCustomAvatarsErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListGameCustomAvatarsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::ListGameCustomAvatarsError { - meta: generic, - kind: crate::error::ListGameCustomAvatarsErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListGameCustomAvatarsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::ListGameCustomAvatarsError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_list_game_custom_avatars_response( - response: &http::Response, -) -> std::result::Result< - crate::output::ListGameCustomAvatarsOutput, - crate::error::ListGameCustomAvatarsError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::list_game_custom_avatars_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_list_game_custom_avatars( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ListGameCustomAvatarsError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_list_namespace_lobbies_error( - response: &http::Response, -) -> std::result::Result< - crate::output::ListNamespaceLobbiesOutput, - crate::error::ListNamespaceLobbiesError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::ListNamespaceLobbiesError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::ListNamespaceLobbiesError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::ListNamespaceLobbiesError { - meta: generic, - kind: crate::error::ListNamespaceLobbiesErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ListNamespaceLobbiesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::ListNamespaceLobbiesError { - meta: generic, - kind: crate::error::ListNamespaceLobbiesErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListNamespaceLobbiesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::ListNamespaceLobbiesError { - meta: generic, - kind: crate::error::ListNamespaceLobbiesErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListNamespaceLobbiesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::ListNamespaceLobbiesError { - meta: generic, - kind: crate::error::ListNamespaceLobbiesErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListNamespaceLobbiesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::ListNamespaceLobbiesError { - meta: generic, - kind: crate::error::ListNamespaceLobbiesErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListNamespaceLobbiesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::ListNamespaceLobbiesError { - meta: generic, - kind: crate::error::ListNamespaceLobbiesErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListNamespaceLobbiesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::ListNamespaceLobbiesError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_list_namespace_lobbies_response( - response: &http::Response, -) -> std::result::Result< - crate::output::ListNamespaceLobbiesOutput, - crate::error::ListNamespaceLobbiesError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::list_namespace_lobbies_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_list_namespace_lobbies( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ListNamespaceLobbiesError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_prepare_custom_avatar_upload_error( - response: &http::Response, -) -> std::result::Result< - crate::output::PrepareCustomAvatarUploadOutput, - crate::error::PrepareCustomAvatarUploadError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::PrepareCustomAvatarUploadError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => { - return Err(crate::error::PrepareCustomAvatarUploadError::unhandled( - generic, - )) - } - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::PrepareCustomAvatarUploadError { - meta: generic, - kind: crate::error::PrepareCustomAvatarUploadErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::PrepareCustomAvatarUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::PrepareCustomAvatarUploadError { - meta: generic, - kind: crate::error::PrepareCustomAvatarUploadErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::PrepareCustomAvatarUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::PrepareCustomAvatarUploadError { - meta: generic, - kind: crate::error::PrepareCustomAvatarUploadErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::PrepareCustomAvatarUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::PrepareCustomAvatarUploadError { - meta: generic, - kind: crate::error::PrepareCustomAvatarUploadErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::PrepareCustomAvatarUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::PrepareCustomAvatarUploadError { - meta: generic, - kind: crate::error::PrepareCustomAvatarUploadErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::PrepareCustomAvatarUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::PrepareCustomAvatarUploadError { - meta: generic, - kind: crate::error::PrepareCustomAvatarUploadErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::PrepareCustomAvatarUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::PrepareCustomAvatarUploadError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_prepare_custom_avatar_upload_response( - response: &http::Response, -) -> std::result::Result< - crate::output::PrepareCustomAvatarUploadOutput, - crate::error::PrepareCustomAvatarUploadError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::prepare_custom_avatar_upload_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_prepare_custom_avatar_upload( - response.body().as_ref(), - output, - ) - .map_err(crate::error::PrepareCustomAvatarUploadError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_remove_namespace_cdn_auth_user_error( - response: &http::Response, -) -> std::result::Result< - crate::output::RemoveNamespaceCdnAuthUserOutput, - crate::error::RemoveNamespaceCdnAuthUserError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::RemoveNamespaceCdnAuthUserError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => { - return Err(crate::error::RemoveNamespaceCdnAuthUserError::unhandled( - generic, - )) - } - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::RemoveNamespaceCdnAuthUserError { - meta: generic, - kind: crate::error::RemoveNamespaceCdnAuthUserErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::RemoveNamespaceCdnAuthUserError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::RemoveNamespaceCdnAuthUserError { - meta: generic, - kind: crate::error::RemoveNamespaceCdnAuthUserErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::RemoveNamespaceCdnAuthUserError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::RemoveNamespaceCdnAuthUserError { - meta: generic, - kind: crate::error::RemoveNamespaceCdnAuthUserErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::RemoveNamespaceCdnAuthUserError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::RemoveNamespaceCdnAuthUserError { - meta: generic, - kind: crate::error::RemoveNamespaceCdnAuthUserErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::RemoveNamespaceCdnAuthUserError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::RemoveNamespaceCdnAuthUserError { - meta: generic, - kind: crate::error::RemoveNamespaceCdnAuthUserErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::RemoveNamespaceCdnAuthUserError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::RemoveNamespaceCdnAuthUserError { - meta: generic, - kind: crate::error::RemoveNamespaceCdnAuthUserErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::RemoveNamespaceCdnAuthUserError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::RemoveNamespaceCdnAuthUserError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_remove_namespace_cdn_auth_user_response( - response: &http::Response, -) -> std::result::Result< - crate::output::RemoveNamespaceCdnAuthUserOutput, - crate::error::RemoveNamespaceCdnAuthUserError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::remove_namespace_cdn_auth_user_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_remove_namespace_domain_error( - response: &http::Response, -) -> std::result::Result< - crate::output::RemoveNamespaceDomainOutput, - crate::error::RemoveNamespaceDomainError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::RemoveNamespaceDomainError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::RemoveNamespaceDomainError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::RemoveNamespaceDomainError { - meta: generic, - kind: crate::error::RemoveNamespaceDomainErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::RemoveNamespaceDomainError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::RemoveNamespaceDomainError { - meta: generic, - kind: crate::error::RemoveNamespaceDomainErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::RemoveNamespaceDomainError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::RemoveNamespaceDomainError { - meta: generic, - kind: crate::error::RemoveNamespaceDomainErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::RemoveNamespaceDomainError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::RemoveNamespaceDomainError { - meta: generic, - kind: crate::error::RemoveNamespaceDomainErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::RemoveNamespaceDomainError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::RemoveNamespaceDomainError { - meta: generic, - kind: crate::error::RemoveNamespaceDomainErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::RemoveNamespaceDomainError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::RemoveNamespaceDomainError { - meta: generic, - kind: crate::error::RemoveNamespaceDomainErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::RemoveNamespaceDomainError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::RemoveNamespaceDomainError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_remove_namespace_domain_response( - response: &http::Response, -) -> std::result::Result< - crate::output::RemoveNamespaceDomainOutput, - crate::error::RemoveNamespaceDomainError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::remove_namespace_domain_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_set_game_billing_plan_error( - response: &http::Response, -) -> std::result::Result< - crate::output::SetGameBillingPlanOutput, - crate::error::SetGameBillingPlanError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::SetGameBillingPlanError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::SetGameBillingPlanError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::SetGameBillingPlanError { - meta: generic, - kind: crate::error::SetGameBillingPlanErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::SetGameBillingPlanError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::SetGameBillingPlanError { - meta: generic, - kind: crate::error::SetGameBillingPlanErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetGameBillingPlanError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::SetGameBillingPlanError { - meta: generic, - kind: crate::error::SetGameBillingPlanErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetGameBillingPlanError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::SetGameBillingPlanError { - meta: generic, - kind: crate::error::SetGameBillingPlanErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetGameBillingPlanError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::SetGameBillingPlanError { - meta: generic, - kind: crate::error::SetGameBillingPlanErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetGameBillingPlanError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::SetGameBillingPlanError { - meta: generic, - kind: crate::error::SetGameBillingPlanErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetGameBillingPlanError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::SetGameBillingPlanError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_set_game_billing_plan_response( - response: &http::Response, -) -> std::result::Result< - crate::output::SetGameBillingPlanOutput, - crate::error::SetGameBillingPlanError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::set_game_billing_plan_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_set_namespace_cdn_auth_type_error( - response: &http::Response, -) -> std::result::Result< - crate::output::SetNamespaceCdnAuthTypeOutput, - crate::error::SetNamespaceCdnAuthTypeError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::SetNamespaceCdnAuthTypeError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => { - return Err(crate::error::SetNamespaceCdnAuthTypeError::unhandled( - generic, - )) - } - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::SetNamespaceCdnAuthTypeError { - meta: generic, - kind: crate::error::SetNamespaceCdnAuthTypeErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::SetNamespaceCdnAuthTypeError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::SetNamespaceCdnAuthTypeError { - meta: generic, - kind: crate::error::SetNamespaceCdnAuthTypeErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetNamespaceCdnAuthTypeError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::SetNamespaceCdnAuthTypeError { - meta: generic, - kind: crate::error::SetNamespaceCdnAuthTypeErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetNamespaceCdnAuthTypeError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::SetNamespaceCdnAuthTypeError { - meta: generic, - kind: crate::error::SetNamespaceCdnAuthTypeErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetNamespaceCdnAuthTypeError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::SetNamespaceCdnAuthTypeError { - meta: generic, - kind: crate::error::SetNamespaceCdnAuthTypeErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetNamespaceCdnAuthTypeError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::SetNamespaceCdnAuthTypeError { - meta: generic, - kind: crate::error::SetNamespaceCdnAuthTypeErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetNamespaceCdnAuthTypeError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::SetNamespaceCdnAuthTypeError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_set_namespace_cdn_auth_type_response( - response: &http::Response, -) -> std::result::Result< - crate::output::SetNamespaceCdnAuthTypeOutput, - crate::error::SetNamespaceCdnAuthTypeError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::set_namespace_cdn_auth_type_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_toggle_namespace_domain_public_auth_error( - response: &http::Response, -) -> std::result::Result< - crate::output::ToggleNamespaceDomainPublicAuthOutput, - crate::error::ToggleNamespaceDomainPublicAuthError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::ToggleNamespaceDomainPublicAuthError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::ToggleNamespaceDomainPublicAuthError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::ToggleNamespaceDomainPublicAuthError { - meta: generic, - kind: crate::error::ToggleNamespaceDomainPublicAuthErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ToggleNamespaceDomainPublicAuthError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::ToggleNamespaceDomainPublicAuthError { - meta: generic, - kind: crate::error::ToggleNamespaceDomainPublicAuthErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::ToggleNamespaceDomainPublicAuthError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::ToggleNamespaceDomainPublicAuthError { - meta: generic, - kind: crate::error::ToggleNamespaceDomainPublicAuthErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::ToggleNamespaceDomainPublicAuthError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::ToggleNamespaceDomainPublicAuthError { - meta: generic, - kind: crate::error::ToggleNamespaceDomainPublicAuthErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::ToggleNamespaceDomainPublicAuthError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::ToggleNamespaceDomainPublicAuthError { - meta: generic, - kind: crate::error::ToggleNamespaceDomainPublicAuthErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::ToggleNamespaceDomainPublicAuthError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::ToggleNamespaceDomainPublicAuthError { - meta: generic, - kind: crate::error::ToggleNamespaceDomainPublicAuthErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::ToggleNamespaceDomainPublicAuthError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::ToggleNamespaceDomainPublicAuthError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_toggle_namespace_domain_public_auth_response( - response: &http::Response, -) -> std::result::Result< - crate::output::ToggleNamespaceDomainPublicAuthOutput, - crate::error::ToggleNamespaceDomainPublicAuthError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::toggle_namespace_domain_public_auth_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_update_game_namespace_matchmaker_config_error( - response: &http::Response, -) -> std::result::Result< - crate::output::UpdateGameNamespaceMatchmakerConfigOutput, - crate::error::UpdateGameNamespaceMatchmakerConfigError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::UpdateGameNamespaceMatchmakerConfigError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => { - return Err(crate::error::UpdateGameNamespaceMatchmakerConfigError::unhandled(generic)) - } - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::UpdateGameNamespaceMatchmakerConfigError { - meta: generic, - kind: crate::error::UpdateGameNamespaceMatchmakerConfigErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err( - crate::error::UpdateGameNamespaceMatchmakerConfigError::unhandled, - )?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::UpdateGameNamespaceMatchmakerConfigError { - meta: generic, - kind: crate::error::UpdateGameNamespaceMatchmakerConfigErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateGameNamespaceMatchmakerConfigError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::UpdateGameNamespaceMatchmakerConfigError { - meta: generic, - kind: crate::error::UpdateGameNamespaceMatchmakerConfigErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateGameNamespaceMatchmakerConfigError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::UpdateGameNamespaceMatchmakerConfigError { - meta: generic, - kind: crate::error::UpdateGameNamespaceMatchmakerConfigErrorKind::UnauthorizedError( - { - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateGameNamespaceMatchmakerConfigError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }, - ), - } - } - "NotFoundError" => { - crate::error::UpdateGameNamespaceMatchmakerConfigError { - meta: generic, - kind: crate::error::UpdateGameNamespaceMatchmakerConfigErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateGameNamespaceMatchmakerConfigError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::UpdateGameNamespaceMatchmakerConfigError { - meta: generic, - kind: crate::error::UpdateGameNamespaceMatchmakerConfigErrorKind::BadRequestError( - { - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateGameNamespaceMatchmakerConfigError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }, - ), - } - } - _ => crate::error::UpdateGameNamespaceMatchmakerConfigError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_update_game_namespace_matchmaker_config_response( - response: &http::Response, -) -> std::result::Result< - crate::output::UpdateGameNamespaceMatchmakerConfigOutput, - crate::error::UpdateGameNamespaceMatchmakerConfigError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::update_game_namespace_matchmaker_config_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_update_game_namespace_version_error( - response: &http::Response, -) -> std::result::Result< - crate::output::UpdateGameNamespaceVersionOutput, - crate::error::UpdateGameNamespaceVersionError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::UpdateGameNamespaceVersionError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => { - return Err(crate::error::UpdateGameNamespaceVersionError::unhandled( - generic, - )) - } - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::UpdateGameNamespaceVersionError { - meta: generic, - kind: crate::error::UpdateGameNamespaceVersionErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::UpdateGameNamespaceVersionError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::UpdateGameNamespaceVersionError { - meta: generic, - kind: crate::error::UpdateGameNamespaceVersionErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateGameNamespaceVersionError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::UpdateGameNamespaceVersionError { - meta: generic, - kind: crate::error::UpdateGameNamespaceVersionErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateGameNamespaceVersionError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::UpdateGameNamespaceVersionError { - meta: generic, - kind: crate::error::UpdateGameNamespaceVersionErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateGameNamespaceVersionError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::UpdateGameNamespaceVersionError { - meta: generic, - kind: crate::error::UpdateGameNamespaceVersionErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateGameNamespaceVersionError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::UpdateGameNamespaceVersionError { - meta: generic, - kind: crate::error::UpdateGameNamespaceVersionErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateGameNamespaceVersionError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::UpdateGameNamespaceVersionError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_update_game_namespace_version_response( - response: &http::Response, -) -> std::result::Result< - crate::output::UpdateGameNamespaceVersionOutput, - crate::error::UpdateGameNamespaceVersionError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::update_game_namespace_version_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_update_namespace_cdn_auth_user_error( - response: &http::Response, -) -> std::result::Result< - crate::output::UpdateNamespaceCdnAuthUserOutput, - crate::error::UpdateNamespaceCdnAuthUserError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::UpdateNamespaceCdnAuthUserError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => { - return Err(crate::error::UpdateNamespaceCdnAuthUserError::unhandled( - generic, - )) - } - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::UpdateNamespaceCdnAuthUserError { - meta: generic, - kind: crate::error::UpdateNamespaceCdnAuthUserErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::UpdateNamespaceCdnAuthUserError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::UpdateNamespaceCdnAuthUserError { - meta: generic, - kind: crate::error::UpdateNamespaceCdnAuthUserErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateNamespaceCdnAuthUserError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::UpdateNamespaceCdnAuthUserError { - meta: generic, - kind: crate::error::UpdateNamespaceCdnAuthUserErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateNamespaceCdnAuthUserError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::UpdateNamespaceCdnAuthUserError { - meta: generic, - kind: crate::error::UpdateNamespaceCdnAuthUserErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateNamespaceCdnAuthUserError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::UpdateNamespaceCdnAuthUserError { - meta: generic, - kind: crate::error::UpdateNamespaceCdnAuthUserErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateNamespaceCdnAuthUserError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::UpdateNamespaceCdnAuthUserError { - meta: generic, - kind: crate::error::UpdateNamespaceCdnAuthUserErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateNamespaceCdnAuthUserError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::UpdateNamespaceCdnAuthUserError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_update_namespace_cdn_auth_user_response( - response: &http::Response, -) -> std::result::Result< - crate::output::UpdateNamespaceCdnAuthUserOutput, - crate::error::UpdateNamespaceCdnAuthUserError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::update_namespace_cdn_auth_user_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_validate_game_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::ValidateGameError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::ValidateGameError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::ValidateGameError { - meta: generic, - kind: crate::error::ValidateGameErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ValidateGameError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::ValidateGameError { - meta: generic, - kind: crate::error::ValidateGameErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGameError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::ValidateGameError { - meta: generic, - kind: crate::error::ValidateGameErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGameError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::ValidateGameError { - meta: generic, - kind: crate::error::ValidateGameErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGameError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::ValidateGameError { - meta: generic, - kind: crate::error::ValidateGameErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGameError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::ValidateGameError { - meta: generic, - kind: crate::error::ValidateGameErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGameError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::ValidateGameError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_validate_game_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::validate_game_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_validate_game( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ValidateGameError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_validate_game_namespace_error( - response: &http::Response, -) -> std::result::Result< - crate::output::ValidateGameNamespaceOutput, - crate::error::ValidateGameNamespaceError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::ValidateGameNamespaceError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::ValidateGameNamespaceError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::ValidateGameNamespaceError { - meta: generic, - kind: crate::error::ValidateGameNamespaceErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ValidateGameNamespaceError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::ValidateGameNamespaceError { - meta: generic, - kind: crate::error::ValidateGameNamespaceErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGameNamespaceError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::ValidateGameNamespaceError { - meta: generic, - kind: crate::error::ValidateGameNamespaceErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGameNamespaceError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::ValidateGameNamespaceError { - meta: generic, - kind: crate::error::ValidateGameNamespaceErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGameNamespaceError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::ValidateGameNamespaceError { - meta: generic, - kind: crate::error::ValidateGameNamespaceErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGameNamespaceError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::ValidateGameNamespaceError { - meta: generic, - kind: crate::error::ValidateGameNamespaceErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGameNamespaceError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::ValidateGameNamespaceError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_validate_game_namespace_response( - response: &http::Response, -) -> std::result::Result< - crate::output::ValidateGameNamespaceOutput, - crate::error::ValidateGameNamespaceError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::validate_game_namespace_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_validate_game_namespace( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ValidateGameNamespaceError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_validate_game_namespace_matchmaker_config_error( - response: &http::Response, -) -> std::result::Result< - crate::output::ValidateGameNamespaceMatchmakerConfigOutput, - crate::error::ValidateGameNamespaceMatchmakerConfigError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::ValidateGameNamespaceMatchmakerConfigError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => { - return Err( - crate::error::ValidateGameNamespaceMatchmakerConfigError::unhandled(generic), - ) - } - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => { - crate::error::ValidateGameNamespaceMatchmakerConfigError { - meta: generic, - kind: crate::error::ValidateGameNamespaceMatchmakerConfigErrorKind::InternalError( - { - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_internal_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGameNamespaceMatchmakerConfigError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }, - ), - } - } - "RateLimitError" => { - crate::error::ValidateGameNamespaceMatchmakerConfigError { - meta: generic, - kind: crate::error::ValidateGameNamespaceMatchmakerConfigErrorKind::RateLimitError( - { - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGameNamespaceMatchmakerConfigError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }, - ), - } - } - "ForbiddenError" => { - crate::error::ValidateGameNamespaceMatchmakerConfigError { - meta: generic, - kind: crate::error::ValidateGameNamespaceMatchmakerConfigErrorKind::ForbiddenError( - { - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGameNamespaceMatchmakerConfigError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }, - ), - } - } - "UnauthorizedError" => crate::error::ValidateGameNamespaceMatchmakerConfigError { - meta: generic, - kind: crate::error::ValidateGameNamespaceMatchmakerConfigErrorKind::UnauthorizedError( - { - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGameNamespaceMatchmakerConfigError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }, - ), - }, - "NotFoundError" => { - crate::error::ValidateGameNamespaceMatchmakerConfigError { - meta: generic, - kind: crate::error::ValidateGameNamespaceMatchmakerConfigErrorKind::NotFoundError( - { - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGameNamespaceMatchmakerConfigError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }, - ), - } - } - "BadRequestError" => { - crate::error::ValidateGameNamespaceMatchmakerConfigError { - meta: generic, - kind: crate::error::ValidateGameNamespaceMatchmakerConfigErrorKind::BadRequestError( - { - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGameNamespaceMatchmakerConfigError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }, - ), - } - } - _ => crate::error::ValidateGameNamespaceMatchmakerConfigError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_validate_game_namespace_matchmaker_config_response( - response: &http::Response, -) -> std::result::Result< - crate::output::ValidateGameNamespaceMatchmakerConfigOutput, - crate::error::ValidateGameNamespaceMatchmakerConfigError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = - crate::output::validate_game_namespace_matchmaker_config_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_validate_game_namespace_matchmaker_config(response.body().as_ref(), output).map_err(crate::error::ValidateGameNamespaceMatchmakerConfigError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_validate_game_namespace_token_development_error( - response: &http::Response, -) -> std::result::Result< - crate::output::ValidateGameNamespaceTokenDevelopmentOutput, - crate::error::ValidateGameNamespaceTokenDevelopmentError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::ValidateGameNamespaceTokenDevelopmentError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => { - return Err( - crate::error::ValidateGameNamespaceTokenDevelopmentError::unhandled(generic), - ) - } - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => { - crate::error::ValidateGameNamespaceTokenDevelopmentError { - meta: generic, - kind: crate::error::ValidateGameNamespaceTokenDevelopmentErrorKind::InternalError( - { - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_internal_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGameNamespaceTokenDevelopmentError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }, - ), - } - } - "RateLimitError" => { - crate::error::ValidateGameNamespaceTokenDevelopmentError { - meta: generic, - kind: crate::error::ValidateGameNamespaceTokenDevelopmentErrorKind::RateLimitError( - { - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGameNamespaceTokenDevelopmentError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }, - ), - } - } - "ForbiddenError" => { - crate::error::ValidateGameNamespaceTokenDevelopmentError { - meta: generic, - kind: crate::error::ValidateGameNamespaceTokenDevelopmentErrorKind::ForbiddenError( - { - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGameNamespaceTokenDevelopmentError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }, - ), - } - } - "UnauthorizedError" => crate::error::ValidateGameNamespaceTokenDevelopmentError { - meta: generic, - kind: crate::error::ValidateGameNamespaceTokenDevelopmentErrorKind::UnauthorizedError( - { - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGameNamespaceTokenDevelopmentError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }, - ), - }, - "NotFoundError" => { - crate::error::ValidateGameNamespaceTokenDevelopmentError { - meta: generic, - kind: crate::error::ValidateGameNamespaceTokenDevelopmentErrorKind::NotFoundError( - { - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGameNamespaceTokenDevelopmentError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }, - ), - } - } - "BadRequestError" => { - crate::error::ValidateGameNamespaceTokenDevelopmentError { - meta: generic, - kind: crate::error::ValidateGameNamespaceTokenDevelopmentErrorKind::BadRequestError( - { - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGameNamespaceTokenDevelopmentError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }, - ), - } - } - _ => crate::error::ValidateGameNamespaceTokenDevelopmentError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_validate_game_namespace_token_development_response( - response: &http::Response, -) -> std::result::Result< - crate::output::ValidateGameNamespaceTokenDevelopmentOutput, - crate::error::ValidateGameNamespaceTokenDevelopmentError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = - crate::output::validate_game_namespace_token_development_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_validate_game_namespace_token_development(response.body().as_ref(), output).map_err(crate::error::ValidateGameNamespaceTokenDevelopmentError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_validate_game_version_error( - response: &http::Response, -) -> std::result::Result< - crate::output::ValidateGameVersionOutput, - crate::error::ValidateGameVersionError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::ValidateGameVersionError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::ValidateGameVersionError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::ValidateGameVersionError { - meta: generic, - kind: crate::error::ValidateGameVersionErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ValidateGameVersionError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::ValidateGameVersionError { - meta: generic, - kind: crate::error::ValidateGameVersionErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGameVersionError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::ValidateGameVersionError { - meta: generic, - kind: crate::error::ValidateGameVersionErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGameVersionError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::ValidateGameVersionError { - meta: generic, - kind: crate::error::ValidateGameVersionErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGameVersionError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::ValidateGameVersionError { - meta: generic, - kind: crate::error::ValidateGameVersionErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGameVersionError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::ValidateGameVersionError { - meta: generic, - kind: crate::error::ValidateGameVersionErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGameVersionError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::ValidateGameVersionError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_validate_game_version_response( - response: &http::Response, -) -> std::result::Result< - crate::output::ValidateGameVersionOutput, - crate::error::ValidateGameVersionError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::validate_game_version_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_validate_game_version( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ValidateGameVersionError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_validate_group_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::ValidateGroupError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::ValidateGroupError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::ValidateGroupError { - meta: generic, - kind: crate::error::ValidateGroupErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ValidateGroupError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::ValidateGroupError { - meta: generic, - kind: crate::error::ValidateGroupErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGroupError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::ValidateGroupError { - meta: generic, - kind: crate::error::ValidateGroupErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGroupError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::ValidateGroupError { - meta: generic, - kind: crate::error::ValidateGroupErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGroupError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::ValidateGroupError { - meta: generic, - kind: crate::error::ValidateGroupErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGroupError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::ValidateGroupError { - meta: generic, - kind: crate::error::ValidateGroupErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGroupError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::ValidateGroupError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_validate_group_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::validate_group_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_validate_group( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ValidateGroupError::unhandled)?; - output.build() - }) -} diff --git a/lib/smithy-output/api-cloud/rust/rust/src/operation_ser.rs b/lib/smithy-output/api-cloud/rust/rust/src/operation_ser.rs deleted file mode 100644 index fc063259e..000000000 --- a/lib/smithy-output/api-cloud/rust/rust/src/operation_ser.rs +++ /dev/null @@ -1,288 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub fn serialize_operation_crate_operation_add_namespace_domain( - input: &crate::input::AddNamespaceDomainInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_add_namespace_domain_input( - &mut object, - input, - )?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_create_game( - input: &crate::input::CreateGameInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_create_game_input(&mut object, input)?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_create_game_build( - input: &crate::input::CreateGameBuildInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_create_game_build_input(&mut object, input)?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_create_game_cdn_site( - input: &crate::input::CreateGameCdnSiteInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_create_game_cdn_site_input( - &mut object, - input, - )?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_create_game_namespace( - input: &crate::input::CreateGameNamespaceInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_create_game_namespace_input( - &mut object, - input, - )?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_create_game_namespace_token_development( - input: &crate::input::CreateGameNamespaceTokenDevelopmentInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_create_game_namespace_token_development_input( - &mut object, - input, - )?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_create_game_version( - input: &crate::input::CreateGameVersionInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_create_game_version_input(&mut object, input)?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_export_lobby_logs( - input: &crate::input::ExportLobbyLogsInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_export_lobby_logs_input(&mut object, input)?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_export_matchmaker_lobby_history( - input: &crate::input::ExportMatchmakerLobbyHistoryInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_export_matchmaker_lobby_history_input( - &mut object, - input, - )?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_game_banner_upload_prepare( - input: &crate::input::GameBannerUploadPrepareInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_game_banner_upload_prepare_input( - &mut object, - input, - )?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_game_logo_upload_prepare( - input: &crate::input::GameLogoUploadPrepareInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_game_logo_upload_prepare_input( - &mut object, - input, - )?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_prepare_custom_avatar_upload( - input: &crate::input::PrepareCustomAvatarUploadInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_prepare_custom_avatar_upload_input( - &mut object, - input, - )?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_set_game_billing_plan( - input: &crate::input::SetGameBillingPlanInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_set_game_billing_plan_input( - &mut object, - input, - )?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_set_namespace_cdn_auth_type( - input: &crate::input::SetNamespaceCdnAuthTypeInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_set_namespace_cdn_auth_type_input( - &mut object, - input, - )?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_toggle_namespace_domain_public_auth( - input: &crate::input::ToggleNamespaceDomainPublicAuthInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_toggle_namespace_domain_public_auth_input( - &mut object, - input, - )?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_update_game_namespace_matchmaker_config( - input: &crate::input::UpdateGameNamespaceMatchmakerConfigInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_update_game_namespace_matchmaker_config_input( - &mut object, - input, - )?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_update_game_namespace_version( - input: &crate::input::UpdateGameNamespaceVersionInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_update_game_namespace_version_input( - &mut object, - input, - )?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_update_namespace_cdn_auth_user( - input: &crate::input::UpdateNamespaceCdnAuthUserInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_update_namespace_cdn_auth_user_input( - &mut object, - input, - )?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_validate_game( - input: &crate::input::ValidateGameInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_validate_game_input(&mut object, input)?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_validate_game_namespace( - input: &crate::input::ValidateGameNamespaceInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_validate_game_namespace_input( - &mut object, - input, - )?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_validate_game_namespace_matchmaker_config( - input: &crate::input::ValidateGameNamespaceMatchmakerConfigInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_validate_game_namespace_matchmaker_config_input(&mut object, input)?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_validate_game_namespace_token_development( - input: &crate::input::ValidateGameNamespaceTokenDevelopmentInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_validate_game_namespace_token_development_input(&mut object, input)?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_validate_game_version( - input: &crate::input::ValidateGameVersionInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_validate_game_version_input( - &mut object, - input, - )?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_validate_group( - input: &crate::input::ValidateGroupInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_validate_group_input(&mut object, input)?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} diff --git a/lib/smithy-output/api-cloud/rust/rust/src/output.rs b/lib/smithy-output/api-cloud/rust/rust/src/output.rs deleted file mode 100644 index 01e02c1cf..000000000 --- a/lib/smithy-output/api-cloud/rust/rust/src/output.rs +++ /dev/null @@ -1,3243 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CompleteCustomAvatarUploadOutput {} -impl std::fmt::Debug for CompleteCustomAvatarUploadOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CompleteCustomAvatarUploadOutput"); - formatter.finish() - } -} -/// See [`CompleteCustomAvatarUploadOutput`](crate::output::CompleteCustomAvatarUploadOutput) -pub mod complete_custom_avatar_upload_output { - /// A builder for [`CompleteCustomAvatarUploadOutput`](crate::output::CompleteCustomAvatarUploadOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`CompleteCustomAvatarUploadOutput`](crate::output::CompleteCustomAvatarUploadOutput) - pub fn build(self) -> crate::output::CompleteCustomAvatarUploadOutput { - crate::output::CompleteCustomAvatarUploadOutput {} - } - } -} -impl CompleteCustomAvatarUploadOutput { - /// Creates a new builder-style object to manufacture [`CompleteCustomAvatarUploadOutput`](crate::output::CompleteCustomAvatarUploadOutput) - pub fn builder() -> crate::output::complete_custom_avatar_upload_output::Builder { - crate::output::complete_custom_avatar_upload_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PrepareCustomAvatarUploadOutput { - /// A universally unique identifier. - pub upload_id: std::option::Option, - /// A presigned request used to upload files. Upload your file to the given URL via a PUT request. - pub presigned_request: std::option::Option, -} -impl PrepareCustomAvatarUploadOutput { - /// A universally unique identifier. - pub fn upload_id(&self) -> std::option::Option<&str> { - self.upload_id.as_deref() - } - /// A presigned request used to upload files. Upload your file to the given URL via a PUT request. - pub fn presigned_request(&self) -> std::option::Option<&crate::model::UploadPresignedRequest> { - self.presigned_request.as_ref() - } -} -impl std::fmt::Debug for PrepareCustomAvatarUploadOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PrepareCustomAvatarUploadOutput"); - formatter.field("upload_id", &self.upload_id); - formatter.field("presigned_request", &self.presigned_request); - formatter.finish() - } -} -/// See [`PrepareCustomAvatarUploadOutput`](crate::output::PrepareCustomAvatarUploadOutput) -pub mod prepare_custom_avatar_upload_output { - /// A builder for [`PrepareCustomAvatarUploadOutput`](crate::output::PrepareCustomAvatarUploadOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) upload_id: std::option::Option, - pub(crate) presigned_request: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn upload_id(mut self, input: impl Into) -> Self { - self.upload_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_upload_id(mut self, input: std::option::Option) -> Self { - self.upload_id = input; - self - } - /// A presigned request used to upload files. Upload your file to the given URL via a PUT request. - pub fn presigned_request(mut self, input: crate::model::UploadPresignedRequest) -> Self { - self.presigned_request = Some(input); - self - } - /// A presigned request used to upload files. Upload your file to the given URL via a PUT request. - pub fn set_presigned_request( - mut self, - input: std::option::Option, - ) -> Self { - self.presigned_request = input; - self - } - /// Consumes the builder and constructs a [`PrepareCustomAvatarUploadOutput`](crate::output::PrepareCustomAvatarUploadOutput) - pub fn build(self) -> crate::output::PrepareCustomAvatarUploadOutput { - crate::output::PrepareCustomAvatarUploadOutput { - upload_id: self.upload_id, - presigned_request: self.presigned_request, - } - } - } -} -impl PrepareCustomAvatarUploadOutput { - /// Creates a new builder-style object to manufacture [`PrepareCustomAvatarUploadOutput`](crate::output::PrepareCustomAvatarUploadOutput) - pub fn builder() -> crate::output::prepare_custom_avatar_upload_output::Builder { - crate::output::prepare_custom_avatar_upload_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ListGameCustomAvatarsOutput { - /// A list of custom avatar summaries. - pub custom_avatars: std::option::Option>, -} -impl ListGameCustomAvatarsOutput { - /// A list of custom avatar summaries. - pub fn custom_avatars(&self) -> std::option::Option<&[crate::model::CustomAvatarSummary]> { - self.custom_avatars.as_deref() - } -} -impl std::fmt::Debug for ListGameCustomAvatarsOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ListGameCustomAvatarsOutput"); - formatter.field("custom_avatars", &self.custom_avatars); - formatter.finish() - } -} -/// See [`ListGameCustomAvatarsOutput`](crate::output::ListGameCustomAvatarsOutput) -pub mod list_game_custom_avatars_output { - /// A builder for [`ListGameCustomAvatarsOutput`](crate::output::ListGameCustomAvatarsOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) custom_avatars: - std::option::Option>, - } - impl Builder { - /// Appends an item to `custom_avatars`. - /// - /// To override the contents of this collection use [`set_custom_avatars`](Self::set_custom_avatars). - /// - /// A list of custom avatar summaries. - pub fn custom_avatars(mut self, input: crate::model::CustomAvatarSummary) -> Self { - let mut v = self.custom_avatars.unwrap_or_default(); - v.push(input); - self.custom_avatars = Some(v); - self - } - /// A list of custom avatar summaries. - pub fn set_custom_avatars( - mut self, - input: std::option::Option>, - ) -> Self { - self.custom_avatars = input; - self - } - /// Consumes the builder and constructs a [`ListGameCustomAvatarsOutput`](crate::output::ListGameCustomAvatarsOutput) - pub fn build(self) -> crate::output::ListGameCustomAvatarsOutput { - crate::output::ListGameCustomAvatarsOutput { - custom_avatars: self.custom_avatars, - } - } - } -} -impl ListGameCustomAvatarsOutput { - /// Creates a new builder-style object to manufacture [`ListGameCustomAvatarsOutput`](crate::output::ListGameCustomAvatarsOutput) - pub fn builder() -> crate::output::list_game_custom_avatars_output::Builder { - crate::output::list_game_custom_avatars_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetRayPerfLogsOutput { - /// A list of service performance summaries. - pub perf_lists: std::option::Option>, -} -impl GetRayPerfLogsOutput { - /// A list of service performance summaries. - pub fn perf_lists(&self) -> std::option::Option<&[crate::model::SvcPerf]> { - self.perf_lists.as_deref() - } -} -impl std::fmt::Debug for GetRayPerfLogsOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetRayPerfLogsOutput"); - formatter.field("perf_lists", &self.perf_lists); - formatter.finish() - } -} -/// See [`GetRayPerfLogsOutput`](crate::output::GetRayPerfLogsOutput) -pub mod get_ray_perf_logs_output { - /// A builder for [`GetRayPerfLogsOutput`](crate::output::GetRayPerfLogsOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) perf_lists: std::option::Option>, - } - impl Builder { - /// Appends an item to `perf_lists`. - /// - /// To override the contents of this collection use [`set_perf_lists`](Self::set_perf_lists). - /// - /// A list of service performance summaries. - pub fn perf_lists(mut self, input: crate::model::SvcPerf) -> Self { - let mut v = self.perf_lists.unwrap_or_default(); - v.push(input); - self.perf_lists = Some(v); - self - } - /// A list of service performance summaries. - pub fn set_perf_lists( - mut self, - input: std::option::Option>, - ) -> Self { - self.perf_lists = input; - self - } - /// Consumes the builder and constructs a [`GetRayPerfLogsOutput`](crate::output::GetRayPerfLogsOutput) - pub fn build(self) -> crate::output::GetRayPerfLogsOutput { - crate::output::GetRayPerfLogsOutput { - perf_lists: self.perf_lists, - } - } - } -} -impl GetRayPerfLogsOutput { - /// Creates a new builder-style object to manufacture [`GetRayPerfLogsOutput`](crate::output::GetRayPerfLogsOutput) - pub fn builder() -> crate::output::get_ray_perf_logs_output::Builder { - crate::output::get_ray_perf_logs_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ValidateGroupOutput { - /// A list of validation errors. - pub errors: std::option::Option>, -} -impl ValidateGroupOutput { - /// A list of validation errors. - pub fn errors(&self) -> std::option::Option<&[crate::model::ValidationError]> { - self.errors.as_deref() - } -} -impl std::fmt::Debug for ValidateGroupOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ValidateGroupOutput"); - formatter.field("errors", &self.errors); - formatter.finish() - } -} -/// See [`ValidateGroupOutput`](crate::output::ValidateGroupOutput) -pub mod validate_group_output { - /// A builder for [`ValidateGroupOutput`](crate::output::ValidateGroupOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) errors: std::option::Option>, - } - impl Builder { - /// Appends an item to `errors`. - /// - /// To override the contents of this collection use [`set_errors`](Self::set_errors). - /// - /// A list of validation errors. - pub fn errors(mut self, input: crate::model::ValidationError) -> Self { - let mut v = self.errors.unwrap_or_default(); - v.push(input); - self.errors = Some(v); - self - } - /// A list of validation errors. - pub fn set_errors( - mut self, - input: std::option::Option>, - ) -> Self { - self.errors = input; - self - } - /// Consumes the builder and constructs a [`ValidateGroupOutput`](crate::output::ValidateGroupOutput) - pub fn build(self) -> crate::output::ValidateGroupOutput { - crate::output::ValidateGroupOutput { - errors: self.errors, - } - } - } -} -impl ValidateGroupOutput { - /// Creates a new builder-style object to manufacture [`ValidateGroupOutput`](crate::output::ValidateGroupOutput) - pub fn builder() -> crate::output::validate_group_output::Builder { - crate::output::validate_group_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GroupBillingCheckoutOutput { - /// The URL of the checkout session. - pub url: std::option::Option, -} -impl GroupBillingCheckoutOutput { - /// The URL of the checkout session. - pub fn url(&self) -> std::option::Option<&str> { - self.url.as_deref() - } -} -impl std::fmt::Debug for GroupBillingCheckoutOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GroupBillingCheckoutOutput"); - formatter.field("url", &self.url); - formatter.finish() - } -} -/// See [`GroupBillingCheckoutOutput`](crate::output::GroupBillingCheckoutOutput) -pub mod group_billing_checkout_output { - /// A builder for [`GroupBillingCheckoutOutput`](crate::output::GroupBillingCheckoutOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) url: std::option::Option, - } - impl Builder { - /// The URL of the checkout session. - pub fn url(mut self, input: impl Into) -> Self { - self.url = Some(input.into()); - self - } - /// The URL of the checkout session. - pub fn set_url(mut self, input: std::option::Option) -> Self { - self.url = input; - self - } - /// Consumes the builder and constructs a [`GroupBillingCheckoutOutput`](crate::output::GroupBillingCheckoutOutput) - pub fn build(self) -> crate::output::GroupBillingCheckoutOutput { - crate::output::GroupBillingCheckoutOutput { url: self.url } - } - } -} -impl GroupBillingCheckoutOutput { - /// Creates a new builder-style object to manufacture [`GroupBillingCheckoutOutput`](crate::output::GroupBillingCheckoutOutput) - pub fn builder() -> crate::output::group_billing_checkout_output::Builder { - crate::output::group_billing_checkout_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ConvertGroupOutput {} -impl std::fmt::Debug for ConvertGroupOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ConvertGroupOutput"); - formatter.finish() - } -} -/// See [`ConvertGroupOutput`](crate::output::ConvertGroupOutput) -pub mod convert_group_output { - /// A builder for [`ConvertGroupOutput`](crate::output::ConvertGroupOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`ConvertGroupOutput`](crate::output::ConvertGroupOutput) - pub fn build(self) -> crate::output::ConvertGroupOutput { - crate::output::ConvertGroupOutput {} - } - } -} -impl ConvertGroupOutput { - /// Creates a new builder-style object to manufacture [`ConvertGroupOutput`](crate::output::ConvertGroupOutput) - pub fn builder() -> crate::output::convert_group_output::Builder { - crate::output::convert_group_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetGroupInvoicesListOutput { - /// A list of a group's billing invoices. - pub invoices: std::option::Option>, -} -impl GetGroupInvoicesListOutput { - /// A list of a group's billing invoices. - pub fn invoices(&self) -> std::option::Option<&[crate::model::GroupBillingInvoice]> { - self.invoices.as_deref() - } -} -impl std::fmt::Debug for GetGroupInvoicesListOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetGroupInvoicesListOutput"); - formatter.field("invoices", &self.invoices); - formatter.finish() - } -} -/// See [`GetGroupInvoicesListOutput`](crate::output::GetGroupInvoicesListOutput) -pub mod get_group_invoices_list_output { - /// A builder for [`GetGroupInvoicesListOutput`](crate::output::GetGroupInvoicesListOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) invoices: std::option::Option>, - } - impl Builder { - /// Appends an item to `invoices`. - /// - /// To override the contents of this collection use [`set_invoices`](Self::set_invoices). - /// - /// A list of a group's billing invoices. - pub fn invoices(mut self, input: crate::model::GroupBillingInvoice) -> Self { - let mut v = self.invoices.unwrap_or_default(); - v.push(input); - self.invoices = Some(v); - self - } - /// A list of a group's billing invoices. - pub fn set_invoices( - mut self, - input: std::option::Option>, - ) -> Self { - self.invoices = input; - self - } - /// Consumes the builder and constructs a [`GetGroupInvoicesListOutput`](crate::output::GetGroupInvoicesListOutput) - pub fn build(self) -> crate::output::GetGroupInvoicesListOutput { - crate::output::GetGroupInvoicesListOutput { - invoices: self.invoices, - } - } - } -} -impl GetGroupInvoicesListOutput { - /// Creates a new builder-style object to manufacture [`GetGroupInvoicesListOutput`](crate::output::GetGroupInvoicesListOutput) - pub fn builder() -> crate::output::get_group_invoices_list_output::Builder { - crate::output::get_group_invoices_list_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetGroupBillingOutput { - /// Signed 64 bit integer. - pub usage: std::option::Option, - /// The status of a developer group. - pub status: std::option::Option, - /// Whether or not the given group can actively host games. - pub active: std::option::Option, -} -impl GetGroupBillingOutput { - /// Signed 64 bit integer. - pub fn usage(&self) -> std::option::Option { - self.usage - } - /// The status of a developer group. - pub fn status(&self) -> std::option::Option<&crate::model::GroupStatus> { - self.status.as_ref() - } - /// Whether or not the given group can actively host games. - pub fn active(&self) -> std::option::Option { - self.active - } -} -impl std::fmt::Debug for GetGroupBillingOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetGroupBillingOutput"); - formatter.field("usage", &self.usage); - formatter.field("status", &self.status); - formatter.field("active", &self.active); - formatter.finish() - } -} -/// See [`GetGroupBillingOutput`](crate::output::GetGroupBillingOutput) -pub mod get_group_billing_output { - /// A builder for [`GetGroupBillingOutput`](crate::output::GetGroupBillingOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) usage: std::option::Option, - pub(crate) status: std::option::Option, - pub(crate) active: std::option::Option, - } - impl Builder { - /// Signed 64 bit integer. - pub fn usage(mut self, input: i64) -> Self { - self.usage = Some(input); - self - } - /// Signed 64 bit integer. - pub fn set_usage(mut self, input: std::option::Option) -> Self { - self.usage = input; - self - } - /// The status of a developer group. - pub fn status(mut self, input: crate::model::GroupStatus) -> Self { - self.status = Some(input); - self - } - /// The status of a developer group. - pub fn set_status(mut self, input: std::option::Option) -> Self { - self.status = input; - self - } - /// Whether or not the given group can actively host games. - pub fn active(mut self, input: bool) -> Self { - self.active = Some(input); - self - } - /// Whether or not the given group can actively host games. - pub fn set_active(mut self, input: std::option::Option) -> Self { - self.active = input; - self - } - /// Consumes the builder and constructs a [`GetGroupBillingOutput`](crate::output::GetGroupBillingOutput) - pub fn build(self) -> crate::output::GetGroupBillingOutput { - crate::output::GetGroupBillingOutput { - usage: self.usage, - status: self.status, - active: self.active, - } - } - } -} -impl GetGroupBillingOutput { - /// Creates a new builder-style object to manufacture [`GetGroupBillingOutput`](crate::output::GetGroupBillingOutput) - pub fn builder() -> crate::output::get_group_billing_output::Builder { - crate::output::get_group_billing_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetRegionTiersOutput { - /// A list of region server tiers. - pub tiers: std::option::Option>, -} -impl GetRegionTiersOutput { - /// A list of region server tiers. - pub fn tiers(&self) -> std::option::Option<&[crate::model::RegionTier]> { - self.tiers.as_deref() - } -} -impl std::fmt::Debug for GetRegionTiersOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetRegionTiersOutput"); - formatter.field("tiers", &self.tiers); - formatter.finish() - } -} -/// See [`GetRegionTiersOutput`](crate::output::GetRegionTiersOutput) -pub mod get_region_tiers_output { - /// A builder for [`GetRegionTiersOutput`](crate::output::GetRegionTiersOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) tiers: std::option::Option>, - } - impl Builder { - /// Appends an item to `tiers`. - /// - /// To override the contents of this collection use [`set_tiers`](Self::set_tiers). - /// - /// A list of region server tiers. - pub fn tiers(mut self, input: crate::model::RegionTier) -> Self { - let mut v = self.tiers.unwrap_or_default(); - v.push(input); - self.tiers = Some(v); - self - } - /// A list of region server tiers. - pub fn set_tiers( - mut self, - input: std::option::Option>, - ) -> Self { - self.tiers = input; - self - } - /// Consumes the builder and constructs a [`GetRegionTiersOutput`](crate::output::GetRegionTiersOutput) - pub fn build(self) -> crate::output::GetRegionTiersOutput { - crate::output::GetRegionTiersOutput { tiers: self.tiers } - } - } -} -impl GetRegionTiersOutput { - /// Creates a new builder-style object to manufacture [`GetRegionTiersOutput`](crate::output::GetRegionTiersOutput) - pub fn builder() -> crate::output::get_region_tiers_output::Builder { - crate::output::get_region_tiers_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ExportLobbyLogsOutput { - /// The URL to a CSV file for the given lobby history. - pub url: std::option::Option, -} -impl ExportLobbyLogsOutput { - /// The URL to a CSV file for the given lobby history. - pub fn url(&self) -> std::option::Option<&str> { - self.url.as_deref() - } -} -impl std::fmt::Debug for ExportLobbyLogsOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ExportLobbyLogsOutput"); - formatter.field("url", &self.url); - formatter.finish() - } -} -/// See [`ExportLobbyLogsOutput`](crate::output::ExportLobbyLogsOutput) -pub mod export_lobby_logs_output { - /// A builder for [`ExportLobbyLogsOutput`](crate::output::ExportLobbyLogsOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) url: std::option::Option, - } - impl Builder { - /// The URL to a CSV file for the given lobby history. - pub fn url(mut self, input: impl Into) -> Self { - self.url = Some(input.into()); - self - } - /// The URL to a CSV file for the given lobby history. - pub fn set_url(mut self, input: std::option::Option) -> Self { - self.url = input; - self - } - /// Consumes the builder and constructs a [`ExportLobbyLogsOutput`](crate::output::ExportLobbyLogsOutput) - pub fn build(self) -> crate::output::ExportLobbyLogsOutput { - crate::output::ExportLobbyLogsOutput { url: self.url } - } - } -} -impl ExportLobbyLogsOutput { - /// Creates a new builder-style object to manufacture [`ExportLobbyLogsOutput`](crate::output::ExportLobbyLogsOutput) - pub fn builder() -> crate::output::export_lobby_logs_output::Builder { - crate::output::export_lobby_logs_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetLobbyLogsOutput { - /// Sorted old to new. - pub lines: std::option::Option>, - /// Sorted old to new. - pub timestamps: std::option::Option>, - /// Provided by watchable endpoints used in blocking loops. - pub watch: std::option::Option, -} -impl GetLobbyLogsOutput { - /// Sorted old to new. - pub fn lines(&self) -> std::option::Option<&[std::string::String]> { - self.lines.as_deref() - } - /// Sorted old to new. - pub fn timestamps(&self) -> std::option::Option<&[aws_smithy_types::DateTime]> { - self.timestamps.as_deref() - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(&self) -> std::option::Option<&crate::model::WatchResponse> { - self.watch.as_ref() - } -} -impl std::fmt::Debug for GetLobbyLogsOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetLobbyLogsOutput"); - formatter.field("lines", &self.lines); - formatter.field("timestamps", &self.timestamps); - formatter.field("watch", &self.watch); - formatter.finish() - } -} -/// See [`GetLobbyLogsOutput`](crate::output::GetLobbyLogsOutput) -pub mod get_lobby_logs_output { - /// A builder for [`GetLobbyLogsOutput`](crate::output::GetLobbyLogsOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) lines: std::option::Option>, - pub(crate) timestamps: std::option::Option>, - pub(crate) watch: std::option::Option, - } - impl Builder { - /// Appends an item to `lines`. - /// - /// To override the contents of this collection use [`set_lines`](Self::set_lines). - /// - /// Sorted old to new. - pub fn lines(mut self, input: impl Into) -> Self { - let mut v = self.lines.unwrap_or_default(); - v.push(input.into()); - self.lines = Some(v); - self - } - /// Sorted old to new. - pub fn set_lines( - mut self, - input: std::option::Option>, - ) -> Self { - self.lines = input; - self - } - /// Appends an item to `timestamps`. - /// - /// To override the contents of this collection use [`set_timestamps`](Self::set_timestamps). - /// - /// Sorted old to new. - pub fn timestamps(mut self, input: aws_smithy_types::DateTime) -> Self { - let mut v = self.timestamps.unwrap_or_default(); - v.push(input); - self.timestamps = Some(v); - self - } - /// Sorted old to new. - pub fn set_timestamps( - mut self, - input: std::option::Option>, - ) -> Self { - self.timestamps = input; - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(mut self, input: crate::model::WatchResponse) -> Self { - self.watch = Some(input); - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn set_watch( - mut self, - input: std::option::Option, - ) -> Self { - self.watch = input; - self - } - /// Consumes the builder and constructs a [`GetLobbyLogsOutput`](crate::output::GetLobbyLogsOutput) - pub fn build(self) -> crate::output::GetLobbyLogsOutput { - crate::output::GetLobbyLogsOutput { - lines: self.lines, - timestamps: self.timestamps, - watch: self.watch, - } - } - } -} -impl GetLobbyLogsOutput { - /// Creates a new builder-style object to manufacture [`GetLobbyLogsOutput`](crate::output::GetLobbyLogsOutput) - pub fn builder() -> crate::output::get_lobby_logs_output::Builder { - crate::output::get_lobby_logs_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ExportMatchmakerLobbyHistoryOutput { - /// The URL to a CSV file for the given lobby history. - pub url: std::option::Option, -} -impl ExportMatchmakerLobbyHistoryOutput { - /// The URL to a CSV file for the given lobby history. - pub fn url(&self) -> std::option::Option<&str> { - self.url.as_deref() - } -} -impl std::fmt::Debug for ExportMatchmakerLobbyHistoryOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ExportMatchmakerLobbyHistoryOutput"); - formatter.field("url", &self.url); - formatter.finish() - } -} -/// See [`ExportMatchmakerLobbyHistoryOutput`](crate::output::ExportMatchmakerLobbyHistoryOutput) -pub mod export_matchmaker_lobby_history_output { - /// A builder for [`ExportMatchmakerLobbyHistoryOutput`](crate::output::ExportMatchmakerLobbyHistoryOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) url: std::option::Option, - } - impl Builder { - /// The URL to a CSV file for the given lobby history. - pub fn url(mut self, input: impl Into) -> Self { - self.url = Some(input.into()); - self - } - /// The URL to a CSV file for the given lobby history. - pub fn set_url(mut self, input: std::option::Option) -> Self { - self.url = input; - self - } - /// Consumes the builder and constructs a [`ExportMatchmakerLobbyHistoryOutput`](crate::output::ExportMatchmakerLobbyHistoryOutput) - pub fn build(self) -> crate::output::ExportMatchmakerLobbyHistoryOutput { - crate::output::ExportMatchmakerLobbyHistoryOutput { url: self.url } - } - } -} -impl ExportMatchmakerLobbyHistoryOutput { - /// Creates a new builder-style object to manufacture [`ExportMatchmakerLobbyHistoryOutput`](crate::output::ExportMatchmakerLobbyHistoryOutput) - pub fn builder() -> crate::output::export_matchmaker_lobby_history_output::Builder { - crate::output::export_matchmaker_lobby_history_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct DeleteMatchmakerLobbyOutput { - /// Whether or not the lobby was successfully stopped. - pub did_remove: std::option::Option, -} -impl DeleteMatchmakerLobbyOutput { - /// Whether or not the lobby was successfully stopped. - pub fn did_remove(&self) -> std::option::Option { - self.did_remove - } -} -impl std::fmt::Debug for DeleteMatchmakerLobbyOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("DeleteMatchmakerLobbyOutput"); - formatter.field("did_remove", &self.did_remove); - formatter.finish() - } -} -/// See [`DeleteMatchmakerLobbyOutput`](crate::output::DeleteMatchmakerLobbyOutput) -pub mod delete_matchmaker_lobby_output { - /// A builder for [`DeleteMatchmakerLobbyOutput`](crate::output::DeleteMatchmakerLobbyOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) did_remove: std::option::Option, - } - impl Builder { - /// Whether or not the lobby was successfully stopped. - pub fn did_remove(mut self, input: bool) -> Self { - self.did_remove = Some(input); - self - } - /// Whether or not the lobby was successfully stopped. - pub fn set_did_remove(mut self, input: std::option::Option) -> Self { - self.did_remove = input; - self - } - /// Consumes the builder and constructs a [`DeleteMatchmakerLobbyOutput`](crate::output::DeleteMatchmakerLobbyOutput) - pub fn build(self) -> crate::output::DeleteMatchmakerLobbyOutput { - crate::output::DeleteMatchmakerLobbyOutput { - did_remove: self.did_remove, - } - } - } -} -impl DeleteMatchmakerLobbyOutput { - /// Creates a new builder-style object to manufacture [`DeleteMatchmakerLobbyOutput`](crate::output::DeleteMatchmakerLobbyOutput) - pub fn builder() -> crate::output::delete_matchmaker_lobby_output::Builder { - crate::output::delete_matchmaker_lobby_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CreateGameCdnSiteOutput { - /// A universally unique identifier. - pub site_id: std::option::Option, - /// A universally unique identifier. - pub upload_id: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub presigned_requests: - std::option::Option>, -} -impl CreateGameCdnSiteOutput { - /// A universally unique identifier. - pub fn site_id(&self) -> std::option::Option<&str> { - self.site_id.as_deref() - } - /// A universally unique identifier. - pub fn upload_id(&self) -> std::option::Option<&str> { - self.upload_id.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn presigned_requests( - &self, - ) -> std::option::Option<&[crate::model::UploadPresignedRequest]> { - self.presigned_requests.as_deref() - } -} -impl std::fmt::Debug for CreateGameCdnSiteOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CreateGameCdnSiteOutput"); - formatter.field("site_id", &self.site_id); - formatter.field("upload_id", &self.upload_id); - formatter.field("presigned_requests", &self.presigned_requests); - formatter.finish() - } -} -/// See [`CreateGameCdnSiteOutput`](crate::output::CreateGameCdnSiteOutput) -pub mod create_game_cdn_site_output { - /// A builder for [`CreateGameCdnSiteOutput`](crate::output::CreateGameCdnSiteOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) site_id: std::option::Option, - pub(crate) upload_id: std::option::Option, - pub(crate) presigned_requests: - std::option::Option>, - } - impl Builder { - /// A universally unique identifier. - pub fn site_id(mut self, input: impl Into) -> Self { - self.site_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_site_id(mut self, input: std::option::Option) -> Self { - self.site_id = input; - self - } - /// A universally unique identifier. - pub fn upload_id(mut self, input: impl Into) -> Self { - self.upload_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_upload_id(mut self, input: std::option::Option) -> Self { - self.upload_id = input; - self - } - /// Appends an item to `presigned_requests`. - /// - /// To override the contents of this collection use [`set_presigned_requests`](Self::set_presigned_requests). - /// - pub fn presigned_requests(mut self, input: crate::model::UploadPresignedRequest) -> Self { - let mut v = self.presigned_requests.unwrap_or_default(); - v.push(input); - self.presigned_requests = Some(v); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_presigned_requests( - mut self, - input: std::option::Option>, - ) -> Self { - self.presigned_requests = input; - self - } - /// Consumes the builder and constructs a [`CreateGameCdnSiteOutput`](crate::output::CreateGameCdnSiteOutput) - pub fn build(self) -> crate::output::CreateGameCdnSiteOutput { - crate::output::CreateGameCdnSiteOutput { - site_id: self.site_id, - upload_id: self.upload_id, - presigned_requests: self.presigned_requests, - } - } - } -} -impl CreateGameCdnSiteOutput { - /// Creates a new builder-style object to manufacture [`CreateGameCdnSiteOutput`](crate::output::CreateGameCdnSiteOutput) - pub fn builder() -> crate::output::create_game_cdn_site_output::Builder { - crate::output::create_game_cdn_site_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ListGameCdnSitesOutput { - /// A list of CDN site summaries. - pub sites: std::option::Option>, -} -impl ListGameCdnSitesOutput { - /// A list of CDN site summaries. - pub fn sites(&self) -> std::option::Option<&[crate::model::CdnSiteSummary]> { - self.sites.as_deref() - } -} -impl std::fmt::Debug for ListGameCdnSitesOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ListGameCdnSitesOutput"); - formatter.field("sites", &self.sites); - formatter.finish() - } -} -/// See [`ListGameCdnSitesOutput`](crate::output::ListGameCdnSitesOutput) -pub mod list_game_cdn_sites_output { - /// A builder for [`ListGameCdnSitesOutput`](crate::output::ListGameCdnSitesOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) sites: std::option::Option>, - } - impl Builder { - /// Appends an item to `sites`. - /// - /// To override the contents of this collection use [`set_sites`](Self::set_sites). - /// - /// A list of CDN site summaries. - pub fn sites(mut self, input: crate::model::CdnSiteSummary) -> Self { - let mut v = self.sites.unwrap_or_default(); - v.push(input); - self.sites = Some(v); - self - } - /// A list of CDN site summaries. - pub fn set_sites( - mut self, - input: std::option::Option>, - ) -> Self { - self.sites = input; - self - } - /// Consumes the builder and constructs a [`ListGameCdnSitesOutput`](crate::output::ListGameCdnSitesOutput) - pub fn build(self) -> crate::output::ListGameCdnSitesOutput { - crate::output::ListGameCdnSitesOutput { sites: self.sites } - } - } -} -impl ListGameCdnSitesOutput { - /// Creates a new builder-style object to manufacture [`ListGameCdnSitesOutput`](crate::output::ListGameCdnSitesOutput) - pub fn builder() -> crate::output::list_game_cdn_sites_output::Builder { - crate::output::list_game_cdn_sites_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CreateGameBuildOutput { - /// A universally unique identifier. - pub build_id: std::option::Option, - /// A universally unique identifier. - pub upload_id: std::option::Option, - /// A presigned request used to upload files. Upload your file to the given URL via a PUT request. - pub image_presigned_request: std::option::Option, -} -impl CreateGameBuildOutput { - /// A universally unique identifier. - pub fn build_id(&self) -> std::option::Option<&str> { - self.build_id.as_deref() - } - /// A universally unique identifier. - pub fn upload_id(&self) -> std::option::Option<&str> { - self.upload_id.as_deref() - } - /// A presigned request used to upload files. Upload your file to the given URL via a PUT request. - pub fn image_presigned_request( - &self, - ) -> std::option::Option<&crate::model::UploadPresignedRequest> { - self.image_presigned_request.as_ref() - } -} -impl std::fmt::Debug for CreateGameBuildOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CreateGameBuildOutput"); - formatter.field("build_id", &self.build_id); - formatter.field("upload_id", &self.upload_id); - formatter.field("image_presigned_request", &self.image_presigned_request); - formatter.finish() - } -} -/// See [`CreateGameBuildOutput`](crate::output::CreateGameBuildOutput) -pub mod create_game_build_output { - /// A builder for [`CreateGameBuildOutput`](crate::output::CreateGameBuildOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) build_id: std::option::Option, - pub(crate) upload_id: std::option::Option, - pub(crate) image_presigned_request: - std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn build_id(mut self, input: impl Into) -> Self { - self.build_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_build_id(mut self, input: std::option::Option) -> Self { - self.build_id = input; - self - } - /// A universally unique identifier. - pub fn upload_id(mut self, input: impl Into) -> Self { - self.upload_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_upload_id(mut self, input: std::option::Option) -> Self { - self.upload_id = input; - self - } - /// A presigned request used to upload files. Upload your file to the given URL via a PUT request. - pub fn image_presigned_request( - mut self, - input: crate::model::UploadPresignedRequest, - ) -> Self { - self.image_presigned_request = Some(input); - self - } - /// A presigned request used to upload files. Upload your file to the given URL via a PUT request. - pub fn set_image_presigned_request( - mut self, - input: std::option::Option, - ) -> Self { - self.image_presigned_request = input; - self - } - /// Consumes the builder and constructs a [`CreateGameBuildOutput`](crate::output::CreateGameBuildOutput) - pub fn build(self) -> crate::output::CreateGameBuildOutput { - crate::output::CreateGameBuildOutput { - build_id: self.build_id, - upload_id: self.upload_id, - image_presigned_request: self.image_presigned_request, - } - } - } -} -impl CreateGameBuildOutput { - /// Creates a new builder-style object to manufacture [`CreateGameBuildOutput`](crate::output::CreateGameBuildOutput) - pub fn builder() -> crate::output::create_game_build_output::Builder { - crate::output::create_game_build_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ListGameBuildsOutput { - /// A list of build summaries. - pub builds: std::option::Option>, -} -impl ListGameBuildsOutput { - /// A list of build summaries. - pub fn builds(&self) -> std::option::Option<&[crate::model::BuildSummary]> { - self.builds.as_deref() - } -} -impl std::fmt::Debug for ListGameBuildsOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ListGameBuildsOutput"); - formatter.field("builds", &self.builds); - formatter.finish() - } -} -/// See [`ListGameBuildsOutput`](crate::output::ListGameBuildsOutput) -pub mod list_game_builds_output { - /// A builder for [`ListGameBuildsOutput`](crate::output::ListGameBuildsOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) builds: std::option::Option>, - } - impl Builder { - /// Appends an item to `builds`. - /// - /// To override the contents of this collection use [`set_builds`](Self::set_builds). - /// - /// A list of build summaries. - pub fn builds(mut self, input: crate::model::BuildSummary) -> Self { - let mut v = self.builds.unwrap_or_default(); - v.push(input); - self.builds = Some(v); - self - } - /// A list of build summaries. - pub fn set_builds( - mut self, - input: std::option::Option>, - ) -> Self { - self.builds = input; - self - } - /// Consumes the builder and constructs a [`ListGameBuildsOutput`](crate::output::ListGameBuildsOutput) - pub fn build(self) -> crate::output::ListGameBuildsOutput { - crate::output::ListGameBuildsOutput { - builds: self.builds, - } - } - } -} -impl ListGameBuildsOutput { - /// Creates a new builder-style object to manufacture [`ListGameBuildsOutput`](crate::output::ListGameBuildsOutput) - pub fn builder() -> crate::output::list_game_builds_output::Builder { - crate::output::list_game_builds_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CreateCloudTokenOutput { - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub token: std::option::Option, -} -impl CreateCloudTokenOutput { - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn token(&self) -> std::option::Option<&str> { - self.token.as_deref() - } -} -impl std::fmt::Debug for CreateCloudTokenOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CreateCloudTokenOutput"); - formatter.field("token", &"*** Sensitive Data Redacted ***"); - formatter.finish() - } -} -/// See [`CreateCloudTokenOutput`](crate::output::CreateCloudTokenOutput) -pub mod create_cloud_token_output { - /// A builder for [`CreateCloudTokenOutput`](crate::output::CreateCloudTokenOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) token: std::option::Option, - } - impl Builder { - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn token(mut self, input: impl Into) -> Self { - self.token = Some(input.into()); - self - } - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn set_token(mut self, input: std::option::Option) -> Self { - self.token = input; - self - } - /// Consumes the builder and constructs a [`CreateCloudTokenOutput`](crate::output::CreateCloudTokenOutput) - pub fn build(self) -> crate::output::CreateCloudTokenOutput { - crate::output::CreateCloudTokenOutput { token: self.token } - } - } -} -impl CreateCloudTokenOutput { - /// Creates a new builder-style object to manufacture [`CreateCloudTokenOutput`](crate::output::CreateCloudTokenOutput) - pub fn builder() -> crate::output::create_cloud_token_output::Builder { - crate::output::create_cloud_token_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetNamespaceLobbyOutput { - /// A logs summary for a lobby. - pub lobby: std::option::Option, - /// Metrics relating to a job service. - pub metrics: std::option::Option, - /// A list of URLs. - pub stdout_presigned_urls: std::option::Option>, - /// A list of URLs. - pub stderr_presigned_urls: std::option::Option>, - /// A list of service performance summaries. - pub perf_lists: std::option::Option>, -} -impl GetNamespaceLobbyOutput { - /// A logs summary for a lobby. - pub fn lobby(&self) -> std::option::Option<&crate::model::LogsLobbySummary> { - self.lobby.as_ref() - } - /// Metrics relating to a job service. - pub fn metrics(&self) -> std::option::Option<&crate::model::SvcMetrics> { - self.metrics.as_ref() - } - /// A list of URLs. - pub fn stdout_presigned_urls(&self) -> std::option::Option<&[std::string::String]> { - self.stdout_presigned_urls.as_deref() - } - /// A list of URLs. - pub fn stderr_presigned_urls(&self) -> std::option::Option<&[std::string::String]> { - self.stderr_presigned_urls.as_deref() - } - /// A list of service performance summaries. - pub fn perf_lists(&self) -> std::option::Option<&[crate::model::SvcPerf]> { - self.perf_lists.as_deref() - } -} -impl std::fmt::Debug for GetNamespaceLobbyOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetNamespaceLobbyOutput"); - formatter.field("lobby", &self.lobby); - formatter.field("metrics", &self.metrics); - formatter.field("stdout_presigned_urls", &self.stdout_presigned_urls); - formatter.field("stderr_presigned_urls", &self.stderr_presigned_urls); - formatter.field("perf_lists", &self.perf_lists); - formatter.finish() - } -} -/// See [`GetNamespaceLobbyOutput`](crate::output::GetNamespaceLobbyOutput) -pub mod get_namespace_lobby_output { - /// A builder for [`GetNamespaceLobbyOutput`](crate::output::GetNamespaceLobbyOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) lobby: std::option::Option, - pub(crate) metrics: std::option::Option, - pub(crate) stdout_presigned_urls: std::option::Option>, - pub(crate) stderr_presigned_urls: std::option::Option>, - pub(crate) perf_lists: std::option::Option>, - } - impl Builder { - /// A logs summary for a lobby. - pub fn lobby(mut self, input: crate::model::LogsLobbySummary) -> Self { - self.lobby = Some(input); - self - } - /// A logs summary for a lobby. - pub fn set_lobby( - mut self, - input: std::option::Option, - ) -> Self { - self.lobby = input; - self - } - /// Metrics relating to a job service. - pub fn metrics(mut self, input: crate::model::SvcMetrics) -> Self { - self.metrics = Some(input); - self - } - /// Metrics relating to a job service. - pub fn set_metrics(mut self, input: std::option::Option) -> Self { - self.metrics = input; - self - } - /// Appends an item to `stdout_presigned_urls`. - /// - /// To override the contents of this collection use [`set_stdout_presigned_urls`](Self::set_stdout_presigned_urls). - /// - /// A list of URLs. - pub fn stdout_presigned_urls(mut self, input: impl Into) -> Self { - let mut v = self.stdout_presigned_urls.unwrap_or_default(); - v.push(input.into()); - self.stdout_presigned_urls = Some(v); - self - } - /// A list of URLs. - pub fn set_stdout_presigned_urls( - mut self, - input: std::option::Option>, - ) -> Self { - self.stdout_presigned_urls = input; - self - } - /// Appends an item to `stderr_presigned_urls`. - /// - /// To override the contents of this collection use [`set_stderr_presigned_urls`](Self::set_stderr_presigned_urls). - /// - /// A list of URLs. - pub fn stderr_presigned_urls(mut self, input: impl Into) -> Self { - let mut v = self.stderr_presigned_urls.unwrap_or_default(); - v.push(input.into()); - self.stderr_presigned_urls = Some(v); - self - } - /// A list of URLs. - pub fn set_stderr_presigned_urls( - mut self, - input: std::option::Option>, - ) -> Self { - self.stderr_presigned_urls = input; - self - } - /// Appends an item to `perf_lists`. - /// - /// To override the contents of this collection use [`set_perf_lists`](Self::set_perf_lists). - /// - /// A list of service performance summaries. - pub fn perf_lists(mut self, input: crate::model::SvcPerf) -> Self { - let mut v = self.perf_lists.unwrap_or_default(); - v.push(input); - self.perf_lists = Some(v); - self - } - /// A list of service performance summaries. - pub fn set_perf_lists( - mut self, - input: std::option::Option>, - ) -> Self { - self.perf_lists = input; - self - } - /// Consumes the builder and constructs a [`GetNamespaceLobbyOutput`](crate::output::GetNamespaceLobbyOutput) - pub fn build(self) -> crate::output::GetNamespaceLobbyOutput { - crate::output::GetNamespaceLobbyOutput { - lobby: self.lobby, - metrics: self.metrics, - stdout_presigned_urls: self.stdout_presigned_urls, - stderr_presigned_urls: self.stderr_presigned_urls, - perf_lists: self.perf_lists, - } - } - } -} -impl GetNamespaceLobbyOutput { - /// Creates a new builder-style object to manufacture [`GetNamespaceLobbyOutput`](crate::output::GetNamespaceLobbyOutput) - pub fn builder() -> crate::output::get_namespace_lobby_output::Builder { - crate::output::get_namespace_lobby_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ListNamespaceLobbiesOutput { - /// A list of lobby log summaries. - pub lobbies: std::option::Option>, -} -impl ListNamespaceLobbiesOutput { - /// A list of lobby log summaries. - pub fn lobbies(&self) -> std::option::Option<&[crate::model::LogsLobbySummary]> { - self.lobbies.as_deref() - } -} -impl std::fmt::Debug for ListNamespaceLobbiesOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ListNamespaceLobbiesOutput"); - formatter.field("lobbies", &self.lobbies); - formatter.finish() - } -} -/// See [`ListNamespaceLobbiesOutput`](crate::output::ListNamespaceLobbiesOutput) -pub mod list_namespace_lobbies_output { - /// A builder for [`ListNamespaceLobbiesOutput`](crate::output::ListNamespaceLobbiesOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) lobbies: std::option::Option>, - } - impl Builder { - /// Appends an item to `lobbies`. - /// - /// To override the contents of this collection use [`set_lobbies`](Self::set_lobbies). - /// - /// A list of lobby log summaries. - pub fn lobbies(mut self, input: crate::model::LogsLobbySummary) -> Self { - let mut v = self.lobbies.unwrap_or_default(); - v.push(input); - self.lobbies = Some(v); - self - } - /// A list of lobby log summaries. - pub fn set_lobbies( - mut self, - input: std::option::Option>, - ) -> Self { - self.lobbies = input; - self - } - /// Consumes the builder and constructs a [`ListNamespaceLobbiesOutput`](crate::output::ListNamespaceLobbiesOutput) - pub fn build(self) -> crate::output::ListNamespaceLobbiesOutput { - crate::output::ListNamespaceLobbiesOutput { - lobbies: self.lobbies, - } - } - } -} -impl ListNamespaceLobbiesOutput { - /// Creates a new builder-style object to manufacture [`ListNamespaceLobbiesOutput`](crate::output::ListNamespaceLobbiesOutput) - pub fn builder() -> crate::output::list_namespace_lobbies_output::Builder { - crate::output::list_namespace_lobbies_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetNamespaceAnalyticsMatchmakerLiveOutput { - /// A list of analytics lobby summaries. - pub lobbies: std::option::Option>, -} -impl GetNamespaceAnalyticsMatchmakerLiveOutput { - /// A list of analytics lobby summaries. - pub fn lobbies(&self) -> std::option::Option<&[crate::model::AnalyticsLobbySummary]> { - self.lobbies.as_deref() - } -} -impl std::fmt::Debug for GetNamespaceAnalyticsMatchmakerLiveOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetNamespaceAnalyticsMatchmakerLiveOutput"); - formatter.field("lobbies", &self.lobbies); - formatter.finish() - } -} -/// See [`GetNamespaceAnalyticsMatchmakerLiveOutput`](crate::output::GetNamespaceAnalyticsMatchmakerLiveOutput) -pub mod get_namespace_analytics_matchmaker_live_output { - /// A builder for [`GetNamespaceAnalyticsMatchmakerLiveOutput`](crate::output::GetNamespaceAnalyticsMatchmakerLiveOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) lobbies: std::option::Option>, - } - impl Builder { - /// Appends an item to `lobbies`. - /// - /// To override the contents of this collection use [`set_lobbies`](Self::set_lobbies). - /// - /// A list of analytics lobby summaries. - pub fn lobbies(mut self, input: crate::model::AnalyticsLobbySummary) -> Self { - let mut v = self.lobbies.unwrap_or_default(); - v.push(input); - self.lobbies = Some(v); - self - } - /// A list of analytics lobby summaries. - pub fn set_lobbies( - mut self, - input: std::option::Option>, - ) -> Self { - self.lobbies = input; - self - } - /// Consumes the builder and constructs a [`GetNamespaceAnalyticsMatchmakerLiveOutput`](crate::output::GetNamespaceAnalyticsMatchmakerLiveOutput) - pub fn build(self) -> crate::output::GetNamespaceAnalyticsMatchmakerLiveOutput { - crate::output::GetNamespaceAnalyticsMatchmakerLiveOutput { - lobbies: self.lobbies, - } - } - } -} -impl GetNamespaceAnalyticsMatchmakerLiveOutput { - /// Creates a new builder-style object to manufacture [`GetNamespaceAnalyticsMatchmakerLiveOutput`](crate::output::GetNamespaceAnalyticsMatchmakerLiveOutput) - pub fn builder() -> crate::output::get_namespace_analytics_matchmaker_live_output::Builder { - crate::output::get_namespace_analytics_matchmaker_live_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct SetNamespaceCdnAuthTypeOutput {} -impl std::fmt::Debug for SetNamespaceCdnAuthTypeOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("SetNamespaceCdnAuthTypeOutput"); - formatter.finish() - } -} -/// See [`SetNamespaceCdnAuthTypeOutput`](crate::output::SetNamespaceCdnAuthTypeOutput) -pub mod set_namespace_cdn_auth_type_output { - /// A builder for [`SetNamespaceCdnAuthTypeOutput`](crate::output::SetNamespaceCdnAuthTypeOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`SetNamespaceCdnAuthTypeOutput`](crate::output::SetNamespaceCdnAuthTypeOutput) - pub fn build(self) -> crate::output::SetNamespaceCdnAuthTypeOutput { - crate::output::SetNamespaceCdnAuthTypeOutput {} - } - } -} -impl SetNamespaceCdnAuthTypeOutput { - /// Creates a new builder-style object to manufacture [`SetNamespaceCdnAuthTypeOutput`](crate::output::SetNamespaceCdnAuthTypeOutput) - pub fn builder() -> crate::output::set_namespace_cdn_auth_type_output::Builder { - crate::output::set_namespace_cdn_auth_type_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct RemoveNamespaceCdnAuthUserOutput {} -impl std::fmt::Debug for RemoveNamespaceCdnAuthUserOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("RemoveNamespaceCdnAuthUserOutput"); - formatter.finish() - } -} -/// See [`RemoveNamespaceCdnAuthUserOutput`](crate::output::RemoveNamespaceCdnAuthUserOutput) -pub mod remove_namespace_cdn_auth_user_output { - /// A builder for [`RemoveNamespaceCdnAuthUserOutput`](crate::output::RemoveNamespaceCdnAuthUserOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`RemoveNamespaceCdnAuthUserOutput`](crate::output::RemoveNamespaceCdnAuthUserOutput) - pub fn build(self) -> crate::output::RemoveNamespaceCdnAuthUserOutput { - crate::output::RemoveNamespaceCdnAuthUserOutput {} - } - } -} -impl RemoveNamespaceCdnAuthUserOutput { - /// Creates a new builder-style object to manufacture [`RemoveNamespaceCdnAuthUserOutput`](crate::output::RemoveNamespaceCdnAuthUserOutput) - pub fn builder() -> crate::output::remove_namespace_cdn_auth_user_output::Builder { - crate::output::remove_namespace_cdn_auth_user_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UpdateNamespaceCdnAuthUserOutput {} -impl std::fmt::Debug for UpdateNamespaceCdnAuthUserOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UpdateNamespaceCdnAuthUserOutput"); - formatter.finish() - } -} -/// See [`UpdateNamespaceCdnAuthUserOutput`](crate::output::UpdateNamespaceCdnAuthUserOutput) -pub mod update_namespace_cdn_auth_user_output { - /// A builder for [`UpdateNamespaceCdnAuthUserOutput`](crate::output::UpdateNamespaceCdnAuthUserOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`UpdateNamespaceCdnAuthUserOutput`](crate::output::UpdateNamespaceCdnAuthUserOutput) - pub fn build(self) -> crate::output::UpdateNamespaceCdnAuthUserOutput { - crate::output::UpdateNamespaceCdnAuthUserOutput {} - } - } -} -impl UpdateNamespaceCdnAuthUserOutput { - /// Creates a new builder-style object to manufacture [`UpdateNamespaceCdnAuthUserOutput`](crate::output::UpdateNamespaceCdnAuthUserOutput) - pub fn builder() -> crate::output::update_namespace_cdn_auth_user_output::Builder { - crate::output::update_namespace_cdn_auth_user_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ValidateGameNamespaceMatchmakerConfigOutput { - /// A list of validation errors. - pub errors: std::option::Option>, -} -impl ValidateGameNamespaceMatchmakerConfigOutput { - /// A list of validation errors. - pub fn errors(&self) -> std::option::Option<&[crate::model::ValidationError]> { - self.errors.as_deref() - } -} -impl std::fmt::Debug for ValidateGameNamespaceMatchmakerConfigOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ValidateGameNamespaceMatchmakerConfigOutput"); - formatter.field("errors", &self.errors); - formatter.finish() - } -} -/// See [`ValidateGameNamespaceMatchmakerConfigOutput`](crate::output::ValidateGameNamespaceMatchmakerConfigOutput) -pub mod validate_game_namespace_matchmaker_config_output { - /// A builder for [`ValidateGameNamespaceMatchmakerConfigOutput`](crate::output::ValidateGameNamespaceMatchmakerConfigOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) errors: std::option::Option>, - } - impl Builder { - /// Appends an item to `errors`. - /// - /// To override the contents of this collection use [`set_errors`](Self::set_errors). - /// - /// A list of validation errors. - pub fn errors(mut self, input: crate::model::ValidationError) -> Self { - let mut v = self.errors.unwrap_or_default(); - v.push(input); - self.errors = Some(v); - self - } - /// A list of validation errors. - pub fn set_errors( - mut self, - input: std::option::Option>, - ) -> Self { - self.errors = input; - self - } - /// Consumes the builder and constructs a [`ValidateGameNamespaceMatchmakerConfigOutput`](crate::output::ValidateGameNamespaceMatchmakerConfigOutput) - pub fn build(self) -> crate::output::ValidateGameNamespaceMatchmakerConfigOutput { - crate::output::ValidateGameNamespaceMatchmakerConfigOutput { - errors: self.errors, - } - } - } -} -impl ValidateGameNamespaceMatchmakerConfigOutput { - /// Creates a new builder-style object to manufacture [`ValidateGameNamespaceMatchmakerConfigOutput`](crate::output::ValidateGameNamespaceMatchmakerConfigOutput) - pub fn builder() -> crate::output::validate_game_namespace_matchmaker_config_output::Builder { - crate::output::validate_game_namespace_matchmaker_config_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ValidateGameNamespaceTokenDevelopmentOutput { - /// A list of validation errors. - pub errors: std::option::Option>, -} -impl ValidateGameNamespaceTokenDevelopmentOutput { - /// A list of validation errors. - pub fn errors(&self) -> std::option::Option<&[crate::model::ValidationError]> { - self.errors.as_deref() - } -} -impl std::fmt::Debug for ValidateGameNamespaceTokenDevelopmentOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ValidateGameNamespaceTokenDevelopmentOutput"); - formatter.field("errors", &self.errors); - formatter.finish() - } -} -/// See [`ValidateGameNamespaceTokenDevelopmentOutput`](crate::output::ValidateGameNamespaceTokenDevelopmentOutput) -pub mod validate_game_namespace_token_development_output { - /// A builder for [`ValidateGameNamespaceTokenDevelopmentOutput`](crate::output::ValidateGameNamespaceTokenDevelopmentOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) errors: std::option::Option>, - } - impl Builder { - /// Appends an item to `errors`. - /// - /// To override the contents of this collection use [`set_errors`](Self::set_errors). - /// - /// A list of validation errors. - pub fn errors(mut self, input: crate::model::ValidationError) -> Self { - let mut v = self.errors.unwrap_or_default(); - v.push(input); - self.errors = Some(v); - self - } - /// A list of validation errors. - pub fn set_errors( - mut self, - input: std::option::Option>, - ) -> Self { - self.errors = input; - self - } - /// Consumes the builder and constructs a [`ValidateGameNamespaceTokenDevelopmentOutput`](crate::output::ValidateGameNamespaceTokenDevelopmentOutput) - pub fn build(self) -> crate::output::ValidateGameNamespaceTokenDevelopmentOutput { - crate::output::ValidateGameNamespaceTokenDevelopmentOutput { - errors: self.errors, - } - } - } -} -impl ValidateGameNamespaceTokenDevelopmentOutput { - /// Creates a new builder-style object to manufacture [`ValidateGameNamespaceTokenDevelopmentOutput`](crate::output::ValidateGameNamespaceTokenDevelopmentOutput) - pub fn builder() -> crate::output::validate_game_namespace_token_development_output::Builder { - crate::output::validate_game_namespace_token_development_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ValidateGameNamespaceOutput { - /// A list of validation errors. - pub errors: std::option::Option>, -} -impl ValidateGameNamespaceOutput { - /// A list of validation errors. - pub fn errors(&self) -> std::option::Option<&[crate::model::ValidationError]> { - self.errors.as_deref() - } -} -impl std::fmt::Debug for ValidateGameNamespaceOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ValidateGameNamespaceOutput"); - formatter.field("errors", &self.errors); - formatter.finish() - } -} -/// See [`ValidateGameNamespaceOutput`](crate::output::ValidateGameNamespaceOutput) -pub mod validate_game_namespace_output { - /// A builder for [`ValidateGameNamespaceOutput`](crate::output::ValidateGameNamespaceOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) errors: std::option::Option>, - } - impl Builder { - /// Appends an item to `errors`. - /// - /// To override the contents of this collection use [`set_errors`](Self::set_errors). - /// - /// A list of validation errors. - pub fn errors(mut self, input: crate::model::ValidationError) -> Self { - let mut v = self.errors.unwrap_or_default(); - v.push(input); - self.errors = Some(v); - self - } - /// A list of validation errors. - pub fn set_errors( - mut self, - input: std::option::Option>, - ) -> Self { - self.errors = input; - self - } - /// Consumes the builder and constructs a [`ValidateGameNamespaceOutput`](crate::output::ValidateGameNamespaceOutput) - pub fn build(self) -> crate::output::ValidateGameNamespaceOutput { - crate::output::ValidateGameNamespaceOutput { - errors: self.errors, - } - } - } -} -impl ValidateGameNamespaceOutput { - /// Creates a new builder-style object to manufacture [`ValidateGameNamespaceOutput`](crate::output::ValidateGameNamespaceOutput) - pub fn builder() -> crate::output::validate_game_namespace_output::Builder { - crate::output::validate_game_namespace_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UpdateGameNamespaceMatchmakerConfigOutput {} -impl std::fmt::Debug for UpdateGameNamespaceMatchmakerConfigOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UpdateGameNamespaceMatchmakerConfigOutput"); - formatter.finish() - } -} -/// See [`UpdateGameNamespaceMatchmakerConfigOutput`](crate::output::UpdateGameNamespaceMatchmakerConfigOutput) -pub mod update_game_namespace_matchmaker_config_output { - /// A builder for [`UpdateGameNamespaceMatchmakerConfigOutput`](crate::output::UpdateGameNamespaceMatchmakerConfigOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`UpdateGameNamespaceMatchmakerConfigOutput`](crate::output::UpdateGameNamespaceMatchmakerConfigOutput) - pub fn build(self) -> crate::output::UpdateGameNamespaceMatchmakerConfigOutput { - crate::output::UpdateGameNamespaceMatchmakerConfigOutput {} - } - } -} -impl UpdateGameNamespaceMatchmakerConfigOutput { - /// Creates a new builder-style object to manufacture [`UpdateGameNamespaceMatchmakerConfigOutput`](crate::output::UpdateGameNamespaceMatchmakerConfigOutput) - pub fn builder() -> crate::output::update_game_namespace_matchmaker_config_output::Builder { - crate::output::update_game_namespace_matchmaker_config_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ToggleNamespaceDomainPublicAuthOutput {} -impl std::fmt::Debug for ToggleNamespaceDomainPublicAuthOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ToggleNamespaceDomainPublicAuthOutput"); - formatter.finish() - } -} -/// See [`ToggleNamespaceDomainPublicAuthOutput`](crate::output::ToggleNamespaceDomainPublicAuthOutput) -pub mod toggle_namespace_domain_public_auth_output { - /// A builder for [`ToggleNamespaceDomainPublicAuthOutput`](crate::output::ToggleNamespaceDomainPublicAuthOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`ToggleNamespaceDomainPublicAuthOutput`](crate::output::ToggleNamespaceDomainPublicAuthOutput) - pub fn build(self) -> crate::output::ToggleNamespaceDomainPublicAuthOutput { - crate::output::ToggleNamespaceDomainPublicAuthOutput {} - } - } -} -impl ToggleNamespaceDomainPublicAuthOutput { - /// Creates a new builder-style object to manufacture [`ToggleNamespaceDomainPublicAuthOutput`](crate::output::ToggleNamespaceDomainPublicAuthOutput) - pub fn builder() -> crate::output::toggle_namespace_domain_public_auth_output::Builder { - crate::output::toggle_namespace_domain_public_auth_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct RemoveNamespaceDomainOutput {} -impl std::fmt::Debug for RemoveNamespaceDomainOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("RemoveNamespaceDomainOutput"); - formatter.finish() - } -} -/// See [`RemoveNamespaceDomainOutput`](crate::output::RemoveNamespaceDomainOutput) -pub mod remove_namespace_domain_output { - /// A builder for [`RemoveNamespaceDomainOutput`](crate::output::RemoveNamespaceDomainOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`RemoveNamespaceDomainOutput`](crate::output::RemoveNamespaceDomainOutput) - pub fn build(self) -> crate::output::RemoveNamespaceDomainOutput { - crate::output::RemoveNamespaceDomainOutput {} - } - } -} -impl RemoveNamespaceDomainOutput { - /// Creates a new builder-style object to manufacture [`RemoveNamespaceDomainOutput`](crate::output::RemoveNamespaceDomainOutput) - pub fn builder() -> crate::output::remove_namespace_domain_output::Builder { - crate::output::remove_namespace_domain_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct AddNamespaceDomainOutput {} -impl std::fmt::Debug for AddNamespaceDomainOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("AddNamespaceDomainOutput"); - formatter.finish() - } -} -/// See [`AddNamespaceDomainOutput`](crate::output::AddNamespaceDomainOutput) -pub mod add_namespace_domain_output { - /// A builder for [`AddNamespaceDomainOutput`](crate::output::AddNamespaceDomainOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`AddNamespaceDomainOutput`](crate::output::AddNamespaceDomainOutput) - pub fn build(self) -> crate::output::AddNamespaceDomainOutput { - crate::output::AddNamespaceDomainOutput {} - } - } -} -impl AddNamespaceDomainOutput { - /// Creates a new builder-style object to manufacture [`AddNamespaceDomainOutput`](crate::output::AddNamespaceDomainOutput) - pub fn builder() -> crate::output::add_namespace_domain_output::Builder { - crate::output::add_namespace_domain_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CreateGameNamespaceTokenDevelopmentOutput { - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub token: std::option::Option, -} -impl CreateGameNamespaceTokenDevelopmentOutput { - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn token(&self) -> std::option::Option<&str> { - self.token.as_deref() - } -} -impl std::fmt::Debug for CreateGameNamespaceTokenDevelopmentOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CreateGameNamespaceTokenDevelopmentOutput"); - formatter.field("token", &"*** Sensitive Data Redacted ***"); - formatter.finish() - } -} -/// See [`CreateGameNamespaceTokenDevelopmentOutput`](crate::output::CreateGameNamespaceTokenDevelopmentOutput) -pub mod create_game_namespace_token_development_output { - /// A builder for [`CreateGameNamespaceTokenDevelopmentOutput`](crate::output::CreateGameNamespaceTokenDevelopmentOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) token: std::option::Option, - } - impl Builder { - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn token(mut self, input: impl Into) -> Self { - self.token = Some(input.into()); - self - } - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn set_token(mut self, input: std::option::Option) -> Self { - self.token = input; - self - } - /// Consumes the builder and constructs a [`CreateGameNamespaceTokenDevelopmentOutput`](crate::output::CreateGameNamespaceTokenDevelopmentOutput) - pub fn build(self) -> crate::output::CreateGameNamespaceTokenDevelopmentOutput { - crate::output::CreateGameNamespaceTokenDevelopmentOutput { token: self.token } - } - } -} -impl CreateGameNamespaceTokenDevelopmentOutput { - /// Creates a new builder-style object to manufacture [`CreateGameNamespaceTokenDevelopmentOutput`](crate::output::CreateGameNamespaceTokenDevelopmentOutput) - pub fn builder() -> crate::output::create_game_namespace_token_development_output::Builder { - crate::output::create_game_namespace_token_development_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CreateGameNamespaceTokenPublicOutput { - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub token: std::option::Option, -} -impl CreateGameNamespaceTokenPublicOutput { - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn token(&self) -> std::option::Option<&str> { - self.token.as_deref() - } -} -impl std::fmt::Debug for CreateGameNamespaceTokenPublicOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CreateGameNamespaceTokenPublicOutput"); - formatter.field("token", &"*** Sensitive Data Redacted ***"); - formatter.finish() - } -} -/// See [`CreateGameNamespaceTokenPublicOutput`](crate::output::CreateGameNamespaceTokenPublicOutput) -pub mod create_game_namespace_token_public_output { - /// A builder for [`CreateGameNamespaceTokenPublicOutput`](crate::output::CreateGameNamespaceTokenPublicOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) token: std::option::Option, - } - impl Builder { - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn token(mut self, input: impl Into) -> Self { - self.token = Some(input.into()); - self - } - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn set_token(mut self, input: std::option::Option) -> Self { - self.token = input; - self - } - /// Consumes the builder and constructs a [`CreateGameNamespaceTokenPublicOutput`](crate::output::CreateGameNamespaceTokenPublicOutput) - pub fn build(self) -> crate::output::CreateGameNamespaceTokenPublicOutput { - crate::output::CreateGameNamespaceTokenPublicOutput { token: self.token } - } - } -} -impl CreateGameNamespaceTokenPublicOutput { - /// Creates a new builder-style object to manufacture [`CreateGameNamespaceTokenPublicOutput`](crate::output::CreateGameNamespaceTokenPublicOutput) - pub fn builder() -> crate::output::create_game_namespace_token_public_output::Builder { - crate::output::create_game_namespace_token_public_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UpdateGameNamespaceVersionOutput {} -impl std::fmt::Debug for UpdateGameNamespaceVersionOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UpdateGameNamespaceVersionOutput"); - formatter.finish() - } -} -/// See [`UpdateGameNamespaceVersionOutput`](crate::output::UpdateGameNamespaceVersionOutput) -pub mod update_game_namespace_version_output { - /// A builder for [`UpdateGameNamespaceVersionOutput`](crate::output::UpdateGameNamespaceVersionOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`UpdateGameNamespaceVersionOutput`](crate::output::UpdateGameNamespaceVersionOutput) - pub fn build(self) -> crate::output::UpdateGameNamespaceVersionOutput { - crate::output::UpdateGameNamespaceVersionOutput {} - } - } -} -impl UpdateGameNamespaceVersionOutput { - /// Creates a new builder-style object to manufacture [`UpdateGameNamespaceVersionOutput`](crate::output::UpdateGameNamespaceVersionOutput) - pub fn builder() -> crate::output::update_game_namespace_version_output::Builder { - crate::output::update_game_namespace_version_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetGameNamespaceByIdOutput { - /// A full namespace. - pub namespace: std::option::Option, -} -impl GetGameNamespaceByIdOutput { - /// A full namespace. - pub fn namespace(&self) -> std::option::Option<&crate::model::NamespaceFull> { - self.namespace.as_ref() - } -} -impl std::fmt::Debug for GetGameNamespaceByIdOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetGameNamespaceByIdOutput"); - formatter.field("namespace", &self.namespace); - formatter.finish() - } -} -/// See [`GetGameNamespaceByIdOutput`](crate::output::GetGameNamespaceByIdOutput) -pub mod get_game_namespace_by_id_output { - /// A builder for [`GetGameNamespaceByIdOutput`](crate::output::GetGameNamespaceByIdOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) namespace: std::option::Option, - } - impl Builder { - /// A full namespace. - pub fn namespace(mut self, input: crate::model::NamespaceFull) -> Self { - self.namespace = Some(input); - self - } - /// A full namespace. - pub fn set_namespace( - mut self, - input: std::option::Option, - ) -> Self { - self.namespace = input; - self - } - /// Consumes the builder and constructs a [`GetGameNamespaceByIdOutput`](crate::output::GetGameNamespaceByIdOutput) - pub fn build(self) -> crate::output::GetGameNamespaceByIdOutput { - crate::output::GetGameNamespaceByIdOutput { - namespace: self.namespace, - } - } - } -} -impl GetGameNamespaceByIdOutput { - /// Creates a new builder-style object to manufacture [`GetGameNamespaceByIdOutput`](crate::output::GetGameNamespaceByIdOutput) - pub fn builder() -> crate::output::get_game_namespace_by_id_output::Builder { - crate::output::get_game_namespace_by_id_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CreateGameNamespaceOutput { - /// A universally unique identifier. - pub namespace_id: std::option::Option, -} -impl CreateGameNamespaceOutput { - /// A universally unique identifier. - pub fn namespace_id(&self) -> std::option::Option<&str> { - self.namespace_id.as_deref() - } -} -impl std::fmt::Debug for CreateGameNamespaceOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CreateGameNamespaceOutput"); - formatter.field("namespace_id", &self.namespace_id); - formatter.finish() - } -} -/// See [`CreateGameNamespaceOutput`](crate::output::CreateGameNamespaceOutput) -pub mod create_game_namespace_output { - /// A builder for [`CreateGameNamespaceOutput`](crate::output::CreateGameNamespaceOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) namespace_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.namespace_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.namespace_id = input; - self - } - /// Consumes the builder and constructs a [`CreateGameNamespaceOutput`](crate::output::CreateGameNamespaceOutput) - pub fn build(self) -> crate::output::CreateGameNamespaceOutput { - crate::output::CreateGameNamespaceOutput { - namespace_id: self.namespace_id, - } - } - } -} -impl CreateGameNamespaceOutput { - /// Creates a new builder-style object to manufacture [`CreateGameNamespaceOutput`](crate::output::CreateGameNamespaceOutput) - pub fn builder() -> crate::output::create_game_namespace_output::Builder { - crate::output::create_game_namespace_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ValidateGameVersionOutput { - /// A list of validation errors. - pub errors: std::option::Option>, -} -impl ValidateGameVersionOutput { - /// A list of validation errors. - pub fn errors(&self) -> std::option::Option<&[crate::model::ValidationError]> { - self.errors.as_deref() - } -} -impl std::fmt::Debug for ValidateGameVersionOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ValidateGameVersionOutput"); - formatter.field("errors", &self.errors); - formatter.finish() - } -} -/// See [`ValidateGameVersionOutput`](crate::output::ValidateGameVersionOutput) -pub mod validate_game_version_output { - /// A builder for [`ValidateGameVersionOutput`](crate::output::ValidateGameVersionOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) errors: std::option::Option>, - } - impl Builder { - /// Appends an item to `errors`. - /// - /// To override the contents of this collection use [`set_errors`](Self::set_errors). - /// - /// A list of validation errors. - pub fn errors(mut self, input: crate::model::ValidationError) -> Self { - let mut v = self.errors.unwrap_or_default(); - v.push(input); - self.errors = Some(v); - self - } - /// A list of validation errors. - pub fn set_errors( - mut self, - input: std::option::Option>, - ) -> Self { - self.errors = input; - self - } - /// Consumes the builder and constructs a [`ValidateGameVersionOutput`](crate::output::ValidateGameVersionOutput) - pub fn build(self) -> crate::output::ValidateGameVersionOutput { - crate::output::ValidateGameVersionOutput { - errors: self.errors, - } - } - } -} -impl ValidateGameVersionOutput { - /// Creates a new builder-style object to manufacture [`ValidateGameVersionOutput`](crate::output::ValidateGameVersionOutput) - pub fn builder() -> crate::output::validate_game_version_output::Builder { - crate::output::validate_game_version_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetGameVersionByIdOutput { - /// A full version. - pub version: std::option::Option, -} -impl GetGameVersionByIdOutput { - /// A full version. - pub fn version(&self) -> std::option::Option<&crate::model::VersionFull> { - self.version.as_ref() - } -} -impl std::fmt::Debug for GetGameVersionByIdOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetGameVersionByIdOutput"); - formatter.field("version", &self.version); - formatter.finish() - } -} -/// See [`GetGameVersionByIdOutput`](crate::output::GetGameVersionByIdOutput) -pub mod get_game_version_by_id_output { - /// A builder for [`GetGameVersionByIdOutput`](crate::output::GetGameVersionByIdOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) version: std::option::Option, - } - impl Builder { - /// A full version. - pub fn version(mut self, input: crate::model::VersionFull) -> Self { - self.version = Some(input); - self - } - /// A full version. - pub fn set_version( - mut self, - input: std::option::Option, - ) -> Self { - self.version = input; - self - } - /// Consumes the builder and constructs a [`GetGameVersionByIdOutput`](crate::output::GetGameVersionByIdOutput) - pub fn build(self) -> crate::output::GetGameVersionByIdOutput { - crate::output::GetGameVersionByIdOutput { - version: self.version, - } - } - } -} -impl GetGameVersionByIdOutput { - /// Creates a new builder-style object to manufacture [`GetGameVersionByIdOutput`](crate::output::GetGameVersionByIdOutput) - pub fn builder() -> crate::output::get_game_version_by_id_output::Builder { - crate::output::get_game_version_by_id_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CreateGameVersionOutput { - /// A universally unique identifier. - pub version_id: std::option::Option, -} -impl CreateGameVersionOutput { - /// A universally unique identifier. - pub fn version_id(&self) -> std::option::Option<&str> { - self.version_id.as_deref() - } -} -impl std::fmt::Debug for CreateGameVersionOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CreateGameVersionOutput"); - formatter.field("version_id", &self.version_id); - formatter.finish() - } -} -/// See [`CreateGameVersionOutput`](crate::output::CreateGameVersionOutput) -pub mod create_game_version_output { - /// A builder for [`CreateGameVersionOutput`](crate::output::CreateGameVersionOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) version_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn version_id(mut self, input: impl Into) -> Self { - self.version_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_version_id(mut self, input: std::option::Option) -> Self { - self.version_id = input; - self - } - /// Consumes the builder and constructs a [`CreateGameVersionOutput`](crate::output::CreateGameVersionOutput) - pub fn build(self) -> crate::output::CreateGameVersionOutput { - crate::output::CreateGameVersionOutput { - version_id: self.version_id, - } - } - } -} -impl CreateGameVersionOutput { - /// Creates a new builder-style object to manufacture [`CreateGameVersionOutput`](crate::output::CreateGameVersionOutput) - pub fn builder() -> crate::output::create_game_version_output::Builder { - crate::output::create_game_version_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetGameBillingPlansOutput { - /// A list of billing plans. - pub plans: std::option::Option>, -} -impl GetGameBillingPlansOutput { - /// A list of billing plans. - pub fn plans(&self) -> std::option::Option<&[crate::model::GameBillingPlan]> { - self.plans.as_deref() - } -} -impl std::fmt::Debug for GetGameBillingPlansOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetGameBillingPlansOutput"); - formatter.field("plans", &self.plans); - formatter.finish() - } -} -/// See [`GetGameBillingPlansOutput`](crate::output::GetGameBillingPlansOutput) -pub mod get_game_billing_plans_output { - /// A builder for [`GetGameBillingPlansOutput`](crate::output::GetGameBillingPlansOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) plans: std::option::Option>, - } - impl Builder { - /// Appends an item to `plans`. - /// - /// To override the contents of this collection use [`set_plans`](Self::set_plans). - /// - /// A list of billing plans. - pub fn plans(mut self, input: crate::model::GameBillingPlan) -> Self { - let mut v = self.plans.unwrap_or_default(); - v.push(input); - self.plans = Some(v); - self - } - /// A list of billing plans. - pub fn set_plans( - mut self, - input: std::option::Option>, - ) -> Self { - self.plans = input; - self - } - /// Consumes the builder and constructs a [`GetGameBillingPlansOutput`](crate::output::GetGameBillingPlansOutput) - pub fn build(self) -> crate::output::GetGameBillingPlansOutput { - crate::output::GetGameBillingPlansOutput { plans: self.plans } - } - } -} -impl GetGameBillingPlansOutput { - /// Creates a new builder-style object to manufacture [`GetGameBillingPlansOutput`](crate::output::GetGameBillingPlansOutput) - pub fn builder() -> crate::output::get_game_billing_plans_output::Builder { - crate::output::get_game_billing_plans_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct SetGameBillingPlanOutput {} -impl std::fmt::Debug for SetGameBillingPlanOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("SetGameBillingPlanOutput"); - formatter.finish() - } -} -/// See [`SetGameBillingPlanOutput`](crate::output::SetGameBillingPlanOutput) -pub mod set_game_billing_plan_output { - /// A builder for [`SetGameBillingPlanOutput`](crate::output::SetGameBillingPlanOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`SetGameBillingPlanOutput`](crate::output::SetGameBillingPlanOutput) - pub fn build(self) -> crate::output::SetGameBillingPlanOutput { - crate::output::SetGameBillingPlanOutput {} - } - } -} -impl SetGameBillingPlanOutput { - /// Creates a new builder-style object to manufacture [`SetGameBillingPlanOutput`](crate::output::SetGameBillingPlanOutput) - pub fn builder() -> crate::output::set_game_billing_plan_output::Builder { - crate::output::set_game_billing_plan_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetGameBillingOutput { - /// A game handle. - pub game: std::option::Option, - /// A list of namespace summaries. - pub namespaces: std::option::Option>, - /// A list of multiple region tier metrics. - pub metrics: std::option::Option>, - /// The status of a developer group. - pub group_status: std::option::Option, - /// Whether or not the given game can actively host games. - pub group_active: std::option::Option, - /// A value denoting a game's billing plan. - pub plan: std::option::Option, - /// A list of region summaries. - pub available_regions: std::option::Option>, -} -impl GetGameBillingOutput { - /// A game handle. - pub fn game(&self) -> std::option::Option<&crate::model::GameHandle> { - self.game.as_ref() - } - /// A list of namespace summaries. - pub fn namespaces(&self) -> std::option::Option<&[crate::model::NamespaceSummary]> { - self.namespaces.as_deref() - } - /// A list of multiple region tier metrics. - pub fn metrics(&self) -> std::option::Option<&[crate::model::RegionTierMetrics]> { - self.metrics.as_deref() - } - /// The status of a developer group. - pub fn group_status(&self) -> std::option::Option<&crate::model::GroupStatus> { - self.group_status.as_ref() - } - /// Whether or not the given game can actively host games. - pub fn group_active(&self) -> std::option::Option { - self.group_active - } - /// A value denoting a game's billing plan. - pub fn plan(&self) -> std::option::Option<&crate::model::GameBillingPlanCode> { - self.plan.as_ref() - } - /// A list of region summaries. - pub fn available_regions(&self) -> std::option::Option<&[crate::model::RegionSummary]> { - self.available_regions.as_deref() - } -} -impl std::fmt::Debug for GetGameBillingOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetGameBillingOutput"); - formatter.field("game", &self.game); - formatter.field("namespaces", &self.namespaces); - formatter.field("metrics", &self.metrics); - formatter.field("group_status", &self.group_status); - formatter.field("group_active", &self.group_active); - formatter.field("plan", &self.plan); - formatter.field("available_regions", &self.available_regions); - formatter.finish() - } -} -/// See [`GetGameBillingOutput`](crate::output::GetGameBillingOutput) -pub mod get_game_billing_output { - /// A builder for [`GetGameBillingOutput`](crate::output::GetGameBillingOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game: std::option::Option, - pub(crate) namespaces: std::option::Option>, - pub(crate) metrics: std::option::Option>, - pub(crate) group_status: std::option::Option, - pub(crate) group_active: std::option::Option, - pub(crate) plan: std::option::Option, - pub(crate) available_regions: - std::option::Option>, - } - impl Builder { - /// A game handle. - pub fn game(mut self, input: crate::model::GameHandle) -> Self { - self.game = Some(input); - self - } - /// A game handle. - pub fn set_game(mut self, input: std::option::Option) -> Self { - self.game = input; - self - } - /// Appends an item to `namespaces`. - /// - /// To override the contents of this collection use [`set_namespaces`](Self::set_namespaces). - /// - /// A list of namespace summaries. - pub fn namespaces(mut self, input: crate::model::NamespaceSummary) -> Self { - let mut v = self.namespaces.unwrap_or_default(); - v.push(input); - self.namespaces = Some(v); - self - } - /// A list of namespace summaries. - pub fn set_namespaces( - mut self, - input: std::option::Option>, - ) -> Self { - self.namespaces = input; - self - } - /// Appends an item to `metrics`. - /// - /// To override the contents of this collection use [`set_metrics`](Self::set_metrics). - /// - /// A list of multiple region tier metrics. - pub fn metrics(mut self, input: crate::model::RegionTierMetrics) -> Self { - let mut v = self.metrics.unwrap_or_default(); - v.push(input); - self.metrics = Some(v); - self - } - /// A list of multiple region tier metrics. - pub fn set_metrics( - mut self, - input: std::option::Option>, - ) -> Self { - self.metrics = input; - self - } - /// The status of a developer group. - pub fn group_status(mut self, input: crate::model::GroupStatus) -> Self { - self.group_status = Some(input); - self - } - /// The status of a developer group. - pub fn set_group_status( - mut self, - input: std::option::Option, - ) -> Self { - self.group_status = input; - self - } - /// Whether or not the given game can actively host games. - pub fn group_active(mut self, input: bool) -> Self { - self.group_active = Some(input); - self - } - /// Whether or not the given game can actively host games. - pub fn set_group_active(mut self, input: std::option::Option) -> Self { - self.group_active = input; - self - } - /// A value denoting a game's billing plan. - pub fn plan(mut self, input: crate::model::GameBillingPlanCode) -> Self { - self.plan = Some(input); - self - } - /// A value denoting a game's billing plan. - pub fn set_plan( - mut self, - input: std::option::Option, - ) -> Self { - self.plan = input; - self - } - /// Appends an item to `available_regions`. - /// - /// To override the contents of this collection use [`set_available_regions`](Self::set_available_regions). - /// - /// A list of region summaries. - pub fn available_regions(mut self, input: crate::model::RegionSummary) -> Self { - let mut v = self.available_regions.unwrap_or_default(); - v.push(input); - self.available_regions = Some(v); - self - } - /// A list of region summaries. - pub fn set_available_regions( - mut self, - input: std::option::Option>, - ) -> Self { - self.available_regions = input; - self - } - /// Consumes the builder and constructs a [`GetGameBillingOutput`](crate::output::GetGameBillingOutput) - pub fn build(self) -> crate::output::GetGameBillingOutput { - crate::output::GetGameBillingOutput { - game: self.game, - namespaces: self.namespaces, - metrics: self.metrics, - group_status: self.group_status, - group_active: self.group_active, - plan: self.plan, - available_regions: self.available_regions, - } - } - } -} -impl GetGameBillingOutput { - /// Creates a new builder-style object to manufacture [`GetGameBillingOutput`](crate::output::GetGameBillingOutput) - pub fn builder() -> crate::output::get_game_billing_output::Builder { - crate::output::get_game_billing_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GameBannerUploadCompleteOutput {} -impl std::fmt::Debug for GameBannerUploadCompleteOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GameBannerUploadCompleteOutput"); - formatter.finish() - } -} -/// See [`GameBannerUploadCompleteOutput`](crate::output::GameBannerUploadCompleteOutput) -pub mod game_banner_upload_complete_output { - /// A builder for [`GameBannerUploadCompleteOutput`](crate::output::GameBannerUploadCompleteOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`GameBannerUploadCompleteOutput`](crate::output::GameBannerUploadCompleteOutput) - pub fn build(self) -> crate::output::GameBannerUploadCompleteOutput { - crate::output::GameBannerUploadCompleteOutput {} - } - } -} -impl GameBannerUploadCompleteOutput { - /// Creates a new builder-style object to manufacture [`GameBannerUploadCompleteOutput`](crate::output::GameBannerUploadCompleteOutput) - pub fn builder() -> crate::output::game_banner_upload_complete_output::Builder { - crate::output::game_banner_upload_complete_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GameBannerUploadPrepareOutput { - /// A universally unique identifier. - pub upload_id: std::option::Option, - /// A presigned request used to upload files. Upload your file to the given URL via a PUT request. - pub presigned_request: std::option::Option, -} -impl GameBannerUploadPrepareOutput { - /// A universally unique identifier. - pub fn upload_id(&self) -> std::option::Option<&str> { - self.upload_id.as_deref() - } - /// A presigned request used to upload files. Upload your file to the given URL via a PUT request. - pub fn presigned_request(&self) -> std::option::Option<&crate::model::UploadPresignedRequest> { - self.presigned_request.as_ref() - } -} -impl std::fmt::Debug for GameBannerUploadPrepareOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GameBannerUploadPrepareOutput"); - formatter.field("upload_id", &self.upload_id); - formatter.field("presigned_request", &self.presigned_request); - formatter.finish() - } -} -/// See [`GameBannerUploadPrepareOutput`](crate::output::GameBannerUploadPrepareOutput) -pub mod game_banner_upload_prepare_output { - /// A builder for [`GameBannerUploadPrepareOutput`](crate::output::GameBannerUploadPrepareOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) upload_id: std::option::Option, - pub(crate) presigned_request: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn upload_id(mut self, input: impl Into) -> Self { - self.upload_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_upload_id(mut self, input: std::option::Option) -> Self { - self.upload_id = input; - self - } - /// A presigned request used to upload files. Upload your file to the given URL via a PUT request. - pub fn presigned_request(mut self, input: crate::model::UploadPresignedRequest) -> Self { - self.presigned_request = Some(input); - self - } - /// A presigned request used to upload files. Upload your file to the given URL via a PUT request. - pub fn set_presigned_request( - mut self, - input: std::option::Option, - ) -> Self { - self.presigned_request = input; - self - } - /// Consumes the builder and constructs a [`GameBannerUploadPrepareOutput`](crate::output::GameBannerUploadPrepareOutput) - pub fn build(self) -> crate::output::GameBannerUploadPrepareOutput { - crate::output::GameBannerUploadPrepareOutput { - upload_id: self.upload_id, - presigned_request: self.presigned_request, - } - } - } -} -impl GameBannerUploadPrepareOutput { - /// Creates a new builder-style object to manufacture [`GameBannerUploadPrepareOutput`](crate::output::GameBannerUploadPrepareOutput) - pub fn builder() -> crate::output::game_banner_upload_prepare_output::Builder { - crate::output::game_banner_upload_prepare_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GameLogoUploadCompleteOutput {} -impl std::fmt::Debug for GameLogoUploadCompleteOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GameLogoUploadCompleteOutput"); - formatter.finish() - } -} -/// See [`GameLogoUploadCompleteOutput`](crate::output::GameLogoUploadCompleteOutput) -pub mod game_logo_upload_complete_output { - /// A builder for [`GameLogoUploadCompleteOutput`](crate::output::GameLogoUploadCompleteOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`GameLogoUploadCompleteOutput`](crate::output::GameLogoUploadCompleteOutput) - pub fn build(self) -> crate::output::GameLogoUploadCompleteOutput { - crate::output::GameLogoUploadCompleteOutput {} - } - } -} -impl GameLogoUploadCompleteOutput { - /// Creates a new builder-style object to manufacture [`GameLogoUploadCompleteOutput`](crate::output::GameLogoUploadCompleteOutput) - pub fn builder() -> crate::output::game_logo_upload_complete_output::Builder { - crate::output::game_logo_upload_complete_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GameLogoUploadPrepareOutput { - /// A universally unique identifier. - pub upload_id: std::option::Option, - /// A presigned request used to upload files. Upload your file to the given URL via a PUT request. - pub presigned_request: std::option::Option, -} -impl GameLogoUploadPrepareOutput { - /// A universally unique identifier. - pub fn upload_id(&self) -> std::option::Option<&str> { - self.upload_id.as_deref() - } - /// A presigned request used to upload files. Upload your file to the given URL via a PUT request. - pub fn presigned_request(&self) -> std::option::Option<&crate::model::UploadPresignedRequest> { - self.presigned_request.as_ref() - } -} -impl std::fmt::Debug for GameLogoUploadPrepareOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GameLogoUploadPrepareOutput"); - formatter.field("upload_id", &self.upload_id); - formatter.field("presigned_request", &self.presigned_request); - formatter.finish() - } -} -/// See [`GameLogoUploadPrepareOutput`](crate::output::GameLogoUploadPrepareOutput) -pub mod game_logo_upload_prepare_output { - /// A builder for [`GameLogoUploadPrepareOutput`](crate::output::GameLogoUploadPrepareOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) upload_id: std::option::Option, - pub(crate) presigned_request: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn upload_id(mut self, input: impl Into) -> Self { - self.upload_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_upload_id(mut self, input: std::option::Option) -> Self { - self.upload_id = input; - self - } - /// A presigned request used to upload files. Upload your file to the given URL via a PUT request. - pub fn presigned_request(mut self, input: crate::model::UploadPresignedRequest) -> Self { - self.presigned_request = Some(input); - self - } - /// A presigned request used to upload files. Upload your file to the given URL via a PUT request. - pub fn set_presigned_request( - mut self, - input: std::option::Option, - ) -> Self { - self.presigned_request = input; - self - } - /// Consumes the builder and constructs a [`GameLogoUploadPrepareOutput`](crate::output::GameLogoUploadPrepareOutput) - pub fn build(self) -> crate::output::GameLogoUploadPrepareOutput { - crate::output::GameLogoUploadPrepareOutput { - upload_id: self.upload_id, - presigned_request: self.presigned_request, - } - } - } -} -impl GameLogoUploadPrepareOutput { - /// Creates a new builder-style object to manufacture [`GameLogoUploadPrepareOutput`](crate::output::GameLogoUploadPrepareOutput) - pub fn builder() -> crate::output::game_logo_upload_prepare_output::Builder { - crate::output::game_logo_upload_prepare_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ValidateGameOutput { - /// A list of validation errors. - pub errors: std::option::Option>, -} -impl ValidateGameOutput { - /// A list of validation errors. - pub fn errors(&self) -> std::option::Option<&[crate::model::ValidationError]> { - self.errors.as_deref() - } -} -impl std::fmt::Debug for ValidateGameOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ValidateGameOutput"); - formatter.field("errors", &self.errors); - formatter.finish() - } -} -/// See [`ValidateGameOutput`](crate::output::ValidateGameOutput) -pub mod validate_game_output { - /// A builder for [`ValidateGameOutput`](crate::output::ValidateGameOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) errors: std::option::Option>, - } - impl Builder { - /// Appends an item to `errors`. - /// - /// To override the contents of this collection use [`set_errors`](Self::set_errors). - /// - /// A list of validation errors. - pub fn errors(mut self, input: crate::model::ValidationError) -> Self { - let mut v = self.errors.unwrap_or_default(); - v.push(input); - self.errors = Some(v); - self - } - /// A list of validation errors. - pub fn set_errors( - mut self, - input: std::option::Option>, - ) -> Self { - self.errors = input; - self - } - /// Consumes the builder and constructs a [`ValidateGameOutput`](crate::output::ValidateGameOutput) - pub fn build(self) -> crate::output::ValidateGameOutput { - crate::output::ValidateGameOutput { - errors: self.errors, - } - } - } -} -impl ValidateGameOutput { - /// Creates a new builder-style object to manufacture [`ValidateGameOutput`](crate::output::ValidateGameOutput) - pub fn builder() -> crate::output::validate_game_output::Builder { - crate::output::validate_game_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetGameByIdOutput { - /// A full game. - pub game: std::option::Option, - /// Provided by watchable endpoints used in blocking loops. - pub watch: std::option::Option, -} -impl GetGameByIdOutput { - /// A full game. - pub fn game(&self) -> std::option::Option<&crate::model::GameFull> { - self.game.as_ref() - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(&self) -> std::option::Option<&crate::model::WatchResponse> { - self.watch.as_ref() - } -} -impl std::fmt::Debug for GetGameByIdOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetGameByIdOutput"); - formatter.field("game", &self.game); - formatter.field("watch", &self.watch); - formatter.finish() - } -} -/// See [`GetGameByIdOutput`](crate::output::GetGameByIdOutput) -pub mod get_game_by_id_output { - /// A builder for [`GetGameByIdOutput`](crate::output::GetGameByIdOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game: std::option::Option, - pub(crate) watch: std::option::Option, - } - impl Builder { - /// A full game. - pub fn game(mut self, input: crate::model::GameFull) -> Self { - self.game = Some(input); - self - } - /// A full game. - pub fn set_game(mut self, input: std::option::Option) -> Self { - self.game = input; - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(mut self, input: crate::model::WatchResponse) -> Self { - self.watch = Some(input); - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn set_watch( - mut self, - input: std::option::Option, - ) -> Self { - self.watch = input; - self - } - /// Consumes the builder and constructs a [`GetGameByIdOutput`](crate::output::GetGameByIdOutput) - pub fn build(self) -> crate::output::GetGameByIdOutput { - crate::output::GetGameByIdOutput { - game: self.game, - watch: self.watch, - } - } - } -} -impl GetGameByIdOutput { - /// Creates a new builder-style object to manufacture [`GetGameByIdOutput`](crate::output::GetGameByIdOutput) - pub fn builder() -> crate::output::get_game_by_id_output::Builder { - crate::output::get_game_by_id_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CreateGameOutput { - /// A universally unique identifier. - pub game_id: std::option::Option, -} -impl CreateGameOutput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } -} -impl std::fmt::Debug for CreateGameOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CreateGameOutput"); - formatter.field("game_id", &self.game_id); - formatter.finish() - } -} -/// See [`CreateGameOutput`](crate::output::CreateGameOutput) -pub mod create_game_output { - /// A builder for [`CreateGameOutput`](crate::output::CreateGameOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// Consumes the builder and constructs a [`CreateGameOutput`](crate::output::CreateGameOutput) - pub fn build(self) -> crate::output::CreateGameOutput { - crate::output::CreateGameOutput { - game_id: self.game_id, - } - } - } -} -impl CreateGameOutput { - /// Creates a new builder-style object to manufacture [`CreateGameOutput`](crate::output::CreateGameOutput) - pub fn builder() -> crate::output::create_game_output::Builder { - crate::output::create_game_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetGamesOutput { - /// A list of game summaries. - pub games: std::option::Option>, - /// A list of group summaries. - pub groups: std::option::Option>, - /// Provided by watchable endpoints used in blocking loops. - pub watch: std::option::Option, -} -impl GetGamesOutput { - /// A list of game summaries. - pub fn games(&self) -> std::option::Option<&[crate::model::GameSummary]> { - self.games.as_deref() - } - /// A list of group summaries. - pub fn groups(&self) -> std::option::Option<&[crate::model::GroupSummary]> { - self.groups.as_deref() - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(&self) -> std::option::Option<&crate::model::WatchResponse> { - self.watch.as_ref() - } -} -impl std::fmt::Debug for GetGamesOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetGamesOutput"); - formatter.field("games", &self.games); - formatter.field("groups", &self.groups); - formatter.field("watch", &self.watch); - formatter.finish() - } -} -/// See [`GetGamesOutput`](crate::output::GetGamesOutput) -pub mod get_games_output { - /// A builder for [`GetGamesOutput`](crate::output::GetGamesOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) games: std::option::Option>, - pub(crate) groups: std::option::Option>, - pub(crate) watch: std::option::Option, - } - impl Builder { - /// Appends an item to `games`. - /// - /// To override the contents of this collection use [`set_games`](Self::set_games). - /// - /// A list of game summaries. - pub fn games(mut self, input: crate::model::GameSummary) -> Self { - let mut v = self.games.unwrap_or_default(); - v.push(input); - self.games = Some(v); - self - } - /// A list of game summaries. - pub fn set_games( - mut self, - input: std::option::Option>, - ) -> Self { - self.games = input; - self - } - /// Appends an item to `groups`. - /// - /// To override the contents of this collection use [`set_groups`](Self::set_groups). - /// - /// A list of group summaries. - pub fn groups(mut self, input: crate::model::GroupSummary) -> Self { - let mut v = self.groups.unwrap_or_default(); - v.push(input); - self.groups = Some(v); - self - } - /// A list of group summaries. - pub fn set_groups( - mut self, - input: std::option::Option>, - ) -> Self { - self.groups = input; - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(mut self, input: crate::model::WatchResponse) -> Self { - self.watch = Some(input); - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn set_watch( - mut self, - input: std::option::Option, - ) -> Self { - self.watch = input; - self - } - /// Consumes the builder and constructs a [`GetGamesOutput`](crate::output::GetGamesOutput) - pub fn build(self) -> crate::output::GetGamesOutput { - crate::output::GetGamesOutput { - games: self.games, - groups: self.groups, - watch: self.watch, - } - } - } -} -impl GetGamesOutput { - /// Creates a new builder-style object to manufacture [`GetGamesOutput`](crate::output::GetGamesOutput) - pub fn builder() -> crate::output::get_games_output::Builder { - crate::output::get_games_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CompleteUploadOutput {} -impl std::fmt::Debug for CompleteUploadOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CompleteUploadOutput"); - formatter.finish() - } -} -/// See [`CompleteUploadOutput`](crate::output::CompleteUploadOutput) -pub mod complete_upload_output { - /// A builder for [`CompleteUploadOutput`](crate::output::CompleteUploadOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`CompleteUploadOutput`](crate::output::CompleteUploadOutput) - pub fn build(self) -> crate::output::CompleteUploadOutput { - crate::output::CompleteUploadOutput {} - } - } -} -impl CompleteUploadOutput { - /// Creates a new builder-style object to manufacture [`CompleteUploadOutput`](crate::output::CompleteUploadOutput) - pub fn builder() -> crate::output::complete_upload_output::Builder { - crate::output::complete_upload_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct InspectOutput { - /// The current authenticated agent. - pub agent: std::option::Option, -} -impl InspectOutput { - /// The current authenticated agent. - pub fn agent(&self) -> std::option::Option<&crate::model::AuthAgent> { - self.agent.as_ref() - } -} -impl std::fmt::Debug for InspectOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("InspectOutput"); - formatter.field("agent", &self.agent); - formatter.finish() - } -} -/// See [`InspectOutput`](crate::output::InspectOutput) -pub mod inspect_output { - /// A builder for [`InspectOutput`](crate::output::InspectOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) agent: std::option::Option, - } - impl Builder { - /// The current authenticated agent. - pub fn agent(mut self, input: crate::model::AuthAgent) -> Self { - self.agent = Some(input); - self - } - /// The current authenticated agent. - pub fn set_agent(mut self, input: std::option::Option) -> Self { - self.agent = input; - self - } - /// Consumes the builder and constructs a [`InspectOutput`](crate::output::InspectOutput) - pub fn build(self) -> crate::output::InspectOutput { - crate::output::InspectOutput { agent: self.agent } - } - } -} -impl InspectOutput { - /// Creates a new builder-style object to manufacture [`InspectOutput`](crate::output::InspectOutput) - pub fn builder() -> crate::output::inspect_output::Builder { - crate::output::inspect_output::Builder::default() - } -} diff --git a/lib/smithy-output/api-group/rust-server/rust-server/Cargo.toml b/lib/smithy-output/api-group/rust-server/rust-server/Cargo.toml deleted file mode 100644 index 554261fab..000000000 --- a/lib/smithy-output/api-group/rust-server/rust-server/Cargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -[package] -name = "rivet-group-server" -version = "0.0.7" -authors = ["Rivet "] -edition = "2021" -license = "Apache-2.0" - -[package.metadata.docs.rs] -all-features = true -targets = ["x86_64-unknown-linux-gnu"] - -[dependencies] -serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" -chrono = { version = "0.4", features = ["serde"] } diff --git a/lib/smithy-output/api-group/rust-server/rust-server/src/lib.rs b/lib/smithy-output/api-group/rust-server/rust-server/src/lib.rs deleted file mode 100644 index ff9294697..000000000 --- a/lib/smithy-output/api-group/rust-server/rust-server/src/lib.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod models; \ No newline at end of file diff --git a/lib/smithy-output/api-group/rust-server/rust-server/src/models.rs b/lib/smithy-output/api-group/rust-server/rust-server/src/models.rs deleted file mode 100644 index 5836c2567..000000000 --- a/lib/smithy-output/api-group/rust-server/rust-server/src/models.rs +++ /dev/null @@ -1,634 +0,0 @@ -#[allow(unused_imports)] -use chrono; -#[allow(unused_imports)] -use serde::{Deserialize, Serialize}; - -/// A group handle. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GroupHandle { - /// A universally unique identifier. - pub group_id: std::string::String, - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// The URL of this group's avatar image. - pub avatar_url: std::option::Option, - /// External links for this group. - pub external: GroupExternalLinks, - /// Whether or not this group is a developer group. - pub is_developer: std::option::Option, -} - -/// External links for this group. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GroupExternalLinks { - /// A link to this group's profile page. - pub profile: std::string::String, - /// A link to this group's chat page. - pub chat: std::string::String, -} - -/// Provided by watchable endpoints used in blocking loops. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct WatchResponse { - /// Index indicating the version of the data responded. Pas this to `rivet.common#WatchQuery` to block and wait for the next response. - pub index: std::string::String, -} - -/// A banned identity. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GroupBannedIdentity { - /// An identity handle. - pub identity: IdentityHandle, - /// RFC3339 timestamp. - pub ban_ts: chrono::DateTime, -} - -/// An identity handle. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct IdentityHandle { - /// A universally unique identifier. - pub identity_id: std::string::String, - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub account_number: i32, - /// The URL of this identity's avatar image. - pub avatar_url: std::string::String, - /// Information about the identity's current status, party, and active game. - pub presence: std::option::Option, - /// A party handle. - pub party: std::option::Option, - /// Whether or not this identity is registered with a linked account. - pub is_registered: bool, - /// External links for an identity. - pub external: IdentityExternalLinks, -} - -/// External links for an identity. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct IdentityExternalLinks { - /// A link to this identity's profile page. - pub profile: std::string::String, - /// A link to the Rivet settings page. - pub settings: std::option::Option, - /// A link to a chat page with the given identity. - pub chat: std::option::Option, -} - -/// A party handle. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PartyHandle { - /// A universally unique identifier. - pub party_id: std::string::String, - /// RFC3339 timestamp. - pub create_ts: chrono::DateTime, - /// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. - pub activity: PartyActivity, - /// External links for a party. - pub external: PartyExternalLinks, -} - -/// External links for a party. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PartyExternalLinks { - /// A link to the given party's chat thread. - pub chat: std::string::String, -} - -/// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum PartyActivity { - /// A party activity denoting that the party is idle. - Idle(PartyActivityIdle), - /// A party activity denoting that the party is currently searching for a lobby. - MatchmakerFindingLobby(PartyActivityMatchmakerFindingLobby), - /// A party activity denoting that the party is currently in a lobby. - MatchmakerLobby(PartyActivityMatchmakerLobby), -} - -/// A party activity denoting that the party is currently in a lobby. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PartyActivityMatchmakerLobby { - /// A party lobby. - pub lobby: PartyMatchmakerLobby, - /// A game handle. - pub game: GameHandle, -} - -/// A game handle. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GameHandle { - /// A universally unique identifier. - pub game_id: std::string::String, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub name_id: std::string::String, - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// The URL of this game's logo image. - pub logo_url: std::option::Option, - /// The URL of this game's banner image. - pub banner_url: std::option::Option, -} - -/// A party lobby. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PartyMatchmakerLobby { - /// A universally unique identifier. - pub lobby_id: std::string::String, -} - -/// A party activity denoting that the party is currently searching for a lobby. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PartyActivityMatchmakerFindingLobby { - /// A game handle. - pub game: GameHandle, -} - -/// A party activity denoting that the party is idle. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PartyActivityIdle {} - -/// Information about the identity's current status, party, and active game. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct IdentityPresence { - /// RFC3339 timestamp. - pub update_ts: chrono::DateTime, - /// The current status of an identity. This helps players understand if another player is currently playing or has their game in the background. - pub status: IdentityStatus, - /// The game an identity is currently participating in. - pub game_activity: std::option::Option, -} - -/// The game an identity is currently participating in. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct IdentityGameActivity { - /// A game handle. - pub game: GameHandle, - /// A short activity message about the current game activity. - pub message: std::string::String, - /// JSON data seen by anyone. - pub public_metadata: std::option::Option, - /// JSON data seen only by the given identity and their mutual followers. - pub mutual_metadata: std::option::Option, -} - -/// The current status of an identity. This helps players understand if another -/// player is currently playing or has their game in the background. -#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd, Hash, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum IdentityStatus { - #[allow(missing_docs)] // documentation missing in model - Away, - #[allow(missing_docs)] // documentation missing in model - Offline, - #[allow(missing_docs)] // documentation missing in model - Online, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for IdentityStatus { - fn from(s: &str) -> Self { - match s { - "away" => IdentityStatus::Away, - "offline" => IdentityStatus::Offline, - "online" => IdentityStatus::Online, - other => IdentityStatus::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for IdentityStatus { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(IdentityStatus::from(s)) - } -} -impl IdentityStatus { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - IdentityStatus::Away => "away", - IdentityStatus::Offline => "offline", - IdentityStatus::Online => "online", - IdentityStatus::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["away", "offline", "online"] - } -} -impl AsRef for IdentityStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// A presigned request used to upload files. Upload your file to the given URL via a PUT request. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct UploadPresignedRequest { - /// The name of the file to upload. This is the same as the one given in the upload prepare file. - pub path: std::string::String, - /// The URL of the presigned request for which to upload your file to. - pub url: std::string::String, -} - -/// An error given by failed content validation. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ValidationError { - /// A list of strings denoting the origin of a validation error. - pub path: std::vec::Vec, -} - -/// The current publicity value for the given group. -#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd, Hash, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum GroupPublicity { - #[allow(missing_docs)] // documentation missing in model - Closed, - #[allow(missing_docs)] // documentation missing in model - Open, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for GroupPublicity { - fn from(s: &str) -> Self { - match s { - "closed" => GroupPublicity::Closed, - "open" => GroupPublicity::Open, - other => GroupPublicity::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for GroupPublicity { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(GroupPublicity::from(s)) - } -} -impl GroupPublicity { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - GroupPublicity::Closed => "closed", - GroupPublicity::Open => "open", - GroupPublicity::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["closed", "open"] - } -} -impl AsRef for GroupPublicity { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// A group summary. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GroupSummary { - /// A universally unique identifier. - pub group_id: std::string::String, - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// The URL of this group's avatar image. - pub avatar_url: std::option::Option, - /// External links for this group. - pub external: GroupExternalLinks, - /// Whether or not this group is a developer. - pub is_developer: bool, - /// Detailed information about a profile. - pub bio: std::string::String, - /// Whether or not the current identity is a member of this group. - pub is_current_identity_member: bool, - /// The current publicity value for the given group. - pub publicity: GroupPublicity, - /// Unsigned 32 bit integer. - pub member_count: i32, - /// A universally unique identifier. - pub owner_identity_id: std::string::String, -} - -/// A group join request. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GroupJoinRequest { - /// An identity handle. - pub identity: IdentityHandle, - /// RFC3339 timestamp. - pub ts: chrono::DateTime, -} - -/// A group member. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GroupMember { - /// An identity handle. - pub identity: IdentityHandle, -} - -/// A list of group profiles. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GroupProfile { - /// A universally unique identifier. - pub group_id: std::string::String, - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// The URL of this group's avatar image. - pub avatar_url: std::option::Option, - /// External links for this group. - pub external: GroupExternalLinks, - /// Whether or not this group is a developer. - pub is_developer: bool, - /// Detailed information about a profile. - pub bio: std::string::String, - /// Whether or not the current identity is a member of this group. - pub is_current_identity_member: bool, - /// The current publicity value for the given group. - pub publicity: GroupPublicity, - /// Unsigned 32 bit integer. - pub member_count: i32, - /// A universally unique identifier. - pub owner_identity_id: std::string::String, - /// A list of group members. - pub members: std::vec::Vec, - /// A list of group join requests. - pub join_requests: std::vec::Vec, - /// Whether or not the current identity is currently requesting to join this group. - pub is_current_identity_requesting_join: bool, - /// A universally unique identifier. - pub thread_id: std::option::Option, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ResolveGroupJoinRequestRequest { - #[allow(missing_docs)] // documentation missing in model - pub resolution: bool, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CreateGroupJoinRequestRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetGroupInviteRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ConsumeGroupInviteRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CreateGroupInviteRequest { - /// How long until the group invite expires (in milliseconds). - pub ttl: std::option::Option, - /// How many times the group invite can be used. - pub use_count: std::option::Option, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetGroupBansRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct UnbanGroupIdentityRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct BanGroupIdentityRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct KickGroupMemberRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct LeaveGroupRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CompleteGroupAvatarUploadRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PrepareGroupAvatarUploadRequest { - /// The path/filename of the group avatar. - pub path: std::string::String, - /// The MIME type of the group avatar. - pub mime: std::option::Option, - /// Unsigned 64 bit integer. - pub content_length: i64, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct SearchGroupsRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TransferGroupOwnershipRequest { - /// Idnetity to transfer the group to. Must be a member of the group. - pub new_owner_identity_id: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ValidateGroupProfileRequest { - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// Detailed information about a profile. - pub bio: std::option::Option, - /// The current publicity value for the given group. - pub publicity: std::option::Option, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetGroupSummaryRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct UpdateGroupProfileRequest { - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// Detailed information about a profile. - pub bio: std::option::Option, - /// The current publicity value for the given group. - pub publicity: std::option::Option, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetGroupJoinRequestsRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetGroupMembersRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetGroupProfileRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CreateGroupRequest { - /// Represent a resource's readable display name. - pub display_name: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ListSuggestedGroupsRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ResolveGroupJoinRequestResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CreateGroupJoinRequestResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetGroupInviteResponse { - /// A group handle. - pub group: GroupHandle, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ConsumeGroupInviteResponse { - /// A universally unique identifier. - pub group_id: std::option::Option, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CreateGroupInviteResponse { - /// The code that will be passed to `rivet.api.group#ConsumeGroupInvite` to join a group. - pub code: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetGroupBansResponse { - /// A list of banned group members. - pub banned_identities: std::vec::Vec, - /// The pagination anchor. - pub anchor: std::option::Option, - /// Provided by watchable endpoints used in blocking loops. - pub watch: WatchResponse, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct UnbanGroupIdentityResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct BanGroupIdentityResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct KickGroupMemberResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct LeaveGroupResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CompleteGroupAvatarUploadResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PrepareGroupAvatarUploadResponse { - /// A universally unique identifier. - pub upload_id: std::string::String, - /// A presigned request used to upload files. Upload your file to the given URL via a PUT request. - pub presigned_request: UploadPresignedRequest, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct SearchGroupsResponse { - /// A list of group handles. - pub groups: std::vec::Vec, - #[allow(missing_docs)] // documentation missing in model - pub anchor: std::option::Option, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TransferGroupOwnershipResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ValidateGroupProfileResponse { - /// A list of validation errors. - pub errors: std::vec::Vec, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetGroupSummaryResponse { - /// A group summary. - pub group: GroupSummary, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct UpdateGroupProfileResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetGroupJoinRequestsResponse { - /// A list of group join requests. - pub join_requests: std::vec::Vec, - /// The pagination anchor. - pub anchor: std::option::Option, - /// Provided by watchable endpoints used in blocking loops. - pub watch: WatchResponse, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetGroupMembersResponse { - /// A list of group members. - pub members: std::vec::Vec, - /// The pagination anchor. - pub anchor: std::option::Option, - /// Provided by watchable endpoints used in blocking loops. - pub watch: WatchResponse, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetGroupProfileResponse { - /// A list of group profiles. - pub group: GroupProfile, - /// Provided by watchable endpoints used in blocking loops. - pub watch: WatchResponse, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CreateGroupResponse { - /// A universally unique identifier. - pub group_id: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ListSuggestedGroupsResponse { - /// A list of group summaries. - pub groups: std::vec::Vec, - /// Provided by watchable endpoints used in blocking loops. - pub watch: WatchResponse, -} - diff --git a/lib/smithy-output/api-group/rust/rust/Cargo.toml b/lib/smithy-output/api-group/rust/rust/Cargo.toml deleted file mode 100644 index 18b409c54..000000000 --- a/lib/smithy-output/api-group/rust/rust/Cargo.toml +++ /dev/null @@ -1,33 +0,0 @@ -# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -[package] -name = "rivet-group" -version = "0.0.7" -authors = ["Rivet Gaming, LLC "] -description = "Rivet service enabling identities to create groups together" -edition = "2021" -license = "Apache-2.0" - -[package.metadata.docs.rs] -all-features = true -targets = ["x86_64-unknown-linux-gnu"] -[dependencies.aws-smithy-client] -version = "^0.41.0" -[dependencies.aws-smithy-http] -version = "^0.41.0" -[dependencies.aws-smithy-json] -version = "^0.41.0" -[dependencies.aws-smithy-types] -version = "^0.41.0" -[dependencies.bytes] -version = "1" -[dependencies.http] -version = "0.2" -[dependencies.tower] -version = "0.4" -[features] -rt-tokio = ["aws-smithy-http/rt-tokio"] -rustls = ["aws-smithy-client/rustls"] -native-tls = ["aws-smithy-client/native-tls"] -default = ["rt-tokio", "rustls"] - - diff --git a/lib/smithy-output/api-group/rust/rust/src/client.rs b/lib/smithy-output/api-group/rust/rust/src/client.rs deleted file mode 100644 index 6d7ff1125..000000000 --- a/lib/smithy-output/api-group/rust/rust/src/client.rs +++ /dev/null @@ -1,2224 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[derive(Debug)] -pub(crate) struct Handle { - pub(crate) client: aws_smithy_client::Client, - pub(crate) conf: crate::Config, -} - -/// An ergonomic service client for `GroupService`. -/// -/// This client allows ergonomic access to a `GroupService`-shaped service. -/// Each method corresponds to an endpoint defined in the service's Smithy model, -/// and the request and response shapes are auto-generated from that same model. -/// -/// # Constructing a Client -/// -/// To construct a client, you need a few different things: -/// -/// - A [`Config`](crate::Config) that specifies additional configuration -/// required by the service. -/// - A connector (`C`) that specifies how HTTP requests are translated -/// into HTTP responses. This will typically be an HTTP client (like -/// `hyper`), though you can also substitute in your own, like a mock -/// mock connector for testing. -/// - A "middleware" (`M`) that modifies requests prior to them being -/// sent to the request. Most commonly, middleware will decide what -/// endpoint the requests should be sent to, as well as perform -/// authentication and authorization of requests (such as SigV4). -/// You can also have middleware that performs request/response -/// tracing, throttling, or other middleware-like tasks. -/// - A retry policy (`R`) that dictates the behavior for requests that -/// fail and should (potentially) be retried. The default type is -/// generally what you want, as it implements a well-vetted retry -/// policy implemented in [`RetryMode::Standard`](aws_smithy_types::retry::RetryMode::Standard). -/// -/// To construct a client, you will generally want to call -/// [`Client::with_config`], which takes a [`aws_smithy_client::Client`] (a -/// Smithy client that isn't specialized to a particular service), -/// and a [`Config`](crate::Config). Both of these are constructed using -/// the [builder pattern] where you first construct a `Builder` type, -/// then configure it with the necessary parameters, and then call -/// `build` to construct the finalized output type. The -/// [`aws_smithy_client::Client`] builder is re-exported in this crate as -/// [`Builder`] for convenience. -/// -/// In _most_ circumstances, you will want to use the following pattern -/// to construct a client: -/// -/// ``` -/// use rivet_group::{Builder, Client, Config}; -/// let raw_client = -/// Builder::dyn_https() -/// # /* -/// .middleware(/* discussed below */) -/// # */ -/// # .middleware_fn(|r| r) -/// .build(); -/// let config = Config::builder().build(); -/// let client = Client::with_config(raw_client, config); -/// ``` -/// -/// For the middleware, you'll want to use whatever matches the -/// routing, authentication and authorization required by the target -/// service. For example, for the standard AWS SDK which uses -/// [SigV4-signed requests], the middleware looks like this: -/// -// Ignored as otherwise we'd need to pull in all these dev-dependencies. -/// ```rust,ignore -/// use aws_endpoint::AwsEndpointStage; -/// use aws_http::auth::CredentialsStage; -/// use aws_http::recursion_detection::RecursionDetectionStage; -/// use aws_http::user_agent::UserAgentStage; -/// use aws_sig_auth::middleware::SigV4SigningStage; -/// use aws_sig_auth::signer::SigV4Signer; -/// use aws_smithy_client::retry::Config as RetryConfig; -/// use aws_smithy_http_tower::map_request::{AsyncMapRequestLayer, MapRequestLayer}; -/// use std::fmt::Debug; -/// use tower::layer::util::{Identity, Stack}; -/// use tower::ServiceBuilder; -/// -/// type AwsMiddlewareStack = Stack< -/// MapRequestLayer, -/// Stack< -/// MapRequestLayer, -/// Stack< -/// AsyncMapRequestLayer, -/// Stack< -/// MapRequestLayer, -/// Stack, Identity>, -/// >, -/// >, -/// >, -/// >; -/// -/// /// AWS Middleware Stack -/// /// -/// /// This implements the middleware stack for this service. It will: -/// /// 1. Load credentials asynchronously into the property bag -/// /// 2. Sign the request with SigV4 -/// /// 3. Resolve an Endpoint for the request -/// /// 4. Add a user agent to the request -/// #[derive(Debug, Default, Clone)] -/// #[non_exhaustive] -/// pub struct AwsMiddleware; -/// -/// impl AwsMiddleware { -/// /// Create a new `AwsMiddleware` stack -/// /// -/// /// Note: `AwsMiddleware` holds no state. -/// pub fn new() -> Self { -/// AwsMiddleware::default() -/// } -/// } -/// -/// // define the middleware stack in a non-generic location to reduce code bloat. -/// fn base() -> ServiceBuilder { -/// let credential_provider = AsyncMapRequestLayer::for_mapper(CredentialsStage::new()); -/// let signer = MapRequestLayer::for_mapper(SigV4SigningStage::new(SigV4Signer::new())); -/// let endpoint_resolver = MapRequestLayer::for_mapper(AwsEndpointStage); -/// let user_agent = MapRequestLayer::for_mapper(UserAgentStage::new()); -/// let recursion_detection = MapRequestLayer::for_mapper(RecursionDetectionStage::new()); -/// // These layers can be considered as occurring in order, that is: -/// // 1. Resolve an endpoint -/// // 2. Add a user agent -/// // 3. Acquire credentials -/// // 4. Sign with credentials -/// // (5. Dispatch over the wire) -/// ServiceBuilder::new() -/// .layer(endpoint_resolver) -/// .layer(user_agent) -/// .layer(credential_provider) -/// .layer(signer) -/// .layer(recursion_detection) -/// } -/// -/// impl tower::Layer for AwsMiddleware { -/// type Service = >::Service; -/// -/// fn layer(&self, inner: S) -> Self::Service { -/// base().service(inner) -/// } -/// } -/// ``` -/// -/// # Using a Client -/// -/// Once you have a client set up, you can access the service's endpoints -/// by calling the appropriate method on [`Client`]. Each such method -/// returns a request builder for that endpoint, with methods for setting -/// the various fields of the request. Once your request is complete, use -/// the `send` method to send the request. `send` returns a future, which -/// you then have to `.await` to get the service's response. -/// -/// [builder pattern]: https://rust-lang.github.io/api-guidelines/type-safety.html#c-builder -/// [SigV4-signed requests]: https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html -#[derive(std::fmt::Debug)] -pub struct Client { - handle: std::sync::Arc>, -} - -impl std::clone::Clone for Client { - fn clone(&self) -> Self { - Self { - handle: self.handle.clone(), - } - } -} - -#[doc(inline)] -pub use aws_smithy_client::Builder; - -impl From> for Client { - fn from(client: aws_smithy_client::Client) -> Self { - Self::with_config(client, crate::Config::builder().build()) - } -} - -impl Client { - /// Creates a client with the given service configuration. - pub fn with_config(client: aws_smithy_client::Client, conf: crate::Config) -> Self { - Self { - handle: std::sync::Arc::new(Handle { client, conf }), - } - } - - /// Returns the client's configuration. - pub fn conf(&self) -> &crate::Config { - &self.handle.conf - } -} -impl Client -where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, -{ - /// Constructs a fluent builder for the [`BanGroupIdentity`](crate::client::fluent_builders::BanGroupIdentity) operation. - /// - /// - The fluent builder is configurable: - /// - [`group_id(impl Into)`](crate::client::fluent_builders::BanGroupIdentity::group_id) / [`set_group_id(Option)`](crate::client::fluent_builders::BanGroupIdentity::set_group_id): A universally unique identifier. - /// - [`identity_id(impl Into)`](crate::client::fluent_builders::BanGroupIdentity::identity_id) / [`set_identity_id(Option)`](crate::client::fluent_builders::BanGroupIdentity::set_identity_id): A universally unique identifier. - /// - On success, responds with [`BanGroupIdentityOutput`](crate::output::BanGroupIdentityOutput) - - /// - On failure, responds with [`SdkError`](crate::error::BanGroupIdentityError) - pub fn ban_group_identity(&self) -> fluent_builders::BanGroupIdentity { - fluent_builders::BanGroupIdentity::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`CompleteGroupAvatarUpload`](crate::client::fluent_builders::CompleteGroupAvatarUpload) operation. - /// - /// - The fluent builder is configurable: - /// - [`group_id(impl Into)`](crate::client::fluent_builders::CompleteGroupAvatarUpload::group_id) / [`set_group_id(Option)`](crate::client::fluent_builders::CompleteGroupAvatarUpload::set_group_id): A universally unique identifier. - /// - [`upload_id(impl Into)`](crate::client::fluent_builders::CompleteGroupAvatarUpload::upload_id) / [`set_upload_id(Option)`](crate::client::fluent_builders::CompleteGroupAvatarUpload::set_upload_id): A universally unique identifier. - /// - On success, responds with [`CompleteGroupAvatarUploadOutput`](crate::output::CompleteGroupAvatarUploadOutput) - - /// - On failure, responds with [`SdkError`](crate::error::CompleteGroupAvatarUploadError) - pub fn complete_group_avatar_upload( - &self, - ) -> fluent_builders::CompleteGroupAvatarUpload { - fluent_builders::CompleteGroupAvatarUpload::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`ConsumeGroupInvite`](crate::client::fluent_builders::ConsumeGroupInvite) operation. - /// - /// - The fluent builder is configurable: - /// - [`group_invite_code(impl Into)`](crate::client::fluent_builders::ConsumeGroupInvite::group_invite_code) / [`set_group_invite_code(Option)`](crate::client::fluent_builders::ConsumeGroupInvite::set_group_invite_code): Provided by `rivet.api.group#CreateGroupInviteOutput$code`. - /// - On success, responds with [`ConsumeGroupInviteOutput`](crate::output::ConsumeGroupInviteOutput) with field(s): - /// - [`group_id(Option)`](crate::output::ConsumeGroupInviteOutput::group_id): A universally unique identifier. - /// - On failure, responds with [`SdkError`](crate::error::ConsumeGroupInviteError) - pub fn consume_group_invite(&self) -> fluent_builders::ConsumeGroupInvite { - fluent_builders::ConsumeGroupInvite::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`CreateGroup`](crate::client::fluent_builders::CreateGroup) operation. - /// - /// - The fluent builder is configurable: - /// - [`display_name(impl Into)`](crate::client::fluent_builders::CreateGroup::display_name) / [`set_display_name(Option)`](crate::client::fluent_builders::CreateGroup::set_display_name): Represent a resource's readable display name. - /// - On success, responds with [`CreateGroupOutput`](crate::output::CreateGroupOutput) with field(s): - /// - [`group_id(Option)`](crate::output::CreateGroupOutput::group_id): A universally unique identifier. - /// - On failure, responds with [`SdkError`](crate::error::CreateGroupError) - pub fn create_group(&self) -> fluent_builders::CreateGroup { - fluent_builders::CreateGroup::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`CreateGroupInvite`](crate::client::fluent_builders::CreateGroupInvite) operation. - /// - /// - The fluent builder is configurable: - /// - [`group_id(impl Into)`](crate::client::fluent_builders::CreateGroupInvite::group_id) / [`set_group_id(Option)`](crate::client::fluent_builders::CreateGroupInvite::set_group_id): A universally unique identifier. - /// - [`ttl(i64)`](crate::client::fluent_builders::CreateGroupInvite::ttl) / [`set_ttl(Option)`](crate::client::fluent_builders::CreateGroupInvite::set_ttl): How long until the group invite expires (in milliseconds). - /// - [`use_count(i64)`](crate::client::fluent_builders::CreateGroupInvite::use_count) / [`set_use_count(Option)`](crate::client::fluent_builders::CreateGroupInvite::set_use_count): How many times the group invite can be used. - /// - On success, responds with [`CreateGroupInviteOutput`](crate::output::CreateGroupInviteOutput) with field(s): - /// - [`code(Option)`](crate::output::CreateGroupInviteOutput::code): The code that will be passed to `rivet.api.group#ConsumeGroupInvite` to join a group. - /// - On failure, responds with [`SdkError`](crate::error::CreateGroupInviteError) - pub fn create_group_invite(&self) -> fluent_builders::CreateGroupInvite { - fluent_builders::CreateGroupInvite::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`CreateGroupJoinRequest`](crate::client::fluent_builders::CreateGroupJoinRequest) operation. - /// - /// - The fluent builder is configurable: - /// - [`group_id(impl Into)`](crate::client::fluent_builders::CreateGroupJoinRequest::group_id) / [`set_group_id(Option)`](crate::client::fluent_builders::CreateGroupJoinRequest::set_group_id): A universally unique identifier. - /// - On success, responds with [`CreateGroupJoinRequestOutput`](crate::output::CreateGroupJoinRequestOutput) - - /// - On failure, responds with [`SdkError`](crate::error::CreateGroupJoinRequestError) - pub fn create_group_join_request(&self) -> fluent_builders::CreateGroupJoinRequest { - fluent_builders::CreateGroupJoinRequest::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GetGroupBans`](crate::client::fluent_builders::GetGroupBans) operation. - /// - /// - The fluent builder is configurable: - /// - [`group_id(impl Into)`](crate::client::fluent_builders::GetGroupBans::group_id) / [`set_group_id(Option)`](crate::client::fluent_builders::GetGroupBans::set_group_id): A universally unique identifier. - /// - [`anchor(impl Into)`](crate::client::fluent_builders::GetGroupBans::anchor) / [`set_anchor(Option)`](crate::client::fluent_builders::GetGroupBans::set_anchor): The pagination anchor. Set to the returned anchor of this endpoint to receive the next set of items. - /// - [`count(i32)`](crate::client::fluent_builders::GetGroupBans::count) / [`set_count(Option)`](crate::client::fluent_builders::GetGroupBans::set_count): Amount of bans to return. - /// - [`watch_index(impl Into)`](crate::client::fluent_builders::GetGroupBans::watch_index) / [`set_watch_index(Option)`](crate::client::fluent_builders::GetGroupBans::set_watch_index): A query parameter denoting the requests watch index. - /// - On success, responds with [`GetGroupBansOutput`](crate::output::GetGroupBansOutput) with field(s): - /// - [`banned_identities(Option>)`](crate::output::GetGroupBansOutput::banned_identities): A list of banned group members. - /// - [`anchor(Option)`](crate::output::GetGroupBansOutput::anchor): The pagination anchor. - /// - [`watch(Option)`](crate::output::GetGroupBansOutput::watch): Provided by watchable endpoints used in blocking loops. - /// - On failure, responds with [`SdkError`](crate::error::GetGroupBansError) - pub fn get_group_bans(&self) -> fluent_builders::GetGroupBans { - fluent_builders::GetGroupBans::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GetGroupInvite`](crate::client::fluent_builders::GetGroupInvite) operation. - /// - /// - The fluent builder is configurable: - /// - [`group_invite_code(impl Into)`](crate::client::fluent_builders::GetGroupInvite::group_invite_code) / [`set_group_invite_code(Option)`](crate::client::fluent_builders::GetGroupInvite::set_group_invite_code): Provided by `rivet.api.group#CreateGroupInviteOutput$code`. - /// - On success, responds with [`GetGroupInviteOutput`](crate::output::GetGroupInviteOutput) with field(s): - /// - [`group(Option)`](crate::output::GetGroupInviteOutput::group): A group handle. - /// - On failure, responds with [`SdkError`](crate::error::GetGroupInviteError) - pub fn get_group_invite(&self) -> fluent_builders::GetGroupInvite { - fluent_builders::GetGroupInvite::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GetGroupJoinRequests`](crate::client::fluent_builders::GetGroupJoinRequests) operation. - /// - /// - The fluent builder is configurable: - /// - [`group_id(impl Into)`](crate::client::fluent_builders::GetGroupJoinRequests::group_id) / [`set_group_id(Option)`](crate::client::fluent_builders::GetGroupJoinRequests::set_group_id): A universally unique identifier. - /// - [`anchor(impl Into)`](crate::client::fluent_builders::GetGroupJoinRequests::anchor) / [`set_anchor(Option)`](crate::client::fluent_builders::GetGroupJoinRequests::set_anchor): The pagination anchor. Set to the returned anchor of this endpoint to receive the next set of items. - /// - [`count(i32)`](crate::client::fluent_builders::GetGroupJoinRequests::count) / [`set_count(Option)`](crate::client::fluent_builders::GetGroupJoinRequests::set_count): Amount of join requests to return. - /// - [`watch_index(impl Into)`](crate::client::fluent_builders::GetGroupJoinRequests::watch_index) / [`set_watch_index(Option)`](crate::client::fluent_builders::GetGroupJoinRequests::set_watch_index): A query parameter denoting the requests watch index. - /// - On success, responds with [`GetGroupJoinRequestsOutput`](crate::output::GetGroupJoinRequestsOutput) with field(s): - /// - [`join_requests(Option>)`](crate::output::GetGroupJoinRequestsOutput::join_requests): A list of group join requests. - /// - [`anchor(Option)`](crate::output::GetGroupJoinRequestsOutput::anchor): The pagination anchor. - /// - [`watch(Option)`](crate::output::GetGroupJoinRequestsOutput::watch): Provided by watchable endpoints used in blocking loops. - /// - On failure, responds with [`SdkError`](crate::error::GetGroupJoinRequestsError) - pub fn get_group_join_requests(&self) -> fluent_builders::GetGroupJoinRequests { - fluent_builders::GetGroupJoinRequests::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GetGroupMembers`](crate::client::fluent_builders::GetGroupMembers) operation. - /// - /// - The fluent builder is configurable: - /// - [`group_id(impl Into)`](crate::client::fluent_builders::GetGroupMembers::group_id) / [`set_group_id(Option)`](crate::client::fluent_builders::GetGroupMembers::set_group_id): A universally unique identifier. - /// - [`anchor(impl Into)`](crate::client::fluent_builders::GetGroupMembers::anchor) / [`set_anchor(Option)`](crate::client::fluent_builders::GetGroupMembers::set_anchor): The pagination anchor. Set to the returned anchor of this endpoint to receive the next set of items. - /// - [`count(i32)`](crate::client::fluent_builders::GetGroupMembers::count) / [`set_count(Option)`](crate::client::fluent_builders::GetGroupMembers::set_count): Amount of members to return. - /// - [`watch_index(impl Into)`](crate::client::fluent_builders::GetGroupMembers::watch_index) / [`set_watch_index(Option)`](crate::client::fluent_builders::GetGroupMembers::set_watch_index): A query parameter denoting the requests watch index. - /// - On success, responds with [`GetGroupMembersOutput`](crate::output::GetGroupMembersOutput) with field(s): - /// - [`members(Option>)`](crate::output::GetGroupMembersOutput::members): A list of group members. - /// - [`anchor(Option)`](crate::output::GetGroupMembersOutput::anchor): The pagination anchor. - /// - [`watch(Option)`](crate::output::GetGroupMembersOutput::watch): Provided by watchable endpoints used in blocking loops. - /// - On failure, responds with [`SdkError`](crate::error::GetGroupMembersError) - pub fn get_group_members(&self) -> fluent_builders::GetGroupMembers { - fluent_builders::GetGroupMembers::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GetGroupProfile`](crate::client::fluent_builders::GetGroupProfile) operation. - /// - /// - The fluent builder is configurable: - /// - [`group_id(impl Into)`](crate::client::fluent_builders::GetGroupProfile::group_id) / [`set_group_id(Option)`](crate::client::fluent_builders::GetGroupProfile::set_group_id): A universally unique identifier. - /// - [`watch_index(impl Into)`](crate::client::fluent_builders::GetGroupProfile::watch_index) / [`set_watch_index(Option)`](crate::client::fluent_builders::GetGroupProfile::set_watch_index): A query parameter denoting the requests watch index. - /// - On success, responds with [`GetGroupProfileOutput`](crate::output::GetGroupProfileOutput) with field(s): - /// - [`group(Option)`](crate::output::GetGroupProfileOutput::group): A list of group profiles. - /// - [`watch(Option)`](crate::output::GetGroupProfileOutput::watch): Provided by watchable endpoints used in blocking loops. - /// - On failure, responds with [`SdkError`](crate::error::GetGroupProfileError) - pub fn get_group_profile(&self) -> fluent_builders::GetGroupProfile { - fluent_builders::GetGroupProfile::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GetGroupSummary`](crate::client::fluent_builders::GetGroupSummary) operation. - /// - /// - The fluent builder is configurable: - /// - [`group_id(impl Into)`](crate::client::fluent_builders::GetGroupSummary::group_id) / [`set_group_id(Option)`](crate::client::fluent_builders::GetGroupSummary::set_group_id): A universally unique identifier. - /// - On success, responds with [`GetGroupSummaryOutput`](crate::output::GetGroupSummaryOutput) with field(s): - /// - [`group(Option)`](crate::output::GetGroupSummaryOutput::group): A group summary. - /// - On failure, responds with [`SdkError`](crate::error::GetGroupSummaryError) - pub fn get_group_summary(&self) -> fluent_builders::GetGroupSummary { - fluent_builders::GetGroupSummary::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`KickGroupMember`](crate::client::fluent_builders::KickGroupMember) operation. - /// - /// - The fluent builder is configurable: - /// - [`group_id(impl Into)`](crate::client::fluent_builders::KickGroupMember::group_id) / [`set_group_id(Option)`](crate::client::fluent_builders::KickGroupMember::set_group_id): A universally unique identifier. - /// - [`identity_id(impl Into)`](crate::client::fluent_builders::KickGroupMember::identity_id) / [`set_identity_id(Option)`](crate::client::fluent_builders::KickGroupMember::set_identity_id): A universally unique identifier. - /// - On success, responds with [`KickGroupMemberOutput`](crate::output::KickGroupMemberOutput) - - /// - On failure, responds with [`SdkError`](crate::error::KickGroupMemberError) - pub fn kick_group_member(&self) -> fluent_builders::KickGroupMember { - fluent_builders::KickGroupMember::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`LeaveGroup`](crate::client::fluent_builders::LeaveGroup) operation. - /// - /// - The fluent builder is configurable: - /// - [`group_id(impl Into)`](crate::client::fluent_builders::LeaveGroup::group_id) / [`set_group_id(Option)`](crate::client::fluent_builders::LeaveGroup::set_group_id): A universally unique identifier. - /// - On success, responds with [`LeaveGroupOutput`](crate::output::LeaveGroupOutput) - - /// - On failure, responds with [`SdkError`](crate::error::LeaveGroupError) - pub fn leave_group(&self) -> fluent_builders::LeaveGroup { - fluent_builders::LeaveGroup::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`ListSuggestedGroups`](crate::client::fluent_builders::ListSuggestedGroups) operation. - /// - /// - The fluent builder is configurable: - /// - [`watch_index(impl Into)`](crate::client::fluent_builders::ListSuggestedGroups::watch_index) / [`set_watch_index(Option)`](crate::client::fluent_builders::ListSuggestedGroups::set_watch_index): A query parameter denoting the requests watch index. - /// - On success, responds with [`ListSuggestedGroupsOutput`](crate::output::ListSuggestedGroupsOutput) with field(s): - /// - [`groups(Option>)`](crate::output::ListSuggestedGroupsOutput::groups): A list of group summaries. - /// - [`watch(Option)`](crate::output::ListSuggestedGroupsOutput::watch): Provided by watchable endpoints used in blocking loops. - /// - On failure, responds with [`SdkError`](crate::error::ListSuggestedGroupsError) - pub fn list_suggested_groups(&self) -> fluent_builders::ListSuggestedGroups { - fluent_builders::ListSuggestedGroups::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`PrepareGroupAvatarUpload`](crate::client::fluent_builders::PrepareGroupAvatarUpload) operation. - /// - /// - The fluent builder is configurable: - /// - [`path(impl Into)`](crate::client::fluent_builders::PrepareGroupAvatarUpload::path) / [`set_path(Option)`](crate::client::fluent_builders::PrepareGroupAvatarUpload::set_path): The path/filename of the group avatar. - /// - [`mime(impl Into)`](crate::client::fluent_builders::PrepareGroupAvatarUpload::mime) / [`set_mime(Option)`](crate::client::fluent_builders::PrepareGroupAvatarUpload::set_mime): The MIME type of the group avatar. - /// - [`content_length(i64)`](crate::client::fluent_builders::PrepareGroupAvatarUpload::content_length) / [`set_content_length(Option)`](crate::client::fluent_builders::PrepareGroupAvatarUpload::set_content_length): Unsigned 64 bit integer. - /// - On success, responds with [`PrepareGroupAvatarUploadOutput`](crate::output::PrepareGroupAvatarUploadOutput) with field(s): - /// - [`upload_id(Option)`](crate::output::PrepareGroupAvatarUploadOutput::upload_id): A universally unique identifier. - /// - [`presigned_request(Option)`](crate::output::PrepareGroupAvatarUploadOutput::presigned_request): A presigned request used to upload files. Upload your file to the given URL via a PUT request. - /// - On failure, responds with [`SdkError`](crate::error::PrepareGroupAvatarUploadError) - pub fn prepare_group_avatar_upload( - &self, - ) -> fluent_builders::PrepareGroupAvatarUpload { - fluent_builders::PrepareGroupAvatarUpload::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`ResolveGroupJoinRequest`](crate::client::fluent_builders::ResolveGroupJoinRequest) operation. - /// - /// - The fluent builder is configurable: - /// - [`group_id(impl Into)`](crate::client::fluent_builders::ResolveGroupJoinRequest::group_id) / [`set_group_id(Option)`](crate::client::fluent_builders::ResolveGroupJoinRequest::set_group_id): A universally unique identifier. - /// - [`identity_id(impl Into)`](crate::client::fluent_builders::ResolveGroupJoinRequest::identity_id) / [`set_identity_id(Option)`](crate::client::fluent_builders::ResolveGroupJoinRequest::set_identity_id): A universally unique identifier. - /// - [`resolution(bool)`](crate::client::fluent_builders::ResolveGroupJoinRequest::resolution) / [`set_resolution(Option)`](crate::client::fluent_builders::ResolveGroupJoinRequest::set_resolution): (undocumented) - /// - On success, responds with [`ResolveGroupJoinRequestOutput`](crate::output::ResolveGroupJoinRequestOutput) - - /// - On failure, responds with [`SdkError`](crate::error::ResolveGroupJoinRequestError) - pub fn resolve_group_join_request(&self) -> fluent_builders::ResolveGroupJoinRequest { - fluent_builders::ResolveGroupJoinRequest::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`SearchGroups`](crate::client::fluent_builders::SearchGroups) operation. - /// - /// - The fluent builder is configurable: - /// - [`query(impl Into)`](crate::client::fluent_builders::SearchGroups::query) / [`set_query(Option)`](crate::client::fluent_builders::SearchGroups::set_query): The query to match group display names against. - /// - [`anchor(impl Into)`](crate::client::fluent_builders::SearchGroups::anchor) / [`set_anchor(Option)`](crate::client::fluent_builders::SearchGroups::set_anchor): (undocumented) - /// - [`limit(i32)`](crate::client::fluent_builders::SearchGroups::limit) / [`set_limit(Option)`](crate::client::fluent_builders::SearchGroups::set_limit): Unsigned 32 bit integer. - /// - On success, responds with [`SearchGroupsOutput`](crate::output::SearchGroupsOutput) with field(s): - /// - [`groups(Option>)`](crate::output::SearchGroupsOutput::groups): A list of group handles. - /// - [`anchor(Option)`](crate::output::SearchGroupsOutput::anchor): (undocumented) - /// - On failure, responds with [`SdkError`](crate::error::SearchGroupsError) - pub fn search_groups(&self) -> fluent_builders::SearchGroups { - fluent_builders::SearchGroups::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`TransferGroupOwnership`](crate::client::fluent_builders::TransferGroupOwnership) operation. - /// - /// - The fluent builder is configurable: - /// - [`group_id(impl Into)`](crate::client::fluent_builders::TransferGroupOwnership::group_id) / [`set_group_id(Option)`](crate::client::fluent_builders::TransferGroupOwnership::set_group_id): A universally unique identifier. - /// - [`new_owner_identity_id(impl Into)`](crate::client::fluent_builders::TransferGroupOwnership::new_owner_identity_id) / [`set_new_owner_identity_id(Option)`](crate::client::fluent_builders::TransferGroupOwnership::set_new_owner_identity_id): Idnetity to transfer the group to. Must be a member of the group. - /// - On success, responds with [`TransferGroupOwnershipOutput`](crate::output::TransferGroupOwnershipOutput) - - /// - On failure, responds with [`SdkError`](crate::error::TransferGroupOwnershipError) - pub fn transfer_group_ownership(&self) -> fluent_builders::TransferGroupOwnership { - fluent_builders::TransferGroupOwnership::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`UnbanGroupIdentity`](crate::client::fluent_builders::UnbanGroupIdentity) operation. - /// - /// - The fluent builder is configurable: - /// - [`group_id(impl Into)`](crate::client::fluent_builders::UnbanGroupIdentity::group_id) / [`set_group_id(Option)`](crate::client::fluent_builders::UnbanGroupIdentity::set_group_id): A universally unique identifier. - /// - [`identity_id(impl Into)`](crate::client::fluent_builders::UnbanGroupIdentity::identity_id) / [`set_identity_id(Option)`](crate::client::fluent_builders::UnbanGroupIdentity::set_identity_id): A universally unique identifier. - /// - On success, responds with [`UnbanGroupIdentityOutput`](crate::output::UnbanGroupIdentityOutput) - - /// - On failure, responds with [`SdkError`](crate::error::UnbanGroupIdentityError) - pub fn unban_group_identity(&self) -> fluent_builders::UnbanGroupIdentity { - fluent_builders::UnbanGroupIdentity::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`UpdateGroupProfile`](crate::client::fluent_builders::UpdateGroupProfile) operation. - /// - /// - The fluent builder is configurable: - /// - [`group_id(impl Into)`](crate::client::fluent_builders::UpdateGroupProfile::group_id) / [`set_group_id(Option)`](crate::client::fluent_builders::UpdateGroupProfile::set_group_id): A universally unique identifier. - /// - [`display_name(impl Into)`](crate::client::fluent_builders::UpdateGroupProfile::display_name) / [`set_display_name(Option)`](crate::client::fluent_builders::UpdateGroupProfile::set_display_name): Represent a resource's readable display name. - /// - [`bio(impl Into)`](crate::client::fluent_builders::UpdateGroupProfile::bio) / [`set_bio(Option)`](crate::client::fluent_builders::UpdateGroupProfile::set_bio): Detailed information about a profile. - /// - [`publicity(GroupPublicity)`](crate::client::fluent_builders::UpdateGroupProfile::publicity) / [`set_publicity(Option)`](crate::client::fluent_builders::UpdateGroupProfile::set_publicity): The current publicity value for the given group. - /// - On success, responds with [`UpdateGroupProfileOutput`](crate::output::UpdateGroupProfileOutput) - - /// - On failure, responds with [`SdkError`](crate::error::UpdateGroupProfileError) - pub fn update_group_profile(&self) -> fluent_builders::UpdateGroupProfile { - fluent_builders::UpdateGroupProfile::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`ValidateGroupProfile`](crate::client::fluent_builders::ValidateGroupProfile) operation. - /// - /// - The fluent builder is configurable: - /// - [`display_name(impl Into)`](crate::client::fluent_builders::ValidateGroupProfile::display_name) / [`set_display_name(Option)`](crate::client::fluent_builders::ValidateGroupProfile::set_display_name): Represent a resource's readable display name. - /// - [`bio(impl Into)`](crate::client::fluent_builders::ValidateGroupProfile::bio) / [`set_bio(Option)`](crate::client::fluent_builders::ValidateGroupProfile::set_bio): Detailed information about a profile. - /// - [`publicity(GroupPublicity)`](crate::client::fluent_builders::ValidateGroupProfile::publicity) / [`set_publicity(Option)`](crate::client::fluent_builders::ValidateGroupProfile::set_publicity): The current publicity value for the given group. - /// - On success, responds with [`ValidateGroupProfileOutput`](crate::output::ValidateGroupProfileOutput) with field(s): - /// - [`errors(Option>)`](crate::output::ValidateGroupProfileOutput::errors): A list of validation errors. - /// - On failure, responds with [`SdkError`](crate::error::ValidateGroupProfileError) - pub fn validate_group_profile(&self) -> fluent_builders::ValidateGroupProfile { - fluent_builders::ValidateGroupProfile::new(self.handle.clone()) - } -} -pub mod fluent_builders { - //! - //! Utilities to ergonomically construct a request to the service. - //! - //! Fluent builders are created through the [`Client`](crate::client::Client) by calling - //! one if its operation methods. After parameters are set using the builder methods, - //! the `send` method can be called to initiate the request. - //! - /// Fluent builder constructing a request to `BanGroupIdentity`. - /// - /// Bans an identity from a group. Must be the owner of the group to perform this action. The banned identity will no longer be able to create a join request or use a group invite. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct BanGroupIdentity { - handle: std::sync::Arc>, - inner: crate::input::ban_group_identity_input::Builder, - } - impl BanGroupIdentity - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `BanGroupIdentity`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::BanGroupIdentityOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::BanGroupIdentityInputOperationOutputAlias, - crate::output::BanGroupIdentityOutput, - crate::error::BanGroupIdentityError, - crate::input::BanGroupIdentityInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.group_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_group_id(input); - self - } - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.identity_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_identity_id(input); - self - } - } - /// Fluent builder constructing a request to `CompleteGroupAvatarUpload`. - /// - /// Completes an avatar image upload. Must be called after the file upload process completes. Call `rivet.api.group#PrepareGroupAvatarUpload` first. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct CompleteGroupAvatarUpload { - handle: std::sync::Arc>, - inner: crate::input::complete_group_avatar_upload_input::Builder, - } - impl CompleteGroupAvatarUpload - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `CompleteGroupAvatarUpload`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::CompleteGroupAvatarUploadOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::CompleteGroupAvatarUploadInputOperationOutputAlias, - crate::output::CompleteGroupAvatarUploadOutput, - crate::error::CompleteGroupAvatarUploadError, - crate::input::CompleteGroupAvatarUploadInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.group_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_group_id(input); - self - } - /// A universally unique identifier. - pub fn upload_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.upload_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_upload_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_upload_id(input); - self - } - } - /// Fluent builder constructing a request to `ConsumeGroupInvite`. - /// - /// Consumes a group invite to join a group. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct ConsumeGroupInvite { - handle: std::sync::Arc>, - inner: crate::input::consume_group_invite_input::Builder, - } - impl ConsumeGroupInvite - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `ConsumeGroupInvite`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::ConsumeGroupInviteOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::ConsumeGroupInviteInputOperationOutputAlias, - crate::output::ConsumeGroupInviteOutput, - crate::error::ConsumeGroupInviteError, - crate::input::ConsumeGroupInviteInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// Provided by `rivet.api.group#CreateGroupInviteOutput$code`. - pub fn group_invite_code(mut self, input: impl Into) -> Self { - self.inner = self.inner.group_invite_code(input.into()); - self - } - /// Provided by `rivet.api.group#CreateGroupInviteOutput$code`. - pub fn set_group_invite_code( - mut self, - input: std::option::Option, - ) -> Self { - self.inner = self.inner.set_group_invite_code(input); - self - } - } - /// Fluent builder constructing a request to `CreateGroup`. - /// - /// Creates a new group. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct CreateGroup { - handle: std::sync::Arc>, - inner: crate::input::create_group_input::Builder, - } - impl CreateGroup - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `CreateGroup`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::CreateGroupOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::CreateGroupInputOperationOutputAlias, - crate::output::CreateGroupOutput, - crate::error::CreateGroupError, - crate::input::CreateGroupInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.inner = self.inner.display_name(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_display_name(input); - self - } - } - /// Fluent builder constructing a request to `CreateGroupInvite`. - /// - /// Creates a group invite. Can be shared with other identities to let them join this group. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct CreateGroupInvite { - handle: std::sync::Arc>, - inner: crate::input::create_group_invite_input::Builder, - } - impl CreateGroupInvite - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `CreateGroupInvite`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::CreateGroupInviteOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::CreateGroupInviteInputOperationOutputAlias, - crate::output::CreateGroupInviteOutput, - crate::error::CreateGroupInviteError, - crate::input::CreateGroupInviteInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.group_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_group_id(input); - self - } - /// How long until the group invite expires (in milliseconds). - pub fn ttl(mut self, input: i64) -> Self { - self.inner = self.inner.ttl(input); - self - } - /// How long until the group invite expires (in milliseconds). - pub fn set_ttl(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_ttl(input); - self - } - /// How many times the group invite can be used. - pub fn use_count(mut self, input: i64) -> Self { - self.inner = self.inner.use_count(input); - self - } - /// How many times the group invite can be used. - pub fn set_use_count(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_use_count(input); - self - } - } - /// Fluent builder constructing a request to `CreateGroupJoinRequest`. - /// - /// Requests to join a group. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct CreateGroupJoinRequest { - handle: std::sync::Arc>, - inner: crate::input::create_group_join_request_input::Builder, - } - impl CreateGroupJoinRequest - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `CreateGroupJoinRequest`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::CreateGroupJoinRequestOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::CreateGroupJoinRequestInputOperationOutputAlias, - crate::output::CreateGroupJoinRequestOutput, - crate::error::CreateGroupJoinRequestError, - crate::input::CreateGroupJoinRequestInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.group_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_group_id(input); - self - } - } - /// Fluent builder constructing a request to `GetGroupBans`. - /// - /// Returns a group's bans. Must have valid permissions to view. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GetGroupBans { - handle: std::sync::Arc>, - inner: crate::input::get_group_bans_input::Builder, - } - impl GetGroupBans - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GetGroupBans`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GetGroupBansOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GetGroupBansInputOperationOutputAlias, - crate::output::GetGroupBansOutput, - crate::error::GetGroupBansError, - crate::input::GetGroupBansInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.group_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_group_id(input); - self - } - /// The pagination anchor. Set to the returned anchor of this endpoint to receive the next set of items. - pub fn anchor(mut self, input: impl Into) -> Self { - self.inner = self.inner.anchor(input.into()); - self - } - /// The pagination anchor. Set to the returned anchor of this endpoint to receive the next set of items. - pub fn set_anchor(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_anchor(input); - self - } - /// Amount of bans to return. - pub fn count(mut self, input: i32) -> Self { - self.inner = self.inner.count(input); - self - } - /// Amount of bans to return. - pub fn set_count(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_count(input); - self - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.inner = self.inner.watch_index(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_watch_index(input); - self - } - } - /// Fluent builder constructing a request to `GetGroupInvite`. - /// - /// Inspects a group invite returning information about the team that created it. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GetGroupInvite { - handle: std::sync::Arc>, - inner: crate::input::get_group_invite_input::Builder, - } - impl GetGroupInvite - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GetGroupInvite`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GetGroupInviteOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GetGroupInviteInputOperationOutputAlias, - crate::output::GetGroupInviteOutput, - crate::error::GetGroupInviteError, - crate::input::GetGroupInviteInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// Provided by `rivet.api.group#CreateGroupInviteOutput$code`. - pub fn group_invite_code(mut self, input: impl Into) -> Self { - self.inner = self.inner.group_invite_code(input.into()); - self - } - /// Provided by `rivet.api.group#CreateGroupInviteOutput$code`. - pub fn set_group_invite_code( - mut self, - input: std::option::Option, - ) -> Self { - self.inner = self.inner.set_group_invite_code(input); - self - } - } - /// Fluent builder constructing a request to `GetGroupJoinRequests`. - /// - /// Returns a group's join requests. Must have valid permissions to view. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GetGroupJoinRequests { - handle: std::sync::Arc>, - inner: crate::input::get_group_join_requests_input::Builder, - } - impl GetGroupJoinRequests - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GetGroupJoinRequests`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GetGroupJoinRequestsOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GetGroupJoinRequestsInputOperationOutputAlias, - crate::output::GetGroupJoinRequestsOutput, - crate::error::GetGroupJoinRequestsError, - crate::input::GetGroupJoinRequestsInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.group_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_group_id(input); - self - } - /// The pagination anchor. Set to the returned anchor of this endpoint to receive the next set of items. - pub fn anchor(mut self, input: impl Into) -> Self { - self.inner = self.inner.anchor(input.into()); - self - } - /// The pagination anchor. Set to the returned anchor of this endpoint to receive the next set of items. - pub fn set_anchor(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_anchor(input); - self - } - /// Amount of join requests to return. - pub fn count(mut self, input: i32) -> Self { - self.inner = self.inner.count(input); - self - } - /// Amount of join requests to return. - pub fn set_count(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_count(input); - self - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.inner = self.inner.watch_index(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_watch_index(input); - self - } - } - /// Fluent builder constructing a request to `GetGroupMembers`. - /// - /// Returns a group's members. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GetGroupMembers { - handle: std::sync::Arc>, - inner: crate::input::get_group_members_input::Builder, - } - impl GetGroupMembers - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GetGroupMembers`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GetGroupMembersOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GetGroupMembersInputOperationOutputAlias, - crate::output::GetGroupMembersOutput, - crate::error::GetGroupMembersError, - crate::input::GetGroupMembersInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.group_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_group_id(input); - self - } - /// The pagination anchor. Set to the returned anchor of this endpoint to receive the next set of items. - pub fn anchor(mut self, input: impl Into) -> Self { - self.inner = self.inner.anchor(input.into()); - self - } - /// The pagination anchor. Set to the returned anchor of this endpoint to receive the next set of items. - pub fn set_anchor(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_anchor(input); - self - } - /// Amount of members to return. - pub fn count(mut self, input: i32) -> Self { - self.inner = self.inner.count(input); - self - } - /// Amount of members to return. - pub fn set_count(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_count(input); - self - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.inner = self.inner.watch_index(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_watch_index(input); - self - } - } - /// Fluent builder constructing a request to `GetGroupProfile`. - /// - /// Returns a group profile. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GetGroupProfile { - handle: std::sync::Arc>, - inner: crate::input::get_group_profile_input::Builder, - } - impl GetGroupProfile - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GetGroupProfile`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GetGroupProfileOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GetGroupProfileInputOperationOutputAlias, - crate::output::GetGroupProfileOutput, - crate::error::GetGroupProfileError, - crate::input::GetGroupProfileInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.group_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_group_id(input); - self - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.inner = self.inner.watch_index(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_watch_index(input); - self - } - } - /// Fluent builder constructing a request to `GetGroupSummary`. - /// - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GetGroupSummary { - handle: std::sync::Arc>, - inner: crate::input::get_group_summary_input::Builder, - } - impl GetGroupSummary - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GetGroupSummary`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GetGroupSummaryOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GetGroupSummaryInputOperationOutputAlias, - crate::output::GetGroupSummaryOutput, - crate::error::GetGroupSummaryError, - crate::input::GetGroupSummaryInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.group_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_group_id(input); - self - } - } - /// Fluent builder constructing a request to `KickGroupMember`. - /// - /// Kicks an identity from a group. Must be the owner of the group to perform this action. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct KickGroupMember { - handle: std::sync::Arc>, - inner: crate::input::kick_group_member_input::Builder, - } - impl KickGroupMember - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `KickGroupMember`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::KickGroupMemberOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::KickGroupMemberInputOperationOutputAlias, - crate::output::KickGroupMemberOutput, - crate::error::KickGroupMemberError, - crate::input::KickGroupMemberInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.group_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_group_id(input); - self - } - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.identity_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_identity_id(input); - self - } - } - /// Fluent builder constructing a request to `LeaveGroup`. - /// - /// Leaves a group. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct LeaveGroup { - handle: std::sync::Arc>, - inner: crate::input::leave_group_input::Builder, - } - impl LeaveGroup - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `LeaveGroup`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::LeaveGroupOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::LeaveGroupInputOperationOutputAlias, - crate::output::LeaveGroupOutput, - crate::error::LeaveGroupError, - crate::input::LeaveGroupInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.group_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_group_id(input); - self - } - } - /// Fluent builder constructing a request to `ListSuggestedGroups`. - /// - /// Returns a list of suggested groups. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct ListSuggestedGroups { - handle: std::sync::Arc>, - inner: crate::input::list_suggested_groups_input::Builder, - } - impl ListSuggestedGroups - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `ListSuggestedGroups`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::ListSuggestedGroupsOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::ListSuggestedGroupsInputOperationOutputAlias, - crate::output::ListSuggestedGroupsOutput, - crate::error::ListSuggestedGroupsError, - crate::input::ListSuggestedGroupsInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.inner = self.inner.watch_index(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_watch_index(input); - self - } - } - /// Fluent builder constructing a request to `PrepareGroupAvatarUpload`. - /// - /// Prepares an avatar image upload. Complete upload with `rivet.api.group#CompleteGroupAvatarUpload`. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct PrepareGroupAvatarUpload { - handle: std::sync::Arc>, - inner: crate::input::prepare_group_avatar_upload_input::Builder, - } - impl PrepareGroupAvatarUpload - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `PrepareGroupAvatarUpload`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::PrepareGroupAvatarUploadOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::PrepareGroupAvatarUploadInputOperationOutputAlias, - crate::output::PrepareGroupAvatarUploadOutput, - crate::error::PrepareGroupAvatarUploadError, - crate::input::PrepareGroupAvatarUploadInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// The path/filename of the group avatar. - pub fn path(mut self, input: impl Into) -> Self { - self.inner = self.inner.path(input.into()); - self - } - /// The path/filename of the group avatar. - pub fn set_path(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_path(input); - self - } - /// The MIME type of the group avatar. - pub fn mime(mut self, input: impl Into) -> Self { - self.inner = self.inner.mime(input.into()); - self - } - /// The MIME type of the group avatar. - pub fn set_mime(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_mime(input); - self - } - /// Unsigned 64 bit integer. - pub fn content_length(mut self, input: i64) -> Self { - self.inner = self.inner.content_length(input); - self - } - /// Unsigned 64 bit integer. - pub fn set_content_length(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_content_length(input); - self - } - } - /// Fluent builder constructing a request to `ResolveGroupJoinRequest`. - /// - /// Resolves a join request for a given group. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct ResolveGroupJoinRequest { - handle: std::sync::Arc>, - inner: crate::input::resolve_group_join_request_input::Builder, - } - impl ResolveGroupJoinRequest - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `ResolveGroupJoinRequest`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::ResolveGroupJoinRequestOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::ResolveGroupJoinRequestInputOperationOutputAlias, - crate::output::ResolveGroupJoinRequestOutput, - crate::error::ResolveGroupJoinRequestError, - crate::input::ResolveGroupJoinRequestInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.group_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_group_id(input); - self - } - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.identity_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_identity_id(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn resolution(mut self, input: bool) -> Self { - self.inner = self.inner.resolution(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_resolution(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_resolution(input); - self - } - } - /// Fluent builder constructing a request to `SearchGroups`. - /// - /// Fuzzy search for groups. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct SearchGroups { - handle: std::sync::Arc>, - inner: crate::input::search_groups_input::Builder, - } - impl SearchGroups - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `SearchGroups`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::SearchGroupsOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::SearchGroupsInputOperationOutputAlias, - crate::output::SearchGroupsOutput, - crate::error::SearchGroupsError, - crate::input::SearchGroupsInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// The query to match group display names against. - pub fn query(mut self, input: impl Into) -> Self { - self.inner = self.inner.query(input.into()); - self - } - /// The query to match group display names against. - pub fn set_query(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_query(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn anchor(mut self, input: impl Into) -> Self { - self.inner = self.inner.anchor(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_anchor(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_anchor(input); - self - } - /// Unsigned 32 bit integer. - pub fn limit(mut self, input: i32) -> Self { - self.inner = self.inner.limit(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_limit(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_limit(input); - self - } - } - /// Fluent builder constructing a request to `TransferGroupOwnership`. - /// - /// Transfers ownership of a group to another identity. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct TransferGroupOwnership { - handle: std::sync::Arc>, - inner: crate::input::transfer_group_ownership_input::Builder, - } - impl TransferGroupOwnership - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `TransferGroupOwnership`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::TransferGroupOwnershipOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::TransferGroupOwnershipInputOperationOutputAlias, - crate::output::TransferGroupOwnershipOutput, - crate::error::TransferGroupOwnershipError, - crate::input::TransferGroupOwnershipInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.group_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_group_id(input); - self - } - /// Idnetity to transfer the group to. Must be a member of the group. - pub fn new_owner_identity_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.new_owner_identity_id(input.into()); - self - } - /// Idnetity to transfer the group to. Must be a member of the group. - pub fn set_new_owner_identity_id( - mut self, - input: std::option::Option, - ) -> Self { - self.inner = self.inner.set_new_owner_identity_id(input); - self - } - } - /// Fluent builder constructing a request to `UnbanGroupIdentity`. - /// - /// Unbans an identity from a group. Must be the owner of the group to perform this action. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct UnbanGroupIdentity { - handle: std::sync::Arc>, - inner: crate::input::unban_group_identity_input::Builder, - } - impl UnbanGroupIdentity - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `UnbanGroupIdentity`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::UnbanGroupIdentityOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::UnbanGroupIdentityInputOperationOutputAlias, - crate::output::UnbanGroupIdentityOutput, - crate::error::UnbanGroupIdentityError, - crate::input::UnbanGroupIdentityInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.group_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_group_id(input); - self - } - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.identity_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_identity_id(input); - self - } - } - /// Fluent builder constructing a request to `UpdateGroupProfile`. - /// - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct UpdateGroupProfile { - handle: std::sync::Arc>, - inner: crate::input::update_group_profile_input::Builder, - } - impl UpdateGroupProfile - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `UpdateGroupProfile`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::UpdateGroupProfileOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::UpdateGroupProfileInputOperationOutputAlias, - crate::output::UpdateGroupProfileOutput, - crate::error::UpdateGroupProfileError, - crate::input::UpdateGroupProfileInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.group_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_group_id(input); - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.inner = self.inner.display_name(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_display_name(input); - self - } - /// Detailed information about a profile. - pub fn bio(mut self, input: impl Into) -> Self { - self.inner = self.inner.bio(input.into()); - self - } - /// Detailed information about a profile. - pub fn set_bio(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_bio(input); - self - } - /// The current publicity value for the given group. - pub fn publicity(mut self, input: crate::model::GroupPublicity) -> Self { - self.inner = self.inner.publicity(input); - self - } - /// The current publicity value for the given group. - pub fn set_publicity( - mut self, - input: std::option::Option, - ) -> Self { - self.inner = self.inner.set_publicity(input); - self - } - } - /// Fluent builder constructing a request to `ValidateGroupProfile`. - /// - /// Validate contents of group profile. Use to provide immediate feedback on profile changes before committing them. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct ValidateGroupProfile { - handle: std::sync::Arc>, - inner: crate::input::validate_group_profile_input::Builder, - } - impl ValidateGroupProfile - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `ValidateGroupProfile`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::ValidateGroupProfileOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::ValidateGroupProfileInputOperationOutputAlias, - crate::output::ValidateGroupProfileOutput, - crate::error::ValidateGroupProfileError, - crate::input::ValidateGroupProfileInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.inner = self.inner.display_name(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_display_name(input); - self - } - /// Detailed information about a profile. - pub fn bio(mut self, input: impl Into) -> Self { - self.inner = self.inner.bio(input.into()); - self - } - /// Detailed information about a profile. - pub fn set_bio(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_bio(input); - self - } - /// The current publicity value for the given group. - pub fn publicity(mut self, input: crate::model::GroupPublicity) -> Self { - self.inner = self.inner.publicity(input); - self - } - /// The current publicity value for the given group. - pub fn set_publicity( - mut self, - input: std::option::Option, - ) -> Self { - self.inner = self.inner.set_publicity(input); - self - } - } -} -/// A wrapper around [`Client`]. Helps reduce external imports. -pub struct ClientWrapper { - pub(crate) client: Client, -} - -impl std::ops::Deref for ClientWrapper { - type Target = Client; - - fn deref(&self) -> &Self::Target { - &self.client - } -} diff --git a/lib/smithy-output/api-group/rust/rust/src/config.rs b/lib/smithy-output/api-group/rust/rust/src/config.rs deleted file mode 100644 index d9ba6d687..000000000 --- a/lib/smithy-output/api-group/rust/rust/src/config.rs +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Service config. -/// -pub struct Config { - pub(crate) auth: Option, - pub(crate) uri: String, -} -impl std::fmt::Debug for Config { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut config = f.debug_struct("Config"); - config.finish() - } -} -impl Config { - /// Constructs a config builder. - pub fn builder() -> Builder { - Builder::default() - } -} -/// Builder for creating a `Config`. -#[derive(Default)] -pub struct Builder { - pub(crate) auth: Option, - pub(crate) uri: Option, -} -impl Builder { - /// Constructs a config builder. - pub fn new() -> Self { - Self::default() - } - /// Sets the bearer token to be used with the Smithy client. - pub fn set_bearer_token(mut self, bearer_token: impl std::fmt::Display) -> Self { - self.auth = Some(format!("Bearer {}", bearer_token)); - self - } - /// Sets the base URI to be used with the Smithy client. - pub fn set_uri(mut self, uri: impl ToString) -> Self { - self.uri = Some(uri.to_string()); - self - } - /// Builds a [`Config`]. - pub fn build(self) -> Config { - Config { - auth: self - .auth - .or_else(|| std::env::var("RIVET_LOBBY_TOKEN").ok()) - .or_else(|| std::env::var("RIVET_CLIENT_TOKEN").ok()), - uri: self - .uri - .or_else(|| std::env::var("RIVET_GROUP_API_URL").ok()) - .unwrap_or_else(|| "https://group.api.rivet.gg/v1".to_string()), - } - } - /// Builds a default [`Client`] from the given config. - pub fn build_client(self) -> crate::client::ClientWrapper { - let raw_client = aws_smithy_client::Builder::dyn_https() - .middleware(tower::layer::util::Identity::new()) - .sleep_impl(None) - .build(); - crate::client::ClientWrapper { - client: crate::Client::with_config(raw_client, self.build()), - } - } -} diff --git a/lib/smithy-output/api-group/rust/rust/src/error.rs b/lib/smithy-output/api-group/rust/rust/src/error.rs deleted file mode 100644 index 9324e46f1..000000000 --- a/lib/smithy-output/api-group/rust/rust/src/error.rs +++ /dev/null @@ -1,3894 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Error type for the `BanGroupIdentity` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct BanGroupIdentityError { - /// Kind of error that occurred. - pub kind: BanGroupIdentityErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `BanGroupIdentity` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum BanGroupIdentityErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for BanGroupIdentityError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - BanGroupIdentityErrorKind::InternalError(_inner) => _inner.fmt(f), - BanGroupIdentityErrorKind::RateLimitError(_inner) => _inner.fmt(f), - BanGroupIdentityErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - BanGroupIdentityErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - BanGroupIdentityErrorKind::NotFoundError(_inner) => _inner.fmt(f), - BanGroupIdentityErrorKind::BadRequestError(_inner) => _inner.fmt(f), - BanGroupIdentityErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for BanGroupIdentityError { - fn code(&self) -> Option<&str> { - BanGroupIdentityError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - BanGroupIdentityErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - BanGroupIdentityErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl BanGroupIdentityError { - /// Creates a new `BanGroupIdentityError`. - pub fn new(kind: BanGroupIdentityErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `BanGroupIdentityError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: BanGroupIdentityErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `BanGroupIdentityError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: BanGroupIdentityErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `BanGroupIdentityErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, BanGroupIdentityErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `BanGroupIdentityErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, BanGroupIdentityErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `BanGroupIdentityErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, BanGroupIdentityErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `BanGroupIdentityErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, BanGroupIdentityErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `BanGroupIdentityErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, BanGroupIdentityErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `BanGroupIdentityErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, BanGroupIdentityErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for BanGroupIdentityError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - BanGroupIdentityErrorKind::InternalError(_inner) => Some(_inner), - BanGroupIdentityErrorKind::RateLimitError(_inner) => Some(_inner), - BanGroupIdentityErrorKind::ForbiddenError(_inner) => Some(_inner), - BanGroupIdentityErrorKind::UnauthorizedError(_inner) => Some(_inner), - BanGroupIdentityErrorKind::NotFoundError(_inner) => Some(_inner), - BanGroupIdentityErrorKind::BadRequestError(_inner) => Some(_inner), - BanGroupIdentityErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `CompleteGroupAvatarUpload` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct CompleteGroupAvatarUploadError { - /// Kind of error that occurred. - pub kind: CompleteGroupAvatarUploadErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `CompleteGroupAvatarUpload` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum CompleteGroupAvatarUploadErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for CompleteGroupAvatarUploadError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - CompleteGroupAvatarUploadErrorKind::InternalError(_inner) => _inner.fmt(f), - CompleteGroupAvatarUploadErrorKind::RateLimitError(_inner) => _inner.fmt(f), - CompleteGroupAvatarUploadErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - CompleteGroupAvatarUploadErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - CompleteGroupAvatarUploadErrorKind::NotFoundError(_inner) => _inner.fmt(f), - CompleteGroupAvatarUploadErrorKind::BadRequestError(_inner) => _inner.fmt(f), - CompleteGroupAvatarUploadErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for CompleteGroupAvatarUploadError { - fn code(&self) -> Option<&str> { - CompleteGroupAvatarUploadError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - CompleteGroupAvatarUploadErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - CompleteGroupAvatarUploadErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl CompleteGroupAvatarUploadError { - /// Creates a new `CompleteGroupAvatarUploadError`. - pub fn new(kind: CompleteGroupAvatarUploadErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `CompleteGroupAvatarUploadError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: CompleteGroupAvatarUploadErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `CompleteGroupAvatarUploadError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: CompleteGroupAvatarUploadErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `CompleteGroupAvatarUploadErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!( - &self.kind, - CompleteGroupAvatarUploadErrorKind::InternalError(_) - ) - } - /// Returns `true` if the error kind is `CompleteGroupAvatarUploadErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - CompleteGroupAvatarUploadErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `CompleteGroupAvatarUploadErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - CompleteGroupAvatarUploadErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `CompleteGroupAvatarUploadErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - CompleteGroupAvatarUploadErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `CompleteGroupAvatarUploadErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!( - &self.kind, - CompleteGroupAvatarUploadErrorKind::NotFoundError(_) - ) - } - /// Returns `true` if the error kind is `CompleteGroupAvatarUploadErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - CompleteGroupAvatarUploadErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for CompleteGroupAvatarUploadError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - CompleteGroupAvatarUploadErrorKind::InternalError(_inner) => Some(_inner), - CompleteGroupAvatarUploadErrorKind::RateLimitError(_inner) => Some(_inner), - CompleteGroupAvatarUploadErrorKind::ForbiddenError(_inner) => Some(_inner), - CompleteGroupAvatarUploadErrorKind::UnauthorizedError(_inner) => Some(_inner), - CompleteGroupAvatarUploadErrorKind::NotFoundError(_inner) => Some(_inner), - CompleteGroupAvatarUploadErrorKind::BadRequestError(_inner) => Some(_inner), - CompleteGroupAvatarUploadErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `ConsumeGroupInvite` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct ConsumeGroupInviteError { - /// Kind of error that occurred. - pub kind: ConsumeGroupInviteErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `ConsumeGroupInvite` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum ConsumeGroupInviteErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for ConsumeGroupInviteError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - ConsumeGroupInviteErrorKind::InternalError(_inner) => _inner.fmt(f), - ConsumeGroupInviteErrorKind::RateLimitError(_inner) => _inner.fmt(f), - ConsumeGroupInviteErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - ConsumeGroupInviteErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - ConsumeGroupInviteErrorKind::NotFoundError(_inner) => _inner.fmt(f), - ConsumeGroupInviteErrorKind::BadRequestError(_inner) => _inner.fmt(f), - ConsumeGroupInviteErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for ConsumeGroupInviteError { - fn code(&self) -> Option<&str> { - ConsumeGroupInviteError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - ConsumeGroupInviteErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - ConsumeGroupInviteErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl ConsumeGroupInviteError { - /// Creates a new `ConsumeGroupInviteError`. - pub fn new(kind: ConsumeGroupInviteErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `ConsumeGroupInviteError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: ConsumeGroupInviteErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `ConsumeGroupInviteError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: ConsumeGroupInviteErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `ConsumeGroupInviteErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, ConsumeGroupInviteErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `ConsumeGroupInviteErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, ConsumeGroupInviteErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `ConsumeGroupInviteErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, ConsumeGroupInviteErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `ConsumeGroupInviteErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - ConsumeGroupInviteErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `ConsumeGroupInviteErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, ConsumeGroupInviteErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `ConsumeGroupInviteErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, ConsumeGroupInviteErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for ConsumeGroupInviteError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - ConsumeGroupInviteErrorKind::InternalError(_inner) => Some(_inner), - ConsumeGroupInviteErrorKind::RateLimitError(_inner) => Some(_inner), - ConsumeGroupInviteErrorKind::ForbiddenError(_inner) => Some(_inner), - ConsumeGroupInviteErrorKind::UnauthorizedError(_inner) => Some(_inner), - ConsumeGroupInviteErrorKind::NotFoundError(_inner) => Some(_inner), - ConsumeGroupInviteErrorKind::BadRequestError(_inner) => Some(_inner), - ConsumeGroupInviteErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `CreateGroup` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct CreateGroupError { - /// Kind of error that occurred. - pub kind: CreateGroupErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `CreateGroup` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum CreateGroupErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for CreateGroupError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - CreateGroupErrorKind::InternalError(_inner) => _inner.fmt(f), - CreateGroupErrorKind::RateLimitError(_inner) => _inner.fmt(f), - CreateGroupErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - CreateGroupErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - CreateGroupErrorKind::NotFoundError(_inner) => _inner.fmt(f), - CreateGroupErrorKind::BadRequestError(_inner) => _inner.fmt(f), - CreateGroupErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for CreateGroupError { - fn code(&self) -> Option<&str> { - CreateGroupError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - CreateGroupErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - CreateGroupErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl CreateGroupError { - /// Creates a new `CreateGroupError`. - pub fn new(kind: CreateGroupErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `CreateGroupError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: CreateGroupErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `CreateGroupError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: CreateGroupErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `CreateGroupErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, CreateGroupErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `CreateGroupErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, CreateGroupErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `CreateGroupErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, CreateGroupErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `CreateGroupErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, CreateGroupErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `CreateGroupErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, CreateGroupErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `CreateGroupErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, CreateGroupErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for CreateGroupError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - CreateGroupErrorKind::InternalError(_inner) => Some(_inner), - CreateGroupErrorKind::RateLimitError(_inner) => Some(_inner), - CreateGroupErrorKind::ForbiddenError(_inner) => Some(_inner), - CreateGroupErrorKind::UnauthorizedError(_inner) => Some(_inner), - CreateGroupErrorKind::NotFoundError(_inner) => Some(_inner), - CreateGroupErrorKind::BadRequestError(_inner) => Some(_inner), - CreateGroupErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `CreateGroupInvite` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct CreateGroupInviteError { - /// Kind of error that occurred. - pub kind: CreateGroupInviteErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `CreateGroupInvite` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum CreateGroupInviteErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for CreateGroupInviteError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - CreateGroupInviteErrorKind::InternalError(_inner) => _inner.fmt(f), - CreateGroupInviteErrorKind::RateLimitError(_inner) => _inner.fmt(f), - CreateGroupInviteErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - CreateGroupInviteErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - CreateGroupInviteErrorKind::NotFoundError(_inner) => _inner.fmt(f), - CreateGroupInviteErrorKind::BadRequestError(_inner) => _inner.fmt(f), - CreateGroupInviteErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for CreateGroupInviteError { - fn code(&self) -> Option<&str> { - CreateGroupInviteError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - CreateGroupInviteErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - CreateGroupInviteErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl CreateGroupInviteError { - /// Creates a new `CreateGroupInviteError`. - pub fn new(kind: CreateGroupInviteErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `CreateGroupInviteError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: CreateGroupInviteErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `CreateGroupInviteError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: CreateGroupInviteErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `CreateGroupInviteErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, CreateGroupInviteErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `CreateGroupInviteErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, CreateGroupInviteErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `CreateGroupInviteErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, CreateGroupInviteErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `CreateGroupInviteErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, CreateGroupInviteErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `CreateGroupInviteErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, CreateGroupInviteErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `CreateGroupInviteErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, CreateGroupInviteErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for CreateGroupInviteError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - CreateGroupInviteErrorKind::InternalError(_inner) => Some(_inner), - CreateGroupInviteErrorKind::RateLimitError(_inner) => Some(_inner), - CreateGroupInviteErrorKind::ForbiddenError(_inner) => Some(_inner), - CreateGroupInviteErrorKind::UnauthorizedError(_inner) => Some(_inner), - CreateGroupInviteErrorKind::NotFoundError(_inner) => Some(_inner), - CreateGroupInviteErrorKind::BadRequestError(_inner) => Some(_inner), - CreateGroupInviteErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `CreateGroupJoinRequest` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct CreateGroupJoinRequestError { - /// Kind of error that occurred. - pub kind: CreateGroupJoinRequestErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `CreateGroupJoinRequest` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum CreateGroupJoinRequestErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for CreateGroupJoinRequestError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - CreateGroupJoinRequestErrorKind::InternalError(_inner) => _inner.fmt(f), - CreateGroupJoinRequestErrorKind::RateLimitError(_inner) => _inner.fmt(f), - CreateGroupJoinRequestErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - CreateGroupJoinRequestErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - CreateGroupJoinRequestErrorKind::NotFoundError(_inner) => _inner.fmt(f), - CreateGroupJoinRequestErrorKind::BadRequestError(_inner) => _inner.fmt(f), - CreateGroupJoinRequestErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for CreateGroupJoinRequestError { - fn code(&self) -> Option<&str> { - CreateGroupJoinRequestError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - CreateGroupJoinRequestErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - CreateGroupJoinRequestErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl CreateGroupJoinRequestError { - /// Creates a new `CreateGroupJoinRequestError`. - pub fn new(kind: CreateGroupJoinRequestErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `CreateGroupJoinRequestError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: CreateGroupJoinRequestErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `CreateGroupJoinRequestError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: CreateGroupJoinRequestErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `CreateGroupJoinRequestErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!( - &self.kind, - CreateGroupJoinRequestErrorKind::InternalError(_) - ) - } - /// Returns `true` if the error kind is `CreateGroupJoinRequestErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - CreateGroupJoinRequestErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `CreateGroupJoinRequestErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - CreateGroupJoinRequestErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `CreateGroupJoinRequestErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - CreateGroupJoinRequestErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `CreateGroupJoinRequestErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!( - &self.kind, - CreateGroupJoinRequestErrorKind::NotFoundError(_) - ) - } - /// Returns `true` if the error kind is `CreateGroupJoinRequestErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - CreateGroupJoinRequestErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for CreateGroupJoinRequestError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - CreateGroupJoinRequestErrorKind::InternalError(_inner) => Some(_inner), - CreateGroupJoinRequestErrorKind::RateLimitError(_inner) => Some(_inner), - CreateGroupJoinRequestErrorKind::ForbiddenError(_inner) => Some(_inner), - CreateGroupJoinRequestErrorKind::UnauthorizedError(_inner) => Some(_inner), - CreateGroupJoinRequestErrorKind::NotFoundError(_inner) => Some(_inner), - CreateGroupJoinRequestErrorKind::BadRequestError(_inner) => Some(_inner), - CreateGroupJoinRequestErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `GetGroupBans` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GetGroupBansError { - /// Kind of error that occurred. - pub kind: GetGroupBansErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GetGroupBans` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GetGroupBansErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GetGroupBansError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GetGroupBansErrorKind::InternalError(_inner) => _inner.fmt(f), - GetGroupBansErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GetGroupBansErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GetGroupBansErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GetGroupBansErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GetGroupBansErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GetGroupBansErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GetGroupBansError { - fn code(&self) -> Option<&str> { - GetGroupBansError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GetGroupBansErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - GetGroupBansErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl GetGroupBansError { - /// Creates a new `GetGroupBansError`. - pub fn new(kind: GetGroupBansErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GetGroupBansError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GetGroupBansErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GetGroupBansError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GetGroupBansErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GetGroupBansErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, GetGroupBansErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `GetGroupBansErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, GetGroupBansErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `GetGroupBansErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, GetGroupBansErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `GetGroupBansErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, GetGroupBansErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `GetGroupBansErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, GetGroupBansErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `GetGroupBansErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, GetGroupBansErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for GetGroupBansError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GetGroupBansErrorKind::InternalError(_inner) => Some(_inner), - GetGroupBansErrorKind::RateLimitError(_inner) => Some(_inner), - GetGroupBansErrorKind::ForbiddenError(_inner) => Some(_inner), - GetGroupBansErrorKind::UnauthorizedError(_inner) => Some(_inner), - GetGroupBansErrorKind::NotFoundError(_inner) => Some(_inner), - GetGroupBansErrorKind::BadRequestError(_inner) => Some(_inner), - GetGroupBansErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `GetGroupInvite` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GetGroupInviteError { - /// Kind of error that occurred. - pub kind: GetGroupInviteErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GetGroupInvite` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GetGroupInviteErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GetGroupInviteError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GetGroupInviteErrorKind::InternalError(_inner) => _inner.fmt(f), - GetGroupInviteErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GetGroupInviteErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GetGroupInviteErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GetGroupInviteErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GetGroupInviteErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GetGroupInviteErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GetGroupInviteError { - fn code(&self) -> Option<&str> { - GetGroupInviteError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GetGroupInviteErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - GetGroupInviteErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl GetGroupInviteError { - /// Creates a new `GetGroupInviteError`. - pub fn new(kind: GetGroupInviteErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GetGroupInviteError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GetGroupInviteErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GetGroupInviteError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GetGroupInviteErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GetGroupInviteErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, GetGroupInviteErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `GetGroupInviteErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, GetGroupInviteErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `GetGroupInviteErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, GetGroupInviteErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `GetGroupInviteErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, GetGroupInviteErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `GetGroupInviteErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, GetGroupInviteErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `GetGroupInviteErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, GetGroupInviteErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for GetGroupInviteError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GetGroupInviteErrorKind::InternalError(_inner) => Some(_inner), - GetGroupInviteErrorKind::RateLimitError(_inner) => Some(_inner), - GetGroupInviteErrorKind::ForbiddenError(_inner) => Some(_inner), - GetGroupInviteErrorKind::UnauthorizedError(_inner) => Some(_inner), - GetGroupInviteErrorKind::NotFoundError(_inner) => Some(_inner), - GetGroupInviteErrorKind::BadRequestError(_inner) => Some(_inner), - GetGroupInviteErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `GetGroupJoinRequests` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GetGroupJoinRequestsError { - /// Kind of error that occurred. - pub kind: GetGroupJoinRequestsErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GetGroupJoinRequests` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GetGroupJoinRequestsErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GetGroupJoinRequestsError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GetGroupJoinRequestsErrorKind::InternalError(_inner) => _inner.fmt(f), - GetGroupJoinRequestsErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GetGroupJoinRequestsErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GetGroupJoinRequestsErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GetGroupJoinRequestsErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GetGroupJoinRequestsErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GetGroupJoinRequestsErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GetGroupJoinRequestsError { - fn code(&self) -> Option<&str> { - GetGroupJoinRequestsError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GetGroupJoinRequestsErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - GetGroupJoinRequestsErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl GetGroupJoinRequestsError { - /// Creates a new `GetGroupJoinRequestsError`. - pub fn new(kind: GetGroupJoinRequestsErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GetGroupJoinRequestsError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GetGroupJoinRequestsErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GetGroupJoinRequestsError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GetGroupJoinRequestsErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GetGroupJoinRequestsErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, GetGroupJoinRequestsErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `GetGroupJoinRequestsErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, GetGroupJoinRequestsErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `GetGroupJoinRequestsErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, GetGroupJoinRequestsErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `GetGroupJoinRequestsErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - GetGroupJoinRequestsErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `GetGroupJoinRequestsErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, GetGroupJoinRequestsErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `GetGroupJoinRequestsErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - GetGroupJoinRequestsErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for GetGroupJoinRequestsError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GetGroupJoinRequestsErrorKind::InternalError(_inner) => Some(_inner), - GetGroupJoinRequestsErrorKind::RateLimitError(_inner) => Some(_inner), - GetGroupJoinRequestsErrorKind::ForbiddenError(_inner) => Some(_inner), - GetGroupJoinRequestsErrorKind::UnauthorizedError(_inner) => Some(_inner), - GetGroupJoinRequestsErrorKind::NotFoundError(_inner) => Some(_inner), - GetGroupJoinRequestsErrorKind::BadRequestError(_inner) => Some(_inner), - GetGroupJoinRequestsErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `GetGroupMembers` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GetGroupMembersError { - /// Kind of error that occurred. - pub kind: GetGroupMembersErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GetGroupMembers` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GetGroupMembersErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GetGroupMembersError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GetGroupMembersErrorKind::InternalError(_inner) => _inner.fmt(f), - GetGroupMembersErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GetGroupMembersErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GetGroupMembersErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GetGroupMembersErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GetGroupMembersErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GetGroupMembersErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GetGroupMembersError { - fn code(&self) -> Option<&str> { - GetGroupMembersError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GetGroupMembersErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - GetGroupMembersErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl GetGroupMembersError { - /// Creates a new `GetGroupMembersError`. - pub fn new(kind: GetGroupMembersErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GetGroupMembersError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GetGroupMembersErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GetGroupMembersError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GetGroupMembersErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GetGroupMembersErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, GetGroupMembersErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `GetGroupMembersErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, GetGroupMembersErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `GetGroupMembersErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, GetGroupMembersErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `GetGroupMembersErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, GetGroupMembersErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `GetGroupMembersErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, GetGroupMembersErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `GetGroupMembersErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, GetGroupMembersErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for GetGroupMembersError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GetGroupMembersErrorKind::InternalError(_inner) => Some(_inner), - GetGroupMembersErrorKind::RateLimitError(_inner) => Some(_inner), - GetGroupMembersErrorKind::ForbiddenError(_inner) => Some(_inner), - GetGroupMembersErrorKind::UnauthorizedError(_inner) => Some(_inner), - GetGroupMembersErrorKind::NotFoundError(_inner) => Some(_inner), - GetGroupMembersErrorKind::BadRequestError(_inner) => Some(_inner), - GetGroupMembersErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `GetGroupProfile` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GetGroupProfileError { - /// Kind of error that occurred. - pub kind: GetGroupProfileErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GetGroupProfile` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GetGroupProfileErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GetGroupProfileError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GetGroupProfileErrorKind::InternalError(_inner) => _inner.fmt(f), - GetGroupProfileErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GetGroupProfileErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GetGroupProfileErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GetGroupProfileErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GetGroupProfileErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GetGroupProfileErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GetGroupProfileError { - fn code(&self) -> Option<&str> { - GetGroupProfileError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GetGroupProfileErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - GetGroupProfileErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl GetGroupProfileError { - /// Creates a new `GetGroupProfileError`. - pub fn new(kind: GetGroupProfileErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GetGroupProfileError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GetGroupProfileErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GetGroupProfileError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GetGroupProfileErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GetGroupProfileErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, GetGroupProfileErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `GetGroupProfileErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, GetGroupProfileErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `GetGroupProfileErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, GetGroupProfileErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `GetGroupProfileErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, GetGroupProfileErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `GetGroupProfileErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, GetGroupProfileErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `GetGroupProfileErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, GetGroupProfileErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for GetGroupProfileError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GetGroupProfileErrorKind::InternalError(_inner) => Some(_inner), - GetGroupProfileErrorKind::RateLimitError(_inner) => Some(_inner), - GetGroupProfileErrorKind::ForbiddenError(_inner) => Some(_inner), - GetGroupProfileErrorKind::UnauthorizedError(_inner) => Some(_inner), - GetGroupProfileErrorKind::NotFoundError(_inner) => Some(_inner), - GetGroupProfileErrorKind::BadRequestError(_inner) => Some(_inner), - GetGroupProfileErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `GetGroupSummary` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GetGroupSummaryError { - /// Kind of error that occurred. - pub kind: GetGroupSummaryErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GetGroupSummary` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GetGroupSummaryErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GetGroupSummaryError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GetGroupSummaryErrorKind::InternalError(_inner) => _inner.fmt(f), - GetGroupSummaryErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GetGroupSummaryErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GetGroupSummaryErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GetGroupSummaryErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GetGroupSummaryErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GetGroupSummaryErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GetGroupSummaryError { - fn code(&self) -> Option<&str> { - GetGroupSummaryError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GetGroupSummaryErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - GetGroupSummaryErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl GetGroupSummaryError { - /// Creates a new `GetGroupSummaryError`. - pub fn new(kind: GetGroupSummaryErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GetGroupSummaryError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GetGroupSummaryErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GetGroupSummaryError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GetGroupSummaryErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GetGroupSummaryErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, GetGroupSummaryErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `GetGroupSummaryErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, GetGroupSummaryErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `GetGroupSummaryErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, GetGroupSummaryErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `GetGroupSummaryErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, GetGroupSummaryErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `GetGroupSummaryErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, GetGroupSummaryErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `GetGroupSummaryErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, GetGroupSummaryErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for GetGroupSummaryError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GetGroupSummaryErrorKind::InternalError(_inner) => Some(_inner), - GetGroupSummaryErrorKind::RateLimitError(_inner) => Some(_inner), - GetGroupSummaryErrorKind::ForbiddenError(_inner) => Some(_inner), - GetGroupSummaryErrorKind::UnauthorizedError(_inner) => Some(_inner), - GetGroupSummaryErrorKind::NotFoundError(_inner) => Some(_inner), - GetGroupSummaryErrorKind::BadRequestError(_inner) => Some(_inner), - GetGroupSummaryErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `KickGroupMember` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct KickGroupMemberError { - /// Kind of error that occurred. - pub kind: KickGroupMemberErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `KickGroupMember` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum KickGroupMemberErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for KickGroupMemberError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - KickGroupMemberErrorKind::InternalError(_inner) => _inner.fmt(f), - KickGroupMemberErrorKind::RateLimitError(_inner) => _inner.fmt(f), - KickGroupMemberErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - KickGroupMemberErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - KickGroupMemberErrorKind::NotFoundError(_inner) => _inner.fmt(f), - KickGroupMemberErrorKind::BadRequestError(_inner) => _inner.fmt(f), - KickGroupMemberErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for KickGroupMemberError { - fn code(&self) -> Option<&str> { - KickGroupMemberError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - KickGroupMemberErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - KickGroupMemberErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl KickGroupMemberError { - /// Creates a new `KickGroupMemberError`. - pub fn new(kind: KickGroupMemberErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `KickGroupMemberError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: KickGroupMemberErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `KickGroupMemberError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: KickGroupMemberErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `KickGroupMemberErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, KickGroupMemberErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `KickGroupMemberErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, KickGroupMemberErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `KickGroupMemberErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, KickGroupMemberErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `KickGroupMemberErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, KickGroupMemberErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `KickGroupMemberErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, KickGroupMemberErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `KickGroupMemberErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, KickGroupMemberErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for KickGroupMemberError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - KickGroupMemberErrorKind::InternalError(_inner) => Some(_inner), - KickGroupMemberErrorKind::RateLimitError(_inner) => Some(_inner), - KickGroupMemberErrorKind::ForbiddenError(_inner) => Some(_inner), - KickGroupMemberErrorKind::UnauthorizedError(_inner) => Some(_inner), - KickGroupMemberErrorKind::NotFoundError(_inner) => Some(_inner), - KickGroupMemberErrorKind::BadRequestError(_inner) => Some(_inner), - KickGroupMemberErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `LeaveGroup` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct LeaveGroupError { - /// Kind of error that occurred. - pub kind: LeaveGroupErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `LeaveGroup` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum LeaveGroupErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for LeaveGroupError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - LeaveGroupErrorKind::InternalError(_inner) => _inner.fmt(f), - LeaveGroupErrorKind::RateLimitError(_inner) => _inner.fmt(f), - LeaveGroupErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - LeaveGroupErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - LeaveGroupErrorKind::NotFoundError(_inner) => _inner.fmt(f), - LeaveGroupErrorKind::BadRequestError(_inner) => _inner.fmt(f), - LeaveGroupErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for LeaveGroupError { - fn code(&self) -> Option<&str> { - LeaveGroupError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - LeaveGroupErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - LeaveGroupErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl LeaveGroupError { - /// Creates a new `LeaveGroupError`. - pub fn new(kind: LeaveGroupErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `LeaveGroupError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: LeaveGroupErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `LeaveGroupError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: LeaveGroupErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `LeaveGroupErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, LeaveGroupErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `LeaveGroupErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, LeaveGroupErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `LeaveGroupErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, LeaveGroupErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `LeaveGroupErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, LeaveGroupErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `LeaveGroupErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, LeaveGroupErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `LeaveGroupErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, LeaveGroupErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for LeaveGroupError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - LeaveGroupErrorKind::InternalError(_inner) => Some(_inner), - LeaveGroupErrorKind::RateLimitError(_inner) => Some(_inner), - LeaveGroupErrorKind::ForbiddenError(_inner) => Some(_inner), - LeaveGroupErrorKind::UnauthorizedError(_inner) => Some(_inner), - LeaveGroupErrorKind::NotFoundError(_inner) => Some(_inner), - LeaveGroupErrorKind::BadRequestError(_inner) => Some(_inner), - LeaveGroupErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `ListSuggestedGroups` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct ListSuggestedGroupsError { - /// Kind of error that occurred. - pub kind: ListSuggestedGroupsErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `ListSuggestedGroups` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum ListSuggestedGroupsErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for ListSuggestedGroupsError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - ListSuggestedGroupsErrorKind::InternalError(_inner) => _inner.fmt(f), - ListSuggestedGroupsErrorKind::RateLimitError(_inner) => _inner.fmt(f), - ListSuggestedGroupsErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - ListSuggestedGroupsErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - ListSuggestedGroupsErrorKind::NotFoundError(_inner) => _inner.fmt(f), - ListSuggestedGroupsErrorKind::BadRequestError(_inner) => _inner.fmt(f), - ListSuggestedGroupsErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for ListSuggestedGroupsError { - fn code(&self) -> Option<&str> { - ListSuggestedGroupsError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - ListSuggestedGroupsErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - ListSuggestedGroupsErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl ListSuggestedGroupsError { - /// Creates a new `ListSuggestedGroupsError`. - pub fn new(kind: ListSuggestedGroupsErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `ListSuggestedGroupsError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: ListSuggestedGroupsErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `ListSuggestedGroupsError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: ListSuggestedGroupsErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `ListSuggestedGroupsErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, ListSuggestedGroupsErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `ListSuggestedGroupsErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, ListSuggestedGroupsErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `ListSuggestedGroupsErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, ListSuggestedGroupsErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `ListSuggestedGroupsErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - ListSuggestedGroupsErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `ListSuggestedGroupsErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, ListSuggestedGroupsErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `ListSuggestedGroupsErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, ListSuggestedGroupsErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for ListSuggestedGroupsError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - ListSuggestedGroupsErrorKind::InternalError(_inner) => Some(_inner), - ListSuggestedGroupsErrorKind::RateLimitError(_inner) => Some(_inner), - ListSuggestedGroupsErrorKind::ForbiddenError(_inner) => Some(_inner), - ListSuggestedGroupsErrorKind::UnauthorizedError(_inner) => Some(_inner), - ListSuggestedGroupsErrorKind::NotFoundError(_inner) => Some(_inner), - ListSuggestedGroupsErrorKind::BadRequestError(_inner) => Some(_inner), - ListSuggestedGroupsErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `PrepareGroupAvatarUpload` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct PrepareGroupAvatarUploadError { - /// Kind of error that occurred. - pub kind: PrepareGroupAvatarUploadErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `PrepareGroupAvatarUpload` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum PrepareGroupAvatarUploadErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for PrepareGroupAvatarUploadError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - PrepareGroupAvatarUploadErrorKind::InternalError(_inner) => _inner.fmt(f), - PrepareGroupAvatarUploadErrorKind::RateLimitError(_inner) => _inner.fmt(f), - PrepareGroupAvatarUploadErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - PrepareGroupAvatarUploadErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - PrepareGroupAvatarUploadErrorKind::NotFoundError(_inner) => _inner.fmt(f), - PrepareGroupAvatarUploadErrorKind::BadRequestError(_inner) => _inner.fmt(f), - PrepareGroupAvatarUploadErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for PrepareGroupAvatarUploadError { - fn code(&self) -> Option<&str> { - PrepareGroupAvatarUploadError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - PrepareGroupAvatarUploadErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - PrepareGroupAvatarUploadErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl PrepareGroupAvatarUploadError { - /// Creates a new `PrepareGroupAvatarUploadError`. - pub fn new(kind: PrepareGroupAvatarUploadErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `PrepareGroupAvatarUploadError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: PrepareGroupAvatarUploadErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `PrepareGroupAvatarUploadError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: PrepareGroupAvatarUploadErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `PrepareGroupAvatarUploadErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!( - &self.kind, - PrepareGroupAvatarUploadErrorKind::InternalError(_) - ) - } - /// Returns `true` if the error kind is `PrepareGroupAvatarUploadErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - PrepareGroupAvatarUploadErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `PrepareGroupAvatarUploadErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - PrepareGroupAvatarUploadErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `PrepareGroupAvatarUploadErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - PrepareGroupAvatarUploadErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `PrepareGroupAvatarUploadErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!( - &self.kind, - PrepareGroupAvatarUploadErrorKind::NotFoundError(_) - ) - } - /// Returns `true` if the error kind is `PrepareGroupAvatarUploadErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - PrepareGroupAvatarUploadErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for PrepareGroupAvatarUploadError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - PrepareGroupAvatarUploadErrorKind::InternalError(_inner) => Some(_inner), - PrepareGroupAvatarUploadErrorKind::RateLimitError(_inner) => Some(_inner), - PrepareGroupAvatarUploadErrorKind::ForbiddenError(_inner) => Some(_inner), - PrepareGroupAvatarUploadErrorKind::UnauthorizedError(_inner) => Some(_inner), - PrepareGroupAvatarUploadErrorKind::NotFoundError(_inner) => Some(_inner), - PrepareGroupAvatarUploadErrorKind::BadRequestError(_inner) => Some(_inner), - PrepareGroupAvatarUploadErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `ResolveGroupJoinRequest` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct ResolveGroupJoinRequestError { - /// Kind of error that occurred. - pub kind: ResolveGroupJoinRequestErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `ResolveGroupJoinRequest` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum ResolveGroupJoinRequestErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for ResolveGroupJoinRequestError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - ResolveGroupJoinRequestErrorKind::InternalError(_inner) => _inner.fmt(f), - ResolveGroupJoinRequestErrorKind::RateLimitError(_inner) => _inner.fmt(f), - ResolveGroupJoinRequestErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - ResolveGroupJoinRequestErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - ResolveGroupJoinRequestErrorKind::NotFoundError(_inner) => _inner.fmt(f), - ResolveGroupJoinRequestErrorKind::BadRequestError(_inner) => _inner.fmt(f), - ResolveGroupJoinRequestErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for ResolveGroupJoinRequestError { - fn code(&self) -> Option<&str> { - ResolveGroupJoinRequestError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - ResolveGroupJoinRequestErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - ResolveGroupJoinRequestErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl ResolveGroupJoinRequestError { - /// Creates a new `ResolveGroupJoinRequestError`. - pub fn new(kind: ResolveGroupJoinRequestErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `ResolveGroupJoinRequestError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: ResolveGroupJoinRequestErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `ResolveGroupJoinRequestError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: ResolveGroupJoinRequestErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `ResolveGroupJoinRequestErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!( - &self.kind, - ResolveGroupJoinRequestErrorKind::InternalError(_) - ) - } - /// Returns `true` if the error kind is `ResolveGroupJoinRequestErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - ResolveGroupJoinRequestErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `ResolveGroupJoinRequestErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - ResolveGroupJoinRequestErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `ResolveGroupJoinRequestErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - ResolveGroupJoinRequestErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `ResolveGroupJoinRequestErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!( - &self.kind, - ResolveGroupJoinRequestErrorKind::NotFoundError(_) - ) - } - /// Returns `true` if the error kind is `ResolveGroupJoinRequestErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - ResolveGroupJoinRequestErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for ResolveGroupJoinRequestError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - ResolveGroupJoinRequestErrorKind::InternalError(_inner) => Some(_inner), - ResolveGroupJoinRequestErrorKind::RateLimitError(_inner) => Some(_inner), - ResolveGroupJoinRequestErrorKind::ForbiddenError(_inner) => Some(_inner), - ResolveGroupJoinRequestErrorKind::UnauthorizedError(_inner) => Some(_inner), - ResolveGroupJoinRequestErrorKind::NotFoundError(_inner) => Some(_inner), - ResolveGroupJoinRequestErrorKind::BadRequestError(_inner) => Some(_inner), - ResolveGroupJoinRequestErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `SearchGroups` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct SearchGroupsError { - /// Kind of error that occurred. - pub kind: SearchGroupsErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `SearchGroups` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum SearchGroupsErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for SearchGroupsError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - SearchGroupsErrorKind::InternalError(_inner) => _inner.fmt(f), - SearchGroupsErrorKind::RateLimitError(_inner) => _inner.fmt(f), - SearchGroupsErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - SearchGroupsErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - SearchGroupsErrorKind::NotFoundError(_inner) => _inner.fmt(f), - SearchGroupsErrorKind::BadRequestError(_inner) => _inner.fmt(f), - SearchGroupsErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for SearchGroupsError { - fn code(&self) -> Option<&str> { - SearchGroupsError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - SearchGroupsErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - SearchGroupsErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl SearchGroupsError { - /// Creates a new `SearchGroupsError`. - pub fn new(kind: SearchGroupsErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `SearchGroupsError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: SearchGroupsErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `SearchGroupsError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: SearchGroupsErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `SearchGroupsErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, SearchGroupsErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `SearchGroupsErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, SearchGroupsErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `SearchGroupsErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, SearchGroupsErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `SearchGroupsErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, SearchGroupsErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `SearchGroupsErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, SearchGroupsErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `SearchGroupsErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, SearchGroupsErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for SearchGroupsError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - SearchGroupsErrorKind::InternalError(_inner) => Some(_inner), - SearchGroupsErrorKind::RateLimitError(_inner) => Some(_inner), - SearchGroupsErrorKind::ForbiddenError(_inner) => Some(_inner), - SearchGroupsErrorKind::UnauthorizedError(_inner) => Some(_inner), - SearchGroupsErrorKind::NotFoundError(_inner) => Some(_inner), - SearchGroupsErrorKind::BadRequestError(_inner) => Some(_inner), - SearchGroupsErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `TransferGroupOwnership` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct TransferGroupOwnershipError { - /// Kind of error that occurred. - pub kind: TransferGroupOwnershipErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `TransferGroupOwnership` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum TransferGroupOwnershipErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for TransferGroupOwnershipError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - TransferGroupOwnershipErrorKind::InternalError(_inner) => _inner.fmt(f), - TransferGroupOwnershipErrorKind::RateLimitError(_inner) => _inner.fmt(f), - TransferGroupOwnershipErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - TransferGroupOwnershipErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - TransferGroupOwnershipErrorKind::NotFoundError(_inner) => _inner.fmt(f), - TransferGroupOwnershipErrorKind::BadRequestError(_inner) => _inner.fmt(f), - TransferGroupOwnershipErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for TransferGroupOwnershipError { - fn code(&self) -> Option<&str> { - TransferGroupOwnershipError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - TransferGroupOwnershipErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - TransferGroupOwnershipErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl TransferGroupOwnershipError { - /// Creates a new `TransferGroupOwnershipError`. - pub fn new(kind: TransferGroupOwnershipErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `TransferGroupOwnershipError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: TransferGroupOwnershipErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `TransferGroupOwnershipError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: TransferGroupOwnershipErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `TransferGroupOwnershipErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!( - &self.kind, - TransferGroupOwnershipErrorKind::InternalError(_) - ) - } - /// Returns `true` if the error kind is `TransferGroupOwnershipErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - TransferGroupOwnershipErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `TransferGroupOwnershipErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - TransferGroupOwnershipErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `TransferGroupOwnershipErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - TransferGroupOwnershipErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `TransferGroupOwnershipErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!( - &self.kind, - TransferGroupOwnershipErrorKind::NotFoundError(_) - ) - } - /// Returns `true` if the error kind is `TransferGroupOwnershipErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - TransferGroupOwnershipErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for TransferGroupOwnershipError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - TransferGroupOwnershipErrorKind::InternalError(_inner) => Some(_inner), - TransferGroupOwnershipErrorKind::RateLimitError(_inner) => Some(_inner), - TransferGroupOwnershipErrorKind::ForbiddenError(_inner) => Some(_inner), - TransferGroupOwnershipErrorKind::UnauthorizedError(_inner) => Some(_inner), - TransferGroupOwnershipErrorKind::NotFoundError(_inner) => Some(_inner), - TransferGroupOwnershipErrorKind::BadRequestError(_inner) => Some(_inner), - TransferGroupOwnershipErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `UnbanGroupIdentity` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct UnbanGroupIdentityError { - /// Kind of error that occurred. - pub kind: UnbanGroupIdentityErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `UnbanGroupIdentity` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum UnbanGroupIdentityErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for UnbanGroupIdentityError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - UnbanGroupIdentityErrorKind::InternalError(_inner) => _inner.fmt(f), - UnbanGroupIdentityErrorKind::RateLimitError(_inner) => _inner.fmt(f), - UnbanGroupIdentityErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - UnbanGroupIdentityErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - UnbanGroupIdentityErrorKind::NotFoundError(_inner) => _inner.fmt(f), - UnbanGroupIdentityErrorKind::BadRequestError(_inner) => _inner.fmt(f), - UnbanGroupIdentityErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for UnbanGroupIdentityError { - fn code(&self) -> Option<&str> { - UnbanGroupIdentityError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - UnbanGroupIdentityErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - UnbanGroupIdentityErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl UnbanGroupIdentityError { - /// Creates a new `UnbanGroupIdentityError`. - pub fn new(kind: UnbanGroupIdentityErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `UnbanGroupIdentityError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: UnbanGroupIdentityErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `UnbanGroupIdentityError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: UnbanGroupIdentityErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `UnbanGroupIdentityErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, UnbanGroupIdentityErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `UnbanGroupIdentityErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, UnbanGroupIdentityErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `UnbanGroupIdentityErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, UnbanGroupIdentityErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `UnbanGroupIdentityErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - UnbanGroupIdentityErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `UnbanGroupIdentityErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, UnbanGroupIdentityErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `UnbanGroupIdentityErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, UnbanGroupIdentityErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for UnbanGroupIdentityError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - UnbanGroupIdentityErrorKind::InternalError(_inner) => Some(_inner), - UnbanGroupIdentityErrorKind::RateLimitError(_inner) => Some(_inner), - UnbanGroupIdentityErrorKind::ForbiddenError(_inner) => Some(_inner), - UnbanGroupIdentityErrorKind::UnauthorizedError(_inner) => Some(_inner), - UnbanGroupIdentityErrorKind::NotFoundError(_inner) => Some(_inner), - UnbanGroupIdentityErrorKind::BadRequestError(_inner) => Some(_inner), - UnbanGroupIdentityErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `UpdateGroupProfile` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct UpdateGroupProfileError { - /// Kind of error that occurred. - pub kind: UpdateGroupProfileErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `UpdateGroupProfile` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum UpdateGroupProfileErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for UpdateGroupProfileError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - UpdateGroupProfileErrorKind::InternalError(_inner) => _inner.fmt(f), - UpdateGroupProfileErrorKind::RateLimitError(_inner) => _inner.fmt(f), - UpdateGroupProfileErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - UpdateGroupProfileErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - UpdateGroupProfileErrorKind::NotFoundError(_inner) => _inner.fmt(f), - UpdateGroupProfileErrorKind::BadRequestError(_inner) => _inner.fmt(f), - UpdateGroupProfileErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for UpdateGroupProfileError { - fn code(&self) -> Option<&str> { - UpdateGroupProfileError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - UpdateGroupProfileErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - UpdateGroupProfileErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl UpdateGroupProfileError { - /// Creates a new `UpdateGroupProfileError`. - pub fn new(kind: UpdateGroupProfileErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `UpdateGroupProfileError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: UpdateGroupProfileErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `UpdateGroupProfileError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: UpdateGroupProfileErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `UpdateGroupProfileErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, UpdateGroupProfileErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `UpdateGroupProfileErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, UpdateGroupProfileErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `UpdateGroupProfileErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, UpdateGroupProfileErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `UpdateGroupProfileErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - UpdateGroupProfileErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `UpdateGroupProfileErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, UpdateGroupProfileErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `UpdateGroupProfileErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, UpdateGroupProfileErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for UpdateGroupProfileError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - UpdateGroupProfileErrorKind::InternalError(_inner) => Some(_inner), - UpdateGroupProfileErrorKind::RateLimitError(_inner) => Some(_inner), - UpdateGroupProfileErrorKind::ForbiddenError(_inner) => Some(_inner), - UpdateGroupProfileErrorKind::UnauthorizedError(_inner) => Some(_inner), - UpdateGroupProfileErrorKind::NotFoundError(_inner) => Some(_inner), - UpdateGroupProfileErrorKind::BadRequestError(_inner) => Some(_inner), - UpdateGroupProfileErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `ValidateGroupProfile` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct ValidateGroupProfileError { - /// Kind of error that occurred. - pub kind: ValidateGroupProfileErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `ValidateGroupProfile` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum ValidateGroupProfileErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for ValidateGroupProfileError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - ValidateGroupProfileErrorKind::InternalError(_inner) => _inner.fmt(f), - ValidateGroupProfileErrorKind::RateLimitError(_inner) => _inner.fmt(f), - ValidateGroupProfileErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - ValidateGroupProfileErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - ValidateGroupProfileErrorKind::NotFoundError(_inner) => _inner.fmt(f), - ValidateGroupProfileErrorKind::BadRequestError(_inner) => _inner.fmt(f), - ValidateGroupProfileErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for ValidateGroupProfileError { - fn code(&self) -> Option<&str> { - ValidateGroupProfileError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - ValidateGroupProfileErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - ValidateGroupProfileErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl ValidateGroupProfileError { - /// Creates a new `ValidateGroupProfileError`. - pub fn new(kind: ValidateGroupProfileErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `ValidateGroupProfileError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: ValidateGroupProfileErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `ValidateGroupProfileError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: ValidateGroupProfileErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `ValidateGroupProfileErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, ValidateGroupProfileErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `ValidateGroupProfileErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, ValidateGroupProfileErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `ValidateGroupProfileErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, ValidateGroupProfileErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `ValidateGroupProfileErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - ValidateGroupProfileErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `ValidateGroupProfileErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, ValidateGroupProfileErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `ValidateGroupProfileErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - ValidateGroupProfileErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for ValidateGroupProfileError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - ValidateGroupProfileErrorKind::InternalError(_inner) => Some(_inner), - ValidateGroupProfileErrorKind::RateLimitError(_inner) => Some(_inner), - ValidateGroupProfileErrorKind::ForbiddenError(_inner) => Some(_inner), - ValidateGroupProfileErrorKind::UnauthorizedError(_inner) => Some(_inner), - ValidateGroupProfileErrorKind::NotFoundError(_inner) => Some(_inner), - ValidateGroupProfileErrorKind::BadRequestError(_inner) => Some(_inner), - ValidateGroupProfileErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// An error thrown when the requestee has sent an invalid or malformed request. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct BadRequestError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl BadRequestError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for BadRequestError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("BadRequestError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl BadRequestError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for BadRequestError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "BadRequestError")?; - if let Some(inner_1) = &self.message { - write!(f, ": {}", inner_1)?; - } - Ok(()) - } -} -impl std::error::Error for BadRequestError {} -/// See [`BadRequestError`](crate::error::BadRequestError) -pub mod bad_request_error { - /// A builder for [`BadRequestError`](crate::error::BadRequestError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`BadRequestError`](crate::error::BadRequestError) - pub fn build(self) -> crate::error::BadRequestError { - crate::error::BadRequestError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl BadRequestError { - /// Creates a new builder-style object to manufacture [`BadRequestError`](crate::error::BadRequestError) - pub fn builder() -> crate::error::bad_request_error::Builder { - crate::error::bad_request_error::Builder::default() - } -} - -/// An error thrown when the requestee requests a non existent resource. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct NotFoundError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl NotFoundError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for NotFoundError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("NotFoundError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl NotFoundError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for NotFoundError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "NotFoundError")?; - if let Some(inner_2) = &self.message { - write!(f, ": {}", inner_2)?; - } - Ok(()) - } -} -impl std::error::Error for NotFoundError {} -/// See [`NotFoundError`](crate::error::NotFoundError) -pub mod not_found_error { - /// A builder for [`NotFoundError`](crate::error::NotFoundError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`NotFoundError`](crate::error::NotFoundError) - pub fn build(self) -> crate::error::NotFoundError { - crate::error::NotFoundError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl NotFoundError { - /// Creates a new builder-style object to manufacture [`NotFoundError`](crate::error::NotFoundError) - pub fn builder() -> crate::error::not_found_error::Builder { - crate::error::not_found_error::Builder::default() - } -} - -/// An error thrown when the requestee is not authenticated. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UnauthorizedError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl UnauthorizedError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for UnauthorizedError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UnauthorizedError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl UnauthorizedError { - /// Returns `Some(ErrorKind)` if the error is retryable. Otherwise, returns `None`. - pub fn retryable_error_kind(&self) -> aws_smithy_types::retry::ErrorKind { - aws_smithy_types::retry::ErrorKind::ClientError - } - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for UnauthorizedError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "UnauthorizedError")?; - if let Some(inner_3) = &self.message { - write!(f, ": {}", inner_3)?; - } - Ok(()) - } -} -impl std::error::Error for UnauthorizedError {} -/// See [`UnauthorizedError`](crate::error::UnauthorizedError) -pub mod unauthorized_error { - /// A builder for [`UnauthorizedError`](crate::error::UnauthorizedError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`UnauthorizedError`](crate::error::UnauthorizedError) - pub fn build(self) -> crate::error::UnauthorizedError { - crate::error::UnauthorizedError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl UnauthorizedError { - /// Creates a new builder-style object to manufacture [`UnauthorizedError`](crate::error::UnauthorizedError) - pub fn builder() -> crate::error::unauthorized_error::Builder { - crate::error::unauthorized_error::Builder::default() - } -} - -/// An error thrown when the requestee requests a resource they do not have access to. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ForbiddenError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl ForbiddenError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for ForbiddenError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ForbiddenError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl ForbiddenError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for ForbiddenError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "ForbiddenError")?; - if let Some(inner_4) = &self.message { - write!(f, ": {}", inner_4)?; - } - Ok(()) - } -} -impl std::error::Error for ForbiddenError {} -/// See [`ForbiddenError`](crate::error::ForbiddenError) -pub mod forbidden_error { - /// A builder for [`ForbiddenError`](crate::error::ForbiddenError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`ForbiddenError`](crate::error::ForbiddenError) - pub fn build(self) -> crate::error::ForbiddenError { - crate::error::ForbiddenError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl ForbiddenError { - /// Creates a new builder-style object to manufacture [`ForbiddenError`](crate::error::ForbiddenError) - pub fn builder() -> crate::error::forbidden_error::Builder { - crate::error::forbidden_error::Builder::default() - } -} - -/// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct RateLimitError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl RateLimitError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for RateLimitError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("RateLimitError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl RateLimitError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for RateLimitError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "RateLimitError")?; - if let Some(inner_5) = &self.message { - write!(f, ": {}", inner_5)?; - } - Ok(()) - } -} -impl std::error::Error for RateLimitError {} -/// See [`RateLimitError`](crate::error::RateLimitError) -pub mod rate_limit_error { - /// A builder for [`RateLimitError`](crate::error::RateLimitError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`RateLimitError`](crate::error::RateLimitError) - pub fn build(self) -> crate::error::RateLimitError { - crate::error::RateLimitError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl RateLimitError { - /// Creates a new builder-style object to manufacture [`RateLimitError`](crate::error::RateLimitError) - pub fn builder() -> crate::error::rate_limit_error::Builder { - crate::error::rate_limit_error::Builder::default() - } -} - -/// An error caused by internal server problems. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct InternalError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl InternalError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for InternalError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("InternalError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl InternalError { - /// Returns `Some(ErrorKind)` if the error is retryable. Otherwise, returns `None`. - pub fn retryable_error_kind(&self) -> aws_smithy_types::retry::ErrorKind { - aws_smithy_types::retry::ErrorKind::ServerError - } - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for InternalError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "InternalError")?; - if let Some(inner_6) = &self.message { - write!(f, ": {}", inner_6)?; - } - Ok(()) - } -} -impl std::error::Error for InternalError {} -/// See [`InternalError`](crate::error::InternalError) -pub mod internal_error { - /// A builder for [`InternalError`](crate::error::InternalError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`InternalError`](crate::error::InternalError) - pub fn build(self) -> crate::error::InternalError { - crate::error::InternalError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl InternalError { - /// Creates a new builder-style object to manufacture [`InternalError`](crate::error::InternalError) - pub fn builder() -> crate::error::internal_error::Builder { - crate::error::internal_error::Builder::default() - } -} diff --git a/lib/smithy-output/api-group/rust/rust/src/error_meta.rs b/lib/smithy-output/api-group/rust/rust/src/error_meta.rs deleted file mode 100644 index 02895c1d6..000000000 --- a/lib/smithy-output/api-group/rust/rust/src/error_meta.rs +++ /dev/null @@ -1,775 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// All possible error types for this service. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum Error { - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An unhandled error occurred. - Unhandled(Box), -} -impl std::fmt::Display for Error { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Error::BadRequestError(inner) => inner.fmt(f), - Error::ForbiddenError(inner) => inner.fmt(f), - Error::InternalError(inner) => inner.fmt(f), - Error::NotFoundError(inner) => inner.fmt(f), - Error::RateLimitError(inner) => inner.fmt(f), - Error::UnauthorizedError(inner) => inner.fmt(f), - Error::Unhandled(inner) => inner.fmt(f), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::BanGroupIdentityErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::BanGroupIdentityErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::BanGroupIdentityErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::BanGroupIdentityErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::BanGroupIdentityErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::BanGroupIdentityErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::BanGroupIdentityErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::CompleteGroupAvatarUploadErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::CompleteGroupAvatarUploadErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::CompleteGroupAvatarUploadErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::CompleteGroupAvatarUploadErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::CompleteGroupAvatarUploadErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::CompleteGroupAvatarUploadErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::CompleteGroupAvatarUploadErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::ConsumeGroupInviteErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::ConsumeGroupInviteErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::ConsumeGroupInviteErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::ConsumeGroupInviteErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::ConsumeGroupInviteErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::ConsumeGroupInviteErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::ConsumeGroupInviteErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::CreateGroupErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::CreateGroupErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::CreateGroupErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::CreateGroupErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::CreateGroupErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::CreateGroupErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::CreateGroupErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::CreateGroupInviteErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::CreateGroupInviteErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::CreateGroupInviteErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::CreateGroupInviteErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::CreateGroupInviteErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::CreateGroupInviteErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::CreateGroupInviteErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::CreateGroupJoinRequestErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::CreateGroupJoinRequestErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::CreateGroupJoinRequestErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::CreateGroupJoinRequestErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::CreateGroupJoinRequestErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::CreateGroupJoinRequestErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::CreateGroupJoinRequestErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GetGroupBansErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GetGroupBansErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GetGroupBansErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GetGroupBansErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GetGroupBansErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GetGroupBansErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GetGroupBansErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GetGroupInviteErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GetGroupInviteErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GetGroupInviteErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GetGroupInviteErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GetGroupInviteErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GetGroupInviteErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GetGroupInviteErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GetGroupJoinRequestsErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GetGroupJoinRequestsErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GetGroupJoinRequestsErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GetGroupJoinRequestsErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GetGroupJoinRequestsErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GetGroupJoinRequestsErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GetGroupJoinRequestsErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GetGroupMembersErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GetGroupMembersErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GetGroupMembersErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GetGroupMembersErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GetGroupMembersErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GetGroupMembersErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GetGroupMembersErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GetGroupProfileErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GetGroupProfileErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GetGroupProfileErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GetGroupProfileErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GetGroupProfileErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GetGroupProfileErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GetGroupProfileErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GetGroupSummaryErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GetGroupSummaryErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GetGroupSummaryErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GetGroupSummaryErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GetGroupSummaryErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GetGroupSummaryErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GetGroupSummaryErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::KickGroupMemberErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::KickGroupMemberErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::KickGroupMemberErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::KickGroupMemberErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::KickGroupMemberErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::KickGroupMemberErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::KickGroupMemberErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::LeaveGroupErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::LeaveGroupErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::LeaveGroupErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::LeaveGroupErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::LeaveGroupErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::LeaveGroupErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::LeaveGroupErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::ListSuggestedGroupsErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::ListSuggestedGroupsErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::ListSuggestedGroupsErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::ListSuggestedGroupsErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::ListSuggestedGroupsErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::ListSuggestedGroupsErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::ListSuggestedGroupsErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::PrepareGroupAvatarUploadErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::PrepareGroupAvatarUploadErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::PrepareGroupAvatarUploadErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::PrepareGroupAvatarUploadErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::PrepareGroupAvatarUploadErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::PrepareGroupAvatarUploadErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::PrepareGroupAvatarUploadErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::ResolveGroupJoinRequestErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::ResolveGroupJoinRequestErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::ResolveGroupJoinRequestErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::ResolveGroupJoinRequestErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::ResolveGroupJoinRequestErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::ResolveGroupJoinRequestErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::ResolveGroupJoinRequestErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::SearchGroupsErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::SearchGroupsErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::SearchGroupsErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::SearchGroupsErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::SearchGroupsErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::SearchGroupsErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::SearchGroupsErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::TransferGroupOwnershipErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::TransferGroupOwnershipErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::TransferGroupOwnershipErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::TransferGroupOwnershipErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::TransferGroupOwnershipErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::TransferGroupOwnershipErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::TransferGroupOwnershipErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::UnbanGroupIdentityErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::UnbanGroupIdentityErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::UnbanGroupIdentityErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::UnbanGroupIdentityErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::UnbanGroupIdentityErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::UnbanGroupIdentityErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::UnbanGroupIdentityErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::UpdateGroupProfileErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::UpdateGroupProfileErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::UpdateGroupProfileErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::UpdateGroupProfileErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::UpdateGroupProfileErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::UpdateGroupProfileErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::UpdateGroupProfileErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::ValidateGroupProfileErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::ValidateGroupProfileErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::ValidateGroupProfileErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::ValidateGroupProfileErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::ValidateGroupProfileErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::ValidateGroupProfileErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::ValidateGroupProfileErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl std::error::Error for Error {} diff --git a/lib/smithy-output/api-group/rust/rust/src/input.rs b/lib/smithy-output/api-group/rust/rust/src/input.rs deleted file mode 100644 index c0981763c..000000000 --- a/lib/smithy-output/api-group/rust/rust/src/input.rs +++ /dev/null @@ -1,3806 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -use std::fmt::Write; -/// See [`BanGroupIdentityInput`](crate::input::BanGroupIdentityInput) -pub mod ban_group_identity_input { - /// A builder for [`BanGroupIdentityInput`](crate::input::BanGroupIdentityInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) group_id: std::option::Option, - pub(crate) identity_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.group_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.group_id = input; - self - } - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.identity_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.identity_id = input; - self - } - /// Consumes the builder and constructs a [`BanGroupIdentityInput`](crate::input::BanGroupIdentityInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::BanGroupIdentityInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::BanGroupIdentityInput { - group_id: self.group_id, - identity_id: self.identity_id, - }) - } - } -} -#[doc(hidden)] -pub type BanGroupIdentityInputOperationOutputAlias = crate::operation::BanGroupIdentity; -#[doc(hidden)] -pub type BanGroupIdentityInputOperationRetryAlias = (); -impl BanGroupIdentityInput { - /// Consumes the builder and constructs an Operation<[`BanGroupIdentity`](crate::operation::BanGroupIdentity)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::BanGroupIdentityInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_1 = &_input.group_id; - let input_1 = input_1.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }, - )?; - let group_id = aws_smithy_http::label::fmt_string(input_1, false); - if group_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }); - } - let input_2 = &_input.identity_id; - let input_2 = input_2.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "identity_id", - details: "cannot be empty or unset", - }, - )?; - let identity_id = aws_smithy_http::label::fmt_string(input_2, false); - if identity_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "identity_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/groups/{group_id}/bans/{identity_id}", - group_id = group_id, - identity_id = identity_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::BanGroupIdentityInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from("{}"); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::BanGroupIdentity::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "BanGroupIdentity", - "GroupService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`BanGroupIdentityInput`](crate::input::BanGroupIdentityInput) - pub fn builder() -> crate::input::ban_group_identity_input::Builder { - crate::input::ban_group_identity_input::Builder::default() - } -} - -/// See [`CompleteGroupAvatarUploadInput`](crate::input::CompleteGroupAvatarUploadInput) -pub mod complete_group_avatar_upload_input { - /// A builder for [`CompleteGroupAvatarUploadInput`](crate::input::CompleteGroupAvatarUploadInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) group_id: std::option::Option, - pub(crate) upload_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.group_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.group_id = input; - self - } - /// A universally unique identifier. - pub fn upload_id(mut self, input: impl Into) -> Self { - self.upload_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_upload_id(mut self, input: std::option::Option) -> Self { - self.upload_id = input; - self - } - /// Consumes the builder and constructs a [`CompleteGroupAvatarUploadInput`](crate::input::CompleteGroupAvatarUploadInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::CompleteGroupAvatarUploadInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::CompleteGroupAvatarUploadInput { - group_id: self.group_id, - upload_id: self.upload_id, - }) - } - } -} -#[doc(hidden)] -pub type CompleteGroupAvatarUploadInputOperationOutputAlias = - crate::operation::CompleteGroupAvatarUpload; -#[doc(hidden)] -pub type CompleteGroupAvatarUploadInputOperationRetryAlias = (); -impl CompleteGroupAvatarUploadInput { - /// Consumes the builder and constructs an Operation<[`CompleteGroupAvatarUpload`](crate::operation::CompleteGroupAvatarUpload)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::CompleteGroupAvatarUploadInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_3 = &_input.group_id; - let input_3 = input_3.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }, - )?; - let group_id = aws_smithy_http::label::fmt_string(input_3, false); - if group_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }); - } - let input_4 = &_input.upload_id; - let input_4 = input_4.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "upload_id", - details: "cannot be empty or unset", - }, - )?; - let upload_id = aws_smithy_http::label::fmt_string(input_4, false); - if upload_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "upload_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/groups/{group_id}/avatar-upload/{upload_id}/complete", - group_id = group_id, - upload_id = upload_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::CompleteGroupAvatarUploadInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from("{}"); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::CompleteGroupAvatarUpload::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "CompleteGroupAvatarUpload", - "GroupService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`CompleteGroupAvatarUploadInput`](crate::input::CompleteGroupAvatarUploadInput) - pub fn builder() -> crate::input::complete_group_avatar_upload_input::Builder { - crate::input::complete_group_avatar_upload_input::Builder::default() - } -} - -/// See [`ConsumeGroupInviteInput`](crate::input::ConsumeGroupInviteInput) -pub mod consume_group_invite_input { - /// A builder for [`ConsumeGroupInviteInput`](crate::input::ConsumeGroupInviteInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) group_invite_code: std::option::Option, - } - impl Builder { - /// Provided by `rivet.api.group#CreateGroupInviteOutput$code`. - pub fn group_invite_code(mut self, input: impl Into) -> Self { - self.group_invite_code = Some(input.into()); - self - } - /// Provided by `rivet.api.group#CreateGroupInviteOutput$code`. - pub fn set_group_invite_code( - mut self, - input: std::option::Option, - ) -> Self { - self.group_invite_code = input; - self - } - /// Consumes the builder and constructs a [`ConsumeGroupInviteInput`](crate::input::ConsumeGroupInviteInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::ConsumeGroupInviteInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::ConsumeGroupInviteInput { - group_invite_code: self.group_invite_code, - }) - } - } -} -#[doc(hidden)] -pub type ConsumeGroupInviteInputOperationOutputAlias = crate::operation::ConsumeGroupInvite; -#[doc(hidden)] -pub type ConsumeGroupInviteInputOperationRetryAlias = (); -impl ConsumeGroupInviteInput { - /// Consumes the builder and constructs an Operation<[`ConsumeGroupInvite`](crate::operation::ConsumeGroupInvite)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::ConsumeGroupInviteInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_5 = &_input.group_invite_code; - let input_5 = input_5.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "group_invite_code", - details: "cannot be empty or unset", - }, - )?; - let group_invite_code = aws_smithy_http::label::fmt_string(input_5, false); - if group_invite_code.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "group_invite_code", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/invites/{group_invite_code}/consume", - group_invite_code = group_invite_code - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::ConsumeGroupInviteInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from("{}"); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::ConsumeGroupInvite::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "ConsumeGroupInvite", - "GroupService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`ConsumeGroupInviteInput`](crate::input::ConsumeGroupInviteInput) - pub fn builder() -> crate::input::consume_group_invite_input::Builder { - crate::input::consume_group_invite_input::Builder::default() - } -} - -/// See [`CreateGroupInput`](crate::input::CreateGroupInput) -pub mod create_group_input { - /// A builder for [`CreateGroupInput`](crate::input::CreateGroupInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) display_name: std::option::Option, - } - impl Builder { - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// Consumes the builder and constructs a [`CreateGroupInput`](crate::input::CreateGroupInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::CreateGroupInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::CreateGroupInput { - display_name: self.display_name, - }) - } - } -} -#[doc(hidden)] -pub type CreateGroupInputOperationOutputAlias = crate::operation::CreateGroup; -#[doc(hidden)] -pub type CreateGroupInputOperationRetryAlias = (); -impl CreateGroupInput { - /// Consumes the builder and constructs an Operation<[`CreateGroup`](crate::operation::CreateGroup)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::CreateGroupInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/groups").expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::CreateGroupInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_create_group(&self)?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::CreateGroup::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "CreateGroup", - "GroupService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`CreateGroupInput`](crate::input::CreateGroupInput) - pub fn builder() -> crate::input::create_group_input::Builder { - crate::input::create_group_input::Builder::default() - } -} - -/// See [`CreateGroupInviteInput`](crate::input::CreateGroupInviteInput) -pub mod create_group_invite_input { - /// A builder for [`CreateGroupInviteInput`](crate::input::CreateGroupInviteInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) group_id: std::option::Option, - pub(crate) ttl: std::option::Option, - pub(crate) use_count: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.group_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.group_id = input; - self - } - /// How long until the group invite expires (in milliseconds). - pub fn ttl(mut self, input: i64) -> Self { - self.ttl = Some(input); - self - } - /// How long until the group invite expires (in milliseconds). - pub fn set_ttl(mut self, input: std::option::Option) -> Self { - self.ttl = input; - self - } - /// How many times the group invite can be used. - pub fn use_count(mut self, input: i64) -> Self { - self.use_count = Some(input); - self - } - /// How many times the group invite can be used. - pub fn set_use_count(mut self, input: std::option::Option) -> Self { - self.use_count = input; - self - } - /// Consumes the builder and constructs a [`CreateGroupInviteInput`](crate::input::CreateGroupInviteInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::CreateGroupInviteInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::CreateGroupInviteInput { - group_id: self.group_id, - ttl: self.ttl, - use_count: self.use_count, - }) - } - } -} -#[doc(hidden)] -pub type CreateGroupInviteInputOperationOutputAlias = crate::operation::CreateGroupInvite; -#[doc(hidden)] -pub type CreateGroupInviteInputOperationRetryAlias = (); -impl CreateGroupInviteInput { - /// Consumes the builder and constructs an Operation<[`CreateGroupInvite`](crate::operation::CreateGroupInvite)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::CreateGroupInviteInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_6 = &_input.group_id; - let input_6 = input_6.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }, - )?; - let group_id = aws_smithy_http::label::fmt_string(input_6, false); - if group_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }); - } - write!(output, "/groups/{group_id}/invites", group_id = group_id) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::CreateGroupInviteInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_create_group_invite(&self)?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::CreateGroupInvite::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "CreateGroupInvite", - "GroupService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`CreateGroupInviteInput`](crate::input::CreateGroupInviteInput) - pub fn builder() -> crate::input::create_group_invite_input::Builder { - crate::input::create_group_invite_input::Builder::default() - } -} - -/// See [`CreateGroupJoinRequestInput`](crate::input::CreateGroupJoinRequestInput) -pub mod create_group_join_request_input { - /// A builder for [`CreateGroupJoinRequestInput`](crate::input::CreateGroupJoinRequestInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) group_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.group_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.group_id = input; - self - } - /// Consumes the builder and constructs a [`CreateGroupJoinRequestInput`](crate::input::CreateGroupJoinRequestInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::CreateGroupJoinRequestInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::CreateGroupJoinRequestInput { - group_id: self.group_id, - }) - } - } -} -#[doc(hidden)] -pub type CreateGroupJoinRequestInputOperationOutputAlias = crate::operation::CreateGroupJoinRequest; -#[doc(hidden)] -pub type CreateGroupJoinRequestInputOperationRetryAlias = (); -impl CreateGroupJoinRequestInput { - /// Consumes the builder and constructs an Operation<[`CreateGroupJoinRequest`](crate::operation::CreateGroupJoinRequest)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::CreateGroupJoinRequestInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_7 = &_input.group_id; - let input_7 = input_7.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }, - )?; - let group_id = aws_smithy_http::label::fmt_string(input_7, false); - if group_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/groups/{group_id}/join-request", - group_id = group_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::CreateGroupJoinRequestInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from("{}"); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::CreateGroupJoinRequest::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "CreateGroupJoinRequest", - "GroupService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`CreateGroupJoinRequestInput`](crate::input::CreateGroupJoinRequestInput) - pub fn builder() -> crate::input::create_group_join_request_input::Builder { - crate::input::create_group_join_request_input::Builder::default() - } -} - -/// See [`GetGroupBansInput`](crate::input::GetGroupBansInput) -pub mod get_group_bans_input { - /// A builder for [`GetGroupBansInput`](crate::input::GetGroupBansInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) group_id: std::option::Option, - pub(crate) anchor: std::option::Option, - pub(crate) count: std::option::Option, - pub(crate) watch_index: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.group_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.group_id = input; - self - } - /// The pagination anchor. Set to the returned anchor of this endpoint to receive the next set of items. - pub fn anchor(mut self, input: impl Into) -> Self { - self.anchor = Some(input.into()); - self - } - /// The pagination anchor. Set to the returned anchor of this endpoint to receive the next set of items. - pub fn set_anchor(mut self, input: std::option::Option) -> Self { - self.anchor = input; - self - } - /// Amount of bans to return. - pub fn count(mut self, input: i32) -> Self { - self.count = Some(input); - self - } - /// Amount of bans to return. - pub fn set_count(mut self, input: std::option::Option) -> Self { - self.count = input; - self - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.watch_index = Some(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.watch_index = input; - self - } - /// Consumes the builder and constructs a [`GetGroupBansInput`](crate::input::GetGroupBansInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::GetGroupBansInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::GetGroupBansInput { - group_id: self.group_id, - anchor: self.anchor, - count: self.count, - watch_index: self.watch_index, - }) - } - } -} -#[doc(hidden)] -pub type GetGroupBansInputOperationOutputAlias = crate::operation::GetGroupBans; -#[doc(hidden)] -pub type GetGroupBansInputOperationRetryAlias = (); -impl GetGroupBansInput { - /// Consumes the builder and constructs an Operation<[`GetGroupBans`](crate::operation::GetGroupBans)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GetGroupBansInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_8 = &_input.group_id; - let input_8 = input_8.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }, - )?; - let group_id = aws_smithy_http::label::fmt_string(input_8, false); - if group_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }); - } - write!(output, "/groups/{group_id}/bans", group_id = group_id) - .expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::GetGroupBansInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_9) = &_input.anchor { - query.push_kv("anchor", &aws_smithy_http::query::fmt_string(&inner_9)); - } - if let Some(inner_10) = &_input.count { - query.push_kv( - "count", - aws_smithy_types::primitive::Encoder::from(*inner_10).encode(), - ); - } - if let Some(inner_11) = &_input.watch_index { - query.push_kv( - "watch_index", - &aws_smithy_http::query::fmt_string(&inner_11), - ); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GetGroupBansInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::GetGroupBans::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GetGroupBans", - "GroupService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GetGroupBansInput`](crate::input::GetGroupBansInput) - pub fn builder() -> crate::input::get_group_bans_input::Builder { - crate::input::get_group_bans_input::Builder::default() - } -} - -/// See [`GetGroupInviteInput`](crate::input::GetGroupInviteInput) -pub mod get_group_invite_input { - /// A builder for [`GetGroupInviteInput`](crate::input::GetGroupInviteInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) group_invite_code: std::option::Option, - } - impl Builder { - /// Provided by `rivet.api.group#CreateGroupInviteOutput$code`. - pub fn group_invite_code(mut self, input: impl Into) -> Self { - self.group_invite_code = Some(input.into()); - self - } - /// Provided by `rivet.api.group#CreateGroupInviteOutput$code`. - pub fn set_group_invite_code( - mut self, - input: std::option::Option, - ) -> Self { - self.group_invite_code = input; - self - } - /// Consumes the builder and constructs a [`GetGroupInviteInput`](crate::input::GetGroupInviteInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::GetGroupInviteInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::GetGroupInviteInput { - group_invite_code: self.group_invite_code, - }) - } - } -} -#[doc(hidden)] -pub type GetGroupInviteInputOperationOutputAlias = crate::operation::GetGroupInvite; -#[doc(hidden)] -pub type GetGroupInviteInputOperationRetryAlias = (); -impl GetGroupInviteInput { - /// Consumes the builder and constructs an Operation<[`GetGroupInvite`](crate::operation::GetGroupInvite)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GetGroupInviteInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_12 = &_input.group_invite_code; - let input_12 = input_12.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "group_invite_code", - details: "cannot be empty or unset", - }, - )?; - let group_invite_code = aws_smithy_http::label::fmt_string(input_12, false); - if group_invite_code.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "group_invite_code", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/invites/{group_invite_code}", - group_invite_code = group_invite_code - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GetGroupInviteInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::GetGroupInvite::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GetGroupInvite", - "GroupService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GetGroupInviteInput`](crate::input::GetGroupInviteInput) - pub fn builder() -> crate::input::get_group_invite_input::Builder { - crate::input::get_group_invite_input::Builder::default() - } -} - -/// See [`GetGroupJoinRequestsInput`](crate::input::GetGroupJoinRequestsInput) -pub mod get_group_join_requests_input { - /// A builder for [`GetGroupJoinRequestsInput`](crate::input::GetGroupJoinRequestsInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) group_id: std::option::Option, - pub(crate) anchor: std::option::Option, - pub(crate) count: std::option::Option, - pub(crate) watch_index: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.group_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.group_id = input; - self - } - /// The pagination anchor. Set to the returned anchor of this endpoint to receive the next set of items. - pub fn anchor(mut self, input: impl Into) -> Self { - self.anchor = Some(input.into()); - self - } - /// The pagination anchor. Set to the returned anchor of this endpoint to receive the next set of items. - pub fn set_anchor(mut self, input: std::option::Option) -> Self { - self.anchor = input; - self - } - /// Amount of join requests to return. - pub fn count(mut self, input: i32) -> Self { - self.count = Some(input); - self - } - /// Amount of join requests to return. - pub fn set_count(mut self, input: std::option::Option) -> Self { - self.count = input; - self - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.watch_index = Some(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.watch_index = input; - self - } - /// Consumes the builder and constructs a [`GetGroupJoinRequestsInput`](crate::input::GetGroupJoinRequestsInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::GetGroupJoinRequestsInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::GetGroupJoinRequestsInput { - group_id: self.group_id, - anchor: self.anchor, - count: self.count, - watch_index: self.watch_index, - }) - } - } -} -#[doc(hidden)] -pub type GetGroupJoinRequestsInputOperationOutputAlias = crate::operation::GetGroupJoinRequests; -#[doc(hidden)] -pub type GetGroupJoinRequestsInputOperationRetryAlias = (); -impl GetGroupJoinRequestsInput { - /// Consumes the builder and constructs an Operation<[`GetGroupJoinRequests`](crate::operation::GetGroupJoinRequests)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GetGroupJoinRequestsInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_13 = &_input.group_id; - let input_13 = input_13.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }, - )?; - let group_id = aws_smithy_http::label::fmt_string(input_13, false); - if group_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/groups/{group_id}/join-requests", - group_id = group_id - ) - .expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::GetGroupJoinRequestsInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_14) = &_input.anchor { - query.push_kv("anchor", &aws_smithy_http::query::fmt_string(&inner_14)); - } - if let Some(inner_15) = &_input.count { - query.push_kv( - "count", - aws_smithy_types::primitive::Encoder::from(*inner_15).encode(), - ); - } - if let Some(inner_16) = &_input.watch_index { - query.push_kv( - "watch_index", - &aws_smithy_http::query::fmt_string(&inner_16), - ); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GetGroupJoinRequestsInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::GetGroupJoinRequests::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GetGroupJoinRequests", - "GroupService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GetGroupJoinRequestsInput`](crate::input::GetGroupJoinRequestsInput) - pub fn builder() -> crate::input::get_group_join_requests_input::Builder { - crate::input::get_group_join_requests_input::Builder::default() - } -} - -/// See [`GetGroupMembersInput`](crate::input::GetGroupMembersInput) -pub mod get_group_members_input { - /// A builder for [`GetGroupMembersInput`](crate::input::GetGroupMembersInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) group_id: std::option::Option, - pub(crate) anchor: std::option::Option, - pub(crate) count: std::option::Option, - pub(crate) watch_index: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.group_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.group_id = input; - self - } - /// The pagination anchor. Set to the returned anchor of this endpoint to receive the next set of items. - pub fn anchor(mut self, input: impl Into) -> Self { - self.anchor = Some(input.into()); - self - } - /// The pagination anchor. Set to the returned anchor of this endpoint to receive the next set of items. - pub fn set_anchor(mut self, input: std::option::Option) -> Self { - self.anchor = input; - self - } - /// Amount of members to return. - pub fn count(mut self, input: i32) -> Self { - self.count = Some(input); - self - } - /// Amount of members to return. - pub fn set_count(mut self, input: std::option::Option) -> Self { - self.count = input; - self - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.watch_index = Some(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.watch_index = input; - self - } - /// Consumes the builder and constructs a [`GetGroupMembersInput`](crate::input::GetGroupMembersInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::GetGroupMembersInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::GetGroupMembersInput { - group_id: self.group_id, - anchor: self.anchor, - count: self.count, - watch_index: self.watch_index, - }) - } - } -} -#[doc(hidden)] -pub type GetGroupMembersInputOperationOutputAlias = crate::operation::GetGroupMembers; -#[doc(hidden)] -pub type GetGroupMembersInputOperationRetryAlias = (); -impl GetGroupMembersInput { - /// Consumes the builder and constructs an Operation<[`GetGroupMembers`](crate::operation::GetGroupMembers)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GetGroupMembersInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_17 = &_input.group_id; - let input_17 = input_17.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }, - )?; - let group_id = aws_smithy_http::label::fmt_string(input_17, false); - if group_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }); - } - write!(output, "/groups/{group_id}/members", group_id = group_id) - .expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::GetGroupMembersInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_18) = &_input.anchor { - query.push_kv("anchor", &aws_smithy_http::query::fmt_string(&inner_18)); - } - if let Some(inner_19) = &_input.count { - query.push_kv( - "count", - aws_smithy_types::primitive::Encoder::from(*inner_19).encode(), - ); - } - if let Some(inner_20) = &_input.watch_index { - query.push_kv( - "watch_index", - &aws_smithy_http::query::fmt_string(&inner_20), - ); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GetGroupMembersInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::GetGroupMembers::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GetGroupMembers", - "GroupService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GetGroupMembersInput`](crate::input::GetGroupMembersInput) - pub fn builder() -> crate::input::get_group_members_input::Builder { - crate::input::get_group_members_input::Builder::default() - } -} - -/// See [`GetGroupProfileInput`](crate::input::GetGroupProfileInput) -pub mod get_group_profile_input { - /// A builder for [`GetGroupProfileInput`](crate::input::GetGroupProfileInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) group_id: std::option::Option, - pub(crate) watch_index: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.group_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.group_id = input; - self - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.watch_index = Some(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.watch_index = input; - self - } - /// Consumes the builder and constructs a [`GetGroupProfileInput`](crate::input::GetGroupProfileInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::GetGroupProfileInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::GetGroupProfileInput { - group_id: self.group_id, - watch_index: self.watch_index, - }) - } - } -} -#[doc(hidden)] -pub type GetGroupProfileInputOperationOutputAlias = crate::operation::GetGroupProfile; -#[doc(hidden)] -pub type GetGroupProfileInputOperationRetryAlias = (); -impl GetGroupProfileInput { - /// Consumes the builder and constructs an Operation<[`GetGroupProfile`](crate::operation::GetGroupProfile)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GetGroupProfileInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_21 = &_input.group_id; - let input_21 = input_21.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }, - )?; - let group_id = aws_smithy_http::label::fmt_string(input_21, false); - if group_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }); - } - write!(output, "/groups/{group_id}/profile", group_id = group_id) - .expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::GetGroupProfileInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_22) = &_input.watch_index { - query.push_kv( - "watch_index", - &aws_smithy_http::query::fmt_string(&inner_22), - ); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GetGroupProfileInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::GetGroupProfile::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GetGroupProfile", - "GroupService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GetGroupProfileInput`](crate::input::GetGroupProfileInput) - pub fn builder() -> crate::input::get_group_profile_input::Builder { - crate::input::get_group_profile_input::Builder::default() - } -} - -/// See [`GetGroupSummaryInput`](crate::input::GetGroupSummaryInput) -pub mod get_group_summary_input { - /// A builder for [`GetGroupSummaryInput`](crate::input::GetGroupSummaryInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) group_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.group_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.group_id = input; - self - } - /// Consumes the builder and constructs a [`GetGroupSummaryInput`](crate::input::GetGroupSummaryInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::GetGroupSummaryInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::GetGroupSummaryInput { - group_id: self.group_id, - }) - } - } -} -#[doc(hidden)] -pub type GetGroupSummaryInputOperationOutputAlias = crate::operation::GetGroupSummary; -#[doc(hidden)] -pub type GetGroupSummaryInputOperationRetryAlias = (); -impl GetGroupSummaryInput { - /// Consumes the builder and constructs an Operation<[`GetGroupSummary`](crate::operation::GetGroupSummary)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GetGroupSummaryInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_23 = &_input.group_id; - let input_23 = input_23.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }, - )?; - let group_id = aws_smithy_http::label::fmt_string(input_23, false); - if group_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }); - } - write!(output, "/groups/{group_id}/summary", group_id = group_id) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GetGroupSummaryInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::GetGroupSummary::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GetGroupSummary", - "GroupService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GetGroupSummaryInput`](crate::input::GetGroupSummaryInput) - pub fn builder() -> crate::input::get_group_summary_input::Builder { - crate::input::get_group_summary_input::Builder::default() - } -} - -/// See [`KickGroupMemberInput`](crate::input::KickGroupMemberInput) -pub mod kick_group_member_input { - /// A builder for [`KickGroupMemberInput`](crate::input::KickGroupMemberInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) group_id: std::option::Option, - pub(crate) identity_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.group_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.group_id = input; - self - } - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.identity_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.identity_id = input; - self - } - /// Consumes the builder and constructs a [`KickGroupMemberInput`](crate::input::KickGroupMemberInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::KickGroupMemberInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::KickGroupMemberInput { - group_id: self.group_id, - identity_id: self.identity_id, - }) - } - } -} -#[doc(hidden)] -pub type KickGroupMemberInputOperationOutputAlias = crate::operation::KickGroupMember; -#[doc(hidden)] -pub type KickGroupMemberInputOperationRetryAlias = (); -impl KickGroupMemberInput { - /// Consumes the builder and constructs an Operation<[`KickGroupMember`](crate::operation::KickGroupMember)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::KickGroupMemberInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_24 = &_input.group_id; - let input_24 = input_24.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }, - )?; - let group_id = aws_smithy_http::label::fmt_string(input_24, false); - if group_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }); - } - let input_25 = &_input.identity_id; - let input_25 = input_25.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "identity_id", - details: "cannot be empty or unset", - }, - )?; - let identity_id = aws_smithy_http::label::fmt_string(input_25, false); - if identity_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "identity_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/groups/{group_id}/kick/{identity_id}", - group_id = group_id, - identity_id = identity_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::KickGroupMemberInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from("{}"); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::KickGroupMember::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "KickGroupMember", - "GroupService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`KickGroupMemberInput`](crate::input::KickGroupMemberInput) - pub fn builder() -> crate::input::kick_group_member_input::Builder { - crate::input::kick_group_member_input::Builder::default() - } -} - -/// See [`LeaveGroupInput`](crate::input::LeaveGroupInput) -pub mod leave_group_input { - /// A builder for [`LeaveGroupInput`](crate::input::LeaveGroupInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) group_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.group_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.group_id = input; - self - } - /// Consumes the builder and constructs a [`LeaveGroupInput`](crate::input::LeaveGroupInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::LeaveGroupInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::LeaveGroupInput { - group_id: self.group_id, - }) - } - } -} -#[doc(hidden)] -pub type LeaveGroupInputOperationOutputAlias = crate::operation::LeaveGroup; -#[doc(hidden)] -pub type LeaveGroupInputOperationRetryAlias = (); -impl LeaveGroupInput { - /// Consumes the builder and constructs an Operation<[`LeaveGroup`](crate::operation::LeaveGroup)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::LeaveGroupInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_26 = &_input.group_id; - let input_26 = input_26.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }, - )?; - let group_id = aws_smithy_http::label::fmt_string(input_26, false); - if group_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }); - } - write!(output, "/groups/{group_id}/leave", group_id = group_id) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::LeaveGroupInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from("{}"); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::LeaveGroup::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "LeaveGroup", - "GroupService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`LeaveGroupInput`](crate::input::LeaveGroupInput) - pub fn builder() -> crate::input::leave_group_input::Builder { - crate::input::leave_group_input::Builder::default() - } -} - -/// See [`ListSuggestedGroupsInput`](crate::input::ListSuggestedGroupsInput) -pub mod list_suggested_groups_input { - /// A builder for [`ListSuggestedGroupsInput`](crate::input::ListSuggestedGroupsInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) watch_index: std::option::Option, - } - impl Builder { - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.watch_index = Some(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.watch_index = input; - self - } - /// Consumes the builder and constructs a [`ListSuggestedGroupsInput`](crate::input::ListSuggestedGroupsInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::ListSuggestedGroupsInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::ListSuggestedGroupsInput { - watch_index: self.watch_index, - }) - } - } -} -#[doc(hidden)] -pub type ListSuggestedGroupsInputOperationOutputAlias = crate::operation::ListSuggestedGroups; -#[doc(hidden)] -pub type ListSuggestedGroupsInputOperationRetryAlias = (); -impl ListSuggestedGroupsInput { - /// Consumes the builder and constructs an Operation<[`ListSuggestedGroups`](crate::operation::ListSuggestedGroups)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::ListSuggestedGroupsInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/groups").expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::ListSuggestedGroupsInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_27) = &_input.watch_index { - query.push_kv( - "watch_index", - &aws_smithy_http::query::fmt_string(&inner_27), - ); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::ListSuggestedGroupsInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::ListSuggestedGroups::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "ListSuggestedGroups", - "GroupService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`ListSuggestedGroupsInput`](crate::input::ListSuggestedGroupsInput) - pub fn builder() -> crate::input::list_suggested_groups_input::Builder { - crate::input::list_suggested_groups_input::Builder::default() - } -} - -/// See [`PrepareGroupAvatarUploadInput`](crate::input::PrepareGroupAvatarUploadInput) -pub mod prepare_group_avatar_upload_input { - /// A builder for [`PrepareGroupAvatarUploadInput`](crate::input::PrepareGroupAvatarUploadInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) path: std::option::Option, - pub(crate) mime: std::option::Option, - pub(crate) content_length: std::option::Option, - } - impl Builder { - /// The path/filename of the group avatar. - pub fn path(mut self, input: impl Into) -> Self { - self.path = Some(input.into()); - self - } - /// The path/filename of the group avatar. - pub fn set_path(mut self, input: std::option::Option) -> Self { - self.path = input; - self - } - /// The MIME type of the group avatar. - pub fn mime(mut self, input: impl Into) -> Self { - self.mime = Some(input.into()); - self - } - /// The MIME type of the group avatar. - pub fn set_mime(mut self, input: std::option::Option) -> Self { - self.mime = input; - self - } - /// Unsigned 64 bit integer. - pub fn content_length(mut self, input: i64) -> Self { - self.content_length = Some(input); - self - } - /// Unsigned 64 bit integer. - pub fn set_content_length(mut self, input: std::option::Option) -> Self { - self.content_length = input; - self - } - /// Consumes the builder and constructs a [`PrepareGroupAvatarUploadInput`](crate::input::PrepareGroupAvatarUploadInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::PrepareGroupAvatarUploadInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::PrepareGroupAvatarUploadInput { - path: self.path, - mime: self.mime, - content_length: self.content_length, - }) - } - } -} -#[doc(hidden)] -pub type PrepareGroupAvatarUploadInputOperationOutputAlias = - crate::operation::PrepareGroupAvatarUpload; -#[doc(hidden)] -pub type PrepareGroupAvatarUploadInputOperationRetryAlias = (); -impl PrepareGroupAvatarUploadInput { - /// Consumes the builder and constructs an Operation<[`PrepareGroupAvatarUpload`](crate::operation::PrepareGroupAvatarUpload)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::PrepareGroupAvatarUploadInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/groups/avatar-upload/prepare").expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::PrepareGroupAvatarUploadInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_prepare_group_avatar_upload( - &self, - )?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::PrepareGroupAvatarUpload::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "PrepareGroupAvatarUpload", - "GroupService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`PrepareGroupAvatarUploadInput`](crate::input::PrepareGroupAvatarUploadInput) - pub fn builder() -> crate::input::prepare_group_avatar_upload_input::Builder { - crate::input::prepare_group_avatar_upload_input::Builder::default() - } -} - -/// See [`ResolveGroupJoinRequestInput`](crate::input::ResolveGroupJoinRequestInput) -pub mod resolve_group_join_request_input { - /// A builder for [`ResolveGroupJoinRequestInput`](crate::input::ResolveGroupJoinRequestInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) group_id: std::option::Option, - pub(crate) identity_id: std::option::Option, - pub(crate) resolution: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.group_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.group_id = input; - self - } - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.identity_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.identity_id = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn resolution(mut self, input: bool) -> Self { - self.resolution = Some(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_resolution(mut self, input: std::option::Option) -> Self { - self.resolution = input; - self - } - /// Consumes the builder and constructs a [`ResolveGroupJoinRequestInput`](crate::input::ResolveGroupJoinRequestInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::ResolveGroupJoinRequestInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::ResolveGroupJoinRequestInput { - group_id: self.group_id, - identity_id: self.identity_id, - resolution: self.resolution, - }) - } - } -} -#[doc(hidden)] -pub type ResolveGroupJoinRequestInputOperationOutputAlias = - crate::operation::ResolveGroupJoinRequest; -#[doc(hidden)] -pub type ResolveGroupJoinRequestInputOperationRetryAlias = (); -impl ResolveGroupJoinRequestInput { - /// Consumes the builder and constructs an Operation<[`ResolveGroupJoinRequest`](crate::operation::ResolveGroupJoinRequest)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::ResolveGroupJoinRequestInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_28 = &_input.group_id; - let input_28 = input_28.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }, - )?; - let group_id = aws_smithy_http::label::fmt_string(input_28, false); - if group_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }); - } - let input_29 = &_input.identity_id; - let input_29 = input_29.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "identity_id", - details: "cannot be empty or unset", - }, - )?; - let identity_id = aws_smithy_http::label::fmt_string(input_29, false); - if identity_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "identity_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/groups/{group_id}/join-request/{identity_id}", - group_id = group_id, - identity_id = identity_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::ResolveGroupJoinRequestInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_resolve_group_join_request( - &self, - )?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::ResolveGroupJoinRequest::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "ResolveGroupJoinRequest", - "GroupService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`ResolveGroupJoinRequestInput`](crate::input::ResolveGroupJoinRequestInput) - pub fn builder() -> crate::input::resolve_group_join_request_input::Builder { - crate::input::resolve_group_join_request_input::Builder::default() - } -} - -/// See [`SearchGroupsInput`](crate::input::SearchGroupsInput) -pub mod search_groups_input { - /// A builder for [`SearchGroupsInput`](crate::input::SearchGroupsInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) query: std::option::Option, - pub(crate) anchor: std::option::Option, - pub(crate) limit: std::option::Option, - } - impl Builder { - /// The query to match group display names against. - pub fn query(mut self, input: impl Into) -> Self { - self.query = Some(input.into()); - self - } - /// The query to match group display names against. - pub fn set_query(mut self, input: std::option::Option) -> Self { - self.query = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn anchor(mut self, input: impl Into) -> Self { - self.anchor = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_anchor(mut self, input: std::option::Option) -> Self { - self.anchor = input; - self - } - /// Unsigned 32 bit integer. - pub fn limit(mut self, input: i32) -> Self { - self.limit = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_limit(mut self, input: std::option::Option) -> Self { - self.limit = input; - self - } - /// Consumes the builder and constructs a [`SearchGroupsInput`](crate::input::SearchGroupsInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::SearchGroupsInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::SearchGroupsInput { - query: self.query, - anchor: self.anchor, - limit: self.limit, - }) - } - } -} -#[doc(hidden)] -pub type SearchGroupsInputOperationOutputAlias = crate::operation::SearchGroups; -#[doc(hidden)] -pub type SearchGroupsInputOperationRetryAlias = (); -impl SearchGroupsInput { - /// Consumes the builder and constructs an Operation<[`SearchGroups`](crate::operation::SearchGroups)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::SearchGroupsInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/groups/search").expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::SearchGroupsInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_30) = &_input.query { - query.push_kv("query", &aws_smithy_http::query::fmt_string(&inner_30)); - } - if let Some(inner_31) = &_input.anchor { - query.push_kv("anchor", &aws_smithy_http::query::fmt_string(&inner_31)); - } - if let Some(inner_32) = &_input.limit { - query.push_kv( - "limit", - aws_smithy_types::primitive::Encoder::from(*inner_32).encode(), - ); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::SearchGroupsInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::SearchGroups::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "SearchGroups", - "GroupService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`SearchGroupsInput`](crate::input::SearchGroupsInput) - pub fn builder() -> crate::input::search_groups_input::Builder { - crate::input::search_groups_input::Builder::default() - } -} - -/// See [`TransferGroupOwnershipInput`](crate::input::TransferGroupOwnershipInput) -pub mod transfer_group_ownership_input { - /// A builder for [`TransferGroupOwnershipInput`](crate::input::TransferGroupOwnershipInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) group_id: std::option::Option, - pub(crate) new_owner_identity_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.group_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.group_id = input; - self - } - /// Idnetity to transfer the group to. Must be a member of the group. - pub fn new_owner_identity_id(mut self, input: impl Into) -> Self { - self.new_owner_identity_id = Some(input.into()); - self - } - /// Idnetity to transfer the group to. Must be a member of the group. - pub fn set_new_owner_identity_id( - mut self, - input: std::option::Option, - ) -> Self { - self.new_owner_identity_id = input; - self - } - /// Consumes the builder and constructs a [`TransferGroupOwnershipInput`](crate::input::TransferGroupOwnershipInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::TransferGroupOwnershipInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::TransferGroupOwnershipInput { - group_id: self.group_id, - new_owner_identity_id: self.new_owner_identity_id, - }) - } - } -} -#[doc(hidden)] -pub type TransferGroupOwnershipInputOperationOutputAlias = crate::operation::TransferGroupOwnership; -#[doc(hidden)] -pub type TransferGroupOwnershipInputOperationRetryAlias = (); -impl TransferGroupOwnershipInput { - /// Consumes the builder and constructs an Operation<[`TransferGroupOwnership`](crate::operation::TransferGroupOwnership)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::TransferGroupOwnershipInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_33 = &_input.group_id; - let input_33 = input_33.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }, - )?; - let group_id = aws_smithy_http::label::fmt_string(input_33, false); - if group_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/groups/{group_id}/transfer-owner", - group_id = group_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::TransferGroupOwnershipInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_transfer_group_ownership( - &self, - )?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::TransferGroupOwnership::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "TransferGroupOwnership", - "GroupService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`TransferGroupOwnershipInput`](crate::input::TransferGroupOwnershipInput) - pub fn builder() -> crate::input::transfer_group_ownership_input::Builder { - crate::input::transfer_group_ownership_input::Builder::default() - } -} - -/// See [`UnbanGroupIdentityInput`](crate::input::UnbanGroupIdentityInput) -pub mod unban_group_identity_input { - /// A builder for [`UnbanGroupIdentityInput`](crate::input::UnbanGroupIdentityInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) group_id: std::option::Option, - pub(crate) identity_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.group_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.group_id = input; - self - } - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.identity_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.identity_id = input; - self - } - /// Consumes the builder and constructs a [`UnbanGroupIdentityInput`](crate::input::UnbanGroupIdentityInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::UnbanGroupIdentityInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::UnbanGroupIdentityInput { - group_id: self.group_id, - identity_id: self.identity_id, - }) - } - } -} -#[doc(hidden)] -pub type UnbanGroupIdentityInputOperationOutputAlias = crate::operation::UnbanGroupIdentity; -#[doc(hidden)] -pub type UnbanGroupIdentityInputOperationRetryAlias = (); -impl UnbanGroupIdentityInput { - /// Consumes the builder and constructs an Operation<[`UnbanGroupIdentity`](crate::operation::UnbanGroupIdentity)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::UnbanGroupIdentityInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_34 = &_input.group_id; - let input_34 = input_34.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }, - )?; - let group_id = aws_smithy_http::label::fmt_string(input_34, false); - if group_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }); - } - let input_35 = &_input.identity_id; - let input_35 = input_35.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "identity_id", - details: "cannot be empty or unset", - }, - )?; - let identity_id = aws_smithy_http::label::fmt_string(input_35, false); - if identity_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "identity_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/groups/{group_id}/bans/{identity_id}", - group_id = group_id, - identity_id = identity_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::UnbanGroupIdentityInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("DELETE").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::UnbanGroupIdentity::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "UnbanGroupIdentity", - "GroupService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`UnbanGroupIdentityInput`](crate::input::UnbanGroupIdentityInput) - pub fn builder() -> crate::input::unban_group_identity_input::Builder { - crate::input::unban_group_identity_input::Builder::default() - } -} - -/// See [`UpdateGroupProfileInput`](crate::input::UpdateGroupProfileInput) -pub mod update_group_profile_input { - /// A builder for [`UpdateGroupProfileInput`](crate::input::UpdateGroupProfileInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) group_id: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) bio: std::option::Option, - pub(crate) publicity: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.group_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.group_id = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// Detailed information about a profile. - pub fn bio(mut self, input: impl Into) -> Self { - self.bio = Some(input.into()); - self - } - /// Detailed information about a profile. - pub fn set_bio(mut self, input: std::option::Option) -> Self { - self.bio = input; - self - } - /// The current publicity value for the given group. - pub fn publicity(mut self, input: crate::model::GroupPublicity) -> Self { - self.publicity = Some(input); - self - } - /// The current publicity value for the given group. - pub fn set_publicity( - mut self, - input: std::option::Option, - ) -> Self { - self.publicity = input; - self - } - /// Consumes the builder and constructs a [`UpdateGroupProfileInput`](crate::input::UpdateGroupProfileInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::UpdateGroupProfileInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::UpdateGroupProfileInput { - group_id: self.group_id, - display_name: self.display_name, - bio: self.bio, - publicity: self.publicity, - }) - } - } -} -#[doc(hidden)] -pub type UpdateGroupProfileInputOperationOutputAlias = crate::operation::UpdateGroupProfile; -#[doc(hidden)] -pub type UpdateGroupProfileInputOperationRetryAlias = (); -impl UpdateGroupProfileInput { - /// Consumes the builder and constructs an Operation<[`UpdateGroupProfile`](crate::operation::UpdateGroupProfile)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::UpdateGroupProfileInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_36 = &_input.group_id; - let input_36 = input_36.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }, - )?; - let group_id = aws_smithy_http::label::fmt_string(input_36, false); - if group_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "group_id", - details: "cannot be empty or unset", - }); - } - write!(output, "/groups/{group_id}/profile", group_id = group_id) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::UpdateGroupProfileInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_update_group_profile(&self)?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::UpdateGroupProfile::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "UpdateGroupProfile", - "GroupService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`UpdateGroupProfileInput`](crate::input::UpdateGroupProfileInput) - pub fn builder() -> crate::input::update_group_profile_input::Builder { - crate::input::update_group_profile_input::Builder::default() - } -} - -/// See [`ValidateGroupProfileInput`](crate::input::ValidateGroupProfileInput) -pub mod validate_group_profile_input { - /// A builder for [`ValidateGroupProfileInput`](crate::input::ValidateGroupProfileInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) display_name: std::option::Option, - pub(crate) bio: std::option::Option, - pub(crate) publicity: std::option::Option, - } - impl Builder { - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// Detailed information about a profile. - pub fn bio(mut self, input: impl Into) -> Self { - self.bio = Some(input.into()); - self - } - /// Detailed information about a profile. - pub fn set_bio(mut self, input: std::option::Option) -> Self { - self.bio = input; - self - } - /// The current publicity value for the given group. - pub fn publicity(mut self, input: crate::model::GroupPublicity) -> Self { - self.publicity = Some(input); - self - } - /// The current publicity value for the given group. - pub fn set_publicity( - mut self, - input: std::option::Option, - ) -> Self { - self.publicity = input; - self - } - /// Consumes the builder and constructs a [`ValidateGroupProfileInput`](crate::input::ValidateGroupProfileInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::ValidateGroupProfileInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::ValidateGroupProfileInput { - display_name: self.display_name, - bio: self.bio, - publicity: self.publicity, - }) - } - } -} -#[doc(hidden)] -pub type ValidateGroupProfileInputOperationOutputAlias = crate::operation::ValidateGroupProfile; -#[doc(hidden)] -pub type ValidateGroupProfileInputOperationRetryAlias = (); -impl ValidateGroupProfileInput { - /// Consumes the builder and constructs an Operation<[`ValidateGroupProfile`](crate::operation::ValidateGroupProfile)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::ValidateGroupProfileInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/groups/profile/validate").expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::ValidateGroupProfileInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_validate_group_profile( - &self, - )?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::ValidateGroupProfile::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "ValidateGroupProfile", - "GroupService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`ValidateGroupProfileInput`](crate::input::ValidateGroupProfileInput) - pub fn builder() -> crate::input::validate_group_profile_input::Builder { - crate::input::validate_group_profile_input::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ResolveGroupJoinRequestInput { - /// A universally unique identifier. - pub group_id: std::option::Option, - /// A universally unique identifier. - pub identity_id: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub resolution: std::option::Option, -} -impl ResolveGroupJoinRequestInput { - /// A universally unique identifier. - pub fn group_id(&self) -> std::option::Option<&str> { - self.group_id.as_deref() - } - /// A universally unique identifier. - pub fn identity_id(&self) -> std::option::Option<&str> { - self.identity_id.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn resolution(&self) -> std::option::Option { - self.resolution - } -} -impl std::fmt::Debug for ResolveGroupJoinRequestInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ResolveGroupJoinRequestInput"); - formatter.field("group_id", &self.group_id); - formatter.field("identity_id", &self.identity_id); - formatter.field("resolution", &self.resolution); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CreateGroupJoinRequestInput { - /// A universally unique identifier. - pub group_id: std::option::Option, -} -impl CreateGroupJoinRequestInput { - /// A universally unique identifier. - pub fn group_id(&self) -> std::option::Option<&str> { - self.group_id.as_deref() - } -} -impl std::fmt::Debug for CreateGroupJoinRequestInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CreateGroupJoinRequestInput"); - formatter.field("group_id", &self.group_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetGroupInviteInput { - /// Provided by `rivet.api.group#CreateGroupInviteOutput$code`. - pub group_invite_code: std::option::Option, -} -impl GetGroupInviteInput { - /// Provided by `rivet.api.group#CreateGroupInviteOutput$code`. - pub fn group_invite_code(&self) -> std::option::Option<&str> { - self.group_invite_code.as_deref() - } -} -impl std::fmt::Debug for GetGroupInviteInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetGroupInviteInput"); - formatter.field("group_invite_code", &self.group_invite_code); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ConsumeGroupInviteInput { - /// Provided by `rivet.api.group#CreateGroupInviteOutput$code`. - pub group_invite_code: std::option::Option, -} -impl ConsumeGroupInviteInput { - /// Provided by `rivet.api.group#CreateGroupInviteOutput$code`. - pub fn group_invite_code(&self) -> std::option::Option<&str> { - self.group_invite_code.as_deref() - } -} -impl std::fmt::Debug for ConsumeGroupInviteInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ConsumeGroupInviteInput"); - formatter.field("group_invite_code", &self.group_invite_code); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CreateGroupInviteInput { - /// A universally unique identifier. - pub group_id: std::option::Option, - /// How long until the group invite expires (in milliseconds). - pub ttl: std::option::Option, - /// How many times the group invite can be used. - pub use_count: std::option::Option, -} -impl CreateGroupInviteInput { - /// A universally unique identifier. - pub fn group_id(&self) -> std::option::Option<&str> { - self.group_id.as_deref() - } - /// How long until the group invite expires (in milliseconds). - pub fn ttl(&self) -> std::option::Option { - self.ttl - } - /// How many times the group invite can be used. - pub fn use_count(&self) -> std::option::Option { - self.use_count - } -} -impl std::fmt::Debug for CreateGroupInviteInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CreateGroupInviteInput"); - formatter.field("group_id", &self.group_id); - formatter.field("ttl", &self.ttl); - formatter.field("use_count", &self.use_count); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetGroupBansInput { - /// A universally unique identifier. - pub group_id: std::option::Option, - /// The pagination anchor. Set to the returned anchor of this endpoint to receive the next set of items. - pub anchor: std::option::Option, - /// Amount of bans to return. - pub count: std::option::Option, - /// A query parameter denoting the requests watch index. - pub watch_index: std::option::Option, -} -impl GetGroupBansInput { - /// A universally unique identifier. - pub fn group_id(&self) -> std::option::Option<&str> { - self.group_id.as_deref() - } - /// The pagination anchor. Set to the returned anchor of this endpoint to receive the next set of items. - pub fn anchor(&self) -> std::option::Option<&str> { - self.anchor.as_deref() - } - /// Amount of bans to return. - pub fn count(&self) -> std::option::Option { - self.count - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(&self) -> std::option::Option<&str> { - self.watch_index.as_deref() - } -} -impl std::fmt::Debug for GetGroupBansInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetGroupBansInput"); - formatter.field("group_id", &self.group_id); - formatter.field("anchor", &self.anchor); - formatter.field("count", &self.count); - formatter.field("watch_index", &self.watch_index); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UnbanGroupIdentityInput { - /// A universally unique identifier. - pub group_id: std::option::Option, - /// A universally unique identifier. - pub identity_id: std::option::Option, -} -impl UnbanGroupIdentityInput { - /// A universally unique identifier. - pub fn group_id(&self) -> std::option::Option<&str> { - self.group_id.as_deref() - } - /// A universally unique identifier. - pub fn identity_id(&self) -> std::option::Option<&str> { - self.identity_id.as_deref() - } -} -impl std::fmt::Debug for UnbanGroupIdentityInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UnbanGroupIdentityInput"); - formatter.field("group_id", &self.group_id); - formatter.field("identity_id", &self.identity_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct BanGroupIdentityInput { - /// A universally unique identifier. - pub group_id: std::option::Option, - /// A universally unique identifier. - pub identity_id: std::option::Option, -} -impl BanGroupIdentityInput { - /// A universally unique identifier. - pub fn group_id(&self) -> std::option::Option<&str> { - self.group_id.as_deref() - } - /// A universally unique identifier. - pub fn identity_id(&self) -> std::option::Option<&str> { - self.identity_id.as_deref() - } -} -impl std::fmt::Debug for BanGroupIdentityInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("BanGroupIdentityInput"); - formatter.field("group_id", &self.group_id); - formatter.field("identity_id", &self.identity_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct KickGroupMemberInput { - /// A universally unique identifier. - pub group_id: std::option::Option, - /// A universally unique identifier. - pub identity_id: std::option::Option, -} -impl KickGroupMemberInput { - /// A universally unique identifier. - pub fn group_id(&self) -> std::option::Option<&str> { - self.group_id.as_deref() - } - /// A universally unique identifier. - pub fn identity_id(&self) -> std::option::Option<&str> { - self.identity_id.as_deref() - } -} -impl std::fmt::Debug for KickGroupMemberInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("KickGroupMemberInput"); - formatter.field("group_id", &self.group_id); - formatter.field("identity_id", &self.identity_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct LeaveGroupInput { - /// A universally unique identifier. - pub group_id: std::option::Option, -} -impl LeaveGroupInput { - /// A universally unique identifier. - pub fn group_id(&self) -> std::option::Option<&str> { - self.group_id.as_deref() - } -} -impl std::fmt::Debug for LeaveGroupInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("LeaveGroupInput"); - formatter.field("group_id", &self.group_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CompleteGroupAvatarUploadInput { - /// A universally unique identifier. - pub group_id: std::option::Option, - /// A universally unique identifier. - pub upload_id: std::option::Option, -} -impl CompleteGroupAvatarUploadInput { - /// A universally unique identifier. - pub fn group_id(&self) -> std::option::Option<&str> { - self.group_id.as_deref() - } - /// A universally unique identifier. - pub fn upload_id(&self) -> std::option::Option<&str> { - self.upload_id.as_deref() - } -} -impl std::fmt::Debug for CompleteGroupAvatarUploadInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CompleteGroupAvatarUploadInput"); - formatter.field("group_id", &self.group_id); - formatter.field("upload_id", &self.upload_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PrepareGroupAvatarUploadInput { - /// The path/filename of the group avatar. - pub path: std::option::Option, - /// The MIME type of the group avatar. - pub mime: std::option::Option, - /// Unsigned 64 bit integer. - pub content_length: std::option::Option, -} -impl PrepareGroupAvatarUploadInput { - /// The path/filename of the group avatar. - pub fn path(&self) -> std::option::Option<&str> { - self.path.as_deref() - } - /// The MIME type of the group avatar. - pub fn mime(&self) -> std::option::Option<&str> { - self.mime.as_deref() - } - /// Unsigned 64 bit integer. - pub fn content_length(&self) -> std::option::Option { - self.content_length - } -} -impl std::fmt::Debug for PrepareGroupAvatarUploadInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PrepareGroupAvatarUploadInput"); - formatter.field("path", &self.path); - formatter.field("mime", &self.mime); - formatter.field("content_length", &self.content_length); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct SearchGroupsInput { - /// The query to match group display names against. - pub query: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub anchor: std::option::Option, - /// Unsigned 32 bit integer. - pub limit: std::option::Option, -} -impl SearchGroupsInput { - /// The query to match group display names against. - pub fn query(&self) -> std::option::Option<&str> { - self.query.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn anchor(&self) -> std::option::Option<&str> { - self.anchor.as_deref() - } - /// Unsigned 32 bit integer. - pub fn limit(&self) -> std::option::Option { - self.limit - } -} -impl std::fmt::Debug for SearchGroupsInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("SearchGroupsInput"); - formatter.field("query", &self.query); - formatter.field("anchor", &self.anchor); - formatter.field("limit", &self.limit); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct TransferGroupOwnershipInput { - /// A universally unique identifier. - pub group_id: std::option::Option, - /// Idnetity to transfer the group to. Must be a member of the group. - pub new_owner_identity_id: std::option::Option, -} -impl TransferGroupOwnershipInput { - /// A universally unique identifier. - pub fn group_id(&self) -> std::option::Option<&str> { - self.group_id.as_deref() - } - /// Idnetity to transfer the group to. Must be a member of the group. - pub fn new_owner_identity_id(&self) -> std::option::Option<&str> { - self.new_owner_identity_id.as_deref() - } -} -impl std::fmt::Debug for TransferGroupOwnershipInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("TransferGroupOwnershipInput"); - formatter.field("group_id", &self.group_id); - formatter.field("new_owner_identity_id", &self.new_owner_identity_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ValidateGroupProfileInput { - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// Detailed information about a profile. - pub bio: std::option::Option, - /// The current publicity value for the given group. - pub publicity: std::option::Option, -} -impl ValidateGroupProfileInput { - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// Detailed information about a profile. - pub fn bio(&self) -> std::option::Option<&str> { - self.bio.as_deref() - } - /// The current publicity value for the given group. - pub fn publicity(&self) -> std::option::Option<&crate::model::GroupPublicity> { - self.publicity.as_ref() - } -} -impl std::fmt::Debug for ValidateGroupProfileInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ValidateGroupProfileInput"); - formatter.field("display_name", &self.display_name); - formatter.field("bio", &self.bio); - formatter.field("publicity", &self.publicity); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetGroupSummaryInput { - /// A universally unique identifier. - pub group_id: std::option::Option, -} -impl GetGroupSummaryInput { - /// A universally unique identifier. - pub fn group_id(&self) -> std::option::Option<&str> { - self.group_id.as_deref() - } -} -impl std::fmt::Debug for GetGroupSummaryInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetGroupSummaryInput"); - formatter.field("group_id", &self.group_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UpdateGroupProfileInput { - /// A universally unique identifier. - pub group_id: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// Detailed information about a profile. - pub bio: std::option::Option, - /// The current publicity value for the given group. - pub publicity: std::option::Option, -} -impl UpdateGroupProfileInput { - /// A universally unique identifier. - pub fn group_id(&self) -> std::option::Option<&str> { - self.group_id.as_deref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// Detailed information about a profile. - pub fn bio(&self) -> std::option::Option<&str> { - self.bio.as_deref() - } - /// The current publicity value for the given group. - pub fn publicity(&self) -> std::option::Option<&crate::model::GroupPublicity> { - self.publicity.as_ref() - } -} -impl std::fmt::Debug for UpdateGroupProfileInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UpdateGroupProfileInput"); - formatter.field("group_id", &self.group_id); - formatter.field("display_name", &self.display_name); - formatter.field("bio", &self.bio); - formatter.field("publicity", &self.publicity); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetGroupJoinRequestsInput { - /// A universally unique identifier. - pub group_id: std::option::Option, - /// The pagination anchor. Set to the returned anchor of this endpoint to receive the next set of items. - pub anchor: std::option::Option, - /// Amount of join requests to return. - pub count: std::option::Option, - /// A query parameter denoting the requests watch index. - pub watch_index: std::option::Option, -} -impl GetGroupJoinRequestsInput { - /// A universally unique identifier. - pub fn group_id(&self) -> std::option::Option<&str> { - self.group_id.as_deref() - } - /// The pagination anchor. Set to the returned anchor of this endpoint to receive the next set of items. - pub fn anchor(&self) -> std::option::Option<&str> { - self.anchor.as_deref() - } - /// Amount of join requests to return. - pub fn count(&self) -> std::option::Option { - self.count - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(&self) -> std::option::Option<&str> { - self.watch_index.as_deref() - } -} -impl std::fmt::Debug for GetGroupJoinRequestsInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetGroupJoinRequestsInput"); - formatter.field("group_id", &self.group_id); - formatter.field("anchor", &self.anchor); - formatter.field("count", &self.count); - formatter.field("watch_index", &self.watch_index); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetGroupMembersInput { - /// A universally unique identifier. - pub group_id: std::option::Option, - /// The pagination anchor. Set to the returned anchor of this endpoint to receive the next set of items. - pub anchor: std::option::Option, - /// Amount of members to return. - pub count: std::option::Option, - /// A query parameter denoting the requests watch index. - pub watch_index: std::option::Option, -} -impl GetGroupMembersInput { - /// A universally unique identifier. - pub fn group_id(&self) -> std::option::Option<&str> { - self.group_id.as_deref() - } - /// The pagination anchor. Set to the returned anchor of this endpoint to receive the next set of items. - pub fn anchor(&self) -> std::option::Option<&str> { - self.anchor.as_deref() - } - /// Amount of members to return. - pub fn count(&self) -> std::option::Option { - self.count - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(&self) -> std::option::Option<&str> { - self.watch_index.as_deref() - } -} -impl std::fmt::Debug for GetGroupMembersInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetGroupMembersInput"); - formatter.field("group_id", &self.group_id); - formatter.field("anchor", &self.anchor); - formatter.field("count", &self.count); - formatter.field("watch_index", &self.watch_index); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetGroupProfileInput { - /// A universally unique identifier. - pub group_id: std::option::Option, - /// A query parameter denoting the requests watch index. - pub watch_index: std::option::Option, -} -impl GetGroupProfileInput { - /// A universally unique identifier. - pub fn group_id(&self) -> std::option::Option<&str> { - self.group_id.as_deref() - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(&self) -> std::option::Option<&str> { - self.watch_index.as_deref() - } -} -impl std::fmt::Debug for GetGroupProfileInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetGroupProfileInput"); - formatter.field("group_id", &self.group_id); - formatter.field("watch_index", &self.watch_index); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CreateGroupInput { - /// Represent a resource's readable display name. - pub display_name: std::option::Option, -} -impl CreateGroupInput { - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } -} -impl std::fmt::Debug for CreateGroupInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CreateGroupInput"); - formatter.field("display_name", &self.display_name); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ListSuggestedGroupsInput { - /// A query parameter denoting the requests watch index. - pub watch_index: std::option::Option, -} -impl ListSuggestedGroupsInput { - /// A query parameter denoting the requests watch index. - pub fn watch_index(&self) -> std::option::Option<&str> { - self.watch_index.as_deref() - } -} -impl std::fmt::Debug for ListSuggestedGroupsInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ListSuggestedGroupsInput"); - formatter.field("watch_index", &self.watch_index); - formatter.finish() - } -} diff --git a/lib/smithy-output/api-group/rust/rust/src/json_deser.rs b/lib/smithy-output/api-group/rust/rust/src/json_deser.rs deleted file mode 100644 index 90589a2f5..000000000 --- a/lib/smithy-output/api-group/rust/rust/src/json_deser.rs +++ /dev/null @@ -1,2660 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub fn parse_http_generic_error( - response: &http::Response, -) -> Result { - crate::json_errors::parse_generic_error(response.body(), response.headers()) -} - -pub fn deser_structure_crate_error_internal_error_json_err( - value: &[u8], - mut builder: crate::error::internal_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_rate_limit_error_json_err( - value: &[u8], - mut builder: crate::error::rate_limit_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_forbidden_error_json_err( - value: &[u8], - mut builder: crate::error::forbidden_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_unauthorized_error_json_err( - value: &[u8], - mut builder: crate::error::unauthorized_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_not_found_error_json_err( - value: &[u8], - mut builder: crate::error::not_found_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_bad_request_error_json_err( - value: &[u8], - mut builder: crate::error::bad_request_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_consume_group_invite( - value: &[u8], - mut builder: crate::output::consume_group_invite_output::Builder, -) -> Result -{ - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "group_id" => { - builder = builder.set_group_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_create_group( - value: &[u8], - mut builder: crate::output::create_group_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "group_id" => { - builder = builder.set_group_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_create_group_invite( - value: &[u8], - mut builder: crate::output::create_group_invite_output::Builder, -) -> Result -{ - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_get_group_bans( - value: &[u8], - mut builder: crate::output::get_group_bans_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "anchor" => { - builder = builder.set_anchor( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "banned_identities" => { - builder = builder.set_banned_identities( - crate::json_deser::deser_list_rivet_group_group_banned_identities( - tokens, - )?, - ); - } - "watch" => { - builder = builder.set_watch( - crate::json_deser::deser_structure_crate_model_watch_response(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_get_group_invite( - value: &[u8], - mut builder: crate::output::get_group_invite_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "group" => { - builder = builder.set_group( - crate::json_deser::deser_structure_crate_model_group_handle(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_get_group_join_requests( - value: &[u8], - mut builder: crate::output::get_group_join_requests_output::Builder, -) -> Result< - crate::output::get_group_join_requests_output::Builder, - aws_smithy_json::deserialize::Error, -> { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "anchor" => { - builder = builder.set_anchor( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "join_requests" => { - builder = builder.set_join_requests( - crate::json_deser::deser_list_rivet_group_group_join_requests(tokens)?, - ); - } - "watch" => { - builder = builder.set_watch( - crate::json_deser::deser_structure_crate_model_watch_response(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_get_group_members( - value: &[u8], - mut builder: crate::output::get_group_members_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "anchor" => { - builder = builder.set_anchor( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "members" => { - builder = builder.set_members( - crate::json_deser::deser_list_rivet_group_group_members(tokens)?, - ); - } - "watch" => { - builder = builder.set_watch( - crate::json_deser::deser_structure_crate_model_watch_response(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_get_group_profile( - value: &[u8], - mut builder: crate::output::get_group_profile_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "group" => { - builder = builder.set_group( - crate::json_deser::deser_structure_crate_model_group_profile(tokens)?, - ); - } - "watch" => { - builder = builder.set_watch( - crate::json_deser::deser_structure_crate_model_watch_response(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_get_group_summary( - value: &[u8], - mut builder: crate::output::get_group_summary_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "group" => { - builder = builder.set_group( - crate::json_deser::deser_structure_crate_model_group_summary(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_list_suggested_groups( - value: &[u8], - mut builder: crate::output::list_suggested_groups_output::Builder, -) -> Result -{ - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "groups" => { - builder = builder.set_groups( - crate::json_deser::deser_list_rivet_group_group_summaries(tokens)?, - ); - } - "watch" => { - builder = builder.set_watch( - crate::json_deser::deser_structure_crate_model_watch_response(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_prepare_group_avatar_upload( - value: &[u8], - mut builder: crate::output::prepare_group_avatar_upload_output::Builder, -) -> Result< - crate::output::prepare_group_avatar_upload_output::Builder, - aws_smithy_json::deserialize::Error, -> { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "presigned_request" => { - builder = builder.set_presigned_request( - crate::json_deser::deser_structure_crate_model_upload_presigned_request(tokens)? - ); - } - "upload_id" => { - builder = builder.set_upload_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_search_groups( - value: &[u8], - mut builder: crate::output::search_groups_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "anchor" => { - builder = builder.set_anchor( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "groups" => { - builder = builder.set_groups( - crate::json_deser::deser_list_rivet_group_group_handles(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_validate_group_profile( - value: &[u8], - mut builder: crate::output::validate_group_profile_output::Builder, -) -> Result< - crate::output::validate_group_profile_output::Builder, - aws_smithy_json::deserialize::Error, -> { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "errors" => { - builder = builder.set_errors( - crate::json_deser::deser_list_rivet_common_validation_errors(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn or_empty_doc(data: &[u8]) -> &[u8] { - if data.is_empty() { - b"{}" - } else { - data - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_group_group_banned_identities<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option>, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_group_banned_identity( - tokens, - )?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_structure_crate_model_watch_response<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::WatchResponse::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "index" => { - builder = builder.set_index( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_group_handle<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GroupHandle::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "group_id" => { - builder = builder.set_group_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "display_name" => { - builder = builder.set_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "avatar_url" => { - builder = builder.set_avatar_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "external" => { - builder = builder.set_external( - crate::json_deser::deser_structure_crate_model_group_external_links(tokens)? - ); - } - "is_developer" => { - builder = builder.set_is_developer( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_group_group_join_requests<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option>, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_group_join_request( - tokens, - )?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_group_group_members<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_group_member(tokens)?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_structure_crate_model_group_profile<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GroupProfile::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "group_id" => { - builder = builder.set_group_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "display_name" => { - builder = builder.set_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "avatar_url" => { - builder = builder.set_avatar_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "external" => { - builder = builder.set_external( - crate::json_deser::deser_structure_crate_model_group_external_links(tokens)? - ); - } - "is_developer" => { - builder = builder.set_is_developer( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - "bio" => { - builder = builder.set_bio( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "is_current_identity_member" => { - builder = builder.set_is_current_identity_member( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - "publicity" => { - builder = builder.set_publicity( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| { - s.to_unescaped() - .map(|u| crate::model::GroupPublicity::from(u.as_ref())) - }) - .transpose()?, - ); - } - "member_count" => { - builder = builder.set_member_count( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "owner_identity_id" => { - builder = builder.set_owner_identity_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "members" => { - builder = builder.set_members( - crate::json_deser::deser_list_rivet_group_group_members( - tokens, - )?, - ); - } - "join_requests" => { - builder = builder.set_join_requests( - crate::json_deser::deser_list_rivet_group_group_join_requests( - tokens, - )?, - ); - } - "is_current_identity_requesting_join" => { - builder = builder.set_is_current_identity_requesting_join( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - "thread_id" => { - builder = builder.set_thread_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_group_summary<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GroupSummary::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "group_id" => { - builder = builder.set_group_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "display_name" => { - builder = builder.set_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "avatar_url" => { - builder = builder.set_avatar_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "external" => { - builder = builder.set_external( - crate::json_deser::deser_structure_crate_model_group_external_links(tokens)? - ); - } - "is_developer" => { - builder = builder.set_is_developer( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - "bio" => { - builder = builder.set_bio( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "is_current_identity_member" => { - builder = builder.set_is_current_identity_member( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - "publicity" => { - builder = builder.set_publicity( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| { - s.to_unescaped() - .map(|u| crate::model::GroupPublicity::from(u.as_ref())) - }) - .transpose()?, - ); - } - "member_count" => { - builder = builder.set_member_count( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "owner_identity_id" => { - builder = builder.set_owner_identity_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_group_group_summaries<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_group_summary(tokens)?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_structure_crate_model_upload_presigned_request<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::UploadPresignedRequest::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "path" => { - builder = builder.set_path( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "url" => { - builder = builder.set_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_group_group_handles<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_group_handle(tokens)?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_common_validation_errors<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_validation_error( - tokens, - )?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_structure_crate_model_group_banned_identity<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GroupBannedIdentity::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "identity" => { - builder = builder.set_identity( - crate::json_deser::deser_structure_crate_model_identity_handle( - tokens, - )?, - ); - } - "ban_ts" => { - builder = builder.set_ban_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_group_external_links<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GroupExternalLinks::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "profile" => { - builder = builder.set_profile( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "chat" => { - builder = builder.set_chat( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_group_join_request<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GroupJoinRequest::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "identity" => { - builder = builder.set_identity( - crate::json_deser::deser_structure_crate_model_identity_handle( - tokens, - )?, - ); - } - "ts" => { - builder = builder.set_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_group_member<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GroupMember::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "identity" => { - builder = builder.set_identity( - crate::json_deser::deser_structure_crate_model_identity_handle( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_validation_error<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::ValidationError::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "path" => { - builder = builder.set_path( - crate::json_deser::deser_list_rivet_common_validation_error_path(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_identity_handle<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::IdentityHandle::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "identity_id" => { - builder = builder.set_identity_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "display_name" => { - builder = builder.set_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "account_number" => { - builder = builder.set_account_number( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "avatar_url" => { - builder = builder.set_avatar_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "presence" => { - builder = builder.set_presence( - crate::json_deser::deser_structure_crate_model_identity_presence(tokens)? - ); - } - "party" => { - builder = builder.set_party( - crate::json_deser::deser_structure_crate_model_party_handle( - tokens, - )?, - ); - } - "is_registered" => { - builder = builder.set_is_registered( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - "external" => { - builder = builder.set_external( - crate::json_deser::deser_structure_crate_model_identity_external_links(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_common_validation_error_path<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_structure_crate_model_identity_presence<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::IdentityPresence::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "update_ts" => { - builder = builder.set_update_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "status" => { - builder = builder.set_status( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| { - s.to_unescaped() - .map(|u| crate::model::IdentityStatus::from(u.as_ref())) - }) - .transpose()?, - ); - } - "game_activity" => { - builder = builder.set_game_activity( - crate::json_deser::deser_structure_crate_model_identity_game_activity(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_party_handle<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PartyHandle::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "party_id" => { - builder = builder.set_party_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "create_ts" => { - builder = builder.set_create_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "activity" => { - builder = builder.set_activity( - crate::json_deser::deser_union_crate_model_party_activity( - tokens, - )?, - ); - } - "external" => { - builder = builder.set_external( - crate::json_deser::deser_structure_crate_model_party_external_links(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_identity_external_links<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::IdentityExternalLinks::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "profile" => { - builder = builder.set_profile( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "settings" => { - builder = builder.set_settings( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "chat" => { - builder = builder.set_chat( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_identity_game_activity<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::IdentityGameActivity::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "game" => { - builder = builder.set_game( - crate::json_deser::deser_structure_crate_model_game_handle( - tokens, - )?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "public_metadata" => { - builder = builder.set_public_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - "mutual_metadata" => { - builder = builder.set_mutual_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_union_crate_model_party_activity<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - let mut variant = None; - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - if variant.is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "encountered mixed variants in union", - )); - } - variant = match key.to_unescaped()?.as_ref() { - "idle" => { - Some(crate::model::PartyActivity::Idle( - crate::json_deser::deser_structure_crate_model_party_activity_idle(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'idle' cannot be null"))? - )) - } - "matchmaker_finding_lobby" => { - Some(crate::model::PartyActivity::MatchmakerFindingLobby( - crate::json_deser::deser_structure_crate_model_party_activity_matchmaker_finding_lobby(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'matchmaker_finding_lobby' cannot be null"))? - )) - } - "matchmaker_lobby" => { - Some(crate::model::PartyActivity::MatchmakerLobby( - crate::json_deser::deser_structure_crate_model_party_activity_matchmaker_lobby(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'matchmaker_lobby' cannot be null"))? - )) - } - _ => { - aws_smithy_json::deserialize::token::skip_value(tokens)?; - Some(crate::model::PartyActivity::Unknown) - } - }; - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - }, - _ => { - return Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )) - } - } - Ok(variant) -} - -pub fn deser_structure_crate_model_party_external_links<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PartyExternalLinks::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "chat" => { - builder = builder.set_chat( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_game_handle<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GameHandle::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "game_id" => { - builder = builder.set_game_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "name_id" => { - builder = builder.set_name_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "display_name" => { - builder = builder.set_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "logo_url" => { - builder = builder.set_logo_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "banner_url" => { - builder = builder.set_banner_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_party_activity_idle<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PartyActivityIdle::builder(); - aws_smithy_json::deserialize::token::skip_to_end(tokens)?; - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_party_activity_matchmaker_finding_lobby<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PartyActivityMatchmakerFindingLobby::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "game" => { - builder = builder.set_game( - crate::json_deser::deser_structure_crate_model_game_handle( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_party_activity_matchmaker_lobby<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PartyActivityMatchmakerLobby::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "lobby" => { - builder = builder.set_lobby( - crate::json_deser::deser_structure_crate_model_party_matchmaker_lobby(tokens)? - ); - } - "game" => { - builder = builder.set_game( - crate::json_deser::deser_structure_crate_model_game_handle( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_party_matchmaker_lobby<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PartyMatchmakerLobby::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "lobby_id" => { - builder = builder.set_lobby_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} diff --git a/lib/smithy-output/api-group/rust/rust/src/json_errors.rs b/lib/smithy-output/api-group/rust/rust/src/json_errors.rs deleted file mode 100644 index 7b7574319..000000000 --- a/lib/smithy-output/api-group/rust/rust/src/json_errors.rs +++ /dev/null @@ -1,220 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -use aws_smithy_json::deserialize::token::skip_value; -use aws_smithy_json::deserialize::{json_token_iter, Error as DeserializeError, Token}; -use aws_smithy_types::Error as SmithyError; -use bytes::Bytes; -use http::header::ToStrError; -use http::{HeaderMap, HeaderValue}; -use std::borrow::Cow; - -// currently only used by AwsJson -#[allow(unused)] -pub fn is_error(response: &http::Response) -> bool { - !response.status().is_success() -} - -fn sanitize_error_code(error_code: &str) -> &str { - // Trim a trailing URL from the error code, beginning with a `:` - let error_code = match error_code.find(':') { - Some(idx) => &error_code[..idx], - None => error_code, - }; - - // Trim a prefixing namespace from the error code, beginning with a `#` - match error_code.find('#') { - Some(idx) => &error_code[idx + 1..], - None => error_code, - } -} - -struct ErrorBody<'a> { - code: Option>, - message: Option>, -} - -fn parse_error_body(bytes: &[u8]) -> Result { - let mut tokens = json_token_iter(bytes).peekable(); - let (mut typ, mut code, mut message) = (None, None, None); - if let Some(Token::StartObject { .. }) = tokens.next().transpose()? { - loop { - match tokens.next().transpose()? { - Some(Token::EndObject { .. }) => break, - Some(Token::ObjectKey { key, .. }) => { - if let Some(Ok(Token::ValueString { value, .. })) = tokens.peek() { - match key.as_escaped_str() { - "code" => code = Some(value.to_unescaped()?), - "__type" => typ = Some(value.to_unescaped()?), - "message" | "Message" | "errorMessage" => { - message = Some(value.to_unescaped()?) - } - _ => {} - } - } - skip_value(&mut tokens)?; - } - _ => { - return Err(DeserializeError::custom( - "expected object key or end object", - )) - } - } - } - if tokens.next().is_some() { - return Err(DeserializeError::custom( - "found more JSON tokens after completing parsing", - )); - } - } - Ok(ErrorBody { - code: code.or(typ), - message, - }) -} - -fn error_type_from_header(headers: &HeaderMap) -> Result, ToStrError> { - headers - .get("X-Amzn-Errortype") - .map(|v| v.to_str()) - .transpose() -} - -fn request_id(headers: &HeaderMap) -> Option<&str> { - headers - .get("X-Amzn-Requestid") - .and_then(|v| v.to_str().ok()) -} - -pub fn parse_generic_error( - payload: &Bytes, - headers: &HeaderMap, -) -> Result { - let ErrorBody { code, message } = parse_error_body(payload.as_ref())?; - - let mut err_builder = SmithyError::builder(); - if let Some(code) = error_type_from_header(headers) - .map_err(|_| DeserializeError::custom("X-Amzn-Errortype header was not valid UTF-8"))? - .or_else(|| code.as_deref()) - .map(sanitize_error_code) - { - err_builder.code(code); - } - if let Some(message) = message { - err_builder.message(message); - } - if let Some(request_id) = request_id(headers) { - err_builder.request_id(request_id); - } - Ok(err_builder.build()) -} - -#[cfg(test)] -mod test { - use crate::json_errors::{parse_error_body, parse_generic_error, sanitize_error_code}; - use aws_smithy_types::Error; - use bytes::Bytes; - use std::borrow::Cow; - - #[test] - fn generic_error() { - let response = http::Response::builder() - .header("X-Amzn-Requestid", "1234") - .body(Bytes::from_static( - br#"{ "__type": "FooError", "message": "Go to foo" }"#, - )) - .unwrap(); - assert_eq!( - parse_generic_error(response.body(), response.headers()).unwrap(), - Error::builder() - .code("FooError") - .message("Go to foo") - .request_id("1234") - .build() - ) - } - - #[test] - fn error_type() { - assert_eq!( - Some(Cow::Borrowed("FooError")), - parse_error_body(br#"{ "__type": "FooError" }"#) - .unwrap() - .code - ); - } - - #[test] - fn code_takes_priority() { - assert_eq!( - Some(Cow::Borrowed("BarError")), - parse_error_body(br#"{ "code": "BarError", "__type": "FooError" }"#) - .unwrap() - .code - ); - } - - #[test] - fn ignore_unrecognized_fields() { - assert_eq!( - Some(Cow::Borrowed("FooError")), - parse_error_body(br#"{ "__type": "FooError", "asdf": 5, "fdsa": {}, "foo": "1" }"#) - .unwrap() - .code - ); - } - - #[test] - fn sanitize_namespace_and_url() { - assert_eq!( - sanitize_error_code("aws.protocoltests.restjson#FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/"), - "FooError"); - } - - #[test] - fn sanitize_noop() { - assert_eq!(sanitize_error_code("FooError"), "FooError"); - } - - #[test] - fn sanitize_url() { - assert_eq!( - sanitize_error_code( - "FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/" - ), - "FooError" - ); - } - - #[test] - fn sanitize_namespace() { - assert_eq!( - sanitize_error_code("aws.protocoltests.restjson#FooError"), - "FooError" - ); - } - - // services like lambda use an alternate `Message` instead of `message` - #[test] - fn alternative_error_message_names() { - let response = http::Response::builder() - .header("x-amzn-errortype", "ResourceNotFoundException") - .body(Bytes::from_static( - br#"{ - "Type": "User", - "Message": "Functions from 'us-west-2' are not reachable from us-east-1" - }"#, - )) - .unwrap(); - assert_eq!( - parse_generic_error(response.body(), response.headers()).unwrap(), - Error::builder() - .code("ResourceNotFoundException") - .message("Functions from 'us-west-2' are not reachable from us-east-1") - .build() - ); - } -} diff --git a/lib/smithy-output/api-group/rust/rust/src/json_ser.rs b/lib/smithy-output/api-group/rust/rust/src/json_ser.rs deleted file mode 100644 index 3303be6ca..000000000 --- a/lib/smithy-output/api-group/rust/rust/src/json_ser.rs +++ /dev/null @@ -1,100 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub fn serialize_structure_crate_input_create_group_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::CreateGroupInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_1) = &input.display_name { - object.key("display_name").string(var_1.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_create_group_invite_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::CreateGroupInviteInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_2) = &input.ttl { - object.key("ttl").number( - #[allow(clippy::useless_conversion)] - aws_smithy_types::Number::NegInt((*var_2).into()), - ); - } - if let Some(var_3) = &input.use_count { - object.key("use_count").number( - #[allow(clippy::useless_conversion)] - aws_smithy_types::Number::NegInt((*var_3).into()), - ); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_prepare_group_avatar_upload_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::PrepareGroupAvatarUploadInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_4) = &input.content_length { - object.key("content_length").number( - #[allow(clippy::useless_conversion)] - aws_smithy_types::Number::NegInt((*var_4).into()), - ); - } - if let Some(var_5) = &input.mime { - object.key("mime").string(var_5.as_str()); - } - if let Some(var_6) = &input.path { - object.key("path").string(var_6.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_resolve_group_join_request_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::ResolveGroupJoinRequestInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_7) = &input.resolution { - object.key("resolution").boolean(*var_7); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_transfer_group_ownership_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::TransferGroupOwnershipInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_8) = &input.new_owner_identity_id { - object.key("new_owner_identity_id").string(var_8.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_update_group_profile_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::UpdateGroupProfileInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_9) = &input.bio { - object.key("bio").string(var_9.as_str()); - } - if let Some(var_10) = &input.display_name { - object.key("display_name").string(var_10.as_str()); - } - if let Some(var_11) = &input.publicity { - object.key("publicity").string(var_11.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_validate_group_profile_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::ValidateGroupProfileInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_12) = &input.bio { - object.key("bio").string(var_12.as_str()); - } - if let Some(var_13) = &input.display_name { - object.key("display_name").string(var_13.as_str()); - } - if let Some(var_14) = &input.publicity { - object.key("publicity").string(var_14.as_str()); - } - Ok(()) -} diff --git a/lib/smithy-output/api-group/rust/rust/src/lib.rs b/lib/smithy-output/api-group/rust/rust/src/lib.rs deleted file mode 100644 index b2eb264b5..000000000 --- a/lib/smithy-output/api-group/rust/rust/src/lib.rs +++ /dev/null @@ -1,57 +0,0 @@ -#![allow(clippy::module_inception)] -#![allow(clippy::upper_case_acronyms)] -#![allow(clippy::large_enum_variant)] -#![allow(clippy::wrong_self_convention)] -#![allow(clippy::should_implement_trait)] -#![allow(clippy::blacklisted_name)] -#![allow(clippy::vec_init_then_push)] -#![allow(rustdoc::bare_urls)] -#![warn(missing_docs)] -//! rivet-group -//! -//! # Crate Organization -//! -//! The entry point for most customers will be [`Client`]. [`Client`] exposes one method for each API offered -//! by the service. -//! -//! Some APIs require complex or nested arguments. These exist in [`model`](crate::model). -//! -//! Lastly, errors that can be returned by the service are contained within [`error`]. [`Error`] defines a meta -//! error encompassing all possible errors that can be returned by the service. -//! -//! The other modules within this crate are not required for normal usage. - -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use error_meta::Error; - -#[doc(inline)] -pub use config::Config; - -/// Client and fluent builders for calling the service. -pub mod client; -/// Configuration for the service. -pub mod config; -/// Errors that can occur when calling the service. -pub mod error; -mod error_meta; -/// Input structures for operations. -pub mod input; -mod json_deser; -mod json_errors; -mod json_ser; -/// Data structures used by operation inputs/outputs. -pub mod model; -/// All operations that this crate can perform. -pub mod operation; -mod operation_deser; -mod operation_ser; -/// Output structures for operations. -pub mod output; -pub use client::{Builder, Client, ClientWrapper}; -/// Crate version number. -pub static PKG_VERSION: &str = env!("CARGO_PKG_VERSION"); -/// Re-exported types from supporting crates. -pub mod types { - pub use aws_smithy_http::result::SdkError; - pub use aws_smithy_types::DateTime; -} diff --git a/lib/smithy-output/api-group/rust/rust/src/model.rs b/lib/smithy-output/api-group/rust/rust/src/model.rs deleted file mode 100644 index d9ecdb7e1..000000000 --- a/lib/smithy-output/api-group/rust/rust/src/model.rs +++ /dev/null @@ -1,2381 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// A group handle. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GroupHandle { - /// A universally unique identifier. - pub group_id: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// The URL of this group's avatar image. - pub avatar_url: std::option::Option, - /// External links for this group. - pub external: std::option::Option, - /// Whether or not this group is a developer group. - pub is_developer: std::option::Option, -} -impl GroupHandle { - /// A universally unique identifier. - pub fn group_id(&self) -> std::option::Option<&str> { - self.group_id.as_deref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// The URL of this group's avatar image. - pub fn avatar_url(&self) -> std::option::Option<&str> { - self.avatar_url.as_deref() - } - /// External links for this group. - pub fn external(&self) -> std::option::Option<&crate::model::GroupExternalLinks> { - self.external.as_ref() - } - /// Whether or not this group is a developer group. - pub fn is_developer(&self) -> std::option::Option { - self.is_developer - } -} -impl std::fmt::Debug for GroupHandle { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GroupHandle"); - formatter.field("group_id", &self.group_id); - formatter.field("display_name", &self.display_name); - formatter.field("avatar_url", &self.avatar_url); - formatter.field("external", &self.external); - formatter.field("is_developer", &self.is_developer); - formatter.finish() - } -} -/// See [`GroupHandle`](crate::model::GroupHandle) -pub mod group_handle { - /// A builder for [`GroupHandle`](crate::model::GroupHandle) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) group_id: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) avatar_url: std::option::Option, - pub(crate) external: std::option::Option, - pub(crate) is_developer: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.group_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.group_id = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// The URL of this group's avatar image. - pub fn avatar_url(mut self, input: impl Into) -> Self { - self.avatar_url = Some(input.into()); - self - } - /// The URL of this group's avatar image. - pub fn set_avatar_url(mut self, input: std::option::Option) -> Self { - self.avatar_url = input; - self - } - /// External links for this group. - pub fn external(mut self, input: crate::model::GroupExternalLinks) -> Self { - self.external = Some(input); - self - } - /// External links for this group. - pub fn set_external( - mut self, - input: std::option::Option, - ) -> Self { - self.external = input; - self - } - /// Whether or not this group is a developer group. - pub fn is_developer(mut self, input: bool) -> Self { - self.is_developer = Some(input); - self - } - /// Whether or not this group is a developer group. - pub fn set_is_developer(mut self, input: std::option::Option) -> Self { - self.is_developer = input; - self - } - /// Consumes the builder and constructs a [`GroupHandle`](crate::model::GroupHandle) - pub fn build(self) -> crate::model::GroupHandle { - crate::model::GroupHandle { - group_id: self.group_id, - display_name: self.display_name, - avatar_url: self.avatar_url, - external: self.external, - is_developer: self.is_developer, - } - } - } -} -impl GroupHandle { - /// Creates a new builder-style object to manufacture [`GroupHandle`](crate::model::GroupHandle) - pub fn builder() -> crate::model::group_handle::Builder { - crate::model::group_handle::Builder::default() - } -} - -/// External links for this group. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GroupExternalLinks { - /// A link to this group's profile page. - pub profile: std::option::Option, - /// A link to this group's chat page. - pub chat: std::option::Option, -} -impl GroupExternalLinks { - /// A link to this group's profile page. - pub fn profile(&self) -> std::option::Option<&str> { - self.profile.as_deref() - } - /// A link to this group's chat page. - pub fn chat(&self) -> std::option::Option<&str> { - self.chat.as_deref() - } -} -impl std::fmt::Debug for GroupExternalLinks { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GroupExternalLinks"); - formatter.field("profile", &self.profile); - formatter.field("chat", &self.chat); - formatter.finish() - } -} -/// See [`GroupExternalLinks`](crate::model::GroupExternalLinks) -pub mod group_external_links { - /// A builder for [`GroupExternalLinks`](crate::model::GroupExternalLinks) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) profile: std::option::Option, - pub(crate) chat: std::option::Option, - } - impl Builder { - /// A link to this group's profile page. - pub fn profile(mut self, input: impl Into) -> Self { - self.profile = Some(input.into()); - self - } - /// A link to this group's profile page. - pub fn set_profile(mut self, input: std::option::Option) -> Self { - self.profile = input; - self - } - /// A link to this group's chat page. - pub fn chat(mut self, input: impl Into) -> Self { - self.chat = Some(input.into()); - self - } - /// A link to this group's chat page. - pub fn set_chat(mut self, input: std::option::Option) -> Self { - self.chat = input; - self - } - /// Consumes the builder and constructs a [`GroupExternalLinks`](crate::model::GroupExternalLinks) - pub fn build(self) -> crate::model::GroupExternalLinks { - crate::model::GroupExternalLinks { - profile: self.profile, - chat: self.chat, - } - } - } -} -impl GroupExternalLinks { - /// Creates a new builder-style object to manufacture [`GroupExternalLinks`](crate::model::GroupExternalLinks) - pub fn builder() -> crate::model::group_external_links::Builder { - crate::model::group_external_links::Builder::default() - } -} - -/// Provided by watchable endpoints used in blocking loops. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct WatchResponse { - /// Index indicating the version of the data responded. Pas this to `rivet.common#WatchQuery` to block and wait for the next response. - pub index: std::option::Option, -} -impl WatchResponse { - /// Index indicating the version of the data responded. Pas this to `rivet.common#WatchQuery` to block and wait for the next response. - pub fn index(&self) -> std::option::Option<&str> { - self.index.as_deref() - } -} -impl std::fmt::Debug for WatchResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("WatchResponse"); - formatter.field("index", &self.index); - formatter.finish() - } -} -/// See [`WatchResponse`](crate::model::WatchResponse) -pub mod watch_response { - /// A builder for [`WatchResponse`](crate::model::WatchResponse) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) index: std::option::Option, - } - impl Builder { - /// Index indicating the version of the data responded. Pas this to `rivet.common#WatchQuery` to block and wait for the next response. - pub fn index(mut self, input: impl Into) -> Self { - self.index = Some(input.into()); - self - } - /// Index indicating the version of the data responded. Pas this to `rivet.common#WatchQuery` to block and wait for the next response. - pub fn set_index(mut self, input: std::option::Option) -> Self { - self.index = input; - self - } - /// Consumes the builder and constructs a [`WatchResponse`](crate::model::WatchResponse) - pub fn build(self) -> crate::model::WatchResponse { - crate::model::WatchResponse { index: self.index } - } - } -} -impl WatchResponse { - /// Creates a new builder-style object to manufacture [`WatchResponse`](crate::model::WatchResponse) - pub fn builder() -> crate::model::watch_response::Builder { - crate::model::watch_response::Builder::default() - } -} - -/// A banned identity. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GroupBannedIdentity { - /// An identity handle. - pub identity: std::option::Option, - /// RFC3339 timestamp. - pub ban_ts: std::option::Option, -} -impl GroupBannedIdentity { - /// An identity handle. - pub fn identity(&self) -> std::option::Option<&crate::model::IdentityHandle> { - self.identity.as_ref() - } - /// RFC3339 timestamp. - pub fn ban_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.ban_ts.as_ref() - } -} -impl std::fmt::Debug for GroupBannedIdentity { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GroupBannedIdentity"); - formatter.field("identity", &self.identity); - formatter.field("ban_ts", &self.ban_ts); - formatter.finish() - } -} -/// See [`GroupBannedIdentity`](crate::model::GroupBannedIdentity) -pub mod group_banned_identity { - /// A builder for [`GroupBannedIdentity`](crate::model::GroupBannedIdentity) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity: std::option::Option, - pub(crate) ban_ts: std::option::Option, - } - impl Builder { - /// An identity handle. - pub fn identity(mut self, input: crate::model::IdentityHandle) -> Self { - self.identity = Some(input); - self - } - /// An identity handle. - pub fn set_identity( - mut self, - input: std::option::Option, - ) -> Self { - self.identity = input; - self - } - /// RFC3339 timestamp. - pub fn ban_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.ban_ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_ban_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.ban_ts = input; - self - } - /// Consumes the builder and constructs a [`GroupBannedIdentity`](crate::model::GroupBannedIdentity) - pub fn build(self) -> crate::model::GroupBannedIdentity { - crate::model::GroupBannedIdentity { - identity: self.identity, - ban_ts: self.ban_ts, - } - } - } -} -impl GroupBannedIdentity { - /// Creates a new builder-style object to manufacture [`GroupBannedIdentity`](crate::model::GroupBannedIdentity) - pub fn builder() -> crate::model::group_banned_identity::Builder { - crate::model::group_banned_identity::Builder::default() - } -} - -/// An identity handle. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct IdentityHandle { - /// A universally unique identifier. - pub identity_id: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub account_number: std::option::Option, - /// The URL of this identity's avatar image. - pub avatar_url: std::option::Option, - /// Information about the identity's current status, party, and active game. - pub presence: std::option::Option, - /// A party handle. - pub party: std::option::Option, - /// Whether or not this identity is registered with a linked account. - pub is_registered: std::option::Option, - /// External links for an identity. - pub external: std::option::Option, -} -impl IdentityHandle { - /// A universally unique identifier. - pub fn identity_id(&self) -> std::option::Option<&str> { - self.identity_id.as_deref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub fn account_number(&self) -> std::option::Option { - self.account_number - } - /// The URL of this identity's avatar image. - pub fn avatar_url(&self) -> std::option::Option<&str> { - self.avatar_url.as_deref() - } - /// Information about the identity's current status, party, and active game. - pub fn presence(&self) -> std::option::Option<&crate::model::IdentityPresence> { - self.presence.as_ref() - } - /// A party handle. - pub fn party(&self) -> std::option::Option<&crate::model::PartyHandle> { - self.party.as_ref() - } - /// Whether or not this identity is registered with a linked account. - pub fn is_registered(&self) -> std::option::Option { - self.is_registered - } - /// External links for an identity. - pub fn external(&self) -> std::option::Option<&crate::model::IdentityExternalLinks> { - self.external.as_ref() - } -} -impl std::fmt::Debug for IdentityHandle { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("IdentityHandle"); - formatter.field("identity_id", &self.identity_id); - formatter.field("display_name", &self.display_name); - formatter.field("account_number", &self.account_number); - formatter.field("avatar_url", &self.avatar_url); - formatter.field("presence", &self.presence); - formatter.field("party", &self.party); - formatter.field("is_registered", &self.is_registered); - formatter.field("external", &self.external); - formatter.finish() - } -} -/// See [`IdentityHandle`](crate::model::IdentityHandle) -pub mod identity_handle { - /// A builder for [`IdentityHandle`](crate::model::IdentityHandle) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity_id: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) account_number: std::option::Option, - pub(crate) avatar_url: std::option::Option, - pub(crate) presence: std::option::Option, - pub(crate) party: std::option::Option, - pub(crate) is_registered: std::option::Option, - pub(crate) external: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.identity_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.identity_id = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub fn account_number(mut self, input: i32) -> Self { - self.account_number = Some(input); - self - } - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub fn set_account_number(mut self, input: std::option::Option) -> Self { - self.account_number = input; - self - } - /// The URL of this identity's avatar image. - pub fn avatar_url(mut self, input: impl Into) -> Self { - self.avatar_url = Some(input.into()); - self - } - /// The URL of this identity's avatar image. - pub fn set_avatar_url(mut self, input: std::option::Option) -> Self { - self.avatar_url = input; - self - } - /// Information about the identity's current status, party, and active game. - pub fn presence(mut self, input: crate::model::IdentityPresence) -> Self { - self.presence = Some(input); - self - } - /// Information about the identity's current status, party, and active game. - pub fn set_presence( - mut self, - input: std::option::Option, - ) -> Self { - self.presence = input; - self - } - /// A party handle. - pub fn party(mut self, input: crate::model::PartyHandle) -> Self { - self.party = Some(input); - self - } - /// A party handle. - pub fn set_party(mut self, input: std::option::Option) -> Self { - self.party = input; - self - } - /// Whether or not this identity is registered with a linked account. - pub fn is_registered(mut self, input: bool) -> Self { - self.is_registered = Some(input); - self - } - /// Whether or not this identity is registered with a linked account. - pub fn set_is_registered(mut self, input: std::option::Option) -> Self { - self.is_registered = input; - self - } - /// External links for an identity. - pub fn external(mut self, input: crate::model::IdentityExternalLinks) -> Self { - self.external = Some(input); - self - } - /// External links for an identity. - pub fn set_external( - mut self, - input: std::option::Option, - ) -> Self { - self.external = input; - self - } - /// Consumes the builder and constructs a [`IdentityHandle`](crate::model::IdentityHandle) - pub fn build(self) -> crate::model::IdentityHandle { - crate::model::IdentityHandle { - identity_id: self.identity_id, - display_name: self.display_name, - account_number: self.account_number, - avatar_url: self.avatar_url, - presence: self.presence, - party: self.party, - is_registered: self.is_registered, - external: self.external, - } - } - } -} -impl IdentityHandle { - /// Creates a new builder-style object to manufacture [`IdentityHandle`](crate::model::IdentityHandle) - pub fn builder() -> crate::model::identity_handle::Builder { - crate::model::identity_handle::Builder::default() - } -} - -/// External links for an identity. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct IdentityExternalLinks { - /// A link to this identity's profile page. - pub profile: std::option::Option, - /// A link to the Rivet settings page. - pub settings: std::option::Option, - /// A link to a chat page with the given identity. - pub chat: std::option::Option, -} -impl IdentityExternalLinks { - /// A link to this identity's profile page. - pub fn profile(&self) -> std::option::Option<&str> { - self.profile.as_deref() - } - /// A link to the Rivet settings page. - pub fn settings(&self) -> std::option::Option<&str> { - self.settings.as_deref() - } - /// A link to a chat page with the given identity. - pub fn chat(&self) -> std::option::Option<&str> { - self.chat.as_deref() - } -} -impl std::fmt::Debug for IdentityExternalLinks { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("IdentityExternalLinks"); - formatter.field("profile", &self.profile); - formatter.field("settings", &self.settings); - formatter.field("chat", &self.chat); - formatter.finish() - } -} -/// See [`IdentityExternalLinks`](crate::model::IdentityExternalLinks) -pub mod identity_external_links { - /// A builder for [`IdentityExternalLinks`](crate::model::IdentityExternalLinks) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) profile: std::option::Option, - pub(crate) settings: std::option::Option, - pub(crate) chat: std::option::Option, - } - impl Builder { - /// A link to this identity's profile page. - pub fn profile(mut self, input: impl Into) -> Self { - self.profile = Some(input.into()); - self - } - /// A link to this identity's profile page. - pub fn set_profile(mut self, input: std::option::Option) -> Self { - self.profile = input; - self - } - /// A link to the Rivet settings page. - pub fn settings(mut self, input: impl Into) -> Self { - self.settings = Some(input.into()); - self - } - /// A link to the Rivet settings page. - pub fn set_settings(mut self, input: std::option::Option) -> Self { - self.settings = input; - self - } - /// A link to a chat page with the given identity. - pub fn chat(mut self, input: impl Into) -> Self { - self.chat = Some(input.into()); - self - } - /// A link to a chat page with the given identity. - pub fn set_chat(mut self, input: std::option::Option) -> Self { - self.chat = input; - self - } - /// Consumes the builder and constructs a [`IdentityExternalLinks`](crate::model::IdentityExternalLinks) - pub fn build(self) -> crate::model::IdentityExternalLinks { - crate::model::IdentityExternalLinks { - profile: self.profile, - settings: self.settings, - chat: self.chat, - } - } - } -} -impl IdentityExternalLinks { - /// Creates a new builder-style object to manufacture [`IdentityExternalLinks`](crate::model::IdentityExternalLinks) - pub fn builder() -> crate::model::identity_external_links::Builder { - crate::model::identity_external_links::Builder::default() - } -} - -/// A party handle. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PartyHandle { - /// A universally unique identifier. - pub party_id: std::option::Option, - /// RFC3339 timestamp. - pub create_ts: std::option::Option, - /// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. - pub activity: std::option::Option, - /// External links for a party. - pub external: std::option::Option, -} -impl PartyHandle { - /// A universally unique identifier. - pub fn party_id(&self) -> std::option::Option<&str> { - self.party_id.as_deref() - } - /// RFC3339 timestamp. - pub fn create_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.create_ts.as_ref() - } - /// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. - pub fn activity(&self) -> std::option::Option<&crate::model::PartyActivity> { - self.activity.as_ref() - } - /// External links for a party. - pub fn external(&self) -> std::option::Option<&crate::model::PartyExternalLinks> { - self.external.as_ref() - } -} -impl std::fmt::Debug for PartyHandle { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PartyHandle"); - formatter.field("party_id", &self.party_id); - formatter.field("create_ts", &self.create_ts); - formatter.field("activity", &self.activity); - formatter.field("external", &self.external); - formatter.finish() - } -} -/// See [`PartyHandle`](crate::model::PartyHandle) -pub mod party_handle { - /// A builder for [`PartyHandle`](crate::model::PartyHandle) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) party_id: std::option::Option, - pub(crate) create_ts: std::option::Option, - pub(crate) activity: std::option::Option, - pub(crate) external: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn party_id(mut self, input: impl Into) -> Self { - self.party_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_party_id(mut self, input: std::option::Option) -> Self { - self.party_id = input; - self - } - /// RFC3339 timestamp. - pub fn create_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.create_ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_create_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.create_ts = input; - self - } - /// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. - pub fn activity(mut self, input: crate::model::PartyActivity) -> Self { - self.activity = Some(input); - self - } - /// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. - pub fn set_activity( - mut self, - input: std::option::Option, - ) -> Self { - self.activity = input; - self - } - /// External links for a party. - pub fn external(mut self, input: crate::model::PartyExternalLinks) -> Self { - self.external = Some(input); - self - } - /// External links for a party. - pub fn set_external( - mut self, - input: std::option::Option, - ) -> Self { - self.external = input; - self - } - /// Consumes the builder and constructs a [`PartyHandle`](crate::model::PartyHandle) - pub fn build(self) -> crate::model::PartyHandle { - crate::model::PartyHandle { - party_id: self.party_id, - create_ts: self.create_ts, - activity: self.activity, - external: self.external, - } - } - } -} -impl PartyHandle { - /// Creates a new builder-style object to manufacture [`PartyHandle`](crate::model::PartyHandle) - pub fn builder() -> crate::model::party_handle::Builder { - crate::model::party_handle::Builder::default() - } -} - -/// External links for a party. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PartyExternalLinks { - /// A link to the given party's chat thread. - pub chat: std::option::Option, -} -impl PartyExternalLinks { - /// A link to the given party's chat thread. - pub fn chat(&self) -> std::option::Option<&str> { - self.chat.as_deref() - } -} -impl std::fmt::Debug for PartyExternalLinks { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PartyExternalLinks"); - formatter.field("chat", &self.chat); - formatter.finish() - } -} -/// See [`PartyExternalLinks`](crate::model::PartyExternalLinks) -pub mod party_external_links { - /// A builder for [`PartyExternalLinks`](crate::model::PartyExternalLinks) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) chat: std::option::Option, - } - impl Builder { - /// A link to the given party's chat thread. - pub fn chat(mut self, input: impl Into) -> Self { - self.chat = Some(input.into()); - self - } - /// A link to the given party's chat thread. - pub fn set_chat(mut self, input: std::option::Option) -> Self { - self.chat = input; - self - } - /// Consumes the builder and constructs a [`PartyExternalLinks`](crate::model::PartyExternalLinks) - pub fn build(self) -> crate::model::PartyExternalLinks { - crate::model::PartyExternalLinks { chat: self.chat } - } - } -} -impl PartyExternalLinks { - /// Creates a new builder-style object to manufacture [`PartyExternalLinks`](crate::model::PartyExternalLinks) - pub fn builder() -> crate::model::party_external_links::Builder { - crate::model::party_external_links::Builder::default() - } -} - -/// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] -pub enum PartyActivity { - /// A party activity denoting that the party is idle. - Idle(crate::model::PartyActivityIdle), - /// A party activity denoting that the party is currently searching for a lobby. - MatchmakerFindingLobby(crate::model::PartyActivityMatchmakerFindingLobby), - /// A party activity denoting that the party is currently in a lobby. - MatchmakerLobby(crate::model::PartyActivityMatchmakerLobby), - /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version. - /// An unknown enum variant - /// - /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._ - /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized - /// by the client. This can happen when the server adds new functionality, but the client has not been updated. - /// To investigate this, consider turning on debug logging to print the raw HTTP response. - #[non_exhaustive] - Unknown, -} -impl PartyActivity { - /// Tries to convert the enum instance into [`Idle`](crate::model::PartyActivity::Idle), extracting the inner [`PartyActivityIdle`](crate::model::PartyActivityIdle). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_idle(&self) -> std::result::Result<&crate::model::PartyActivityIdle, &Self> { - if let PartyActivity::Idle(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`Idle`](crate::model::PartyActivity::Idle). - pub fn is_idle(&self) -> bool { - self.as_idle().is_ok() - } - /// Tries to convert the enum instance into [`MatchmakerFindingLobby`](crate::model::PartyActivity::MatchmakerFindingLobby), extracting the inner [`PartyActivityMatchmakerFindingLobby`](crate::model::PartyActivityMatchmakerFindingLobby). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_matchmaker_finding_lobby( - &self, - ) -> std::result::Result<&crate::model::PartyActivityMatchmakerFindingLobby, &Self> { - if let PartyActivity::MatchmakerFindingLobby(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`MatchmakerFindingLobby`](crate::model::PartyActivity::MatchmakerFindingLobby). - pub fn is_matchmaker_finding_lobby(&self) -> bool { - self.as_matchmaker_finding_lobby().is_ok() - } - /// Tries to convert the enum instance into [`MatchmakerLobby`](crate::model::PartyActivity::MatchmakerLobby), extracting the inner [`PartyActivityMatchmakerLobby`](crate::model::PartyActivityMatchmakerLobby). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_matchmaker_lobby( - &self, - ) -> std::result::Result<&crate::model::PartyActivityMatchmakerLobby, &Self> { - if let PartyActivity::MatchmakerLobby(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`MatchmakerLobby`](crate::model::PartyActivity::MatchmakerLobby). - pub fn is_matchmaker_lobby(&self) -> bool { - self.as_matchmaker_lobby().is_ok() - } - /// Returns true if the enum instance is the `Unknown` variant. - pub fn is_unknown(&self) -> bool { - matches!(self, Self::Unknown) - } -} - -/// A party activity denoting that the party is currently in a lobby. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PartyActivityMatchmakerLobby { - /// A party lobby. - pub lobby: std::option::Option, - /// A game handle. - pub game: std::option::Option, -} -impl PartyActivityMatchmakerLobby { - /// A party lobby. - pub fn lobby(&self) -> std::option::Option<&crate::model::PartyMatchmakerLobby> { - self.lobby.as_ref() - } - /// A game handle. - pub fn game(&self) -> std::option::Option<&crate::model::GameHandle> { - self.game.as_ref() - } -} -impl std::fmt::Debug for PartyActivityMatchmakerLobby { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PartyActivityMatchmakerLobby"); - formatter.field("lobby", &self.lobby); - formatter.field("game", &self.game); - formatter.finish() - } -} -/// See [`PartyActivityMatchmakerLobby`](crate::model::PartyActivityMatchmakerLobby) -pub mod party_activity_matchmaker_lobby { - /// A builder for [`PartyActivityMatchmakerLobby`](crate::model::PartyActivityMatchmakerLobby) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) lobby: std::option::Option, - pub(crate) game: std::option::Option, - } - impl Builder { - /// A party lobby. - pub fn lobby(mut self, input: crate::model::PartyMatchmakerLobby) -> Self { - self.lobby = Some(input); - self - } - /// A party lobby. - pub fn set_lobby( - mut self, - input: std::option::Option, - ) -> Self { - self.lobby = input; - self - } - /// A game handle. - pub fn game(mut self, input: crate::model::GameHandle) -> Self { - self.game = Some(input); - self - } - /// A game handle. - pub fn set_game(mut self, input: std::option::Option) -> Self { - self.game = input; - self - } - /// Consumes the builder and constructs a [`PartyActivityMatchmakerLobby`](crate::model::PartyActivityMatchmakerLobby) - pub fn build(self) -> crate::model::PartyActivityMatchmakerLobby { - crate::model::PartyActivityMatchmakerLobby { - lobby: self.lobby, - game: self.game, - } - } - } -} -impl PartyActivityMatchmakerLobby { - /// Creates a new builder-style object to manufacture [`PartyActivityMatchmakerLobby`](crate::model::PartyActivityMatchmakerLobby) - pub fn builder() -> crate::model::party_activity_matchmaker_lobby::Builder { - crate::model::party_activity_matchmaker_lobby::Builder::default() - } -} - -/// A game handle. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GameHandle { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub name_id: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// The URL of this game's logo image. - pub logo_url: std::option::Option, - /// The URL of this game's banner image. - pub banner_url: std::option::Option, -} -impl GameHandle { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn name_id(&self) -> std::option::Option<&str> { - self.name_id.as_deref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// The URL of this game's logo image. - pub fn logo_url(&self) -> std::option::Option<&str> { - self.logo_url.as_deref() - } - /// The URL of this game's banner image. - pub fn banner_url(&self) -> std::option::Option<&str> { - self.banner_url.as_deref() - } -} -impl std::fmt::Debug for GameHandle { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GameHandle"); - formatter.field("game_id", &self.game_id); - formatter.field("name_id", &self.name_id); - formatter.field("display_name", &self.display_name); - formatter.field("logo_url", &self.logo_url); - formatter.field("banner_url", &self.banner_url); - formatter.finish() - } -} -/// See [`GameHandle`](crate::model::GameHandle) -pub mod game_handle { - /// A builder for [`GameHandle`](crate::model::GameHandle) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) name_id: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) logo_url: std::option::Option, - pub(crate) banner_url: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn name_id(mut self, input: impl Into) -> Self { - self.name_id = Some(input.into()); - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn set_name_id(mut self, input: std::option::Option) -> Self { - self.name_id = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// The URL of this game's logo image. - pub fn logo_url(mut self, input: impl Into) -> Self { - self.logo_url = Some(input.into()); - self - } - /// The URL of this game's logo image. - pub fn set_logo_url(mut self, input: std::option::Option) -> Self { - self.logo_url = input; - self - } - /// The URL of this game's banner image. - pub fn banner_url(mut self, input: impl Into) -> Self { - self.banner_url = Some(input.into()); - self - } - /// The URL of this game's banner image. - pub fn set_banner_url(mut self, input: std::option::Option) -> Self { - self.banner_url = input; - self - } - /// Consumes the builder and constructs a [`GameHandle`](crate::model::GameHandle) - pub fn build(self) -> crate::model::GameHandle { - crate::model::GameHandle { - game_id: self.game_id, - name_id: self.name_id, - display_name: self.display_name, - logo_url: self.logo_url, - banner_url: self.banner_url, - } - } - } -} -impl GameHandle { - /// Creates a new builder-style object to manufacture [`GameHandle`](crate::model::GameHandle) - pub fn builder() -> crate::model::game_handle::Builder { - crate::model::game_handle::Builder::default() - } -} - -/// A party lobby. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PartyMatchmakerLobby { - /// A universally unique identifier. - pub lobby_id: std::option::Option, -} -impl PartyMatchmakerLobby { - /// A universally unique identifier. - pub fn lobby_id(&self) -> std::option::Option<&str> { - self.lobby_id.as_deref() - } -} -impl std::fmt::Debug for PartyMatchmakerLobby { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PartyMatchmakerLobby"); - formatter.field("lobby_id", &self.lobby_id); - formatter.finish() - } -} -/// See [`PartyMatchmakerLobby`](crate::model::PartyMatchmakerLobby) -pub mod party_matchmaker_lobby { - /// A builder for [`PartyMatchmakerLobby`](crate::model::PartyMatchmakerLobby) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) lobby_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn lobby_id(mut self, input: impl Into) -> Self { - self.lobby_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_lobby_id(mut self, input: std::option::Option) -> Self { - self.lobby_id = input; - self - } - /// Consumes the builder and constructs a [`PartyMatchmakerLobby`](crate::model::PartyMatchmakerLobby) - pub fn build(self) -> crate::model::PartyMatchmakerLobby { - crate::model::PartyMatchmakerLobby { - lobby_id: self.lobby_id, - } - } - } -} -impl PartyMatchmakerLobby { - /// Creates a new builder-style object to manufacture [`PartyMatchmakerLobby`](crate::model::PartyMatchmakerLobby) - pub fn builder() -> crate::model::party_matchmaker_lobby::Builder { - crate::model::party_matchmaker_lobby::Builder::default() - } -} - -/// A party activity denoting that the party is currently searching for a lobby. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PartyActivityMatchmakerFindingLobby { - /// A game handle. - pub game: std::option::Option, -} -impl PartyActivityMatchmakerFindingLobby { - /// A game handle. - pub fn game(&self) -> std::option::Option<&crate::model::GameHandle> { - self.game.as_ref() - } -} -impl std::fmt::Debug for PartyActivityMatchmakerFindingLobby { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PartyActivityMatchmakerFindingLobby"); - formatter.field("game", &self.game); - formatter.finish() - } -} -/// See [`PartyActivityMatchmakerFindingLobby`](crate::model::PartyActivityMatchmakerFindingLobby) -pub mod party_activity_matchmaker_finding_lobby { - /// A builder for [`PartyActivityMatchmakerFindingLobby`](crate::model::PartyActivityMatchmakerFindingLobby) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game: std::option::Option, - } - impl Builder { - /// A game handle. - pub fn game(mut self, input: crate::model::GameHandle) -> Self { - self.game = Some(input); - self - } - /// A game handle. - pub fn set_game(mut self, input: std::option::Option) -> Self { - self.game = input; - self - } - /// Consumes the builder and constructs a [`PartyActivityMatchmakerFindingLobby`](crate::model::PartyActivityMatchmakerFindingLobby) - pub fn build(self) -> crate::model::PartyActivityMatchmakerFindingLobby { - crate::model::PartyActivityMatchmakerFindingLobby { game: self.game } - } - } -} -impl PartyActivityMatchmakerFindingLobby { - /// Creates a new builder-style object to manufacture [`PartyActivityMatchmakerFindingLobby`](crate::model::PartyActivityMatchmakerFindingLobby) - pub fn builder() -> crate::model::party_activity_matchmaker_finding_lobby::Builder { - crate::model::party_activity_matchmaker_finding_lobby::Builder::default() - } -} - -/// A party activity denoting that the party is idle. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PartyActivityIdle {} -impl std::fmt::Debug for PartyActivityIdle { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PartyActivityIdle"); - formatter.finish() - } -} -/// See [`PartyActivityIdle`](crate::model::PartyActivityIdle) -pub mod party_activity_idle { - /// A builder for [`PartyActivityIdle`](crate::model::PartyActivityIdle) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`PartyActivityIdle`](crate::model::PartyActivityIdle) - pub fn build(self) -> crate::model::PartyActivityIdle { - crate::model::PartyActivityIdle {} - } - } -} -impl PartyActivityIdle { - /// Creates a new builder-style object to manufacture [`PartyActivityIdle`](crate::model::PartyActivityIdle) - pub fn builder() -> crate::model::party_activity_idle::Builder { - crate::model::party_activity_idle::Builder::default() - } -} - -/// Information about the identity's current status, party, and active game. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct IdentityPresence { - /// RFC3339 timestamp. - pub update_ts: std::option::Option, - /// The current status of an identity. This helps players understand if another player is currently playing or has their game in the background. - pub status: std::option::Option, - /// The game an identity is currently participating in. - pub game_activity: std::option::Option, -} -impl IdentityPresence { - /// RFC3339 timestamp. - pub fn update_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.update_ts.as_ref() - } - /// The current status of an identity. This helps players understand if another player is currently playing or has their game in the background. - pub fn status(&self) -> std::option::Option<&crate::model::IdentityStatus> { - self.status.as_ref() - } - /// The game an identity is currently participating in. - pub fn game_activity(&self) -> std::option::Option<&crate::model::IdentityGameActivity> { - self.game_activity.as_ref() - } -} -impl std::fmt::Debug for IdentityPresence { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("IdentityPresence"); - formatter.field("update_ts", &self.update_ts); - formatter.field("status", &self.status); - formatter.field("game_activity", &self.game_activity); - formatter.finish() - } -} -/// See [`IdentityPresence`](crate::model::IdentityPresence) -pub mod identity_presence { - /// A builder for [`IdentityPresence`](crate::model::IdentityPresence) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) update_ts: std::option::Option, - pub(crate) status: std::option::Option, - pub(crate) game_activity: std::option::Option, - } - impl Builder { - /// RFC3339 timestamp. - pub fn update_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.update_ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_update_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.update_ts = input; - self - } - /// The current status of an identity. This helps players understand if another player is currently playing or has their game in the background. - pub fn status(mut self, input: crate::model::IdentityStatus) -> Self { - self.status = Some(input); - self - } - /// The current status of an identity. This helps players understand if another player is currently playing or has their game in the background. - pub fn set_status( - mut self, - input: std::option::Option, - ) -> Self { - self.status = input; - self - } - /// The game an identity is currently participating in. - pub fn game_activity(mut self, input: crate::model::IdentityGameActivity) -> Self { - self.game_activity = Some(input); - self - } - /// The game an identity is currently participating in. - pub fn set_game_activity( - mut self, - input: std::option::Option, - ) -> Self { - self.game_activity = input; - self - } - /// Consumes the builder and constructs a [`IdentityPresence`](crate::model::IdentityPresence) - pub fn build(self) -> crate::model::IdentityPresence { - crate::model::IdentityPresence { - update_ts: self.update_ts, - status: self.status, - game_activity: self.game_activity, - } - } - } -} -impl IdentityPresence { - /// Creates a new builder-style object to manufacture [`IdentityPresence`](crate::model::IdentityPresence) - pub fn builder() -> crate::model::identity_presence::Builder { - crate::model::identity_presence::Builder::default() - } -} - -/// The game an identity is currently participating in. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct IdentityGameActivity { - /// A game handle. - pub game: std::option::Option, - /// A short activity message about the current game activity. - pub message: std::option::Option, - /// JSON data seen by anyone. - pub public_metadata: std::option::Option, - /// JSON data seen only by the given identity and their mutual followers. - pub mutual_metadata: std::option::Option, -} -impl IdentityGameActivity { - /// A game handle. - pub fn game(&self) -> std::option::Option<&crate::model::GameHandle> { - self.game.as_ref() - } - /// A short activity message about the current game activity. - pub fn message(&self) -> std::option::Option<&str> { - self.message.as_deref() - } - /// JSON data seen by anyone. - pub fn public_metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.public_metadata.as_ref() - } - /// JSON data seen only by the given identity and their mutual followers. - pub fn mutual_metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.mutual_metadata.as_ref() - } -} -impl std::fmt::Debug for IdentityGameActivity { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("IdentityGameActivity"); - formatter.field("game", &self.game); - formatter.field("message", &self.message); - formatter.field("public_metadata", &self.public_metadata); - formatter.field("mutual_metadata", &self.mutual_metadata); - formatter.finish() - } -} -/// See [`IdentityGameActivity`](crate::model::IdentityGameActivity) -pub mod identity_game_activity { - /// A builder for [`IdentityGameActivity`](crate::model::IdentityGameActivity) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) public_metadata: std::option::Option, - pub(crate) mutual_metadata: std::option::Option, - } - impl Builder { - /// A game handle. - pub fn game(mut self, input: crate::model::GameHandle) -> Self { - self.game = Some(input); - self - } - /// A game handle. - pub fn set_game(mut self, input: std::option::Option) -> Self { - self.game = input; - self - } - /// A short activity message about the current game activity. - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - /// A short activity message about the current game activity. - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - /// JSON data seen by anyone. - pub fn public_metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.public_metadata = Some(input); - self - } - /// JSON data seen by anyone. - pub fn set_public_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.public_metadata = input; - self - } - /// JSON data seen only by the given identity and their mutual followers. - pub fn mutual_metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.mutual_metadata = Some(input); - self - } - /// JSON data seen only by the given identity and their mutual followers. - pub fn set_mutual_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.mutual_metadata = input; - self - } - /// Consumes the builder and constructs a [`IdentityGameActivity`](crate::model::IdentityGameActivity) - pub fn build(self) -> crate::model::IdentityGameActivity { - crate::model::IdentityGameActivity { - game: self.game, - message: self.message, - public_metadata: self.public_metadata, - mutual_metadata: self.mutual_metadata, - } - } - } -} -impl IdentityGameActivity { - /// Creates a new builder-style object to manufacture [`IdentityGameActivity`](crate::model::IdentityGameActivity) - pub fn builder() -> crate::model::identity_game_activity::Builder { - crate::model::identity_game_activity::Builder::default() - } -} - -/// The current status of an identity. This helps players understand if another -/// player is currently playing or has their game in the background. -#[non_exhaustive] -#[derive( - std::clone::Clone, - std::cmp::Eq, - std::cmp::Ord, - std::cmp::PartialEq, - std::cmp::PartialOrd, - std::fmt::Debug, - std::hash::Hash, -)] -pub enum IdentityStatus { - #[allow(missing_docs)] // documentation missing in model - Away, - #[allow(missing_docs)] // documentation missing in model - Offline, - #[allow(missing_docs)] // documentation missing in model - Online, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for IdentityStatus { - fn from(s: &str) -> Self { - match s { - "away" => IdentityStatus::Away, - "offline" => IdentityStatus::Offline, - "online" => IdentityStatus::Online, - other => IdentityStatus::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for IdentityStatus { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(IdentityStatus::from(s)) - } -} -impl IdentityStatus { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - IdentityStatus::Away => "away", - IdentityStatus::Offline => "offline", - IdentityStatus::Online => "online", - IdentityStatus::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["away", "offline", "online"] - } -} -impl AsRef for IdentityStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// A presigned request used to upload files. Upload your file to the given URL via a PUT request. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UploadPresignedRequest { - /// The name of the file to upload. This is the same as the one given in the upload prepare file. - pub path: std::option::Option, - /// The URL of the presigned request for which to upload your file to. - pub url: std::option::Option, -} -impl UploadPresignedRequest { - /// The name of the file to upload. This is the same as the one given in the upload prepare file. - pub fn path(&self) -> std::option::Option<&str> { - self.path.as_deref() - } - /// The URL of the presigned request for which to upload your file to. - pub fn url(&self) -> std::option::Option<&str> { - self.url.as_deref() - } -} -impl std::fmt::Debug for UploadPresignedRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UploadPresignedRequest"); - formatter.field("path", &self.path); - formatter.field("url", &self.url); - formatter.finish() - } -} -/// See [`UploadPresignedRequest`](crate::model::UploadPresignedRequest) -pub mod upload_presigned_request { - /// A builder for [`UploadPresignedRequest`](crate::model::UploadPresignedRequest) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) path: std::option::Option, - pub(crate) url: std::option::Option, - } - impl Builder { - /// The name of the file to upload. This is the same as the one given in the upload prepare file. - pub fn path(mut self, input: impl Into) -> Self { - self.path = Some(input.into()); - self - } - /// The name of the file to upload. This is the same as the one given in the upload prepare file. - pub fn set_path(mut self, input: std::option::Option) -> Self { - self.path = input; - self - } - /// The URL of the presigned request for which to upload your file to. - pub fn url(mut self, input: impl Into) -> Self { - self.url = Some(input.into()); - self - } - /// The URL of the presigned request for which to upload your file to. - pub fn set_url(mut self, input: std::option::Option) -> Self { - self.url = input; - self - } - /// Consumes the builder and constructs a [`UploadPresignedRequest`](crate::model::UploadPresignedRequest) - pub fn build(self) -> crate::model::UploadPresignedRequest { - crate::model::UploadPresignedRequest { - path: self.path, - url: self.url, - } - } - } -} -impl UploadPresignedRequest { - /// Creates a new builder-style object to manufacture [`UploadPresignedRequest`](crate::model::UploadPresignedRequest) - pub fn builder() -> crate::model::upload_presigned_request::Builder { - crate::model::upload_presigned_request::Builder::default() - } -} - -/// An error given by failed content validation. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ValidationError { - /// A list of strings denoting the origin of a validation error. - pub path: std::option::Option>, -} -impl ValidationError { - /// A list of strings denoting the origin of a validation error. - pub fn path(&self) -> std::option::Option<&[std::string::String]> { - self.path.as_deref() - } -} -impl std::fmt::Debug for ValidationError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ValidationError"); - formatter.field("path", &self.path); - formatter.finish() - } -} -/// See [`ValidationError`](crate::model::ValidationError) -pub mod validation_error { - /// A builder for [`ValidationError`](crate::model::ValidationError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) path: std::option::Option>, - } - impl Builder { - /// Appends an item to `path`. - /// - /// To override the contents of this collection use [`set_path`](Self::set_path). - /// - /// A list of strings denoting the origin of a validation error. - pub fn path(mut self, input: impl Into) -> Self { - let mut v = self.path.unwrap_or_default(); - v.push(input.into()); - self.path = Some(v); - self - } - /// A list of strings denoting the origin of a validation error. - pub fn set_path( - mut self, - input: std::option::Option>, - ) -> Self { - self.path = input; - self - } - /// Consumes the builder and constructs a [`ValidationError`](crate::model::ValidationError) - pub fn build(self) -> crate::model::ValidationError { - crate::model::ValidationError { path: self.path } - } - } -} -impl ValidationError { - /// Creates a new builder-style object to manufacture [`ValidationError`](crate::model::ValidationError) - pub fn builder() -> crate::model::validation_error::Builder { - crate::model::validation_error::Builder::default() - } -} - -/// The current publicity value for the given group. -#[non_exhaustive] -#[derive( - std::clone::Clone, - std::cmp::Eq, - std::cmp::Ord, - std::cmp::PartialEq, - std::cmp::PartialOrd, - std::fmt::Debug, - std::hash::Hash, -)] -pub enum GroupPublicity { - #[allow(missing_docs)] // documentation missing in model - Closed, - #[allow(missing_docs)] // documentation missing in model - Open, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for GroupPublicity { - fn from(s: &str) -> Self { - match s { - "closed" => GroupPublicity::Closed, - "open" => GroupPublicity::Open, - other => GroupPublicity::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for GroupPublicity { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(GroupPublicity::from(s)) - } -} -impl GroupPublicity { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - GroupPublicity::Closed => "closed", - GroupPublicity::Open => "open", - GroupPublicity::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["closed", "open"] - } -} -impl AsRef for GroupPublicity { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// A group summary. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GroupSummary { - /// A universally unique identifier. - pub group_id: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// The URL of this group's avatar image. - pub avatar_url: std::option::Option, - /// External links for this group. - pub external: std::option::Option, - /// Whether or not this group is a developer. - pub is_developer: std::option::Option, - /// Detailed information about a profile. - pub bio: std::option::Option, - /// Whether or not the current identity is a member of this group. - pub is_current_identity_member: std::option::Option, - /// The current publicity value for the given group. - pub publicity: std::option::Option, - /// Unsigned 32 bit integer. - pub member_count: std::option::Option, - /// A universally unique identifier. - pub owner_identity_id: std::option::Option, -} -impl GroupSummary { - /// A universally unique identifier. - pub fn group_id(&self) -> std::option::Option<&str> { - self.group_id.as_deref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// The URL of this group's avatar image. - pub fn avatar_url(&self) -> std::option::Option<&str> { - self.avatar_url.as_deref() - } - /// External links for this group. - pub fn external(&self) -> std::option::Option<&crate::model::GroupExternalLinks> { - self.external.as_ref() - } - /// Whether or not this group is a developer. - pub fn is_developer(&self) -> std::option::Option { - self.is_developer - } - /// Detailed information about a profile. - pub fn bio(&self) -> std::option::Option<&str> { - self.bio.as_deref() - } - /// Whether or not the current identity is a member of this group. - pub fn is_current_identity_member(&self) -> std::option::Option { - self.is_current_identity_member - } - /// The current publicity value for the given group. - pub fn publicity(&self) -> std::option::Option<&crate::model::GroupPublicity> { - self.publicity.as_ref() - } - /// Unsigned 32 bit integer. - pub fn member_count(&self) -> std::option::Option { - self.member_count - } - /// A universally unique identifier. - pub fn owner_identity_id(&self) -> std::option::Option<&str> { - self.owner_identity_id.as_deref() - } -} -impl std::fmt::Debug for GroupSummary { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GroupSummary"); - formatter.field("group_id", &self.group_id); - formatter.field("display_name", &self.display_name); - formatter.field("avatar_url", &self.avatar_url); - formatter.field("external", &self.external); - formatter.field("is_developer", &self.is_developer); - formatter.field("bio", &self.bio); - formatter.field( - "is_current_identity_member", - &self.is_current_identity_member, - ); - formatter.field("publicity", &self.publicity); - formatter.field("member_count", &self.member_count); - formatter.field("owner_identity_id", &self.owner_identity_id); - formatter.finish() - } -} -/// See [`GroupSummary`](crate::model::GroupSummary) -pub mod group_summary { - /// A builder for [`GroupSummary`](crate::model::GroupSummary) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) group_id: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) avatar_url: std::option::Option, - pub(crate) external: std::option::Option, - pub(crate) is_developer: std::option::Option, - pub(crate) bio: std::option::Option, - pub(crate) is_current_identity_member: std::option::Option, - pub(crate) publicity: std::option::Option, - pub(crate) member_count: std::option::Option, - pub(crate) owner_identity_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.group_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.group_id = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// The URL of this group's avatar image. - pub fn avatar_url(mut self, input: impl Into) -> Self { - self.avatar_url = Some(input.into()); - self - } - /// The URL of this group's avatar image. - pub fn set_avatar_url(mut self, input: std::option::Option) -> Self { - self.avatar_url = input; - self - } - /// External links for this group. - pub fn external(mut self, input: crate::model::GroupExternalLinks) -> Self { - self.external = Some(input); - self - } - /// External links for this group. - pub fn set_external( - mut self, - input: std::option::Option, - ) -> Self { - self.external = input; - self - } - /// Whether or not this group is a developer. - pub fn is_developer(mut self, input: bool) -> Self { - self.is_developer = Some(input); - self - } - /// Whether or not this group is a developer. - pub fn set_is_developer(mut self, input: std::option::Option) -> Self { - self.is_developer = input; - self - } - /// Detailed information about a profile. - pub fn bio(mut self, input: impl Into) -> Self { - self.bio = Some(input.into()); - self - } - /// Detailed information about a profile. - pub fn set_bio(mut self, input: std::option::Option) -> Self { - self.bio = input; - self - } - /// Whether or not the current identity is a member of this group. - pub fn is_current_identity_member(mut self, input: bool) -> Self { - self.is_current_identity_member = Some(input); - self - } - /// Whether or not the current identity is a member of this group. - pub fn set_is_current_identity_member(mut self, input: std::option::Option) -> Self { - self.is_current_identity_member = input; - self - } - /// The current publicity value for the given group. - pub fn publicity(mut self, input: crate::model::GroupPublicity) -> Self { - self.publicity = Some(input); - self - } - /// The current publicity value for the given group. - pub fn set_publicity( - mut self, - input: std::option::Option, - ) -> Self { - self.publicity = input; - self - } - /// Unsigned 32 bit integer. - pub fn member_count(mut self, input: i32) -> Self { - self.member_count = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_member_count(mut self, input: std::option::Option) -> Self { - self.member_count = input; - self - } - /// A universally unique identifier. - pub fn owner_identity_id(mut self, input: impl Into) -> Self { - self.owner_identity_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_owner_identity_id( - mut self, - input: std::option::Option, - ) -> Self { - self.owner_identity_id = input; - self - } - /// Consumes the builder and constructs a [`GroupSummary`](crate::model::GroupSummary) - pub fn build(self) -> crate::model::GroupSummary { - crate::model::GroupSummary { - group_id: self.group_id, - display_name: self.display_name, - avatar_url: self.avatar_url, - external: self.external, - is_developer: self.is_developer, - bio: self.bio, - is_current_identity_member: self.is_current_identity_member, - publicity: self.publicity, - member_count: self.member_count, - owner_identity_id: self.owner_identity_id, - } - } - } -} -impl GroupSummary { - /// Creates a new builder-style object to manufacture [`GroupSummary`](crate::model::GroupSummary) - pub fn builder() -> crate::model::group_summary::Builder { - crate::model::group_summary::Builder::default() - } -} - -/// A group join request. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GroupJoinRequest { - /// An identity handle. - pub identity: std::option::Option, - /// RFC3339 timestamp. - pub ts: std::option::Option, -} -impl GroupJoinRequest { - /// An identity handle. - pub fn identity(&self) -> std::option::Option<&crate::model::IdentityHandle> { - self.identity.as_ref() - } - /// RFC3339 timestamp. - pub fn ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.ts.as_ref() - } -} -impl std::fmt::Debug for GroupJoinRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GroupJoinRequest"); - formatter.field("identity", &self.identity); - formatter.field("ts", &self.ts); - formatter.finish() - } -} -/// See [`GroupJoinRequest`](crate::model::GroupJoinRequest) -pub mod group_join_request { - /// A builder for [`GroupJoinRequest`](crate::model::GroupJoinRequest) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity: std::option::Option, - pub(crate) ts: std::option::Option, - } - impl Builder { - /// An identity handle. - pub fn identity(mut self, input: crate::model::IdentityHandle) -> Self { - self.identity = Some(input); - self - } - /// An identity handle. - pub fn set_identity( - mut self, - input: std::option::Option, - ) -> Self { - self.identity = input; - self - } - /// RFC3339 timestamp. - pub fn ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_ts(mut self, input: std::option::Option) -> Self { - self.ts = input; - self - } - /// Consumes the builder and constructs a [`GroupJoinRequest`](crate::model::GroupJoinRequest) - pub fn build(self) -> crate::model::GroupJoinRequest { - crate::model::GroupJoinRequest { - identity: self.identity, - ts: self.ts, - } - } - } -} -impl GroupJoinRequest { - /// Creates a new builder-style object to manufacture [`GroupJoinRequest`](crate::model::GroupJoinRequest) - pub fn builder() -> crate::model::group_join_request::Builder { - crate::model::group_join_request::Builder::default() - } -} - -/// A group member. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GroupMember { - /// An identity handle. - pub identity: std::option::Option, -} -impl GroupMember { - /// An identity handle. - pub fn identity(&self) -> std::option::Option<&crate::model::IdentityHandle> { - self.identity.as_ref() - } -} -impl std::fmt::Debug for GroupMember { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GroupMember"); - formatter.field("identity", &self.identity); - formatter.finish() - } -} -/// See [`GroupMember`](crate::model::GroupMember) -pub mod group_member { - /// A builder for [`GroupMember`](crate::model::GroupMember) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity: std::option::Option, - } - impl Builder { - /// An identity handle. - pub fn identity(mut self, input: crate::model::IdentityHandle) -> Self { - self.identity = Some(input); - self - } - /// An identity handle. - pub fn set_identity( - mut self, - input: std::option::Option, - ) -> Self { - self.identity = input; - self - } - /// Consumes the builder and constructs a [`GroupMember`](crate::model::GroupMember) - pub fn build(self) -> crate::model::GroupMember { - crate::model::GroupMember { - identity: self.identity, - } - } - } -} -impl GroupMember { - /// Creates a new builder-style object to manufacture [`GroupMember`](crate::model::GroupMember) - pub fn builder() -> crate::model::group_member::Builder { - crate::model::group_member::Builder::default() - } -} - -/// A list of group profiles. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GroupProfile { - /// A universally unique identifier. - pub group_id: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// The URL of this group's avatar image. - pub avatar_url: std::option::Option, - /// External links for this group. - pub external: std::option::Option, - /// Whether or not this group is a developer. - pub is_developer: std::option::Option, - /// Detailed information about a profile. - pub bio: std::option::Option, - /// Whether or not the current identity is a member of this group. - pub is_current_identity_member: std::option::Option, - /// The current publicity value for the given group. - pub publicity: std::option::Option, - /// Unsigned 32 bit integer. - pub member_count: std::option::Option, - /// A universally unique identifier. - pub owner_identity_id: std::option::Option, - /// A list of group members. - pub members: std::option::Option>, - /// A list of group join requests. - pub join_requests: std::option::Option>, - /// Whether or not the current identity is currently requesting to join this group. - pub is_current_identity_requesting_join: std::option::Option, - /// A universally unique identifier. - pub thread_id: std::option::Option, -} -impl GroupProfile { - /// A universally unique identifier. - pub fn group_id(&self) -> std::option::Option<&str> { - self.group_id.as_deref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// The URL of this group's avatar image. - pub fn avatar_url(&self) -> std::option::Option<&str> { - self.avatar_url.as_deref() - } - /// External links for this group. - pub fn external(&self) -> std::option::Option<&crate::model::GroupExternalLinks> { - self.external.as_ref() - } - /// Whether or not this group is a developer. - pub fn is_developer(&self) -> std::option::Option { - self.is_developer - } - /// Detailed information about a profile. - pub fn bio(&self) -> std::option::Option<&str> { - self.bio.as_deref() - } - /// Whether or not the current identity is a member of this group. - pub fn is_current_identity_member(&self) -> std::option::Option { - self.is_current_identity_member - } - /// The current publicity value for the given group. - pub fn publicity(&self) -> std::option::Option<&crate::model::GroupPublicity> { - self.publicity.as_ref() - } - /// Unsigned 32 bit integer. - pub fn member_count(&self) -> std::option::Option { - self.member_count - } - /// A universally unique identifier. - pub fn owner_identity_id(&self) -> std::option::Option<&str> { - self.owner_identity_id.as_deref() - } - /// A list of group members. - pub fn members(&self) -> std::option::Option<&[crate::model::GroupMember]> { - self.members.as_deref() - } - /// A list of group join requests. - pub fn join_requests(&self) -> std::option::Option<&[crate::model::GroupJoinRequest]> { - self.join_requests.as_deref() - } - /// Whether or not the current identity is currently requesting to join this group. - pub fn is_current_identity_requesting_join(&self) -> std::option::Option { - self.is_current_identity_requesting_join - } - /// A universally unique identifier. - pub fn thread_id(&self) -> std::option::Option<&str> { - self.thread_id.as_deref() - } -} -impl std::fmt::Debug for GroupProfile { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GroupProfile"); - formatter.field("group_id", &self.group_id); - formatter.field("display_name", &self.display_name); - formatter.field("avatar_url", &self.avatar_url); - formatter.field("external", &self.external); - formatter.field("is_developer", &self.is_developer); - formatter.field("bio", &self.bio); - formatter.field( - "is_current_identity_member", - &self.is_current_identity_member, - ); - formatter.field("publicity", &self.publicity); - formatter.field("member_count", &self.member_count); - formatter.field("owner_identity_id", &self.owner_identity_id); - formatter.field("members", &self.members); - formatter.field("join_requests", &self.join_requests); - formatter.field( - "is_current_identity_requesting_join", - &self.is_current_identity_requesting_join, - ); - formatter.field("thread_id", &self.thread_id); - formatter.finish() - } -} -/// See [`GroupProfile`](crate::model::GroupProfile) -pub mod group_profile { - /// A builder for [`GroupProfile`](crate::model::GroupProfile) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) group_id: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) avatar_url: std::option::Option, - pub(crate) external: std::option::Option, - pub(crate) is_developer: std::option::Option, - pub(crate) bio: std::option::Option, - pub(crate) is_current_identity_member: std::option::Option, - pub(crate) publicity: std::option::Option, - pub(crate) member_count: std::option::Option, - pub(crate) owner_identity_id: std::option::Option, - pub(crate) members: std::option::Option>, - pub(crate) join_requests: - std::option::Option>, - pub(crate) is_current_identity_requesting_join: std::option::Option, - pub(crate) thread_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.group_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.group_id = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// The URL of this group's avatar image. - pub fn avatar_url(mut self, input: impl Into) -> Self { - self.avatar_url = Some(input.into()); - self - } - /// The URL of this group's avatar image. - pub fn set_avatar_url(mut self, input: std::option::Option) -> Self { - self.avatar_url = input; - self - } - /// External links for this group. - pub fn external(mut self, input: crate::model::GroupExternalLinks) -> Self { - self.external = Some(input); - self - } - /// External links for this group. - pub fn set_external( - mut self, - input: std::option::Option, - ) -> Self { - self.external = input; - self - } - /// Whether or not this group is a developer. - pub fn is_developer(mut self, input: bool) -> Self { - self.is_developer = Some(input); - self - } - /// Whether or not this group is a developer. - pub fn set_is_developer(mut self, input: std::option::Option) -> Self { - self.is_developer = input; - self - } - /// Detailed information about a profile. - pub fn bio(mut self, input: impl Into) -> Self { - self.bio = Some(input.into()); - self - } - /// Detailed information about a profile. - pub fn set_bio(mut self, input: std::option::Option) -> Self { - self.bio = input; - self - } - /// Whether or not the current identity is a member of this group. - pub fn is_current_identity_member(mut self, input: bool) -> Self { - self.is_current_identity_member = Some(input); - self - } - /// Whether or not the current identity is a member of this group. - pub fn set_is_current_identity_member(mut self, input: std::option::Option) -> Self { - self.is_current_identity_member = input; - self - } - /// The current publicity value for the given group. - pub fn publicity(mut self, input: crate::model::GroupPublicity) -> Self { - self.publicity = Some(input); - self - } - /// The current publicity value for the given group. - pub fn set_publicity( - mut self, - input: std::option::Option, - ) -> Self { - self.publicity = input; - self - } - /// Unsigned 32 bit integer. - pub fn member_count(mut self, input: i32) -> Self { - self.member_count = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_member_count(mut self, input: std::option::Option) -> Self { - self.member_count = input; - self - } - /// A universally unique identifier. - pub fn owner_identity_id(mut self, input: impl Into) -> Self { - self.owner_identity_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_owner_identity_id( - mut self, - input: std::option::Option, - ) -> Self { - self.owner_identity_id = input; - self - } - /// Appends an item to `members`. - /// - /// To override the contents of this collection use [`set_members`](Self::set_members). - /// - /// A list of group members. - pub fn members(mut self, input: crate::model::GroupMember) -> Self { - let mut v = self.members.unwrap_or_default(); - v.push(input); - self.members = Some(v); - self - } - /// A list of group members. - pub fn set_members( - mut self, - input: std::option::Option>, - ) -> Self { - self.members = input; - self - } - /// Appends an item to `join_requests`. - /// - /// To override the contents of this collection use [`set_join_requests`](Self::set_join_requests). - /// - /// A list of group join requests. - pub fn join_requests(mut self, input: crate::model::GroupJoinRequest) -> Self { - let mut v = self.join_requests.unwrap_or_default(); - v.push(input); - self.join_requests = Some(v); - self - } - /// A list of group join requests. - pub fn set_join_requests( - mut self, - input: std::option::Option>, - ) -> Self { - self.join_requests = input; - self - } - /// Whether or not the current identity is currently requesting to join this group. - pub fn is_current_identity_requesting_join(mut self, input: bool) -> Self { - self.is_current_identity_requesting_join = Some(input); - self - } - /// Whether or not the current identity is currently requesting to join this group. - pub fn set_is_current_identity_requesting_join( - mut self, - input: std::option::Option, - ) -> Self { - self.is_current_identity_requesting_join = input; - self - } - /// A universally unique identifier. - pub fn thread_id(mut self, input: impl Into) -> Self { - self.thread_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_thread_id(mut self, input: std::option::Option) -> Self { - self.thread_id = input; - self - } - /// Consumes the builder and constructs a [`GroupProfile`](crate::model::GroupProfile) - pub fn build(self) -> crate::model::GroupProfile { - crate::model::GroupProfile { - group_id: self.group_id, - display_name: self.display_name, - avatar_url: self.avatar_url, - external: self.external, - is_developer: self.is_developer, - bio: self.bio, - is_current_identity_member: self.is_current_identity_member, - publicity: self.publicity, - member_count: self.member_count, - owner_identity_id: self.owner_identity_id, - members: self.members, - join_requests: self.join_requests, - is_current_identity_requesting_join: self.is_current_identity_requesting_join, - thread_id: self.thread_id, - } - } - } -} -impl GroupProfile { - /// Creates a new builder-style object to manufacture [`GroupProfile`](crate::model::GroupProfile) - pub fn builder() -> crate::model::group_profile::Builder { - crate::model::group_profile::Builder::default() - } -} diff --git a/lib/smithy-output/api-group/rust/rust/src/operation.rs b/lib/smithy-output/api-group/rust/rust/src/operation.rs deleted file mode 100644 index 3f64f95a5..000000000 --- a/lib/smithy-output/api-group/rust/rust/src/operation.rs +++ /dev/null @@ -1,738 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Operation shape for `BanGroupIdentity`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`ban_group_identity`](crate::client::Client::ban_group_identity). -/// -/// See [`crate::client::fluent_builders::BanGroupIdentity`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct BanGroupIdentity { - _private: (), -} -impl BanGroupIdentity { - /// Creates a new builder-style object to manufacture [`BanGroupIdentityInput`](crate::input::BanGroupIdentityInput) - pub fn builder() -> crate::input::ban_group_identity_input::Builder { - crate::input::ban_group_identity_input::Builder::default() - } - /// Creates a new `BanGroupIdentity` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for BanGroupIdentity { - type Output = std::result::Result< - crate::output::BanGroupIdentityOutput, - crate::error::BanGroupIdentityError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_ban_group_identity_error(response) - } else { - crate::operation_deser::parse_ban_group_identity_response(response) - } - } -} - -/// Operation shape for `CompleteGroupAvatarUpload`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`complete_group_avatar_upload`](crate::client::Client::complete_group_avatar_upload). -/// -/// See [`crate::client::fluent_builders::CompleteGroupAvatarUpload`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct CompleteGroupAvatarUpload { - _private: (), -} -impl CompleteGroupAvatarUpload { - /// Creates a new builder-style object to manufacture [`CompleteGroupAvatarUploadInput`](crate::input::CompleteGroupAvatarUploadInput) - pub fn builder() -> crate::input::complete_group_avatar_upload_input::Builder { - crate::input::complete_group_avatar_upload_input::Builder::default() - } - /// Creates a new `CompleteGroupAvatarUpload` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for CompleteGroupAvatarUpload { - type Output = std::result::Result< - crate::output::CompleteGroupAvatarUploadOutput, - crate::error::CompleteGroupAvatarUploadError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_complete_group_avatar_upload_error(response) - } else { - crate::operation_deser::parse_complete_group_avatar_upload_response(response) - } - } -} - -/// Operation shape for `ConsumeGroupInvite`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`consume_group_invite`](crate::client::Client::consume_group_invite). -/// -/// See [`crate::client::fluent_builders::ConsumeGroupInvite`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct ConsumeGroupInvite { - _private: (), -} -impl ConsumeGroupInvite { - /// Creates a new builder-style object to manufacture [`ConsumeGroupInviteInput`](crate::input::ConsumeGroupInviteInput) - pub fn builder() -> crate::input::consume_group_invite_input::Builder { - crate::input::consume_group_invite_input::Builder::default() - } - /// Creates a new `ConsumeGroupInvite` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for ConsumeGroupInvite { - type Output = std::result::Result< - crate::output::ConsumeGroupInviteOutput, - crate::error::ConsumeGroupInviteError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_consume_group_invite_error(response) - } else { - crate::operation_deser::parse_consume_group_invite_response(response) - } - } -} - -/// Operation shape for `CreateGroup`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`create_group`](crate::client::Client::create_group). -/// -/// See [`crate::client::fluent_builders::CreateGroup`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct CreateGroup { - _private: (), -} -impl CreateGroup { - /// Creates a new builder-style object to manufacture [`CreateGroupInput`](crate::input::CreateGroupInput) - pub fn builder() -> crate::input::create_group_input::Builder { - crate::input::create_group_input::Builder::default() - } - /// Creates a new `CreateGroup` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for CreateGroup { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_create_group_error(response) - } else { - crate::operation_deser::parse_create_group_response(response) - } - } -} - -/// Operation shape for `CreateGroupInvite`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`create_group_invite`](crate::client::Client::create_group_invite). -/// -/// See [`crate::client::fluent_builders::CreateGroupInvite`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct CreateGroupInvite { - _private: (), -} -impl CreateGroupInvite { - /// Creates a new builder-style object to manufacture [`CreateGroupInviteInput`](crate::input::CreateGroupInviteInput) - pub fn builder() -> crate::input::create_group_invite_input::Builder { - crate::input::create_group_invite_input::Builder::default() - } - /// Creates a new `CreateGroupInvite` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for CreateGroupInvite { - type Output = std::result::Result< - crate::output::CreateGroupInviteOutput, - crate::error::CreateGroupInviteError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_create_group_invite_error(response) - } else { - crate::operation_deser::parse_create_group_invite_response(response) - } - } -} - -/// Operation shape for `CreateGroupJoinRequest`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`create_group_join_request`](crate::client::Client::create_group_join_request). -/// -/// See [`crate::client::fluent_builders::CreateGroupJoinRequest`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct CreateGroupJoinRequest { - _private: (), -} -impl CreateGroupJoinRequest { - /// Creates a new builder-style object to manufacture [`CreateGroupJoinRequestInput`](crate::input::CreateGroupJoinRequestInput) - pub fn builder() -> crate::input::create_group_join_request_input::Builder { - crate::input::create_group_join_request_input::Builder::default() - } - /// Creates a new `CreateGroupJoinRequest` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for CreateGroupJoinRequest { - type Output = std::result::Result< - crate::output::CreateGroupJoinRequestOutput, - crate::error::CreateGroupJoinRequestError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_create_group_join_request_error(response) - } else { - crate::operation_deser::parse_create_group_join_request_response(response) - } - } -} - -/// Operation shape for `GetGroupBans`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`get_group_bans`](crate::client::Client::get_group_bans). -/// -/// See [`crate::client::fluent_builders::GetGroupBans`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GetGroupBans { - _private: (), -} -impl GetGroupBans { - /// Creates a new builder-style object to manufacture [`GetGroupBansInput`](crate::input::GetGroupBansInput) - pub fn builder() -> crate::input::get_group_bans_input::Builder { - crate::input::get_group_bans_input::Builder::default() - } - /// Creates a new `GetGroupBans` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GetGroupBans { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_get_group_bans_error(response) - } else { - crate::operation_deser::parse_get_group_bans_response(response) - } - } -} - -/// Operation shape for `GetGroupInvite`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`get_group_invite`](crate::client::Client::get_group_invite). -/// -/// See [`crate::client::fluent_builders::GetGroupInvite`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GetGroupInvite { - _private: (), -} -impl GetGroupInvite { - /// Creates a new builder-style object to manufacture [`GetGroupInviteInput`](crate::input::GetGroupInviteInput) - pub fn builder() -> crate::input::get_group_invite_input::Builder { - crate::input::get_group_invite_input::Builder::default() - } - /// Creates a new `GetGroupInvite` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GetGroupInvite { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_get_group_invite_error(response) - } else { - crate::operation_deser::parse_get_group_invite_response(response) - } - } -} - -/// Operation shape for `GetGroupJoinRequests`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`get_group_join_requests`](crate::client::Client::get_group_join_requests). -/// -/// See [`crate::client::fluent_builders::GetGroupJoinRequests`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GetGroupJoinRequests { - _private: (), -} -impl GetGroupJoinRequests { - /// Creates a new builder-style object to manufacture [`GetGroupJoinRequestsInput`](crate::input::GetGroupJoinRequestsInput) - pub fn builder() -> crate::input::get_group_join_requests_input::Builder { - crate::input::get_group_join_requests_input::Builder::default() - } - /// Creates a new `GetGroupJoinRequests` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GetGroupJoinRequests { - type Output = std::result::Result< - crate::output::GetGroupJoinRequestsOutput, - crate::error::GetGroupJoinRequestsError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_get_group_join_requests_error(response) - } else { - crate::operation_deser::parse_get_group_join_requests_response(response) - } - } -} - -/// Operation shape for `GetGroupMembers`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`get_group_members`](crate::client::Client::get_group_members). -/// -/// See [`crate::client::fluent_builders::GetGroupMembers`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GetGroupMembers { - _private: (), -} -impl GetGroupMembers { - /// Creates a new builder-style object to manufacture [`GetGroupMembersInput`](crate::input::GetGroupMembersInput) - pub fn builder() -> crate::input::get_group_members_input::Builder { - crate::input::get_group_members_input::Builder::default() - } - /// Creates a new `GetGroupMembers` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GetGroupMembers { - type Output = std::result::Result< - crate::output::GetGroupMembersOutput, - crate::error::GetGroupMembersError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_get_group_members_error(response) - } else { - crate::operation_deser::parse_get_group_members_response(response) - } - } -} - -/// Operation shape for `GetGroupProfile`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`get_group_profile`](crate::client::Client::get_group_profile). -/// -/// See [`crate::client::fluent_builders::GetGroupProfile`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GetGroupProfile { - _private: (), -} -impl GetGroupProfile { - /// Creates a new builder-style object to manufacture [`GetGroupProfileInput`](crate::input::GetGroupProfileInput) - pub fn builder() -> crate::input::get_group_profile_input::Builder { - crate::input::get_group_profile_input::Builder::default() - } - /// Creates a new `GetGroupProfile` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GetGroupProfile { - type Output = std::result::Result< - crate::output::GetGroupProfileOutput, - crate::error::GetGroupProfileError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_get_group_profile_error(response) - } else { - crate::operation_deser::parse_get_group_profile_response(response) - } - } -} - -/// Operation shape for `GetGroupSummary`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`get_group_summary`](crate::client::Client::get_group_summary). -/// -/// See [`crate::client::fluent_builders::GetGroupSummary`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GetGroupSummary { - _private: (), -} -impl GetGroupSummary { - /// Creates a new builder-style object to manufacture [`GetGroupSummaryInput`](crate::input::GetGroupSummaryInput) - pub fn builder() -> crate::input::get_group_summary_input::Builder { - crate::input::get_group_summary_input::Builder::default() - } - /// Creates a new `GetGroupSummary` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GetGroupSummary { - type Output = std::result::Result< - crate::output::GetGroupSummaryOutput, - crate::error::GetGroupSummaryError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_get_group_summary_error(response) - } else { - crate::operation_deser::parse_get_group_summary_response(response) - } - } -} - -/// Operation shape for `KickGroupMember`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`kick_group_member`](crate::client::Client::kick_group_member). -/// -/// See [`crate::client::fluent_builders::KickGroupMember`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct KickGroupMember { - _private: (), -} -impl KickGroupMember { - /// Creates a new builder-style object to manufacture [`KickGroupMemberInput`](crate::input::KickGroupMemberInput) - pub fn builder() -> crate::input::kick_group_member_input::Builder { - crate::input::kick_group_member_input::Builder::default() - } - /// Creates a new `KickGroupMember` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for KickGroupMember { - type Output = std::result::Result< - crate::output::KickGroupMemberOutput, - crate::error::KickGroupMemberError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_kick_group_member_error(response) - } else { - crate::operation_deser::parse_kick_group_member_response(response) - } - } -} - -/// Operation shape for `LeaveGroup`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`leave_group`](crate::client::Client::leave_group). -/// -/// See [`crate::client::fluent_builders::LeaveGroup`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct LeaveGroup { - _private: (), -} -impl LeaveGroup { - /// Creates a new builder-style object to manufacture [`LeaveGroupInput`](crate::input::LeaveGroupInput) - pub fn builder() -> crate::input::leave_group_input::Builder { - crate::input::leave_group_input::Builder::default() - } - /// Creates a new `LeaveGroup` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for LeaveGroup { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_leave_group_error(response) - } else { - crate::operation_deser::parse_leave_group_response(response) - } - } -} - -/// Operation shape for `ListSuggestedGroups`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`list_suggested_groups`](crate::client::Client::list_suggested_groups). -/// -/// See [`crate::client::fluent_builders::ListSuggestedGroups`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct ListSuggestedGroups { - _private: (), -} -impl ListSuggestedGroups { - /// Creates a new builder-style object to manufacture [`ListSuggestedGroupsInput`](crate::input::ListSuggestedGroupsInput) - pub fn builder() -> crate::input::list_suggested_groups_input::Builder { - crate::input::list_suggested_groups_input::Builder::default() - } - /// Creates a new `ListSuggestedGroups` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for ListSuggestedGroups { - type Output = std::result::Result< - crate::output::ListSuggestedGroupsOutput, - crate::error::ListSuggestedGroupsError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_list_suggested_groups_error(response) - } else { - crate::operation_deser::parse_list_suggested_groups_response(response) - } - } -} - -/// Operation shape for `PrepareGroupAvatarUpload`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`prepare_group_avatar_upload`](crate::client::Client::prepare_group_avatar_upload). -/// -/// See [`crate::client::fluent_builders::PrepareGroupAvatarUpload`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct PrepareGroupAvatarUpload { - _private: (), -} -impl PrepareGroupAvatarUpload { - /// Creates a new builder-style object to manufacture [`PrepareGroupAvatarUploadInput`](crate::input::PrepareGroupAvatarUploadInput) - pub fn builder() -> crate::input::prepare_group_avatar_upload_input::Builder { - crate::input::prepare_group_avatar_upload_input::Builder::default() - } - /// Creates a new `PrepareGroupAvatarUpload` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for PrepareGroupAvatarUpload { - type Output = std::result::Result< - crate::output::PrepareGroupAvatarUploadOutput, - crate::error::PrepareGroupAvatarUploadError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_prepare_group_avatar_upload_error(response) - } else { - crate::operation_deser::parse_prepare_group_avatar_upload_response(response) - } - } -} - -/// Operation shape for `ResolveGroupJoinRequest`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`resolve_group_join_request`](crate::client::Client::resolve_group_join_request). -/// -/// See [`crate::client::fluent_builders::ResolveGroupJoinRequest`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct ResolveGroupJoinRequest { - _private: (), -} -impl ResolveGroupJoinRequest { - /// Creates a new builder-style object to manufacture [`ResolveGroupJoinRequestInput`](crate::input::ResolveGroupJoinRequestInput) - pub fn builder() -> crate::input::resolve_group_join_request_input::Builder { - crate::input::resolve_group_join_request_input::Builder::default() - } - /// Creates a new `ResolveGroupJoinRequest` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for ResolveGroupJoinRequest { - type Output = std::result::Result< - crate::output::ResolveGroupJoinRequestOutput, - crate::error::ResolveGroupJoinRequestError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_resolve_group_join_request_error(response) - } else { - crate::operation_deser::parse_resolve_group_join_request_response(response) - } - } -} - -/// Operation shape for `SearchGroups`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`search_groups`](crate::client::Client::search_groups). -/// -/// See [`crate::client::fluent_builders::SearchGroups`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct SearchGroups { - _private: (), -} -impl SearchGroups { - /// Creates a new builder-style object to manufacture [`SearchGroupsInput`](crate::input::SearchGroupsInput) - pub fn builder() -> crate::input::search_groups_input::Builder { - crate::input::search_groups_input::Builder::default() - } - /// Creates a new `SearchGroups` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for SearchGroups { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_search_groups_error(response) - } else { - crate::operation_deser::parse_search_groups_response(response) - } - } -} - -/// Operation shape for `TransferGroupOwnership`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`transfer_group_ownership`](crate::client::Client::transfer_group_ownership). -/// -/// See [`crate::client::fluent_builders::TransferGroupOwnership`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct TransferGroupOwnership { - _private: (), -} -impl TransferGroupOwnership { - /// Creates a new builder-style object to manufacture [`TransferGroupOwnershipInput`](crate::input::TransferGroupOwnershipInput) - pub fn builder() -> crate::input::transfer_group_ownership_input::Builder { - crate::input::transfer_group_ownership_input::Builder::default() - } - /// Creates a new `TransferGroupOwnership` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for TransferGroupOwnership { - type Output = std::result::Result< - crate::output::TransferGroupOwnershipOutput, - crate::error::TransferGroupOwnershipError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_transfer_group_ownership_error(response) - } else { - crate::operation_deser::parse_transfer_group_ownership_response(response) - } - } -} - -/// Operation shape for `UnbanGroupIdentity`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`unban_group_identity`](crate::client::Client::unban_group_identity). -/// -/// See [`crate::client::fluent_builders::UnbanGroupIdentity`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct UnbanGroupIdentity { - _private: (), -} -impl UnbanGroupIdentity { - /// Creates a new builder-style object to manufacture [`UnbanGroupIdentityInput`](crate::input::UnbanGroupIdentityInput) - pub fn builder() -> crate::input::unban_group_identity_input::Builder { - crate::input::unban_group_identity_input::Builder::default() - } - /// Creates a new `UnbanGroupIdentity` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for UnbanGroupIdentity { - type Output = std::result::Result< - crate::output::UnbanGroupIdentityOutput, - crate::error::UnbanGroupIdentityError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_unban_group_identity_error(response) - } else { - crate::operation_deser::parse_unban_group_identity_response(response) - } - } -} - -/// Operation shape for `UpdateGroupProfile`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`update_group_profile`](crate::client::Client::update_group_profile). -/// -/// See [`crate::client::fluent_builders::UpdateGroupProfile`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct UpdateGroupProfile { - _private: (), -} -impl UpdateGroupProfile { - /// Creates a new builder-style object to manufacture [`UpdateGroupProfileInput`](crate::input::UpdateGroupProfileInput) - pub fn builder() -> crate::input::update_group_profile_input::Builder { - crate::input::update_group_profile_input::Builder::default() - } - /// Creates a new `UpdateGroupProfile` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for UpdateGroupProfile { - type Output = std::result::Result< - crate::output::UpdateGroupProfileOutput, - crate::error::UpdateGroupProfileError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_update_group_profile_error(response) - } else { - crate::operation_deser::parse_update_group_profile_response(response) - } - } -} - -/// Operation shape for `ValidateGroupProfile`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`validate_group_profile`](crate::client::Client::validate_group_profile). -/// -/// See [`crate::client::fluent_builders::ValidateGroupProfile`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct ValidateGroupProfile { - _private: (), -} -impl ValidateGroupProfile { - /// Creates a new builder-style object to manufacture [`ValidateGroupProfileInput`](crate::input::ValidateGroupProfileInput) - pub fn builder() -> crate::input::validate_group_profile_input::Builder { - crate::input::validate_group_profile_input::Builder::default() - } - /// Creates a new `ValidateGroupProfile` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for ValidateGroupProfile { - type Output = std::result::Result< - crate::output::ValidateGroupProfileOutput, - crate::error::ValidateGroupProfileError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_validate_group_profile_error(response) - } else { - crate::operation_deser::parse_validate_group_profile_response(response) - } - } -} diff --git a/lib/smithy-output/api-group/rust/rust/src/operation_deser.rs b/lib/smithy-output/api-group/rust/rust/src/operation_deser.rs deleted file mode 100644 index d2f779bd1..000000000 --- a/lib/smithy-output/api-group/rust/rust/src/operation_deser.rs +++ /dev/null @@ -1,3367 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[allow(clippy::unnecessary_wraps)] -pub fn parse_ban_group_identity_error( - response: &http::Response, -) -> std::result::Result -{ - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::BanGroupIdentityError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::BanGroupIdentityError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::BanGroupIdentityError { - meta: generic, - kind: crate::error::BanGroupIdentityErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::BanGroupIdentityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::BanGroupIdentityError { - meta: generic, - kind: crate::error::BanGroupIdentityErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::BanGroupIdentityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::BanGroupIdentityError { - meta: generic, - kind: crate::error::BanGroupIdentityErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::BanGroupIdentityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::BanGroupIdentityError { - meta: generic, - kind: crate::error::BanGroupIdentityErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::BanGroupIdentityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::BanGroupIdentityError { - meta: generic, - kind: crate::error::BanGroupIdentityErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::BanGroupIdentityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::BanGroupIdentityError { - meta: generic, - kind: crate::error::BanGroupIdentityErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::BanGroupIdentityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::BanGroupIdentityError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_ban_group_identity_response( - response: &http::Response, -) -> std::result::Result -{ - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::ban_group_identity_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_complete_group_avatar_upload_error( - response: &http::Response, -) -> std::result::Result< - crate::output::CompleteGroupAvatarUploadOutput, - crate::error::CompleteGroupAvatarUploadError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::CompleteGroupAvatarUploadError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => { - return Err(crate::error::CompleteGroupAvatarUploadError::unhandled( - generic, - )) - } - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::CompleteGroupAvatarUploadError { - meta: generic, - kind: crate::error::CompleteGroupAvatarUploadErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::CompleteGroupAvatarUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::CompleteGroupAvatarUploadError { - meta: generic, - kind: crate::error::CompleteGroupAvatarUploadErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::CompleteGroupAvatarUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::CompleteGroupAvatarUploadError { - meta: generic, - kind: crate::error::CompleteGroupAvatarUploadErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::CompleteGroupAvatarUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::CompleteGroupAvatarUploadError { - meta: generic, - kind: crate::error::CompleteGroupAvatarUploadErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::CompleteGroupAvatarUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::CompleteGroupAvatarUploadError { - meta: generic, - kind: crate::error::CompleteGroupAvatarUploadErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::CompleteGroupAvatarUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::CompleteGroupAvatarUploadError { - meta: generic, - kind: crate::error::CompleteGroupAvatarUploadErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::CompleteGroupAvatarUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::CompleteGroupAvatarUploadError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_complete_group_avatar_upload_response( - response: &http::Response, -) -> std::result::Result< - crate::output::CompleteGroupAvatarUploadOutput, - crate::error::CompleteGroupAvatarUploadError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::complete_group_avatar_upload_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_consume_group_invite_error( - response: &http::Response, -) -> std::result::Result< - crate::output::ConsumeGroupInviteOutput, - crate::error::ConsumeGroupInviteError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::ConsumeGroupInviteError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::ConsumeGroupInviteError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::ConsumeGroupInviteError { - meta: generic, - kind: crate::error::ConsumeGroupInviteErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ConsumeGroupInviteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::ConsumeGroupInviteError { - meta: generic, - kind: crate::error::ConsumeGroupInviteErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::ConsumeGroupInviteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::ConsumeGroupInviteError { - meta: generic, - kind: crate::error::ConsumeGroupInviteErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::ConsumeGroupInviteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::ConsumeGroupInviteError { - meta: generic, - kind: crate::error::ConsumeGroupInviteErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::ConsumeGroupInviteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::ConsumeGroupInviteError { - meta: generic, - kind: crate::error::ConsumeGroupInviteErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::ConsumeGroupInviteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::ConsumeGroupInviteError { - meta: generic, - kind: crate::error::ConsumeGroupInviteErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::ConsumeGroupInviteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::ConsumeGroupInviteError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_consume_group_invite_response( - response: &http::Response, -) -> std::result::Result< - crate::output::ConsumeGroupInviteOutput, - crate::error::ConsumeGroupInviteError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::consume_group_invite_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_consume_group_invite( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ConsumeGroupInviteError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_create_group_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::CreateGroupError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::CreateGroupError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::CreateGroupError { - meta: generic, - kind: crate::error::CreateGroupErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::CreateGroupError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::CreateGroupError { - meta: generic, - kind: crate::error::CreateGroupErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGroupError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::CreateGroupError { - meta: generic, - kind: crate::error::CreateGroupErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGroupError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::CreateGroupError { - meta: generic, - kind: crate::error::CreateGroupErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGroupError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::CreateGroupError { - meta: generic, - kind: crate::error::CreateGroupErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGroupError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::CreateGroupError { - meta: generic, - kind: crate::error::CreateGroupErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGroupError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::CreateGroupError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_create_group_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::create_group_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_create_group( - response.body().as_ref(), - output, - ) - .map_err(crate::error::CreateGroupError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_create_group_invite_error( - response: &http::Response, -) -> std::result::Result -{ - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::CreateGroupInviteError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::CreateGroupInviteError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::CreateGroupInviteError { - meta: generic, - kind: crate::error::CreateGroupInviteErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::CreateGroupInviteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::CreateGroupInviteError { - meta: generic, - kind: crate::error::CreateGroupInviteErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGroupInviteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::CreateGroupInviteError { - meta: generic, - kind: crate::error::CreateGroupInviteErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGroupInviteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::CreateGroupInviteError { - meta: generic, - kind: crate::error::CreateGroupInviteErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGroupInviteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::CreateGroupInviteError { - meta: generic, - kind: crate::error::CreateGroupInviteErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGroupInviteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::CreateGroupInviteError { - meta: generic, - kind: crate::error::CreateGroupInviteErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGroupInviteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::CreateGroupInviteError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_create_group_invite_response( - response: &http::Response, -) -> std::result::Result -{ - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::create_group_invite_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_create_group_invite( - response.body().as_ref(), - output, - ) - .map_err(crate::error::CreateGroupInviteError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_create_group_join_request_error( - response: &http::Response, -) -> std::result::Result< - crate::output::CreateGroupJoinRequestOutput, - crate::error::CreateGroupJoinRequestError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::CreateGroupJoinRequestError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => { - return Err(crate::error::CreateGroupJoinRequestError::unhandled( - generic, - )) - } - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::CreateGroupJoinRequestError { - meta: generic, - kind: crate::error::CreateGroupJoinRequestErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::CreateGroupJoinRequestError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::CreateGroupJoinRequestError { - meta: generic, - kind: crate::error::CreateGroupJoinRequestErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGroupJoinRequestError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::CreateGroupJoinRequestError { - meta: generic, - kind: crate::error::CreateGroupJoinRequestErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGroupJoinRequestError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::CreateGroupJoinRequestError { - meta: generic, - kind: crate::error::CreateGroupJoinRequestErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGroupJoinRequestError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::CreateGroupJoinRequestError { - meta: generic, - kind: crate::error::CreateGroupJoinRequestErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGroupJoinRequestError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::CreateGroupJoinRequestError { - meta: generic, - kind: crate::error::CreateGroupJoinRequestErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGroupJoinRequestError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::CreateGroupJoinRequestError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_create_group_join_request_response( - response: &http::Response, -) -> std::result::Result< - crate::output::CreateGroupJoinRequestOutput, - crate::error::CreateGroupJoinRequestError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::create_group_join_request_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_group_bans_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GetGroupBansError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::GetGroupBansError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GetGroupBansError { - meta: generic, - kind: crate::error::GetGroupBansErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetGroupBansError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GetGroupBansError { - meta: generic, - kind: crate::error::GetGroupBansErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupBansError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GetGroupBansError { - meta: generic, - kind: crate::error::GetGroupBansErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupBansError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GetGroupBansError { - meta: generic, - kind: crate::error::GetGroupBansErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupBansError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GetGroupBansError { - meta: generic, - kind: crate::error::GetGroupBansErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupBansError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GetGroupBansError { - meta: generic, - kind: crate::error::GetGroupBansErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupBansError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GetGroupBansError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_group_bans_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::get_group_bans_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_get_group_bans( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetGroupBansError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_group_invite_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GetGroupInviteError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::GetGroupInviteError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GetGroupInviteError { - meta: generic, - kind: crate::error::GetGroupInviteErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetGroupInviteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GetGroupInviteError { - meta: generic, - kind: crate::error::GetGroupInviteErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupInviteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GetGroupInviteError { - meta: generic, - kind: crate::error::GetGroupInviteErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupInviteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GetGroupInviteError { - meta: generic, - kind: crate::error::GetGroupInviteErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupInviteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GetGroupInviteError { - meta: generic, - kind: crate::error::GetGroupInviteErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupInviteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GetGroupInviteError { - meta: generic, - kind: crate::error::GetGroupInviteErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupInviteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GetGroupInviteError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_group_invite_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::get_group_invite_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_get_group_invite( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetGroupInviteError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_group_join_requests_error( - response: &http::Response, -) -> std::result::Result< - crate::output::GetGroupJoinRequestsOutput, - crate::error::GetGroupJoinRequestsError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GetGroupJoinRequestsError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::GetGroupJoinRequestsError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GetGroupJoinRequestsError { - meta: generic, - kind: crate::error::GetGroupJoinRequestsErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetGroupJoinRequestsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GetGroupJoinRequestsError { - meta: generic, - kind: crate::error::GetGroupJoinRequestsErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupJoinRequestsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GetGroupJoinRequestsError { - meta: generic, - kind: crate::error::GetGroupJoinRequestsErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupJoinRequestsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GetGroupJoinRequestsError { - meta: generic, - kind: crate::error::GetGroupJoinRequestsErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupJoinRequestsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GetGroupJoinRequestsError { - meta: generic, - kind: crate::error::GetGroupJoinRequestsErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupJoinRequestsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GetGroupJoinRequestsError { - meta: generic, - kind: crate::error::GetGroupJoinRequestsErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupJoinRequestsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GetGroupJoinRequestsError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_group_join_requests_response( - response: &http::Response, -) -> std::result::Result< - crate::output::GetGroupJoinRequestsOutput, - crate::error::GetGroupJoinRequestsError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::get_group_join_requests_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_get_group_join_requests( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetGroupJoinRequestsError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_group_members_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GetGroupMembersError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::GetGroupMembersError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GetGroupMembersError { - meta: generic, - kind: crate::error::GetGroupMembersErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetGroupMembersError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GetGroupMembersError { - meta: generic, - kind: crate::error::GetGroupMembersErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupMembersError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GetGroupMembersError { - meta: generic, - kind: crate::error::GetGroupMembersErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupMembersError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GetGroupMembersError { - meta: generic, - kind: crate::error::GetGroupMembersErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupMembersError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GetGroupMembersError { - meta: generic, - kind: crate::error::GetGroupMembersErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupMembersError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GetGroupMembersError { - meta: generic, - kind: crate::error::GetGroupMembersErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupMembersError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GetGroupMembersError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_group_members_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::get_group_members_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_get_group_members( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetGroupMembersError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_group_profile_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GetGroupProfileError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::GetGroupProfileError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GetGroupProfileError { - meta: generic, - kind: crate::error::GetGroupProfileErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetGroupProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GetGroupProfileError { - meta: generic, - kind: crate::error::GetGroupProfileErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GetGroupProfileError { - meta: generic, - kind: crate::error::GetGroupProfileErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GetGroupProfileError { - meta: generic, - kind: crate::error::GetGroupProfileErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GetGroupProfileError { - meta: generic, - kind: crate::error::GetGroupProfileErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GetGroupProfileError { - meta: generic, - kind: crate::error::GetGroupProfileErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GetGroupProfileError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_group_profile_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::get_group_profile_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_get_group_profile( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetGroupProfileError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_group_summary_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GetGroupSummaryError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::GetGroupSummaryError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GetGroupSummaryError { - meta: generic, - kind: crate::error::GetGroupSummaryErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetGroupSummaryError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GetGroupSummaryError { - meta: generic, - kind: crate::error::GetGroupSummaryErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupSummaryError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GetGroupSummaryError { - meta: generic, - kind: crate::error::GetGroupSummaryErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupSummaryError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GetGroupSummaryError { - meta: generic, - kind: crate::error::GetGroupSummaryErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupSummaryError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GetGroupSummaryError { - meta: generic, - kind: crate::error::GetGroupSummaryErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupSummaryError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GetGroupSummaryError { - meta: generic, - kind: crate::error::GetGroupSummaryErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGroupSummaryError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GetGroupSummaryError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_group_summary_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::get_group_summary_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_get_group_summary( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetGroupSummaryError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_kick_group_member_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::KickGroupMemberError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::KickGroupMemberError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::KickGroupMemberError { - meta: generic, - kind: crate::error::KickGroupMemberErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::KickGroupMemberError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::KickGroupMemberError { - meta: generic, - kind: crate::error::KickGroupMemberErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::KickGroupMemberError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::KickGroupMemberError { - meta: generic, - kind: crate::error::KickGroupMemberErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::KickGroupMemberError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::KickGroupMemberError { - meta: generic, - kind: crate::error::KickGroupMemberErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::KickGroupMemberError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::KickGroupMemberError { - meta: generic, - kind: crate::error::KickGroupMemberErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::KickGroupMemberError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::KickGroupMemberError { - meta: generic, - kind: crate::error::KickGroupMemberErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::KickGroupMemberError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::KickGroupMemberError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_kick_group_member_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::kick_group_member_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_leave_group_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::LeaveGroupError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::LeaveGroupError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::LeaveGroupError { - meta: generic, - kind: crate::error::LeaveGroupErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::LeaveGroupError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::LeaveGroupError { - meta: generic, - kind: crate::error::LeaveGroupErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::LeaveGroupError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::LeaveGroupError { - meta: generic, - kind: crate::error::LeaveGroupErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::LeaveGroupError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::LeaveGroupError { - meta: generic, - kind: crate::error::LeaveGroupErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::LeaveGroupError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::LeaveGroupError { - meta: generic, - kind: crate::error::LeaveGroupErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::LeaveGroupError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::LeaveGroupError { - meta: generic, - kind: crate::error::LeaveGroupErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::LeaveGroupError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::LeaveGroupError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_leave_group_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::leave_group_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_list_suggested_groups_error( - response: &http::Response, -) -> std::result::Result< - crate::output::ListSuggestedGroupsOutput, - crate::error::ListSuggestedGroupsError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::ListSuggestedGroupsError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::ListSuggestedGroupsError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::ListSuggestedGroupsError { - meta: generic, - kind: crate::error::ListSuggestedGroupsErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ListSuggestedGroupsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::ListSuggestedGroupsError { - meta: generic, - kind: crate::error::ListSuggestedGroupsErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListSuggestedGroupsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::ListSuggestedGroupsError { - meta: generic, - kind: crate::error::ListSuggestedGroupsErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListSuggestedGroupsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::ListSuggestedGroupsError { - meta: generic, - kind: crate::error::ListSuggestedGroupsErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListSuggestedGroupsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::ListSuggestedGroupsError { - meta: generic, - kind: crate::error::ListSuggestedGroupsErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListSuggestedGroupsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::ListSuggestedGroupsError { - meta: generic, - kind: crate::error::ListSuggestedGroupsErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListSuggestedGroupsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::ListSuggestedGroupsError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_list_suggested_groups_response( - response: &http::Response, -) -> std::result::Result< - crate::output::ListSuggestedGroupsOutput, - crate::error::ListSuggestedGroupsError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::list_suggested_groups_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_list_suggested_groups( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ListSuggestedGroupsError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_prepare_group_avatar_upload_error( - response: &http::Response, -) -> std::result::Result< - crate::output::PrepareGroupAvatarUploadOutput, - crate::error::PrepareGroupAvatarUploadError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::PrepareGroupAvatarUploadError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => { - return Err(crate::error::PrepareGroupAvatarUploadError::unhandled( - generic, - )) - } - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::PrepareGroupAvatarUploadError { - meta: generic, - kind: crate::error::PrepareGroupAvatarUploadErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::PrepareGroupAvatarUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::PrepareGroupAvatarUploadError { - meta: generic, - kind: crate::error::PrepareGroupAvatarUploadErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::PrepareGroupAvatarUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::PrepareGroupAvatarUploadError { - meta: generic, - kind: crate::error::PrepareGroupAvatarUploadErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::PrepareGroupAvatarUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::PrepareGroupAvatarUploadError { - meta: generic, - kind: crate::error::PrepareGroupAvatarUploadErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::PrepareGroupAvatarUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::PrepareGroupAvatarUploadError { - meta: generic, - kind: crate::error::PrepareGroupAvatarUploadErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::PrepareGroupAvatarUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::PrepareGroupAvatarUploadError { - meta: generic, - kind: crate::error::PrepareGroupAvatarUploadErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::PrepareGroupAvatarUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::PrepareGroupAvatarUploadError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_prepare_group_avatar_upload_response( - response: &http::Response, -) -> std::result::Result< - crate::output::PrepareGroupAvatarUploadOutput, - crate::error::PrepareGroupAvatarUploadError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::prepare_group_avatar_upload_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_prepare_group_avatar_upload( - response.body().as_ref(), - output, - ) - .map_err(crate::error::PrepareGroupAvatarUploadError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_resolve_group_join_request_error( - response: &http::Response, -) -> std::result::Result< - crate::output::ResolveGroupJoinRequestOutput, - crate::error::ResolveGroupJoinRequestError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::ResolveGroupJoinRequestError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => { - return Err(crate::error::ResolveGroupJoinRequestError::unhandled( - generic, - )) - } - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::ResolveGroupJoinRequestError { - meta: generic, - kind: crate::error::ResolveGroupJoinRequestErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ResolveGroupJoinRequestError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::ResolveGroupJoinRequestError { - meta: generic, - kind: crate::error::ResolveGroupJoinRequestErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::ResolveGroupJoinRequestError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::ResolveGroupJoinRequestError { - meta: generic, - kind: crate::error::ResolveGroupJoinRequestErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::ResolveGroupJoinRequestError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::ResolveGroupJoinRequestError { - meta: generic, - kind: crate::error::ResolveGroupJoinRequestErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::ResolveGroupJoinRequestError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::ResolveGroupJoinRequestError { - meta: generic, - kind: crate::error::ResolveGroupJoinRequestErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::ResolveGroupJoinRequestError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::ResolveGroupJoinRequestError { - meta: generic, - kind: crate::error::ResolveGroupJoinRequestErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::ResolveGroupJoinRequestError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::ResolveGroupJoinRequestError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_resolve_group_join_request_response( - response: &http::Response, -) -> std::result::Result< - crate::output::ResolveGroupJoinRequestOutput, - crate::error::ResolveGroupJoinRequestError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::resolve_group_join_request_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_search_groups_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::SearchGroupsError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::SearchGroupsError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::SearchGroupsError { - meta: generic, - kind: crate::error::SearchGroupsErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::SearchGroupsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::SearchGroupsError { - meta: generic, - kind: crate::error::SearchGroupsErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::SearchGroupsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::SearchGroupsError { - meta: generic, - kind: crate::error::SearchGroupsErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::SearchGroupsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::SearchGroupsError { - meta: generic, - kind: crate::error::SearchGroupsErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::SearchGroupsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::SearchGroupsError { - meta: generic, - kind: crate::error::SearchGroupsErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::SearchGroupsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::SearchGroupsError { - meta: generic, - kind: crate::error::SearchGroupsErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::SearchGroupsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::SearchGroupsError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_search_groups_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::search_groups_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_search_groups( - response.body().as_ref(), - output, - ) - .map_err(crate::error::SearchGroupsError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_transfer_group_ownership_error( - response: &http::Response, -) -> std::result::Result< - crate::output::TransferGroupOwnershipOutput, - crate::error::TransferGroupOwnershipError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::TransferGroupOwnershipError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => { - return Err(crate::error::TransferGroupOwnershipError::unhandled( - generic, - )) - } - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::TransferGroupOwnershipError { - meta: generic, - kind: crate::error::TransferGroupOwnershipErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::TransferGroupOwnershipError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::TransferGroupOwnershipError { - meta: generic, - kind: crate::error::TransferGroupOwnershipErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::TransferGroupOwnershipError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::TransferGroupOwnershipError { - meta: generic, - kind: crate::error::TransferGroupOwnershipErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::TransferGroupOwnershipError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::TransferGroupOwnershipError { - meta: generic, - kind: crate::error::TransferGroupOwnershipErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::TransferGroupOwnershipError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::TransferGroupOwnershipError { - meta: generic, - kind: crate::error::TransferGroupOwnershipErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::TransferGroupOwnershipError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::TransferGroupOwnershipError { - meta: generic, - kind: crate::error::TransferGroupOwnershipErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::TransferGroupOwnershipError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::TransferGroupOwnershipError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_transfer_group_ownership_response( - response: &http::Response, -) -> std::result::Result< - crate::output::TransferGroupOwnershipOutput, - crate::error::TransferGroupOwnershipError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::transfer_group_ownership_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_unban_group_identity_error( - response: &http::Response, -) -> std::result::Result< - crate::output::UnbanGroupIdentityOutput, - crate::error::UnbanGroupIdentityError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::UnbanGroupIdentityError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::UnbanGroupIdentityError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::UnbanGroupIdentityError { - meta: generic, - kind: crate::error::UnbanGroupIdentityErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::UnbanGroupIdentityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::UnbanGroupIdentityError { - meta: generic, - kind: crate::error::UnbanGroupIdentityErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::UnbanGroupIdentityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::UnbanGroupIdentityError { - meta: generic, - kind: crate::error::UnbanGroupIdentityErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::UnbanGroupIdentityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::UnbanGroupIdentityError { - meta: generic, - kind: crate::error::UnbanGroupIdentityErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::UnbanGroupIdentityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::UnbanGroupIdentityError { - meta: generic, - kind: crate::error::UnbanGroupIdentityErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::UnbanGroupIdentityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::UnbanGroupIdentityError { - meta: generic, - kind: crate::error::UnbanGroupIdentityErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::UnbanGroupIdentityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::UnbanGroupIdentityError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_unban_group_identity_response( - response: &http::Response, -) -> std::result::Result< - crate::output::UnbanGroupIdentityOutput, - crate::error::UnbanGroupIdentityError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::unban_group_identity_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_update_group_profile_error( - response: &http::Response, -) -> std::result::Result< - crate::output::UpdateGroupProfileOutput, - crate::error::UpdateGroupProfileError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::UpdateGroupProfileError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::UpdateGroupProfileError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::UpdateGroupProfileError { - meta: generic, - kind: crate::error::UpdateGroupProfileErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::UpdateGroupProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::UpdateGroupProfileError { - meta: generic, - kind: crate::error::UpdateGroupProfileErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateGroupProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::UpdateGroupProfileError { - meta: generic, - kind: crate::error::UpdateGroupProfileErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateGroupProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::UpdateGroupProfileError { - meta: generic, - kind: crate::error::UpdateGroupProfileErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateGroupProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::UpdateGroupProfileError { - meta: generic, - kind: crate::error::UpdateGroupProfileErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateGroupProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::UpdateGroupProfileError { - meta: generic, - kind: crate::error::UpdateGroupProfileErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateGroupProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::UpdateGroupProfileError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_update_group_profile_response( - response: &http::Response, -) -> std::result::Result< - crate::output::UpdateGroupProfileOutput, - crate::error::UpdateGroupProfileError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::update_group_profile_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_validate_group_profile_error( - response: &http::Response, -) -> std::result::Result< - crate::output::ValidateGroupProfileOutput, - crate::error::ValidateGroupProfileError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::ValidateGroupProfileError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::ValidateGroupProfileError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::ValidateGroupProfileError { - meta: generic, - kind: crate::error::ValidateGroupProfileErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ValidateGroupProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::ValidateGroupProfileError { - meta: generic, - kind: crate::error::ValidateGroupProfileErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGroupProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::ValidateGroupProfileError { - meta: generic, - kind: crate::error::ValidateGroupProfileErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGroupProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::ValidateGroupProfileError { - meta: generic, - kind: crate::error::ValidateGroupProfileErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGroupProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::ValidateGroupProfileError { - meta: generic, - kind: crate::error::ValidateGroupProfileErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGroupProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::ValidateGroupProfileError { - meta: generic, - kind: crate::error::ValidateGroupProfileErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateGroupProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::ValidateGroupProfileError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_validate_group_profile_response( - response: &http::Response, -) -> std::result::Result< - crate::output::ValidateGroupProfileOutput, - crate::error::ValidateGroupProfileError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::validate_group_profile_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_validate_group_profile( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ValidateGroupProfileError::unhandled)?; - output.build() - }) -} diff --git a/lib/smithy-output/api-group/rust/rust/src/operation_ser.rs b/lib/smithy-output/api-group/rust/rust/src/operation_ser.rs deleted file mode 100644 index e750b6eaf..000000000 --- a/lib/smithy-output/api-group/rust/rust/src/operation_ser.rs +++ /dev/null @@ -1,85 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub fn serialize_operation_crate_operation_create_group( - input: &crate::input::CreateGroupInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_create_group_input(&mut object, input)?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_create_group_invite( - input: &crate::input::CreateGroupInviteInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_create_group_invite_input(&mut object, input)?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_prepare_group_avatar_upload( - input: &crate::input::PrepareGroupAvatarUploadInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_prepare_group_avatar_upload_input( - &mut object, - input, - )?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_resolve_group_join_request( - input: &crate::input::ResolveGroupJoinRequestInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_resolve_group_join_request_input( - &mut object, - input, - )?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_transfer_group_ownership( - input: &crate::input::TransferGroupOwnershipInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_transfer_group_ownership_input( - &mut object, - input, - )?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_update_group_profile( - input: &crate::input::UpdateGroupProfileInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_update_group_profile_input( - &mut object, - input, - )?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_validate_group_profile( - input: &crate::input::ValidateGroupProfileInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_validate_group_profile_input( - &mut object, - input, - )?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} diff --git a/lib/smithy-output/api-group/rust/rust/src/output.rs b/lib/smithy-output/api-group/rust/rust/src/output.rs deleted file mode 100644 index 5f8e4b580..000000000 --- a/lib/smithy-output/api-group/rust/rust/src/output.rs +++ /dev/null @@ -1,1230 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ResolveGroupJoinRequestOutput {} -impl std::fmt::Debug for ResolveGroupJoinRequestOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ResolveGroupJoinRequestOutput"); - formatter.finish() - } -} -/// See [`ResolveGroupJoinRequestOutput`](crate::output::ResolveGroupJoinRequestOutput) -pub mod resolve_group_join_request_output { - /// A builder for [`ResolveGroupJoinRequestOutput`](crate::output::ResolveGroupJoinRequestOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`ResolveGroupJoinRequestOutput`](crate::output::ResolveGroupJoinRequestOutput) - pub fn build(self) -> crate::output::ResolveGroupJoinRequestOutput { - crate::output::ResolveGroupJoinRequestOutput {} - } - } -} -impl ResolveGroupJoinRequestOutput { - /// Creates a new builder-style object to manufacture [`ResolveGroupJoinRequestOutput`](crate::output::ResolveGroupJoinRequestOutput) - pub fn builder() -> crate::output::resolve_group_join_request_output::Builder { - crate::output::resolve_group_join_request_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CreateGroupJoinRequestOutput {} -impl std::fmt::Debug for CreateGroupJoinRequestOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CreateGroupJoinRequestOutput"); - formatter.finish() - } -} -/// See [`CreateGroupJoinRequestOutput`](crate::output::CreateGroupJoinRequestOutput) -pub mod create_group_join_request_output { - /// A builder for [`CreateGroupJoinRequestOutput`](crate::output::CreateGroupJoinRequestOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`CreateGroupJoinRequestOutput`](crate::output::CreateGroupJoinRequestOutput) - pub fn build(self) -> crate::output::CreateGroupJoinRequestOutput { - crate::output::CreateGroupJoinRequestOutput {} - } - } -} -impl CreateGroupJoinRequestOutput { - /// Creates a new builder-style object to manufacture [`CreateGroupJoinRequestOutput`](crate::output::CreateGroupJoinRequestOutput) - pub fn builder() -> crate::output::create_group_join_request_output::Builder { - crate::output::create_group_join_request_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetGroupInviteOutput { - /// A group handle. - pub group: std::option::Option, -} -impl GetGroupInviteOutput { - /// A group handle. - pub fn group(&self) -> std::option::Option<&crate::model::GroupHandle> { - self.group.as_ref() - } -} -impl std::fmt::Debug for GetGroupInviteOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetGroupInviteOutput"); - formatter.field("group", &self.group); - formatter.finish() - } -} -/// See [`GetGroupInviteOutput`](crate::output::GetGroupInviteOutput) -pub mod get_group_invite_output { - /// A builder for [`GetGroupInviteOutput`](crate::output::GetGroupInviteOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) group: std::option::Option, - } - impl Builder { - /// A group handle. - pub fn group(mut self, input: crate::model::GroupHandle) -> Self { - self.group = Some(input); - self - } - /// A group handle. - pub fn set_group(mut self, input: std::option::Option) -> Self { - self.group = input; - self - } - /// Consumes the builder and constructs a [`GetGroupInviteOutput`](crate::output::GetGroupInviteOutput) - pub fn build(self) -> crate::output::GetGroupInviteOutput { - crate::output::GetGroupInviteOutput { group: self.group } - } - } -} -impl GetGroupInviteOutput { - /// Creates a new builder-style object to manufacture [`GetGroupInviteOutput`](crate::output::GetGroupInviteOutput) - pub fn builder() -> crate::output::get_group_invite_output::Builder { - crate::output::get_group_invite_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ConsumeGroupInviteOutput { - /// A universally unique identifier. - pub group_id: std::option::Option, -} -impl ConsumeGroupInviteOutput { - /// A universally unique identifier. - pub fn group_id(&self) -> std::option::Option<&str> { - self.group_id.as_deref() - } -} -impl std::fmt::Debug for ConsumeGroupInviteOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ConsumeGroupInviteOutput"); - formatter.field("group_id", &self.group_id); - formatter.finish() - } -} -/// See [`ConsumeGroupInviteOutput`](crate::output::ConsumeGroupInviteOutput) -pub mod consume_group_invite_output { - /// A builder for [`ConsumeGroupInviteOutput`](crate::output::ConsumeGroupInviteOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) group_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.group_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.group_id = input; - self - } - /// Consumes the builder and constructs a [`ConsumeGroupInviteOutput`](crate::output::ConsumeGroupInviteOutput) - pub fn build(self) -> crate::output::ConsumeGroupInviteOutput { - crate::output::ConsumeGroupInviteOutput { - group_id: self.group_id, - } - } - } -} -impl ConsumeGroupInviteOutput { - /// Creates a new builder-style object to manufacture [`ConsumeGroupInviteOutput`](crate::output::ConsumeGroupInviteOutput) - pub fn builder() -> crate::output::consume_group_invite_output::Builder { - crate::output::consume_group_invite_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CreateGroupInviteOutput { - /// The code that will be passed to `rivet.api.group#ConsumeGroupInvite` to join a group. - pub code: std::option::Option, -} -impl CreateGroupInviteOutput { - /// The code that will be passed to `rivet.api.group#ConsumeGroupInvite` to join a group. - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } -} -impl std::fmt::Debug for CreateGroupInviteOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CreateGroupInviteOutput"); - formatter.field("code", &self.code); - formatter.finish() - } -} -/// See [`CreateGroupInviteOutput`](crate::output::CreateGroupInviteOutput) -pub mod create_group_invite_output { - /// A builder for [`CreateGroupInviteOutput`](crate::output::CreateGroupInviteOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - } - impl Builder { - /// The code that will be passed to `rivet.api.group#ConsumeGroupInvite` to join a group. - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - /// The code that will be passed to `rivet.api.group#ConsumeGroupInvite` to join a group. - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - /// Consumes the builder and constructs a [`CreateGroupInviteOutput`](crate::output::CreateGroupInviteOutput) - pub fn build(self) -> crate::output::CreateGroupInviteOutput { - crate::output::CreateGroupInviteOutput { code: self.code } - } - } -} -impl CreateGroupInviteOutput { - /// Creates a new builder-style object to manufacture [`CreateGroupInviteOutput`](crate::output::CreateGroupInviteOutput) - pub fn builder() -> crate::output::create_group_invite_output::Builder { - crate::output::create_group_invite_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetGroupBansOutput { - /// A list of banned group members. - pub banned_identities: std::option::Option>, - /// The pagination anchor. - pub anchor: std::option::Option, - /// Provided by watchable endpoints used in blocking loops. - pub watch: std::option::Option, -} -impl GetGroupBansOutput { - /// A list of banned group members. - pub fn banned_identities(&self) -> std::option::Option<&[crate::model::GroupBannedIdentity]> { - self.banned_identities.as_deref() - } - /// The pagination anchor. - pub fn anchor(&self) -> std::option::Option<&str> { - self.anchor.as_deref() - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(&self) -> std::option::Option<&crate::model::WatchResponse> { - self.watch.as_ref() - } -} -impl std::fmt::Debug for GetGroupBansOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetGroupBansOutput"); - formatter.field("banned_identities", &self.banned_identities); - formatter.field("anchor", &self.anchor); - formatter.field("watch", &self.watch); - formatter.finish() - } -} -/// See [`GetGroupBansOutput`](crate::output::GetGroupBansOutput) -pub mod get_group_bans_output { - /// A builder for [`GetGroupBansOutput`](crate::output::GetGroupBansOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) banned_identities: - std::option::Option>, - pub(crate) anchor: std::option::Option, - pub(crate) watch: std::option::Option, - } - impl Builder { - /// Appends an item to `banned_identities`. - /// - /// To override the contents of this collection use [`set_banned_identities`](Self::set_banned_identities). - /// - /// A list of banned group members. - pub fn banned_identities(mut self, input: crate::model::GroupBannedIdentity) -> Self { - let mut v = self.banned_identities.unwrap_or_default(); - v.push(input); - self.banned_identities = Some(v); - self - } - /// A list of banned group members. - pub fn set_banned_identities( - mut self, - input: std::option::Option>, - ) -> Self { - self.banned_identities = input; - self - } - /// The pagination anchor. - pub fn anchor(mut self, input: impl Into) -> Self { - self.anchor = Some(input.into()); - self - } - /// The pagination anchor. - pub fn set_anchor(mut self, input: std::option::Option) -> Self { - self.anchor = input; - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(mut self, input: crate::model::WatchResponse) -> Self { - self.watch = Some(input); - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn set_watch( - mut self, - input: std::option::Option, - ) -> Self { - self.watch = input; - self - } - /// Consumes the builder and constructs a [`GetGroupBansOutput`](crate::output::GetGroupBansOutput) - pub fn build(self) -> crate::output::GetGroupBansOutput { - crate::output::GetGroupBansOutput { - banned_identities: self.banned_identities, - anchor: self.anchor, - watch: self.watch, - } - } - } -} -impl GetGroupBansOutput { - /// Creates a new builder-style object to manufacture [`GetGroupBansOutput`](crate::output::GetGroupBansOutput) - pub fn builder() -> crate::output::get_group_bans_output::Builder { - crate::output::get_group_bans_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UnbanGroupIdentityOutput {} -impl std::fmt::Debug for UnbanGroupIdentityOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UnbanGroupIdentityOutput"); - formatter.finish() - } -} -/// See [`UnbanGroupIdentityOutput`](crate::output::UnbanGroupIdentityOutput) -pub mod unban_group_identity_output { - /// A builder for [`UnbanGroupIdentityOutput`](crate::output::UnbanGroupIdentityOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`UnbanGroupIdentityOutput`](crate::output::UnbanGroupIdentityOutput) - pub fn build(self) -> crate::output::UnbanGroupIdentityOutput { - crate::output::UnbanGroupIdentityOutput {} - } - } -} -impl UnbanGroupIdentityOutput { - /// Creates a new builder-style object to manufacture [`UnbanGroupIdentityOutput`](crate::output::UnbanGroupIdentityOutput) - pub fn builder() -> crate::output::unban_group_identity_output::Builder { - crate::output::unban_group_identity_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct BanGroupIdentityOutput {} -impl std::fmt::Debug for BanGroupIdentityOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("BanGroupIdentityOutput"); - formatter.finish() - } -} -/// See [`BanGroupIdentityOutput`](crate::output::BanGroupIdentityOutput) -pub mod ban_group_identity_output { - /// A builder for [`BanGroupIdentityOutput`](crate::output::BanGroupIdentityOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`BanGroupIdentityOutput`](crate::output::BanGroupIdentityOutput) - pub fn build(self) -> crate::output::BanGroupIdentityOutput { - crate::output::BanGroupIdentityOutput {} - } - } -} -impl BanGroupIdentityOutput { - /// Creates a new builder-style object to manufacture [`BanGroupIdentityOutput`](crate::output::BanGroupIdentityOutput) - pub fn builder() -> crate::output::ban_group_identity_output::Builder { - crate::output::ban_group_identity_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct KickGroupMemberOutput {} -impl std::fmt::Debug for KickGroupMemberOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("KickGroupMemberOutput"); - formatter.finish() - } -} -/// See [`KickGroupMemberOutput`](crate::output::KickGroupMemberOutput) -pub mod kick_group_member_output { - /// A builder for [`KickGroupMemberOutput`](crate::output::KickGroupMemberOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`KickGroupMemberOutput`](crate::output::KickGroupMemberOutput) - pub fn build(self) -> crate::output::KickGroupMemberOutput { - crate::output::KickGroupMemberOutput {} - } - } -} -impl KickGroupMemberOutput { - /// Creates a new builder-style object to manufacture [`KickGroupMemberOutput`](crate::output::KickGroupMemberOutput) - pub fn builder() -> crate::output::kick_group_member_output::Builder { - crate::output::kick_group_member_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct LeaveGroupOutput {} -impl std::fmt::Debug for LeaveGroupOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("LeaveGroupOutput"); - formatter.finish() - } -} -/// See [`LeaveGroupOutput`](crate::output::LeaveGroupOutput) -pub mod leave_group_output { - /// A builder for [`LeaveGroupOutput`](crate::output::LeaveGroupOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`LeaveGroupOutput`](crate::output::LeaveGroupOutput) - pub fn build(self) -> crate::output::LeaveGroupOutput { - crate::output::LeaveGroupOutput {} - } - } -} -impl LeaveGroupOutput { - /// Creates a new builder-style object to manufacture [`LeaveGroupOutput`](crate::output::LeaveGroupOutput) - pub fn builder() -> crate::output::leave_group_output::Builder { - crate::output::leave_group_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CompleteGroupAvatarUploadOutput {} -impl std::fmt::Debug for CompleteGroupAvatarUploadOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CompleteGroupAvatarUploadOutput"); - formatter.finish() - } -} -/// See [`CompleteGroupAvatarUploadOutput`](crate::output::CompleteGroupAvatarUploadOutput) -pub mod complete_group_avatar_upload_output { - /// A builder for [`CompleteGroupAvatarUploadOutput`](crate::output::CompleteGroupAvatarUploadOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`CompleteGroupAvatarUploadOutput`](crate::output::CompleteGroupAvatarUploadOutput) - pub fn build(self) -> crate::output::CompleteGroupAvatarUploadOutput { - crate::output::CompleteGroupAvatarUploadOutput {} - } - } -} -impl CompleteGroupAvatarUploadOutput { - /// Creates a new builder-style object to manufacture [`CompleteGroupAvatarUploadOutput`](crate::output::CompleteGroupAvatarUploadOutput) - pub fn builder() -> crate::output::complete_group_avatar_upload_output::Builder { - crate::output::complete_group_avatar_upload_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PrepareGroupAvatarUploadOutput { - /// A universally unique identifier. - pub upload_id: std::option::Option, - /// A presigned request used to upload files. Upload your file to the given URL via a PUT request. - pub presigned_request: std::option::Option, -} -impl PrepareGroupAvatarUploadOutput { - /// A universally unique identifier. - pub fn upload_id(&self) -> std::option::Option<&str> { - self.upload_id.as_deref() - } - /// A presigned request used to upload files. Upload your file to the given URL via a PUT request. - pub fn presigned_request(&self) -> std::option::Option<&crate::model::UploadPresignedRequest> { - self.presigned_request.as_ref() - } -} -impl std::fmt::Debug for PrepareGroupAvatarUploadOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PrepareGroupAvatarUploadOutput"); - formatter.field("upload_id", &self.upload_id); - formatter.field("presigned_request", &self.presigned_request); - formatter.finish() - } -} -/// See [`PrepareGroupAvatarUploadOutput`](crate::output::PrepareGroupAvatarUploadOutput) -pub mod prepare_group_avatar_upload_output { - /// A builder for [`PrepareGroupAvatarUploadOutput`](crate::output::PrepareGroupAvatarUploadOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) upload_id: std::option::Option, - pub(crate) presigned_request: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn upload_id(mut self, input: impl Into) -> Self { - self.upload_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_upload_id(mut self, input: std::option::Option) -> Self { - self.upload_id = input; - self - } - /// A presigned request used to upload files. Upload your file to the given URL via a PUT request. - pub fn presigned_request(mut self, input: crate::model::UploadPresignedRequest) -> Self { - self.presigned_request = Some(input); - self - } - /// A presigned request used to upload files. Upload your file to the given URL via a PUT request. - pub fn set_presigned_request( - mut self, - input: std::option::Option, - ) -> Self { - self.presigned_request = input; - self - } - /// Consumes the builder and constructs a [`PrepareGroupAvatarUploadOutput`](crate::output::PrepareGroupAvatarUploadOutput) - pub fn build(self) -> crate::output::PrepareGroupAvatarUploadOutput { - crate::output::PrepareGroupAvatarUploadOutput { - upload_id: self.upload_id, - presigned_request: self.presigned_request, - } - } - } -} -impl PrepareGroupAvatarUploadOutput { - /// Creates a new builder-style object to manufacture [`PrepareGroupAvatarUploadOutput`](crate::output::PrepareGroupAvatarUploadOutput) - pub fn builder() -> crate::output::prepare_group_avatar_upload_output::Builder { - crate::output::prepare_group_avatar_upload_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct SearchGroupsOutput { - /// A list of group handles. - pub groups: std::option::Option>, - #[allow(missing_docs)] // documentation missing in model - pub anchor: std::option::Option, -} -impl SearchGroupsOutput { - /// A list of group handles. - pub fn groups(&self) -> std::option::Option<&[crate::model::GroupHandle]> { - self.groups.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn anchor(&self) -> std::option::Option<&str> { - self.anchor.as_deref() - } -} -impl std::fmt::Debug for SearchGroupsOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("SearchGroupsOutput"); - formatter.field("groups", &self.groups); - formatter.field("anchor", &self.anchor); - formatter.finish() - } -} -/// See [`SearchGroupsOutput`](crate::output::SearchGroupsOutput) -pub mod search_groups_output { - /// A builder for [`SearchGroupsOutput`](crate::output::SearchGroupsOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) groups: std::option::Option>, - pub(crate) anchor: std::option::Option, - } - impl Builder { - /// Appends an item to `groups`. - /// - /// To override the contents of this collection use [`set_groups`](Self::set_groups). - /// - /// A list of group handles. - pub fn groups(mut self, input: crate::model::GroupHandle) -> Self { - let mut v = self.groups.unwrap_or_default(); - v.push(input); - self.groups = Some(v); - self - } - /// A list of group handles. - pub fn set_groups( - mut self, - input: std::option::Option>, - ) -> Self { - self.groups = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn anchor(mut self, input: impl Into) -> Self { - self.anchor = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_anchor(mut self, input: std::option::Option) -> Self { - self.anchor = input; - self - } - /// Consumes the builder and constructs a [`SearchGroupsOutput`](crate::output::SearchGroupsOutput) - pub fn build(self) -> crate::output::SearchGroupsOutput { - crate::output::SearchGroupsOutput { - groups: self.groups, - anchor: self.anchor, - } - } - } -} -impl SearchGroupsOutput { - /// Creates a new builder-style object to manufacture [`SearchGroupsOutput`](crate::output::SearchGroupsOutput) - pub fn builder() -> crate::output::search_groups_output::Builder { - crate::output::search_groups_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct TransferGroupOwnershipOutput {} -impl std::fmt::Debug for TransferGroupOwnershipOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("TransferGroupOwnershipOutput"); - formatter.finish() - } -} -/// See [`TransferGroupOwnershipOutput`](crate::output::TransferGroupOwnershipOutput) -pub mod transfer_group_ownership_output { - /// A builder for [`TransferGroupOwnershipOutput`](crate::output::TransferGroupOwnershipOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`TransferGroupOwnershipOutput`](crate::output::TransferGroupOwnershipOutput) - pub fn build(self) -> crate::output::TransferGroupOwnershipOutput { - crate::output::TransferGroupOwnershipOutput {} - } - } -} -impl TransferGroupOwnershipOutput { - /// Creates a new builder-style object to manufacture [`TransferGroupOwnershipOutput`](crate::output::TransferGroupOwnershipOutput) - pub fn builder() -> crate::output::transfer_group_ownership_output::Builder { - crate::output::transfer_group_ownership_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ValidateGroupProfileOutput { - /// A list of validation errors. - pub errors: std::option::Option>, -} -impl ValidateGroupProfileOutput { - /// A list of validation errors. - pub fn errors(&self) -> std::option::Option<&[crate::model::ValidationError]> { - self.errors.as_deref() - } -} -impl std::fmt::Debug for ValidateGroupProfileOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ValidateGroupProfileOutput"); - formatter.field("errors", &self.errors); - formatter.finish() - } -} -/// See [`ValidateGroupProfileOutput`](crate::output::ValidateGroupProfileOutput) -pub mod validate_group_profile_output { - /// A builder for [`ValidateGroupProfileOutput`](crate::output::ValidateGroupProfileOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) errors: std::option::Option>, - } - impl Builder { - /// Appends an item to `errors`. - /// - /// To override the contents of this collection use [`set_errors`](Self::set_errors). - /// - /// A list of validation errors. - pub fn errors(mut self, input: crate::model::ValidationError) -> Self { - let mut v = self.errors.unwrap_or_default(); - v.push(input); - self.errors = Some(v); - self - } - /// A list of validation errors. - pub fn set_errors( - mut self, - input: std::option::Option>, - ) -> Self { - self.errors = input; - self - } - /// Consumes the builder and constructs a [`ValidateGroupProfileOutput`](crate::output::ValidateGroupProfileOutput) - pub fn build(self) -> crate::output::ValidateGroupProfileOutput { - crate::output::ValidateGroupProfileOutput { - errors: self.errors, - } - } - } -} -impl ValidateGroupProfileOutput { - /// Creates a new builder-style object to manufacture [`ValidateGroupProfileOutput`](crate::output::ValidateGroupProfileOutput) - pub fn builder() -> crate::output::validate_group_profile_output::Builder { - crate::output::validate_group_profile_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetGroupSummaryOutput { - /// A group summary. - pub group: std::option::Option, -} -impl GetGroupSummaryOutput { - /// A group summary. - pub fn group(&self) -> std::option::Option<&crate::model::GroupSummary> { - self.group.as_ref() - } -} -impl std::fmt::Debug for GetGroupSummaryOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetGroupSummaryOutput"); - formatter.field("group", &self.group); - formatter.finish() - } -} -/// See [`GetGroupSummaryOutput`](crate::output::GetGroupSummaryOutput) -pub mod get_group_summary_output { - /// A builder for [`GetGroupSummaryOutput`](crate::output::GetGroupSummaryOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) group: std::option::Option, - } - impl Builder { - /// A group summary. - pub fn group(mut self, input: crate::model::GroupSummary) -> Self { - self.group = Some(input); - self - } - /// A group summary. - pub fn set_group(mut self, input: std::option::Option) -> Self { - self.group = input; - self - } - /// Consumes the builder and constructs a [`GetGroupSummaryOutput`](crate::output::GetGroupSummaryOutput) - pub fn build(self) -> crate::output::GetGroupSummaryOutput { - crate::output::GetGroupSummaryOutput { group: self.group } - } - } -} -impl GetGroupSummaryOutput { - /// Creates a new builder-style object to manufacture [`GetGroupSummaryOutput`](crate::output::GetGroupSummaryOutput) - pub fn builder() -> crate::output::get_group_summary_output::Builder { - crate::output::get_group_summary_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UpdateGroupProfileOutput {} -impl std::fmt::Debug for UpdateGroupProfileOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UpdateGroupProfileOutput"); - formatter.finish() - } -} -/// See [`UpdateGroupProfileOutput`](crate::output::UpdateGroupProfileOutput) -pub mod update_group_profile_output { - /// A builder for [`UpdateGroupProfileOutput`](crate::output::UpdateGroupProfileOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`UpdateGroupProfileOutput`](crate::output::UpdateGroupProfileOutput) - pub fn build(self) -> crate::output::UpdateGroupProfileOutput { - crate::output::UpdateGroupProfileOutput {} - } - } -} -impl UpdateGroupProfileOutput { - /// Creates a new builder-style object to manufacture [`UpdateGroupProfileOutput`](crate::output::UpdateGroupProfileOutput) - pub fn builder() -> crate::output::update_group_profile_output::Builder { - crate::output::update_group_profile_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetGroupJoinRequestsOutput { - /// A list of group join requests. - pub join_requests: std::option::Option>, - /// The pagination anchor. - pub anchor: std::option::Option, - /// Provided by watchable endpoints used in blocking loops. - pub watch: std::option::Option, -} -impl GetGroupJoinRequestsOutput { - /// A list of group join requests. - pub fn join_requests(&self) -> std::option::Option<&[crate::model::GroupJoinRequest]> { - self.join_requests.as_deref() - } - /// The pagination anchor. - pub fn anchor(&self) -> std::option::Option<&str> { - self.anchor.as_deref() - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(&self) -> std::option::Option<&crate::model::WatchResponse> { - self.watch.as_ref() - } -} -impl std::fmt::Debug for GetGroupJoinRequestsOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetGroupJoinRequestsOutput"); - formatter.field("join_requests", &self.join_requests); - formatter.field("anchor", &self.anchor); - formatter.field("watch", &self.watch); - formatter.finish() - } -} -/// See [`GetGroupJoinRequestsOutput`](crate::output::GetGroupJoinRequestsOutput) -pub mod get_group_join_requests_output { - /// A builder for [`GetGroupJoinRequestsOutput`](crate::output::GetGroupJoinRequestsOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) join_requests: - std::option::Option>, - pub(crate) anchor: std::option::Option, - pub(crate) watch: std::option::Option, - } - impl Builder { - /// Appends an item to `join_requests`. - /// - /// To override the contents of this collection use [`set_join_requests`](Self::set_join_requests). - /// - /// A list of group join requests. - pub fn join_requests(mut self, input: crate::model::GroupJoinRequest) -> Self { - let mut v = self.join_requests.unwrap_or_default(); - v.push(input); - self.join_requests = Some(v); - self - } - /// A list of group join requests. - pub fn set_join_requests( - mut self, - input: std::option::Option>, - ) -> Self { - self.join_requests = input; - self - } - /// The pagination anchor. - pub fn anchor(mut self, input: impl Into) -> Self { - self.anchor = Some(input.into()); - self - } - /// The pagination anchor. - pub fn set_anchor(mut self, input: std::option::Option) -> Self { - self.anchor = input; - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(mut self, input: crate::model::WatchResponse) -> Self { - self.watch = Some(input); - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn set_watch( - mut self, - input: std::option::Option, - ) -> Self { - self.watch = input; - self - } - /// Consumes the builder and constructs a [`GetGroupJoinRequestsOutput`](crate::output::GetGroupJoinRequestsOutput) - pub fn build(self) -> crate::output::GetGroupJoinRequestsOutput { - crate::output::GetGroupJoinRequestsOutput { - join_requests: self.join_requests, - anchor: self.anchor, - watch: self.watch, - } - } - } -} -impl GetGroupJoinRequestsOutput { - /// Creates a new builder-style object to manufacture [`GetGroupJoinRequestsOutput`](crate::output::GetGroupJoinRequestsOutput) - pub fn builder() -> crate::output::get_group_join_requests_output::Builder { - crate::output::get_group_join_requests_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetGroupMembersOutput { - /// A list of group members. - pub members: std::option::Option>, - /// The pagination anchor. - pub anchor: std::option::Option, - /// Provided by watchable endpoints used in blocking loops. - pub watch: std::option::Option, -} -impl GetGroupMembersOutput { - /// A list of group members. - pub fn members(&self) -> std::option::Option<&[crate::model::GroupMember]> { - self.members.as_deref() - } - /// The pagination anchor. - pub fn anchor(&self) -> std::option::Option<&str> { - self.anchor.as_deref() - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(&self) -> std::option::Option<&crate::model::WatchResponse> { - self.watch.as_ref() - } -} -impl std::fmt::Debug for GetGroupMembersOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetGroupMembersOutput"); - formatter.field("members", &self.members); - formatter.field("anchor", &self.anchor); - formatter.field("watch", &self.watch); - formatter.finish() - } -} -/// See [`GetGroupMembersOutput`](crate::output::GetGroupMembersOutput) -pub mod get_group_members_output { - /// A builder for [`GetGroupMembersOutput`](crate::output::GetGroupMembersOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) members: std::option::Option>, - pub(crate) anchor: std::option::Option, - pub(crate) watch: std::option::Option, - } - impl Builder { - /// Appends an item to `members`. - /// - /// To override the contents of this collection use [`set_members`](Self::set_members). - /// - /// A list of group members. - pub fn members(mut self, input: crate::model::GroupMember) -> Self { - let mut v = self.members.unwrap_or_default(); - v.push(input); - self.members = Some(v); - self - } - /// A list of group members. - pub fn set_members( - mut self, - input: std::option::Option>, - ) -> Self { - self.members = input; - self - } - /// The pagination anchor. - pub fn anchor(mut self, input: impl Into) -> Self { - self.anchor = Some(input.into()); - self - } - /// The pagination anchor. - pub fn set_anchor(mut self, input: std::option::Option) -> Self { - self.anchor = input; - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(mut self, input: crate::model::WatchResponse) -> Self { - self.watch = Some(input); - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn set_watch( - mut self, - input: std::option::Option, - ) -> Self { - self.watch = input; - self - } - /// Consumes the builder and constructs a [`GetGroupMembersOutput`](crate::output::GetGroupMembersOutput) - pub fn build(self) -> crate::output::GetGroupMembersOutput { - crate::output::GetGroupMembersOutput { - members: self.members, - anchor: self.anchor, - watch: self.watch, - } - } - } -} -impl GetGroupMembersOutput { - /// Creates a new builder-style object to manufacture [`GetGroupMembersOutput`](crate::output::GetGroupMembersOutput) - pub fn builder() -> crate::output::get_group_members_output::Builder { - crate::output::get_group_members_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetGroupProfileOutput { - /// A list of group profiles. - pub group: std::option::Option, - /// Provided by watchable endpoints used in blocking loops. - pub watch: std::option::Option, -} -impl GetGroupProfileOutput { - /// A list of group profiles. - pub fn group(&self) -> std::option::Option<&crate::model::GroupProfile> { - self.group.as_ref() - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(&self) -> std::option::Option<&crate::model::WatchResponse> { - self.watch.as_ref() - } -} -impl std::fmt::Debug for GetGroupProfileOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetGroupProfileOutput"); - formatter.field("group", &self.group); - formatter.field("watch", &self.watch); - formatter.finish() - } -} -/// See [`GetGroupProfileOutput`](crate::output::GetGroupProfileOutput) -pub mod get_group_profile_output { - /// A builder for [`GetGroupProfileOutput`](crate::output::GetGroupProfileOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) group: std::option::Option, - pub(crate) watch: std::option::Option, - } - impl Builder { - /// A list of group profiles. - pub fn group(mut self, input: crate::model::GroupProfile) -> Self { - self.group = Some(input); - self - } - /// A list of group profiles. - pub fn set_group(mut self, input: std::option::Option) -> Self { - self.group = input; - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(mut self, input: crate::model::WatchResponse) -> Self { - self.watch = Some(input); - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn set_watch( - mut self, - input: std::option::Option, - ) -> Self { - self.watch = input; - self - } - /// Consumes the builder and constructs a [`GetGroupProfileOutput`](crate::output::GetGroupProfileOutput) - pub fn build(self) -> crate::output::GetGroupProfileOutput { - crate::output::GetGroupProfileOutput { - group: self.group, - watch: self.watch, - } - } - } -} -impl GetGroupProfileOutput { - /// Creates a new builder-style object to manufacture [`GetGroupProfileOutput`](crate::output::GetGroupProfileOutput) - pub fn builder() -> crate::output::get_group_profile_output::Builder { - crate::output::get_group_profile_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CreateGroupOutput { - /// A universally unique identifier. - pub group_id: std::option::Option, -} -impl CreateGroupOutput { - /// A universally unique identifier. - pub fn group_id(&self) -> std::option::Option<&str> { - self.group_id.as_deref() - } -} -impl std::fmt::Debug for CreateGroupOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CreateGroupOutput"); - formatter.field("group_id", &self.group_id); - formatter.finish() - } -} -/// See [`CreateGroupOutput`](crate::output::CreateGroupOutput) -pub mod create_group_output { - /// A builder for [`CreateGroupOutput`](crate::output::CreateGroupOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) group_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.group_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.group_id = input; - self - } - /// Consumes the builder and constructs a [`CreateGroupOutput`](crate::output::CreateGroupOutput) - pub fn build(self) -> crate::output::CreateGroupOutput { - crate::output::CreateGroupOutput { - group_id: self.group_id, - } - } - } -} -impl CreateGroupOutput { - /// Creates a new builder-style object to manufacture [`CreateGroupOutput`](crate::output::CreateGroupOutput) - pub fn builder() -> crate::output::create_group_output::Builder { - crate::output::create_group_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ListSuggestedGroupsOutput { - /// A list of group summaries. - pub groups: std::option::Option>, - /// Provided by watchable endpoints used in blocking loops. - pub watch: std::option::Option, -} -impl ListSuggestedGroupsOutput { - /// A list of group summaries. - pub fn groups(&self) -> std::option::Option<&[crate::model::GroupSummary]> { - self.groups.as_deref() - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(&self) -> std::option::Option<&crate::model::WatchResponse> { - self.watch.as_ref() - } -} -impl std::fmt::Debug for ListSuggestedGroupsOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ListSuggestedGroupsOutput"); - formatter.field("groups", &self.groups); - formatter.field("watch", &self.watch); - formatter.finish() - } -} -/// See [`ListSuggestedGroupsOutput`](crate::output::ListSuggestedGroupsOutput) -pub mod list_suggested_groups_output { - /// A builder for [`ListSuggestedGroupsOutput`](crate::output::ListSuggestedGroupsOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) groups: std::option::Option>, - pub(crate) watch: std::option::Option, - } - impl Builder { - /// Appends an item to `groups`. - /// - /// To override the contents of this collection use [`set_groups`](Self::set_groups). - /// - /// A list of group summaries. - pub fn groups(mut self, input: crate::model::GroupSummary) -> Self { - let mut v = self.groups.unwrap_or_default(); - v.push(input); - self.groups = Some(v); - self - } - /// A list of group summaries. - pub fn set_groups( - mut self, - input: std::option::Option>, - ) -> Self { - self.groups = input; - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(mut self, input: crate::model::WatchResponse) -> Self { - self.watch = Some(input); - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn set_watch( - mut self, - input: std::option::Option, - ) -> Self { - self.watch = input; - self - } - /// Consumes the builder and constructs a [`ListSuggestedGroupsOutput`](crate::output::ListSuggestedGroupsOutput) - pub fn build(self) -> crate::output::ListSuggestedGroupsOutput { - crate::output::ListSuggestedGroupsOutput { - groups: self.groups, - watch: self.watch, - } - } - } -} -impl ListSuggestedGroupsOutput { - /// Creates a new builder-style object to manufacture [`ListSuggestedGroupsOutput`](crate::output::ListSuggestedGroupsOutput) - pub fn builder() -> crate::output::list_suggested_groups_output::Builder { - crate::output::list_suggested_groups_output::Builder::default() - } -} diff --git a/lib/smithy-output/api-identity/rust-server/rust-server/Cargo.toml b/lib/smithy-output/api-identity/rust-server/rust-server/Cargo.toml deleted file mode 100644 index 00e11f5e6..000000000 --- a/lib/smithy-output/api-identity/rust-server/rust-server/Cargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -[package] -name = "rivet-identity-server" -version = "0.0.14" -authors = ["Rivet "] -edition = "2021" -license = "Apache-2.0" - -[package.metadata.docs.rs] -all-features = true -targets = ["x86_64-unknown-linux-gnu"] - -[dependencies] -serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" -chrono = { version = "0.4", features = ["serde"] } diff --git a/lib/smithy-output/api-identity/rust-server/rust-server/src/lib.rs b/lib/smithy-output/api-identity/rust-server/rust-server/src/lib.rs deleted file mode 100644 index ff9294697..000000000 --- a/lib/smithy-output/api-identity/rust-server/rust-server/src/lib.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod models; \ No newline at end of file diff --git a/lib/smithy-output/api-identity/rust-server/rust-server/src/models.rs b/lib/smithy-output/api-identity/rust-server/rust-server/src/models.rs deleted file mode 100644 index 9aa4b3a67..000000000 --- a/lib/smithy-output/api-identity/rust-server/rust-server/src/models.rs +++ /dev/null @@ -1,1633 +0,0 @@ -#[allow(unused_imports)] -use chrono; -#[allow(unused_imports)] -use serde::{Deserialize, Serialize}; - -/// Provided by watchable endpoints used in blocking loops. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct WatchResponse { - /// Index indicating the version of the data responded. Pas this to `rivet.common#WatchQuery` to block and wait for the next response. - pub index: std::string::String, -} - -/// An identity handle. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct IdentityHandle { - /// A universally unique identifier. - pub identity_id: std::string::String, - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub account_number: i32, - /// The URL of this identity's avatar image. - pub avatar_url: std::string::String, - /// Information about the identity's current status, party, and active game. - pub presence: std::option::Option, - /// A party handle. - pub party: std::option::Option, - /// Whether or not this identity is registered with a linked account. - pub is_registered: bool, - /// External links for an identity. - pub external: IdentityExternalLinks, -} - -/// External links for an identity. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct IdentityExternalLinks { - /// A link to this identity's profile page. - pub profile: std::string::String, - /// A link to the Rivet settings page. - pub settings: std::option::Option, - /// A link to a chat page with the given identity. - pub chat: std::option::Option, -} - -/// A party handle. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PartyHandle { - /// A universally unique identifier. - pub party_id: std::string::String, - /// RFC3339 timestamp. - pub create_ts: chrono::DateTime, - /// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. - pub activity: PartyActivity, - /// External links for a party. - pub external: PartyExternalLinks, -} - -/// External links for a party. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PartyExternalLinks { - /// A link to the given party's chat thread. - pub chat: std::string::String, -} - -/// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum PartyActivity { - /// A party activity denoting that the party is idle. - Idle(PartyActivityIdle), - /// A party activity denoting that the party is currently searching for a lobby. - MatchmakerFindingLobby(PartyActivityMatchmakerFindingLobby), - /// A party activity denoting that the party is currently in a lobby. - MatchmakerLobby(PartyActivityMatchmakerLobby), -} - -/// A party activity denoting that the party is currently in a lobby. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PartyActivityMatchmakerLobby { - /// A party lobby. - pub lobby: PartyMatchmakerLobby, - /// A game handle. - pub game: GameHandle, -} - -/// A game handle. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GameHandle { - /// A universally unique identifier. - pub game_id: std::string::String, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub name_id: std::string::String, - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// The URL of this game's logo image. - pub logo_url: std::option::Option, - /// The URL of this game's banner image. - pub banner_url: std::option::Option, -} - -/// A party lobby. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PartyMatchmakerLobby { - /// A universally unique identifier. - pub lobby_id: std::string::String, -} - -/// A party activity denoting that the party is currently searching for a lobby. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PartyActivityMatchmakerFindingLobby { - /// A game handle. - pub game: GameHandle, -} - -/// A party activity denoting that the party is idle. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PartyActivityIdle {} - -/// Information about the identity's current status, party, and active game. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct IdentityPresence { - /// RFC3339 timestamp. - pub update_ts: chrono::DateTime, - /// The current status of an identity. This helps players understand if another player is currently playing or has their game in the background. - pub status: IdentityStatus, - /// The game an identity is currently participating in. - pub game_activity: std::option::Option, -} - -/// The game an identity is currently participating in. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct IdentityGameActivity { - /// A game handle. - pub game: GameHandle, - /// A short activity message about the current game activity. - pub message: std::string::String, - /// JSON data seen by anyone. - pub public_metadata: std::option::Option, - /// JSON data seen only by the given identity and their mutual followers. - pub mutual_metadata: std::option::Option, -} - -/// The current status of an identity. This helps players understand if another -/// player is currently playing or has their game in the background. -#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd, Hash, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum IdentityStatus { - #[allow(missing_docs)] // documentation missing in model - Away, - #[allow(missing_docs)] // documentation missing in model - Offline, - #[allow(missing_docs)] // documentation missing in model - Online, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for IdentityStatus { - fn from(s: &str) -> Self { - match s { - "away" => IdentityStatus::Away, - "offline" => IdentityStatus::Offline, - "online" => IdentityStatus::Online, - other => IdentityStatus::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for IdentityStatus { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(IdentityStatus::from(s)) - } -} -impl IdentityStatus { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - IdentityStatus::Away => "away", - IdentityStatus::Offline => "offline", - IdentityStatus::Online => "online", - IdentityStatus::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["away", "offline", "online"] - } -} -impl AsRef for IdentityStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// A group summary. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GroupSummary { - /// A universally unique identifier. - pub group_id: std::string::String, - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// The URL of this group's avatar image. - pub avatar_url: std::option::Option, - /// External links for this group. - pub external: GroupExternalLinks, - /// Whether or not this group is a developer. - pub is_developer: bool, - /// Detailed information about a profile. - pub bio: std::string::String, - /// Whether or not the current identity is a member of this group. - pub is_current_identity_member: bool, - /// The current publicity value for the given group. - pub publicity: GroupPublicity, - /// Unsigned 32 bit integer. - pub member_count: i32, - /// A universally unique identifier. - pub owner_identity_id: std::string::String, -} - -/// The current publicity value for the given group. -#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd, Hash, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum GroupPublicity { - #[allow(missing_docs)] // documentation missing in model - Closed, - #[allow(missing_docs)] // documentation missing in model - Open, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for GroupPublicity { - fn from(s: &str) -> Self { - match s { - "closed" => GroupPublicity::Closed, - "open" => GroupPublicity::Open, - other => GroupPublicity::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for GroupPublicity { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(GroupPublicity::from(s)) - } -} -impl GroupPublicity { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - GroupPublicity::Closed => "closed", - GroupPublicity::Open => "open", - GroupPublicity::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["closed", "open"] - } -} -impl AsRef for GroupPublicity { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// External links for this group. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GroupExternalLinks { - /// A link to this group's profile page. - pub profile: std::string::String, - /// A link to this group's chat page. - pub chat: std::string::String, -} - -/// A party summary. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PartySummary { - /// A universally unique identifier. - pub party_id: std::string::String, - /// RFC3339 timestamp. - pub create_ts: chrono::DateTime, - /// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. - pub activity: PartyActivity, - /// External links for a party. - pub external: PartyExternalLinks, - #[allow(missing_docs)] // documentation missing in model - pub publicity: PartyPublicity, - /// Unsigned 32 bit integer. - pub party_size: i32, - /// A list of party members. - pub members: std::vec::Vec, - /// A universally unique identifier. - pub thread_id: std::string::String, -} - -/// A party member summary. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PartyMemberSummary { - /// An identity handle. - pub identity: IdentityHandle, - /// Whether or not this party member is the leader of the given party. - pub is_leader: bool, - /// RFC3339 timestamp. - pub join_ts: chrono::DateTime, - /// A union representing the current state of a party member. - `Inactive`: The player is not doing anything. For example, the player can be sitting in the game menu or hanging out on the hub. - It's possible for the member to be in an inactive state while the party is in a lobby; this means the player is simply observing/interacting with others in the party and not part of the matchmaking process. - `MatchmakerReady`: This means the member wants a player created for them. - Members can be in the ready state while the party is in an idle state. This means that the player will get a player created for them. - Members can be in the ready state while the party is in a lobby. This means that the player could not join the lobby because it was full or the player left the lobby unintentionally. - `MatchmakerFindingLobby`: A find request is in progress for the member. - `MatchmakerLobby`: The member is in a lobby. - pub state: PartyMemberState, -} - -/// A union representing the current state of a party member. - `Inactive`: The player is not doing anything. For example, the player can be sitting in the game menu or hanging out on the hub. - It's possible for the member to be in an inactive state while the party is in a lobby; this means the player is simply observing/interacting with others in the party and not part of the matchmaking process. - `MatchmakerReady`: This means the member wants a player created for them. - Members can be in the ready state while the party is in an idle state. This means that the player will get a player created for them. - Members can be in the ready state while the party is in a lobby. This means that the player could not join the lobby because it was full or the player left the lobby unintentionally. - `MatchmakerFindingLobby`: A find request is in progress for the member. - `MatchmakerLobby`: The member is in a lobby. -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum PartyMemberState { - /// A party member state denoting that the member is inactive. - Inactive(PartyMemberStateInactive), - /// A party member state denoting that the member is currently searching for a lobby. - MatchmakerFindingLobby(PartyMemberStateMatchmakerFindingLobby), - /// A party member state denoting that the member is in a lobby. - MatchmakerLobby(PartyMemberStateMatchmakerLobby), - /// A party member state denoting that the member is currently waiting to start matchmaking. - MatchmakerReady(PartyMemberStateMatchmakerReady), -} - -/// A party member state denoting that the member is in a lobby. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PartyMemberStateMatchmakerLobby { - /// A universally unique identifier. - pub player_id: std::string::String, -} - -/// A party member state denoting that the member is currently searching for a lobby. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PartyMemberStateMatchmakerFindingLobby {} - -/// A party member state denoting that the member is currently waiting to start matchmaking. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PartyMemberStateMatchmakerReady {} - -/// A party member state denoting that the member is inactive. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PartyMemberStateInactive {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PartyPublicity { - #[allow(missing_docs)] // documentation missing in model - pub public: PartyPublicityLevel, - #[allow(missing_docs)] // documentation missing in model - pub mutual_followers: PartyPublicityLevel, - #[allow(missing_docs)] // documentation missing in model - pub groups: PartyPublicityLevel, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd, Hash, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum PartyPublicityLevel { - #[allow(missing_docs)] // documentation missing in model - Join, - #[allow(missing_docs)] // documentation missing in model - None, - #[allow(missing_docs)] // documentation missing in model - View, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for PartyPublicityLevel { - fn from(s: &str) -> Self { - match s { - "join" => PartyPublicityLevel::Join, - "none" => PartyPublicityLevel::None, - "view" => PartyPublicityLevel::View, - other => PartyPublicityLevel::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for PartyPublicityLevel { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(PartyPublicityLevel::from(s)) - } -} -impl PartyPublicityLevel { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - PartyPublicityLevel::Join => "join", - PartyPublicityLevel::None => "none", - PartyPublicityLevel::View => "view", - PartyPublicityLevel::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["join", "none", "view"] - } -} -impl AsRef for PartyPublicityLevel { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GameSummary { - /// A universally unique identifier. - pub game_id: std::string::String, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub name_id: std::string::String, - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// The URL of this game's logo image. - pub logo_url: std::option::Option, - /// The URL of this game's banner image. - pub banner_url: std::option::Option, - /// The URL to this game's website. - pub url: std::string::String, - /// A group handle. - pub developer: GroupHandle, - /// A list of game tags. - pub tags: std::vec::Vec, -} - -/// A group handle. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GroupHandle { - /// A universally unique identifier. - pub group_id: std::string::String, - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// The URL of this group's avatar image. - pub avatar_url: std::option::Option, - /// External links for this group. - pub external: GroupExternalLinks, - /// Whether or not this group is a developer group. - pub is_developer: std::option::Option, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetGameLinkNewIdentity { - /// See `rivet.api.identity#SetupIdentityOutput$identity_token`. - pub identity_token: std::string::String, - /// See `rivet.api.identity#SetupIdentityOutput$identity_token_expire_ts`. - pub identity_token_expire_ts: chrono::DateTime, - /// See `rivet.api.identity#SetupIdentityOutput$identity`. - pub identity: IdentityProfile, -} - -/// An identity profile. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct IdentityProfile { - /// A universally unique identifier. - pub identity_id: std::string::String, - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub account_number: i32, - /// The URL of this identity's avatar image. - pub avatar_url: std::string::String, - /// Information about the identity's current status, party, and active game. - pub presence: std::option::Option, - /// A party summary. - pub party: std::option::Option, - /// Whether or not this identity is registered with a linked account. - pub is_registered: bool, - /// External links for an identity. - pub external: IdentityExternalLinks, - /// Whether or not this identity is an admin. - pub is_admin: bool, - /// Whether or not this game user has been linked through the Rivet dashboard. - pub is_game_linked: std::option::Option, - /// The state of the given identity's developer status. - pub dev_state: std::option::Option, - /// Unsigned 64 bit integer. - pub follower_count: i64, - /// Unsigned 64 bit integer. - pub following_count: i64, - /// Whether or not the requestee's identity is following this identity. - pub following: bool, - /// Whether or not this identity following the requestee's identity. - pub is_following_me: bool, - /// Whether or not this identity is both following and is followed by the requestee's identity. - pub is_mutual_following: bool, - /// RFC3339 timestamp. - pub join_ts: chrono::DateTime, - /// Detailed information about a profile. - pub bio: std::string::String, - /// A list of an identity's linked accounts. - pub linked_accounts: std::vec::Vec, - /// A list of groups that the given identity is in. - pub groups: std::vec::Vec, - /// A list of game statistic summaries. - pub games: std::vec::Vec, - /// Whether or not this identity is awaiting account deletion. Only visible to when the requestee is this identity. - pub awaiting_deletion: std::option::Option, -} - -/// A game statistic summary. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GameStatSummary { - /// A game handle. - pub game: GameHandle, - /// A list of game statistics. - pub stats: std::vec::Vec, -} - -/// A game statistic. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GameStat { - /// A game statistic config. - pub config: GameStatConfig, - /// A single overall value of the given statistic. - pub overall_value: f32, -} - -/// A game statistic config. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GameStatConfig { - /// A universally unique identifier. - pub record_id: std::string::String, - /// A universally unique identifier. - pub icon_id: std::string::String, - /// A value denoting the format method of a game statistic. - pub format: GameStatFormatMethod, - /// A value denoting the aggregation method of a game statistic. - pub aggregation: GameStatAggregationMethod, - /// A value denoting the sorting method of a game statistic. - pub sorting: GameStatSortingMethod, - /// Unsigned 32 bit integer. - pub priority: i32, - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// A string appended to the end of a singular game statistic's value. Example: 1 **dollar**. - pub postfix_singular: std::option::Option, - /// A string appended to the end of a game statistic's value that is not exactly 1. Example: 45 **dollars**. - pub postfix_plural: std::option::Option, - /// A string appended to the beginning of a singular game statistic's value. Example: **value** 1. - pub prefix_singular: std::option::Option, - /// A string prepended to the beginning of a game statistic's value that is not exactly 1. Example: **values** 45. - pub prefix_plural: std::option::Option, -} - -/// A value denoting the sorting method of a game statistic. -#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd, Hash, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum GameStatSortingMethod { - /// Ascending sorting. - Asc, - /// Descending sorting. - Desc, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for GameStatSortingMethod { - fn from(s: &str) -> Self { - match s { - "asc" => GameStatSortingMethod::Asc, - "desc" => GameStatSortingMethod::Desc, - other => GameStatSortingMethod::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for GameStatSortingMethod { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(GameStatSortingMethod::from(s)) - } -} -impl GameStatSortingMethod { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - GameStatSortingMethod::Asc => "asc", - GameStatSortingMethod::Desc => "desc", - GameStatSortingMethod::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["asc", "desc"] - } -} -impl AsRef for GameStatSortingMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// A value denoting the aggregation method of a game statistic. -#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd, Hash, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum GameStatAggregationMethod { - /// Average aggergation. - Average, - /// Maximum value aggregation. - Max, - /// Minimum value aggregation. - Min, - /// Summation aggregation. - Sum, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for GameStatAggregationMethod { - fn from(s: &str) -> Self { - match s { - "average" => GameStatAggregationMethod::Average, - "max" => GameStatAggregationMethod::Max, - "min" => GameStatAggregationMethod::Min, - "sum" => GameStatAggregationMethod::Sum, - other => GameStatAggregationMethod::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for GameStatAggregationMethod { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(GameStatAggregationMethod::from(s)) - } -} -impl GameStatAggregationMethod { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - GameStatAggregationMethod::Average => "average", - GameStatAggregationMethod::Max => "max", - GameStatAggregationMethod::Min => "min", - GameStatAggregationMethod::Sum => "sum", - GameStatAggregationMethod::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["average", "max", "min", "sum"] - } -} -impl AsRef for GameStatAggregationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// A value denoting the format method of a game statistic. -#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd, Hash, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum GameStatFormatMethod { - /// A duration with hundredth-second precision (1d 2h 45m 21.46s). - DurationHundredthSecond, - /// A duration with minute precision (1d 2h 45m). - DurationMinute, - /// A duration with second precision (1d 2h 45m 21s). - DuractionSecond, - /// A float with 1 decimal (1,234.5). - Float1, - /// A float with 2 decimals (1,234.56). - Float2, - /// A float with 3 decimals (1,234.567). - Float3, - /// An integer with no decimals (1,234). - Integer, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for GameStatFormatMethod { - fn from(s: &str) -> Self { - match s { - "duration_hundredth_second" => GameStatFormatMethod::DurationHundredthSecond, - "duration_minute" => GameStatFormatMethod::DurationMinute, - "duration_second" => GameStatFormatMethod::DuractionSecond, - "float_1" => GameStatFormatMethod::Float1, - "float_2" => GameStatFormatMethod::Float2, - "float_3" => GameStatFormatMethod::Float3, - "integer" => GameStatFormatMethod::Integer, - other => GameStatFormatMethod::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for GameStatFormatMethod { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(GameStatFormatMethod::from(s)) - } -} -impl GameStatFormatMethod { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - GameStatFormatMethod::DurationHundredthSecond => "duration_hundredth_second", - GameStatFormatMethod::DurationMinute => "duration_minute", - GameStatFormatMethod::DuractionSecond => "duration_second", - GameStatFormatMethod::Float1 => "float_1", - GameStatFormatMethod::Float2 => "float_2", - GameStatFormatMethod::Float3 => "float_3", - GameStatFormatMethod::Integer => "integer", - GameStatFormatMethod::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &[ - "duration_hundredth_second", - "duration_minute", - "duration_second", - "float_1", - "float_2", - "float_3", - "integer", - ] - } -} -impl AsRef for GameStatFormatMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// A group that the given identity. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct IdentityGroup { - /// A group handle. - pub group: GroupHandle, -} - -/// A union representing an identity's linked accounts. -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum IdentityLinkedAccount { - /// An identity's linked email. - Email(IdentityEmailLinkedAccount), -} - -/// An identity's linked email. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct IdentityEmailLinkedAccount { - /// A valid email address. - pub email: std::string::String, -} - -/// The state of the given identity's developer status. -#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd, Hash, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum IdentityDevState { - #[allow(missing_docs)] // documentation missing in model - Accepted, - #[allow(missing_docs)] // documentation missing in model - Inactive, - #[allow(missing_docs)] // documentation missing in model - Pending, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for IdentityDevState { - fn from(s: &str) -> Self { - match s { - "accepted" => IdentityDevState::Accepted, - "inactive" => IdentityDevState::Inactive, - "pending" => IdentityDevState::Pending, - other => IdentityDevState::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for IdentityDevState { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(IdentityDevState::from(s)) - } -} -impl IdentityDevState { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - IdentityDevState::Accepted => "accepted", - IdentityDevState::Inactive => "inactive", - IdentityDevState::Pending => "pending", - IdentityDevState::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["accepted", "inactive", "pending"] - } -} -impl AsRef for IdentityDevState { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// The link status between an identity and a game user. -#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd, Hash, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum GameLinkStatus { - #[allow(missing_docs)] // documentation missing in model - Cancelled, - #[allow(missing_docs)] // documentation missing in model - Complete, - #[allow(missing_docs)] // documentation missing in model - Incomplete, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for GameLinkStatus { - fn from(s: &str) -> Self { - match s { - "cancelled" => GameLinkStatus::Cancelled, - "complete" => GameLinkStatus::Complete, - "incomplete" => GameLinkStatus::Incomplete, - other => GameLinkStatus::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for GameLinkStatus { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(GameLinkStatus::from(s)) - } -} -impl GameLinkStatus { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - GameLinkStatus::Cancelled => "cancelled", - GameLinkStatus::Complete => "complete", - GameLinkStatus::Incomplete => "incomplete", - GameLinkStatus::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["cancelled", "complete", "incomplete"] - } -} -impl AsRef for GameLinkStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// An event relevant to the current identity. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GlobalEvent { - /// RFC3339 timestamp. - pub ts: chrono::DateTime, - /// Kind of event that occurred. - pub kind: GlobalEventKind, - /// Notifications represent information that should be presented to the user immediately. At the moment, only chat message events have associated notifications. # Display Notifications should be displayed in an unobtrusive manner throughout the entire game. Notifications should disappear after a few seconds if not interacted with. # Interactions If your platform supports it, notifications should be able to be clicked or tapped in order to open the relevant context for the event. For a simple implementation of notification interactions, open `url` in a web browser to present the relevant context. For example, a chat message notification will open the thread the chat message was sent in. For advanced implementations that implement a custom chat UI, use `rivet.api.identity.common#GlobalEvent$kind` to determine what action to take when the notification is interacted with. For example, if the global event kind is `rivet.api.identity.common#GlobalEventChatMessage`, then open the chat UI for the given thread. - pub notification: std::option::Option, -} - -/// Notifications represent information that should be presented to the user immediately. At the moment, only chat message events have associated notifications. # Display Notifications should be displayed in an unobtrusive manner throughout the entire game. Notifications should disappear after a few seconds if not interacted with. # Interactions If your platform supports it, notifications should be able to be clicked or tapped in order to open the relevant context for the event. For a simple implementation of notification interactions, open `url` in a web browser to present the relevant context. For example, a chat message notification will open the thread the chat message was sent in. For advanced implementations that implement a custom chat UI, use `rivet.api.identity.common#GlobalEvent$kind` to determine what action to take when the notification is interacted with. For example, if the global event kind is `rivet.api.identity.common#GlobalEventChatMessage`, then open the chat UI for the given thread. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GlobalEventNotification { - #[allow(missing_docs)] // documentation missing in model - pub title: std::string::String, - #[allow(missing_docs)] // documentation missing in model - pub description: std::string::String, - /// URL to an image thumbnail that should be shown for this notification. - pub thumbnail_url: std::string::String, - /// Rivet Hub URL that holds the relevant context for this notification. - pub url: std::string::String, -} - -/// Kind of event that occurred. -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum GlobalEventKind { - /// `rivet.api.identity.common#GlobalEventKind` variant for chat messages. Received any time a message is sent to a chat the identity is in. - ChatMessage(GlobalEventChatMessage), - /// `rivet.api.identity.common#GlobalEventKind` variant for chat reads. Received any time the last read timestamp is set. Used to update the status of unread indicators on chats. - ChatRead(GlobalEventChatRead), - /// `rivet.api.identity.common#GlobalEventKind` variant for a chat thread being removed. Received any time the current identity is no longer able to access the given thread. This can happen if - ChatThreadRemove(GlobalEventChatThreadRemove), - /// `rivet.api.identity.common#GlobalEventKind` variant for identity updates. Received any time identity details are changed OR the identity switches. - IdentityUpdate(GlobalEventIdentityUpdate), - /// `rivet.api.identity.common#GlobalEventKind` variant for party updates. Received when the identity should be instructed to join a lobby. This needs to be implemented in conjunction with parties in order to force clients to join the same lobby as the party they're in. - MatchmakerLobbyJoin(GlobalEventMatchmakerLobbyJoin), - /// `rivet.api.identity.common#GlobalEventKind` variant for party updates. Received any time the identity joins a party, a party is updated, or when the identity leaves a party. - PartyUpdate(GlobalEventPartyUpdate), -} - -/// `rivet.api.identity.common#GlobalEventKind` variant for a chat thread being removed. Received any time the current identity is no longer able to access the given thread. This can happen if -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GlobalEventChatThreadRemove { - /// A universally unique identifier. - pub thread_id: std::string::String, -} - -/// `rivet.api.identity.common#GlobalEventKind` variant for party updates. Received when the identity should be instructed to join a lobby. This needs to be implemented in conjunction with parties in order to force clients to join the same lobby as the party they're in. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GlobalEventMatchmakerLobbyJoin { - /// A matchmaker lobby. - pub lobby: MatchmakerLobbyJoinInfo, -} - -/// A matchmaker lobby. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct MatchmakerLobbyJoinInfo { - /// A universally unique identifier. - pub lobby_id: std::string::String, - /// A matchmaker lobby region. - pub region: MatchmakerLobbyJoinInfoRegion, - /// A list of lobby ports. - pub ports: - std::collections::HashMap, - /// A matchmaker lobby player. - pub player: MatchmakerLobbyJoinInfoPlayer, -} - -/// A matchmaker lobby player. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct MatchmakerLobbyJoinInfoPlayer { - /// Pass this token through the socket to the lobby server. The lobby server will validate this token with `rivet.api.matchmaker#PlayerConnected$player_token`. - pub token: std::string::String, -} - -/// A matchmaker lobby port. Configured by `rivet.cloud#LobbyGroupRuntimeDockerPort$label`. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct MatchmakerLobbyJoinInfoPort { - /// The host for the given port. Will be null if using a port range. - pub host: std::option::Option, - /// The hostname for the given port. - pub hostname: std::string::String, - /// The port number for this lobby. Will be null if using a port range. - pub port: std::option::Option, - /// The port range for this lobby. - pub port_range: std::option::Option, - /// Wether or not this lobby port uses TLS. You cannot mix a non-TLS and TLS ports. - pub is_tls: bool, -} - -/// Inclusive range of ports that can be connected to. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct MatchmakerLobbyJoinInfoPortRange { - /// Minimum port that can be connected to. Inclusive range. - pub min: i32, - /// Maximum port that can be connected to. Inclusive range. - pub max: i32, -} - -/// A matchmaker lobby region. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct MatchmakerLobbyJoinInfoRegion { - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub region_id: std::string::String, - /// Represent a resource's readable display name. - pub display_name: std::string::String, -} - -/// `rivet.api.identity.common#GlobalEventKind` variant for identity updates. Received any time identity details are changed OR the identity switches. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GlobalEventIdentityUpdate { - /// An identity profile. - pub identity: IdentityProfile, -} - -/// `rivet.api.identity.common#GlobalEventKind` variant for party updates. Received any time the identity joins a party, a party is updated, or when the identity leaves a party. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GlobalEventPartyUpdate { - /// If null, the identity left the party. - pub party: std::option::Option, -} - -/// `rivet.api.identity.common#GlobalEventKind` variant for chat reads. Received any time the last read timestamp is set. Used to update the status of unread indicators on chats. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GlobalEventChatRead { - /// A universally unique identifier. - pub thread_id: std::string::String, - /// RFC3339 timestamp. - pub read_ts: chrono::DateTime, -} - -/// `rivet.api.identity.common#GlobalEventKind` variant for chat messages. Received any time a message is sent to a chat the identity is in. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GlobalEventChatMessage { - /// A chat thread. - pub thread: ChatThread, -} - -/// A chat thread. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ChatThread { - /// A universally unique identifier. - pub thread_id: std::string::String, - /// RFC3339 timestamp. - pub create_ts: chrono::DateTime, - /// Represents the topic of the given chat thread. - pub topic: ChatTopic, - /// A chat message. - pub tail_message: std::option::Option, - /// RFC3339 timestamp. - pub last_read_ts: chrono::DateTime, - /// Unsigned 64 bit integer. - pub unread_count: i64, - /// External links for a chat thread. - pub external: ChatThreadExternalLinks, -} - -/// External links for a chat thread. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ChatThreadExternalLinks { - /// A link to opening the chat thread. - pub chat: std::string::String, -} - -/// A chat message. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ChatMessage { - /// A universally unique identifier. - pub chat_message_id: std::string::String, - /// A universally unique identifier. - pub thread_id: std::string::String, - /// RFC3339 timestamp. - pub send_ts: chrono::DateTime, - /// Represents types of chat message bodies. - pub body: ChatMessageBody, -} - -/// Represents types of chat message bodies. -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum ChatMessageBody { - /// `rivet.chat#ChatMessageBody` variant for indicating a new chat was created. - ChatCreate(ChatMessageBodyChatCreate), - /// `rivet.chat#ChatMessageBody` variant for deleted messages. - Deleted(ChatMessageBodyDeleted), - /// `rivet.chat#ChatMessageBody` variant for indicating an identity joined the group. - GroupJoin(ChatMessageBodyGroupJoin), - /// `rivet.chat#ChatMessageBody` variant for indicating an identity left the group. - GroupLeave(ChatMessageBodyGroupLeave), - /// `rivet.chat#ChatMessageBody` variant for indicating an identity has been kicked from the group. - GroupMemberKick(ChatMessageBodyGroupMemberKick), - /// `rivet.chat#ChatMessageBody` variant for indicating an identity followed the identity. - IdentityFollow(ChatMessageBodyIdentityFollow), - /// `rivet.chat#ChatMessageBody` variant for indicating a change in the party's current activity. - PartyActivityChange(ChatMessageBodyPartyActivityChange), - /// `rivet.chat#ChatMessageBody` variant holding an a party invitation. - PartyInvite(ChatMessageBodyPartyInvite), - /// `rivet.chat#ChatMessageBody` variant for indicating an identity joined the party. - PartyJoin(ChatMessageBodyPartyJoin), - /// `rivet.chat#ChatMessageBody` variant for indicating an identity requesting to join your party. - PartyJoinRequest(ChatMessageBodyPartyJoinRequest), - /// `rivet.chat#ChatMessageBody` variant for indicating an identity left the party. - PartyLeave(ChatMessageBodyPartyLeave), - /// `rivet.chat#ChatMessageBody` variant for text messages. Sent by other identities using the chat interface. - Text(ChatMessageBodyText), -} - -/// `rivet.chat#ChatMessageBody` variant for indicating a change in the party's current activity. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ChatMessageBodyPartyActivityChange { - /// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. - pub activity: PartyActivity, -} - -/// `rivet.chat#ChatMessageBody` variant for indicating an identity left the party. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ChatMessageBodyPartyLeave { - /// An identity handle. - pub identity: IdentityHandle, -} - -/// `rivet.chat#ChatMessageBody` variant for indicating an identity joined the party. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ChatMessageBodyPartyJoin { - /// An identity handle. - pub identity: IdentityHandle, -} - -/// `rivet.chat#ChatMessageBody` variant for indicating an identity requesting to join your party. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ChatMessageBodyPartyJoinRequest { - /// An identity handle. - pub sender: IdentityHandle, -} - -/// `rivet.chat#ChatMessageBody` variant holding an a party invitation. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ChatMessageBodyPartyInvite { - /// An identity handle. - pub sender: IdentityHandle, - /// A party handle. - pub party: std::option::Option, - /// Pass to `rivet.api.party#GetPartyFromInvite$token` to view more information about the party. Pass to `rivet.api.party.common#JoinPartyInvite$token` to join the party. - pub invite_token: std::option::Option, -} - -/// `rivet.chat#ChatMessageBody` variant for indicating an identity has been kicked from the group. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ChatMessageBodyGroupMemberKick { - /// An identity handle. - pub identity: IdentityHandle, -} - -/// `rivet.chat#ChatMessageBody` variant for indicating an identity left the group. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ChatMessageBodyGroupLeave { - /// An identity handle. - pub identity: IdentityHandle, -} - -/// `rivet.chat#ChatMessageBody` variant for indicating an identity joined the group. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ChatMessageBodyGroupJoin { - /// An identity handle. - pub identity: IdentityHandle, -} - -/// `rivet.chat#ChatMessageBody` variant for indicating an identity followed the identity. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ChatMessageBodyIdentityFollow {} - -/// `rivet.chat#ChatMessageBody` variant for deleted messages. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ChatMessageBodyDeleted { - /// An identity handle. - pub sender: IdentityHandle, -} - -/// `rivet.chat#ChatMessageBody` variant for indicating a new chat was created. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ChatMessageBodyChatCreate {} - -/// `rivet.chat#ChatMessageBody` variant for text messages. Sent by other identities using the chat interface. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ChatMessageBodyText { - /// An identity handle. - pub sender: IdentityHandle, - /// The text in the message. - pub body: std::string::String, -} - -/// Represents the topic of the given chat thread. -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum ChatTopic { - /// `rivet.chat#ChatTopic` variant for direct (identity to identity) chats. - Direct(ChatTopicDirect), - /// `rivet.chat#ChatTopic` variant for groups. - Group(ChatTopicGroup), - /// `rivet.chat#ChatTopic` variant for parties. - Party(ChatTopicParty), -} - -/// `rivet.chat#ChatTopic` variant for direct (identity to identity) chats. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ChatTopicDirect { - /// An identity handle. - pub identity_a: IdentityHandle, - /// An identity handle. - pub identity_b: IdentityHandle, -} - -/// `rivet.chat#ChatTopic` variant for parties. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ChatTopicParty { - /// A party handle. - pub party: PartyHandle, -} - -/// `rivet.chat#ChatTopic` variant for groups. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ChatTopicGroup { - /// A group handle. - pub group: GroupHandle, -} - -/// An identity summary. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct IdentitySummary { - /// A universally unique identifier. - pub identity_id: std::string::String, - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub account_number: i32, - /// The URL of this identity's avatar image. - pub avatar_url: std::string::String, - /// Information about the identity's current status, party, and active game. - pub presence: std::option::Option, - /// A party handle. - pub party: std::option::Option, - /// Whether or not this identity is registered with a linked account. - pub is_registered: bool, - /// External links for an identity. - pub external: IdentityExternalLinks, - /// Whether or not the requestee's identity is following this identity. - pub following: bool, - /// Whether or not this identity following the requestee's identity. - pub is_following_me: bool, - /// Whether or not this identity is both following and is followed by the requestee's identity. - pub is_mutual_following: bool, -} - -/// A presigned request used to upload files. Upload your file to the given URL via a PUT request. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct UploadPresignedRequest { - /// The name of the file to upload. This is the same as the one given in the upload prepare file. - pub path: std::string::String, - /// The URL of the presigned request for which to upload your file to. - pub url: std::string::String, -} - -/// Information about the identity's current game. This is information that all other identities can see about what the current identity is doing. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct UpdateIdentityGameActivity { - /// A short message about the current game activity. - pub message: std::string::String, - /// JSON data seen by anyone. - pub public_metadata: std::option::Option, - /// JSON data seen only by the given identity and their mutual followers. - pub mutual_metadata: std::option::Option, -} - -/// An error given by failed content validation. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ValidationError { - /// A list of strings denoting the origin of a validation error. - pub path: std::vec::Vec, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ListActivitiesRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CancelGameLinkRequest { - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub identity_link_token: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CompleteGameLinkRequest { - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub identity_link_token: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetGameLinkRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PrepareGameLinkRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct WatchEventsRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct UnmarkDeletionRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct MarkDeletionRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ListMutualFriendsRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct RecentFollowerIgnoreRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ListRecentFollowersRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetIdentitySummariesRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetIdentityHandlesRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ReportIdentityRequest { - #[allow(missing_docs)] // documentation missing in model - pub reason: std::option::Option, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ListFriendsRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ListFollowingRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ListFollowersRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct SignupForBetaRequest { - #[allow(missing_docs)] // documentation missing in model - pub name: std::string::String, - #[allow(missing_docs)] // documentation missing in model - pub company_name: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub company_size: std::string::String, - #[allow(missing_docs)] // documentation missing in model - pub preferred_tools: std::string::String, - #[allow(missing_docs)] // documentation missing in model - pub goals: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CompleteIdentityAvatarUploadRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PrepareIdentityAvatarUploadRequest { - /// The path/filename of the identity avatar. - pub path: std::string::String, - /// The MIME type of the identity avatar. - pub mime: std::option::Option, - /// Unsigned 64 bit integer. - pub content_length: i64, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct UnfollowIdentityRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct FollowIdentityRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct UpdateIdentityStatusRequest { - /// The current status of an identity. This helps players understand if another player is currently playing or has their game in the background. - pub status: IdentityStatus, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct RemoveIdentityGameActivityRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct SetIdentityGameActivityRequest { - /// Information about the identity's current game. This is information that all other identities can see about what the current identity is doing. - pub game_activity: UpdateIdentityGameActivity, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct SearchIdentitiesRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ValidateIdentityProfileRequest { - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub account_number: std::option::Option, - /// Detailed information about a profile. - pub bio: std::option::Option, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct UpdateIdentityProfileRequest { - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub account_number: std::option::Option, - /// Detailed information about a profile. - pub bio: std::option::Option, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetIdentitySelfProfileRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetIdentityProfileRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct SetupIdentityRequest { - /// Token returned from previous call to `rivet.api.identity#SetupIdentity`. If this token is invalid, a new identity will be returned. - pub existing_identity_token: std::option::Option, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ListActivitiesResponse { - /// A list of identity handles. - pub identities: std::vec::Vec, - /// A list of game summaries. - pub games: std::vec::Vec, - /// A list of party summaries. - pub parties: std::vec::Vec, - /// A list of group summaries. - pub suggested_groups: std::vec::Vec, - /// A list of identity handles. - pub suggested_players: std::vec::Vec, - /// Provided by watchable endpoints used in blocking loops. - pub watch: WatchResponse, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CancelGameLinkResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CompleteGameLinkResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetGameLinkResponse { - /// The link status between an identity and a game user. - pub status: GameLinkStatus, - /// A game handle. - pub game: GameHandle, - /// The current game user identity which created this game link. - pub current_identity: IdentityHandle, - /// If `status` is `GameLinkStatus$COMPLETE`, this will return the new identity and identity token to use for all future requests. - pub new_identity: std::option::Option, - /// Provided by watchable endpoints used in blocking loops. - pub watch: WatchResponse, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PrepareGameLinkResponse { - /// Pass this to `rivet.api.identity#GetGameLink` to get the linking status. Valid for 15 minutes. - pub identity_link_token: std::string::String, - /// The URL that the user should visit to link their Rivet account. - pub identity_link_url: std::string::String, - /// Timestamp (in milliseconds) at which the link will expire. - pub expire_ts: chrono::DateTime, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct WatchEventsResponse { - /// A list of global events. Ordered old to new. - pub events: std::vec::Vec, - /// Provided by watchable endpoints used in blocking loops. - pub watch: WatchResponse, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct UnmarkDeletionResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct MarkDeletionResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ListMutualFriendsResponse { - /// A list of identity handles. - pub identities: std::vec::Vec, - #[allow(missing_docs)] // documentation missing in model - pub anchor: std::option::Option, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct RecentFollowerIgnoreResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ListRecentFollowersResponse { - /// A list of identity handles. - pub identities: std::vec::Vec, - #[allow(missing_docs)] // documentation missing in model - pub anchor: std::option::Option, - /// Provided by watchable endpoints used in blocking loops. - pub watch: WatchResponse, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetIdentitySummariesResponse { - /// A list of identity summaries. - pub identities: std::vec::Vec, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetIdentityHandlesResponse { - /// A list of identity handles. - pub identities: std::vec::Vec, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ReportIdentityResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ListFriendsResponse { - /// A list of identity handles. - pub identities: std::vec::Vec, - #[allow(missing_docs)] // documentation missing in model - pub anchor: std::option::Option, - /// Provided by watchable endpoints used in blocking loops. - pub watch: WatchResponse, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ListFollowingResponse { - /// A list of identity handles. - pub identities: std::vec::Vec, - #[allow(missing_docs)] // documentation missing in model - pub anchor: std::option::Option, - /// Provided by watchable endpoints used in blocking loops. - pub watch: WatchResponse, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ListFollowersResponse { - /// A list of identity handles. - pub identities: std::vec::Vec, - #[allow(missing_docs)] // documentation missing in model - pub anchor: std::option::Option, - /// Provided by watchable endpoints used in blocking loops. - pub watch: WatchResponse, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct SignupForBetaResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CompleteIdentityAvatarUploadResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PrepareIdentityAvatarUploadResponse { - /// A universally unique identifier. - pub upload_id: std::string::String, - /// A presigned request used to upload files. Upload your file to the given URL via a PUT request. - pub presigned_request: UploadPresignedRequest, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct UnfollowIdentityResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct FollowIdentityResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct UpdateIdentityStatusResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct RemoveIdentityGameActivityResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct SetIdentityGameActivityResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct SearchIdentitiesResponse { - /// A list of identity handles. - pub identities: std::vec::Vec, - #[allow(missing_docs)] // documentation missing in model - pub anchor: std::option::Option, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ValidateIdentityProfileResponse { - /// A list of validation errors. - pub errors: std::vec::Vec, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct UpdateIdentityProfileResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetIdentitySelfProfileResponse { - /// An identity profile. - pub identity: IdentityProfile, - /// Provided by watchable endpoints used in blocking loops. - pub watch: WatchResponse, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetIdentityProfileResponse { - /// An identity profile. - pub identity: IdentityProfile, - /// Provided by watchable endpoints used in blocking loops. - pub watch: WatchResponse, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct SetupIdentityResponse { - /// Token used to authenticate the identity. Should be stored somewhere permanent. Pass this to `rivet.api.identity#SetupIdentity$existing_identity_token` next time `rivet.api.identity#SetupIdentity` is called. Token has a 90 day TTL. This means that if `rivet.api.identity#SetupIdentity` is not called again within 90 days, the token will no longer be valid. If this happens, the user can recover their account through the linking process (see `rivet.api.identity#PrepareGameLink`). This token should be stored locally and never sent to a server or another device. If this token is compromised, anyone with access to this token has control of the identity. - pub identity_token: std::string::String, - /// Timestamp (in milliseconds) at which the token expires. - pub identity_token_expire_ts: chrono::DateTime, - /// Information about the identity that was just authenticated. - pub identity: IdentityProfile, - /// A universally unique identifier. - pub game_id: std::string::String, -} - diff --git a/lib/smithy-output/api-identity/rust/rust/Cargo.toml b/lib/smithy-output/api-identity/rust/rust/Cargo.toml deleted file mode 100644 index 439cec51e..000000000 --- a/lib/smithy-output/api-identity/rust/rust/Cargo.toml +++ /dev/null @@ -1,33 +0,0 @@ -# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -[package] -name = "rivet-identity" -version = "0.0.14" -authors = ["Rivet Gaming, LLC "] -description = "Rivet service for authenticating and managing identities" -edition = "2021" -license = "Apache-2.0" - -[package.metadata.docs.rs] -all-features = true -targets = ["x86_64-unknown-linux-gnu"] -[dependencies.aws-smithy-client] -version = "^0.41.0" -[dependencies.aws-smithy-http] -version = "^0.41.0" -[dependencies.aws-smithy-json] -version = "^0.41.0" -[dependencies.aws-smithy-types] -version = "^0.41.0" -[dependencies.bytes] -version = "1" -[dependencies.http] -version = "0.2" -[dependencies.tower] -version = "0.4" -[features] -rt-tokio = ["aws-smithy-http/rt-tokio"] -rustls = ["aws-smithy-client/rustls"] -native-tls = ["aws-smithy-client/native-tls"] -default = ["rt-tokio", "rustls"] - - diff --git a/lib/smithy-output/api-identity/rust/rust/src/client.rs b/lib/smithy-output/api-identity/rust/rust/src/client.rs deleted file mode 100644 index 54f453f4a..000000000 --- a/lib/smithy-output/api-identity/rust/rust/src/client.rs +++ /dev/null @@ -1,2894 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[derive(Debug)] -pub(crate) struct Handle { - pub(crate) client: aws_smithy_client::Client, - pub(crate) conf: crate::Config, -} - -/// An ergonomic service client for `IdentityService`. -/// -/// This client allows ergonomic access to a `IdentityService`-shaped service. -/// Each method corresponds to an endpoint defined in the service's Smithy model, -/// and the request and response shapes are auto-generated from that same model. -/// -/// # Constructing a Client -/// -/// To construct a client, you need a few different things: -/// -/// - A [`Config`](crate::Config) that specifies additional configuration -/// required by the service. -/// - A connector (`C`) that specifies how HTTP requests are translated -/// into HTTP responses. This will typically be an HTTP client (like -/// `hyper`), though you can also substitute in your own, like a mock -/// mock connector for testing. -/// - A "middleware" (`M`) that modifies requests prior to them being -/// sent to the request. Most commonly, middleware will decide what -/// endpoint the requests should be sent to, as well as perform -/// authentication and authorization of requests (such as SigV4). -/// You can also have middleware that performs request/response -/// tracing, throttling, or other middleware-like tasks. -/// - A retry policy (`R`) that dictates the behavior for requests that -/// fail and should (potentially) be retried. The default type is -/// generally what you want, as it implements a well-vetted retry -/// policy implemented in [`RetryMode::Standard`](aws_smithy_types::retry::RetryMode::Standard). -/// -/// To construct a client, you will generally want to call -/// [`Client::with_config`], which takes a [`aws_smithy_client::Client`] (a -/// Smithy client that isn't specialized to a particular service), -/// and a [`Config`](crate::Config). Both of these are constructed using -/// the [builder pattern] where you first construct a `Builder` type, -/// then configure it with the necessary parameters, and then call -/// `build` to construct the finalized output type. The -/// [`aws_smithy_client::Client`] builder is re-exported in this crate as -/// [`Builder`] for convenience. -/// -/// In _most_ circumstances, you will want to use the following pattern -/// to construct a client: -/// -/// ``` -/// use rivet_identity::{Builder, Client, Config}; -/// let raw_client = -/// Builder::dyn_https() -/// # /* -/// .middleware(/* discussed below */) -/// # */ -/// # .middleware_fn(|r| r) -/// .build(); -/// let config = Config::builder().build(); -/// let client = Client::with_config(raw_client, config); -/// ``` -/// -/// For the middleware, you'll want to use whatever matches the -/// routing, authentication and authorization required by the target -/// service. For example, for the standard AWS SDK which uses -/// [SigV4-signed requests], the middleware looks like this: -/// -// Ignored as otherwise we'd need to pull in all these dev-dependencies. -/// ```rust,ignore -/// use aws_endpoint::AwsEndpointStage; -/// use aws_http::auth::CredentialsStage; -/// use aws_http::recursion_detection::RecursionDetectionStage; -/// use aws_http::user_agent::UserAgentStage; -/// use aws_sig_auth::middleware::SigV4SigningStage; -/// use aws_sig_auth::signer::SigV4Signer; -/// use aws_smithy_client::retry::Config as RetryConfig; -/// use aws_smithy_http_tower::map_request::{AsyncMapRequestLayer, MapRequestLayer}; -/// use std::fmt::Debug; -/// use tower::layer::util::{Identity, Stack}; -/// use tower::ServiceBuilder; -/// -/// type AwsMiddlewareStack = Stack< -/// MapRequestLayer, -/// Stack< -/// MapRequestLayer, -/// Stack< -/// AsyncMapRequestLayer, -/// Stack< -/// MapRequestLayer, -/// Stack, Identity>, -/// >, -/// >, -/// >, -/// >; -/// -/// /// AWS Middleware Stack -/// /// -/// /// This implements the middleware stack for this service. It will: -/// /// 1. Load credentials asynchronously into the property bag -/// /// 2. Sign the request with SigV4 -/// /// 3. Resolve an Endpoint for the request -/// /// 4. Add a user agent to the request -/// #[derive(Debug, Default, Clone)] -/// #[non_exhaustive] -/// pub struct AwsMiddleware; -/// -/// impl AwsMiddleware { -/// /// Create a new `AwsMiddleware` stack -/// /// -/// /// Note: `AwsMiddleware` holds no state. -/// pub fn new() -> Self { -/// AwsMiddleware::default() -/// } -/// } -/// -/// // define the middleware stack in a non-generic location to reduce code bloat. -/// fn base() -> ServiceBuilder { -/// let credential_provider = AsyncMapRequestLayer::for_mapper(CredentialsStage::new()); -/// let signer = MapRequestLayer::for_mapper(SigV4SigningStage::new(SigV4Signer::new())); -/// let endpoint_resolver = MapRequestLayer::for_mapper(AwsEndpointStage); -/// let user_agent = MapRequestLayer::for_mapper(UserAgentStage::new()); -/// let recursion_detection = MapRequestLayer::for_mapper(RecursionDetectionStage::new()); -/// // These layers can be considered as occurring in order, that is: -/// // 1. Resolve an endpoint -/// // 2. Add a user agent -/// // 3. Acquire credentials -/// // 4. Sign with credentials -/// // (5. Dispatch over the wire) -/// ServiceBuilder::new() -/// .layer(endpoint_resolver) -/// .layer(user_agent) -/// .layer(credential_provider) -/// .layer(signer) -/// .layer(recursion_detection) -/// } -/// -/// impl tower::Layer for AwsMiddleware { -/// type Service = >::Service; -/// -/// fn layer(&self, inner: S) -> Self::Service { -/// base().service(inner) -/// } -/// } -/// ``` -/// -/// # Using a Client -/// -/// Once you have a client set up, you can access the service's endpoints -/// by calling the appropriate method on [`Client`]. Each such method -/// returns a request builder for that endpoint, with methods for setting -/// the various fields of the request. Once your request is complete, use -/// the `send` method to send the request. `send` returns a future, which -/// you then have to `.await` to get the service's response. -/// -/// [builder pattern]: https://rust-lang.github.io/api-guidelines/type-safety.html#c-builder -/// [SigV4-signed requests]: https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html -#[derive(std::fmt::Debug)] -pub struct Client { - handle: std::sync::Arc>, -} - -impl std::clone::Clone for Client { - fn clone(&self) -> Self { - Self { - handle: self.handle.clone(), - } - } -} - -#[doc(inline)] -pub use aws_smithy_client::Builder; - -impl From> for Client { - fn from(client: aws_smithy_client::Client) -> Self { - Self::with_config(client, crate::Config::builder().build()) - } -} - -impl Client { - /// Creates a client with the given service configuration. - pub fn with_config(client: aws_smithy_client::Client, conf: crate::Config) -> Self { - Self { - handle: std::sync::Arc::new(Handle { client, conf }), - } - } - - /// Returns the client's configuration. - pub fn conf(&self) -> &crate::Config { - &self.handle.conf - } -} -impl Client -where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, -{ - /// Constructs a fluent builder for the [`CancelGameLink`](crate::client::fluent_builders::CancelGameLink) operation. - /// - /// - The fluent builder is configurable: - /// - [`identity_link_token(impl Into)`](crate::client::fluent_builders::CancelGameLink::identity_link_token) / [`set_identity_link_token(Option)`](crate::client::fluent_builders::CancelGameLink::set_identity_link_token): A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - /// - On success, responds with [`CancelGameLinkOutput`](crate::output::CancelGameLinkOutput) - - /// - On failure, responds with [`SdkError`](crate::error::CancelGameLinkError) - pub fn cancel_game_link(&self) -> fluent_builders::CancelGameLink { - fluent_builders::CancelGameLink::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`CompleteGameLink`](crate::client::fluent_builders::CompleteGameLink) operation. - /// - /// - The fluent builder is configurable: - /// - [`identity_link_token(impl Into)`](crate::client::fluent_builders::CompleteGameLink::identity_link_token) / [`set_identity_link_token(Option)`](crate::client::fluent_builders::CompleteGameLink::set_identity_link_token): A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - /// - On success, responds with [`CompleteGameLinkOutput`](crate::output::CompleteGameLinkOutput) - - /// - On failure, responds with [`SdkError`](crate::error::CompleteGameLinkError) - pub fn complete_game_link(&self) -> fluent_builders::CompleteGameLink { - fluent_builders::CompleteGameLink::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`CompleteIdentityAvatarUpload`](crate::client::fluent_builders::CompleteIdentityAvatarUpload) operation. - /// - /// - The fluent builder is configurable: - /// - [`upload_id(impl Into)`](crate::client::fluent_builders::CompleteIdentityAvatarUpload::upload_id) / [`set_upload_id(Option)`](crate::client::fluent_builders::CompleteIdentityAvatarUpload::set_upload_id): A universally unique identifier. - /// - On success, responds with [`CompleteIdentityAvatarUploadOutput`](crate::output::CompleteIdentityAvatarUploadOutput) - - /// - On failure, responds with [`SdkError`](crate::error::CompleteIdentityAvatarUploadError) - pub fn complete_identity_avatar_upload( - &self, - ) -> fluent_builders::CompleteIdentityAvatarUpload { - fluent_builders::CompleteIdentityAvatarUpload::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`FollowIdentity`](crate::client::fluent_builders::FollowIdentity) operation. - /// - /// - The fluent builder is configurable: - /// - [`identity_id(impl Into)`](crate::client::fluent_builders::FollowIdentity::identity_id) / [`set_identity_id(Option)`](crate::client::fluent_builders::FollowIdentity::set_identity_id): A universally unique identifier. - /// - On success, responds with [`FollowIdentityOutput`](crate::output::FollowIdentityOutput) - - /// - On failure, responds with [`SdkError`](crate::error::FollowIdentityError) - pub fn follow_identity(&self) -> fluent_builders::FollowIdentity { - fluent_builders::FollowIdentity::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GetGameLink`](crate::client::fluent_builders::GetGameLink) operation. - /// - /// - The fluent builder is configurable: - /// - [`identity_link_token(impl Into)`](crate::client::fluent_builders::GetGameLink::identity_link_token) / [`set_identity_link_token(Option)`](crate::client::fluent_builders::GetGameLink::set_identity_link_token): `identity_link_token` returned by `PrepareGameLink`. - /// - [`watch_index(impl Into)`](crate::client::fluent_builders::GetGameLink::watch_index) / [`set_watch_index(Option)`](crate::client::fluent_builders::GetGameLink::set_watch_index): A query parameter denoting the requests watch index. - /// - On success, responds with [`GetGameLinkOutput`](crate::output::GetGameLinkOutput) with field(s): - /// - [`status(Option)`](crate::output::GetGameLinkOutput::status): The link status between an identity and a game user. - /// - [`game(Option)`](crate::output::GetGameLinkOutput::game): A game handle. - /// - [`current_identity(Option)`](crate::output::GetGameLinkOutput::current_identity): The current game user identity which created this game link. - /// - [`new_identity(Option)`](crate::output::GetGameLinkOutput::new_identity): If `status` is `GameLinkStatus$COMPLETE`, this will return the new identity and identity token to use for all future requests. - /// - [`watch(Option)`](crate::output::GetGameLinkOutput::watch): Provided by watchable endpoints used in blocking loops. - /// - On failure, responds with [`SdkError`](crate::error::GetGameLinkError) - pub fn get_game_link(&self) -> fluent_builders::GetGameLink { - fluent_builders::GetGameLink::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GetIdentityHandles`](crate::client::fluent_builders::GetIdentityHandles) operation. - /// - /// - The fluent builder is configurable: - /// - [`identity_ids(Vec)`](crate::client::fluent_builders::GetIdentityHandles::identity_ids) / [`set_identity_ids(Option>)`](crate::client::fluent_builders::GetIdentityHandles::set_identity_ids): A list of identity IDs. - /// - On success, responds with [`GetIdentityHandlesOutput`](crate::output::GetIdentityHandlesOutput) with field(s): - /// - [`identities(Option>)`](crate::output::GetIdentityHandlesOutput::identities): A list of identity handles. - /// - On failure, responds with [`SdkError`](crate::error::GetIdentityHandlesError) - pub fn get_identity_handles(&self) -> fluent_builders::GetIdentityHandles { - fluent_builders::GetIdentityHandles::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GetIdentityProfile`](crate::client::fluent_builders::GetIdentityProfile) operation. - /// - /// - The fluent builder is configurable: - /// - [`identity_id(impl Into)`](crate::client::fluent_builders::GetIdentityProfile::identity_id) / [`set_identity_id(Option)`](crate::client::fluent_builders::GetIdentityProfile::set_identity_id): A universally unique identifier. - /// - [`watch_index(impl Into)`](crate::client::fluent_builders::GetIdentityProfile::watch_index) / [`set_watch_index(Option)`](crate::client::fluent_builders::GetIdentityProfile::set_watch_index): A query parameter denoting the requests watch index. - /// - On success, responds with [`GetIdentityProfileOutput`](crate::output::GetIdentityProfileOutput) with field(s): - /// - [`identity(Option)`](crate::output::GetIdentityProfileOutput::identity): An identity profile. - /// - [`watch(Option)`](crate::output::GetIdentityProfileOutput::watch): Provided by watchable endpoints used in blocking loops. - /// - On failure, responds with [`SdkError`](crate::error::GetIdentityProfileError) - pub fn get_identity_profile(&self) -> fluent_builders::GetIdentityProfile { - fluent_builders::GetIdentityProfile::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GetIdentitySelfProfile`](crate::client::fluent_builders::GetIdentitySelfProfile) operation. - /// - /// - The fluent builder is configurable: - /// - [`watch_index(impl Into)`](crate::client::fluent_builders::GetIdentitySelfProfile::watch_index) / [`set_watch_index(Option)`](crate::client::fluent_builders::GetIdentitySelfProfile::set_watch_index): A query parameter denoting the requests watch index. - /// - On success, responds with [`GetIdentitySelfProfileOutput`](crate::output::GetIdentitySelfProfileOutput) with field(s): - /// - [`identity(Option)`](crate::output::GetIdentitySelfProfileOutput::identity): An identity profile. - /// - [`watch(Option)`](crate::output::GetIdentitySelfProfileOutput::watch): Provided by watchable endpoints used in blocking loops. - /// - On failure, responds with [`SdkError`](crate::error::GetIdentitySelfProfileError) - pub fn get_identity_self_profile(&self) -> fluent_builders::GetIdentitySelfProfile { - fluent_builders::GetIdentitySelfProfile::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GetIdentitySummaries`](crate::client::fluent_builders::GetIdentitySummaries) operation. - /// - /// - The fluent builder is configurable: - /// - [`identity_ids(Vec)`](crate::client::fluent_builders::GetIdentitySummaries::identity_ids) / [`set_identity_ids(Option>)`](crate::client::fluent_builders::GetIdentitySummaries::set_identity_ids): A list of identity IDs. - /// - On success, responds with [`GetIdentitySummariesOutput`](crate::output::GetIdentitySummariesOutput) with field(s): - /// - [`identities(Option>)`](crate::output::GetIdentitySummariesOutput::identities): A list of identity summaries. - /// - On failure, responds with [`SdkError`](crate::error::GetIdentitySummariesError) - pub fn get_identity_summaries(&self) -> fluent_builders::GetIdentitySummaries { - fluent_builders::GetIdentitySummaries::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`ListActivities`](crate::client::fluent_builders::ListActivities) operation. - /// - /// - The fluent builder is configurable: - /// - [`watch_index(impl Into)`](crate::client::fluent_builders::ListActivities::watch_index) / [`set_watch_index(Option)`](crate::client::fluent_builders::ListActivities::set_watch_index): A query parameter denoting the requests watch index. - /// - On success, responds with [`ListActivitiesOutput`](crate::output::ListActivitiesOutput) with field(s): - /// - [`identities(Option>)`](crate::output::ListActivitiesOutput::identities): A list of identity handles. - /// - [`games(Option>)`](crate::output::ListActivitiesOutput::games): A list of game summaries. - /// - [`parties(Option>)`](crate::output::ListActivitiesOutput::parties): A list of party summaries. - /// - [`suggested_groups(Option>)`](crate::output::ListActivitiesOutput::suggested_groups): A list of group summaries. - /// - [`suggested_players(Option>)`](crate::output::ListActivitiesOutput::suggested_players): A list of identity handles. - /// - [`watch(Option)`](crate::output::ListActivitiesOutput::watch): Provided by watchable endpoints used in blocking loops. - /// - On failure, responds with [`SdkError`](crate::error::ListActivitiesError) - pub fn list_activities(&self) -> fluent_builders::ListActivities { - fluent_builders::ListActivities::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`ListFollowers`](crate::client::fluent_builders::ListFollowers) operation. - /// - /// - The fluent builder is configurable: - /// - [`identity_id(impl Into)`](crate::client::fluent_builders::ListFollowers::identity_id) / [`set_identity_id(Option)`](crate::client::fluent_builders::ListFollowers::set_identity_id): A universally unique identifier. - /// - [`anchor(impl Into)`](crate::client::fluent_builders::ListFollowers::anchor) / [`set_anchor(Option)`](crate::client::fluent_builders::ListFollowers::set_anchor): (undocumented) - /// - [`count(i32)`](crate::client::fluent_builders::ListFollowers::count) / [`set_count(Option)`](crate::client::fluent_builders::ListFollowers::set_count): Unsigned 32 bit integer. - /// - [`watch_index(impl Into)`](crate::client::fluent_builders::ListFollowers::watch_index) / [`set_watch_index(Option)`](crate::client::fluent_builders::ListFollowers::set_watch_index): A query parameter denoting the requests watch index. - /// - On success, responds with [`ListFollowersOutput`](crate::output::ListFollowersOutput) with field(s): - /// - [`identities(Option>)`](crate::output::ListFollowersOutput::identities): A list of identity handles. - /// - [`anchor(Option)`](crate::output::ListFollowersOutput::anchor): (undocumented) - /// - [`watch(Option)`](crate::output::ListFollowersOutput::watch): Provided by watchable endpoints used in blocking loops. - /// - On failure, responds with [`SdkError`](crate::error::ListFollowersError) - pub fn list_followers(&self) -> fluent_builders::ListFollowers { - fluent_builders::ListFollowers::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`ListFollowing`](crate::client::fluent_builders::ListFollowing) operation. - /// - /// - The fluent builder is configurable: - /// - [`identity_id(impl Into)`](crate::client::fluent_builders::ListFollowing::identity_id) / [`set_identity_id(Option)`](crate::client::fluent_builders::ListFollowing::set_identity_id): A universally unique identifier. - /// - [`anchor(impl Into)`](crate::client::fluent_builders::ListFollowing::anchor) / [`set_anchor(Option)`](crate::client::fluent_builders::ListFollowing::set_anchor): (undocumented) - /// - [`count(i32)`](crate::client::fluent_builders::ListFollowing::count) / [`set_count(Option)`](crate::client::fluent_builders::ListFollowing::set_count): Unsigned 32 bit integer. - /// - [`watch_index(impl Into)`](crate::client::fluent_builders::ListFollowing::watch_index) / [`set_watch_index(Option)`](crate::client::fluent_builders::ListFollowing::set_watch_index): A query parameter denoting the requests watch index. - /// - On success, responds with [`ListFollowingOutput`](crate::output::ListFollowingOutput) with field(s): - /// - [`identities(Option>)`](crate::output::ListFollowingOutput::identities): A list of identity handles. - /// - [`anchor(Option)`](crate::output::ListFollowingOutput::anchor): (undocumented) - /// - [`watch(Option)`](crate::output::ListFollowingOutput::watch): Provided by watchable endpoints used in blocking loops. - /// - On failure, responds with [`SdkError`](crate::error::ListFollowingError) - pub fn list_following(&self) -> fluent_builders::ListFollowing { - fluent_builders::ListFollowing::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`ListFriends`](crate::client::fluent_builders::ListFriends) operation. - /// - /// - The fluent builder is configurable: - /// - [`anchor(impl Into)`](crate::client::fluent_builders::ListFriends::anchor) / [`set_anchor(Option)`](crate::client::fluent_builders::ListFriends::set_anchor): (undocumented) - /// - [`count(i32)`](crate::client::fluent_builders::ListFriends::count) / [`set_count(Option)`](crate::client::fluent_builders::ListFriends::set_count): Unsigned 32 bit integer. - /// - [`watch_index(impl Into)`](crate::client::fluent_builders::ListFriends::watch_index) / [`set_watch_index(Option)`](crate::client::fluent_builders::ListFriends::set_watch_index): A query parameter denoting the requests watch index. - /// - On success, responds with [`ListFriendsOutput`](crate::output::ListFriendsOutput) with field(s): - /// - [`identities(Option>)`](crate::output::ListFriendsOutput::identities): A list of identity handles. - /// - [`anchor(Option)`](crate::output::ListFriendsOutput::anchor): (undocumented) - /// - [`watch(Option)`](crate::output::ListFriendsOutput::watch): Provided by watchable endpoints used in blocking loops. - /// - On failure, responds with [`SdkError`](crate::error::ListFriendsError) - pub fn list_friends(&self) -> fluent_builders::ListFriends { - fluent_builders::ListFriends::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`ListMutualFriends`](crate::client::fluent_builders::ListMutualFriends) operation. - /// - /// - The fluent builder is configurable: - /// - [`identity_id(impl Into)`](crate::client::fluent_builders::ListMutualFriends::identity_id) / [`set_identity_id(Option)`](crate::client::fluent_builders::ListMutualFriends::set_identity_id): A universally unique identifier. - /// - [`anchor(impl Into)`](crate::client::fluent_builders::ListMutualFriends::anchor) / [`set_anchor(Option)`](crate::client::fluent_builders::ListMutualFriends::set_anchor): (undocumented) - /// - [`count(i32)`](crate::client::fluent_builders::ListMutualFriends::count) / [`set_count(Option)`](crate::client::fluent_builders::ListMutualFriends::set_count): Unsigned 32 bit integer. - /// - On success, responds with [`ListMutualFriendsOutput`](crate::output::ListMutualFriendsOutput) with field(s): - /// - [`identities(Option>)`](crate::output::ListMutualFriendsOutput::identities): A list of identity handles. - /// - [`anchor(Option)`](crate::output::ListMutualFriendsOutput::anchor): (undocumented) - /// - On failure, responds with [`SdkError`](crate::error::ListMutualFriendsError) - pub fn list_mutual_friends(&self) -> fluent_builders::ListMutualFriends { - fluent_builders::ListMutualFriends::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`ListRecentFollowers`](crate::client::fluent_builders::ListRecentFollowers) operation. - /// - /// - The fluent builder is configurable: - /// - [`anchor(impl Into)`](crate::client::fluent_builders::ListRecentFollowers::anchor) / [`set_anchor(Option)`](crate::client::fluent_builders::ListRecentFollowers::set_anchor): (undocumented) - /// - [`count(i32)`](crate::client::fluent_builders::ListRecentFollowers::count) / [`set_count(Option)`](crate::client::fluent_builders::ListRecentFollowers::set_count): Unsigned 32 bit integer. - /// - [`watch_index(impl Into)`](crate::client::fluent_builders::ListRecentFollowers::watch_index) / [`set_watch_index(Option)`](crate::client::fluent_builders::ListRecentFollowers::set_watch_index): A query parameter denoting the requests watch index. - /// - On success, responds with [`ListRecentFollowersOutput`](crate::output::ListRecentFollowersOutput) with field(s): - /// - [`identities(Option>)`](crate::output::ListRecentFollowersOutput::identities): A list of identity handles. - /// - [`anchor(Option)`](crate::output::ListRecentFollowersOutput::anchor): (undocumented) - /// - [`watch(Option)`](crate::output::ListRecentFollowersOutput::watch): Provided by watchable endpoints used in blocking loops. - /// - On failure, responds with [`SdkError`](crate::error::ListRecentFollowersError) - pub fn list_recent_followers(&self) -> fluent_builders::ListRecentFollowers { - fluent_builders::ListRecentFollowers::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`MarkDeletion`](crate::client::fluent_builders::MarkDeletion) operation. - /// - /// - The fluent builder takes no input, just [`send`](crate::client::fluent_builders::MarkDeletion::send) it. - - /// - On success, responds with [`MarkDeletionOutput`](crate::output::MarkDeletionOutput) - - /// - On failure, responds with [`SdkError`](crate::error::MarkDeletionError) - pub fn mark_deletion(&self) -> fluent_builders::MarkDeletion { - fluent_builders::MarkDeletion::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`PrepareGameLink`](crate::client::fluent_builders::PrepareGameLink) operation. - /// - /// - The fluent builder takes no input, just [`send`](crate::client::fluent_builders::PrepareGameLink::send) it. - - /// - On success, responds with [`PrepareGameLinkOutput`](crate::output::PrepareGameLinkOutput) with field(s): - /// - [`identity_link_token(Option)`](crate::output::PrepareGameLinkOutput::identity_link_token): Pass this to `rivet.api.identity#GetGameLink` to get the linking status. Valid for 15 minutes. - /// - [`identity_link_url(Option)`](crate::output::PrepareGameLinkOutput::identity_link_url): The URL that the user should visit to link their Rivet account. - /// - [`expire_ts(Option)`](crate::output::PrepareGameLinkOutput::expire_ts): Timestamp (in milliseconds) at which the link will expire. - /// - On failure, responds with [`SdkError`](crate::error::PrepareGameLinkError) - pub fn prepare_game_link(&self) -> fluent_builders::PrepareGameLink { - fluent_builders::PrepareGameLink::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`PrepareIdentityAvatarUpload`](crate::client::fluent_builders::PrepareIdentityAvatarUpload) operation. - /// - /// - The fluent builder is configurable: - /// - [`path(impl Into)`](crate::client::fluent_builders::PrepareIdentityAvatarUpload::path) / [`set_path(Option)`](crate::client::fluent_builders::PrepareIdentityAvatarUpload::set_path): The path/filename of the identity avatar. - /// - [`mime(impl Into)`](crate::client::fluent_builders::PrepareIdentityAvatarUpload::mime) / [`set_mime(Option)`](crate::client::fluent_builders::PrepareIdentityAvatarUpload::set_mime): The MIME type of the identity avatar. - /// - [`content_length(i64)`](crate::client::fluent_builders::PrepareIdentityAvatarUpload::content_length) / [`set_content_length(Option)`](crate::client::fluent_builders::PrepareIdentityAvatarUpload::set_content_length): Unsigned 64 bit integer. - /// - On success, responds with [`PrepareIdentityAvatarUploadOutput`](crate::output::PrepareIdentityAvatarUploadOutput) with field(s): - /// - [`upload_id(Option)`](crate::output::PrepareIdentityAvatarUploadOutput::upload_id): A universally unique identifier. - /// - [`presigned_request(Option)`](crate::output::PrepareIdentityAvatarUploadOutput::presigned_request): A presigned request used to upload files. Upload your file to the given URL via a PUT request. - /// - On failure, responds with [`SdkError`](crate::error::PrepareIdentityAvatarUploadError) - pub fn prepare_identity_avatar_upload( - &self, - ) -> fluent_builders::PrepareIdentityAvatarUpload { - fluent_builders::PrepareIdentityAvatarUpload::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`RecentFollowerIgnore`](crate::client::fluent_builders::RecentFollowerIgnore) operation. - /// - /// - The fluent builder is configurable: - /// - [`identity_id(impl Into)`](crate::client::fluent_builders::RecentFollowerIgnore::identity_id) / [`set_identity_id(Option)`](crate::client::fluent_builders::RecentFollowerIgnore::set_identity_id): A universally unique identifier. - /// - On success, responds with [`RecentFollowerIgnoreOutput`](crate::output::RecentFollowerIgnoreOutput) - - /// - On failure, responds with [`SdkError`](crate::error::RecentFollowerIgnoreError) - pub fn recent_follower_ignore(&self) -> fluent_builders::RecentFollowerIgnore { - fluent_builders::RecentFollowerIgnore::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`RemoveIdentityGameActivity`](crate::client::fluent_builders::RemoveIdentityGameActivity) operation. - /// - /// - The fluent builder takes no input, just [`send`](crate::client::fluent_builders::RemoveIdentityGameActivity::send) it. - - /// - On success, responds with [`RemoveIdentityGameActivityOutput`](crate::output::RemoveIdentityGameActivityOutput) - - /// - On failure, responds with [`SdkError`](crate::error::RemoveIdentityGameActivityError) - pub fn remove_identity_game_activity( - &self, - ) -> fluent_builders::RemoveIdentityGameActivity { - fluent_builders::RemoveIdentityGameActivity::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`ReportIdentity`](crate::client::fluent_builders::ReportIdentity) operation. - /// - /// - The fluent builder is configurable: - /// - [`identity_id(impl Into)`](crate::client::fluent_builders::ReportIdentity::identity_id) / [`set_identity_id(Option)`](crate::client::fluent_builders::ReportIdentity::set_identity_id): A universally unique identifier. - /// - [`reason(impl Into)`](crate::client::fluent_builders::ReportIdentity::reason) / [`set_reason(Option)`](crate::client::fluent_builders::ReportIdentity::set_reason): (undocumented) - /// - On success, responds with [`ReportIdentityOutput`](crate::output::ReportIdentityOutput) - - /// - On failure, responds with [`SdkError`](crate::error::ReportIdentityError) - pub fn report_identity(&self) -> fluent_builders::ReportIdentity { - fluent_builders::ReportIdentity::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`SearchIdentities`](crate::client::fluent_builders::SearchIdentities) operation. - /// - /// - The fluent builder is configurable: - /// - [`query(impl Into)`](crate::client::fluent_builders::SearchIdentities::query) / [`set_query(Option)`](crate::client::fluent_builders::SearchIdentities::set_query): The query to match identity display names and account numbers against. - /// - [`anchor(impl Into)`](crate::client::fluent_builders::SearchIdentities::anchor) / [`set_anchor(Option)`](crate::client::fluent_builders::SearchIdentities::set_anchor): (undocumented) - /// - [`limit(i32)`](crate::client::fluent_builders::SearchIdentities::limit) / [`set_limit(Option)`](crate::client::fluent_builders::SearchIdentities::set_limit): Unsigned 32 bit integer. - /// - On success, responds with [`SearchIdentitiesOutput`](crate::output::SearchIdentitiesOutput) with field(s): - /// - [`identities(Option>)`](crate::output::SearchIdentitiesOutput::identities): A list of identity handles. - /// - [`anchor(Option)`](crate::output::SearchIdentitiesOutput::anchor): (undocumented) - /// - On failure, responds with [`SdkError`](crate::error::SearchIdentitiesError) - pub fn search_identities(&self) -> fluent_builders::SearchIdentities { - fluent_builders::SearchIdentities::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`SetIdentityGameActivity`](crate::client::fluent_builders::SetIdentityGameActivity) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_activity(UpdateIdentityGameActivity)`](crate::client::fluent_builders::SetIdentityGameActivity::game_activity) / [`set_game_activity(Option)`](crate::client::fluent_builders::SetIdentityGameActivity::set_game_activity): Information about the identity's current game. This is information that all other identities can see about what the current identity is doing. - /// - On success, responds with [`SetIdentityGameActivityOutput`](crate::output::SetIdentityGameActivityOutput) - - /// - On failure, responds with [`SdkError`](crate::error::SetIdentityGameActivityError) - pub fn set_identity_game_activity(&self) -> fluent_builders::SetIdentityGameActivity { - fluent_builders::SetIdentityGameActivity::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`SetupIdentity`](crate::client::fluent_builders::SetupIdentity) operation. - /// - /// - The fluent builder is configurable: - /// - [`existing_identity_token(impl Into)`](crate::client::fluent_builders::SetupIdentity::existing_identity_token) / [`set_existing_identity_token(Option)`](crate::client::fluent_builders::SetupIdentity::set_existing_identity_token): Token returned from previous call to `rivet.api.identity#SetupIdentity`. If this token is invalid, a new identity will be returned. - /// - On success, responds with [`SetupIdentityOutput`](crate::output::SetupIdentityOutput) with field(s): - /// - [`identity_token(Option)`](crate::output::SetupIdentityOutput::identity_token): Token used to authenticate the identity. Should be stored somewhere permanent. Pass this to `rivet.api.identity#SetupIdentity$existing_identity_token` next time `rivet.api.identity#SetupIdentity` is called. Token has a 90 day TTL. This means that if `rivet.api.identity#SetupIdentity` is not called again within 90 days, the token will no longer be valid. If this happens, the user can recover their account through the linking process (see `rivet.api.identity#PrepareGameLink`). This token should be stored locally and never sent to a server or another device. If this token is compromised, anyone with access to this token has control of the identity. - /// - [`identity_token_expire_ts(Option)`](crate::output::SetupIdentityOutput::identity_token_expire_ts): Timestamp (in milliseconds) at which the token expires. - /// - [`identity(Option)`](crate::output::SetupIdentityOutput::identity): Information about the identity that was just authenticated. - /// - [`game_id(Option)`](crate::output::SetupIdentityOutput::game_id): A universally unique identifier. - /// - On failure, responds with [`SdkError`](crate::error::SetupIdentityError) - pub fn setup_identity(&self) -> fluent_builders::SetupIdentity { - fluent_builders::SetupIdentity::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`SignupForBeta`](crate::client::fluent_builders::SignupForBeta) operation. - /// - /// - The fluent builder is configurable: - /// - [`name(impl Into)`](crate::client::fluent_builders::SignupForBeta::name) / [`set_name(Option)`](crate::client::fluent_builders::SignupForBeta::set_name): (undocumented) - /// - [`company_name(impl Into)`](crate::client::fluent_builders::SignupForBeta::company_name) / [`set_company_name(Option)`](crate::client::fluent_builders::SignupForBeta::set_company_name): (undocumented) - /// - [`company_size(impl Into)`](crate::client::fluent_builders::SignupForBeta::company_size) / [`set_company_size(Option)`](crate::client::fluent_builders::SignupForBeta::set_company_size): (undocumented) - /// - [`preferred_tools(impl Into)`](crate::client::fluent_builders::SignupForBeta::preferred_tools) / [`set_preferred_tools(Option)`](crate::client::fluent_builders::SignupForBeta::set_preferred_tools): (undocumented) - /// - [`goals(impl Into)`](crate::client::fluent_builders::SignupForBeta::goals) / [`set_goals(Option)`](crate::client::fluent_builders::SignupForBeta::set_goals): (undocumented) - /// - On success, responds with [`SignupForBetaOutput`](crate::output::SignupForBetaOutput) - - /// - On failure, responds with [`SdkError`](crate::error::SignupForBetaError) - pub fn signup_for_beta(&self) -> fluent_builders::SignupForBeta { - fluent_builders::SignupForBeta::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`UnfollowIdentity`](crate::client::fluent_builders::UnfollowIdentity) operation. - /// - /// - The fluent builder is configurable: - /// - [`identity_id(impl Into)`](crate::client::fluent_builders::UnfollowIdentity::identity_id) / [`set_identity_id(Option)`](crate::client::fluent_builders::UnfollowIdentity::set_identity_id): A universally unique identifier. - /// - On success, responds with [`UnfollowIdentityOutput`](crate::output::UnfollowIdentityOutput) - - /// - On failure, responds with [`SdkError`](crate::error::UnfollowIdentityError) - pub fn unfollow_identity(&self) -> fluent_builders::UnfollowIdentity { - fluent_builders::UnfollowIdentity::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`UnmarkDeletion`](crate::client::fluent_builders::UnmarkDeletion) operation. - /// - /// - The fluent builder takes no input, just [`send`](crate::client::fluent_builders::UnmarkDeletion::send) it. - - /// - On success, responds with [`UnmarkDeletionOutput`](crate::output::UnmarkDeletionOutput) - - /// - On failure, responds with [`SdkError`](crate::error::UnmarkDeletionError) - pub fn unmark_deletion(&self) -> fluent_builders::UnmarkDeletion { - fluent_builders::UnmarkDeletion::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`UpdateIdentityProfile`](crate::client::fluent_builders::UpdateIdentityProfile) operation. - /// - /// - The fluent builder is configurable: - /// - [`display_name(impl Into)`](crate::client::fluent_builders::UpdateIdentityProfile::display_name) / [`set_display_name(Option)`](crate::client::fluent_builders::UpdateIdentityProfile::set_display_name): Represent a resource's readable display name. - /// - [`account_number(i32)`](crate::client::fluent_builders::UpdateIdentityProfile::account_number) / [`set_account_number(Option)`](crate::client::fluent_builders::UpdateIdentityProfile::set_account_number): Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - /// - [`bio(impl Into)`](crate::client::fluent_builders::UpdateIdentityProfile::bio) / [`set_bio(Option)`](crate::client::fluent_builders::UpdateIdentityProfile::set_bio): Detailed information about a profile. - /// - On success, responds with [`UpdateIdentityProfileOutput`](crate::output::UpdateIdentityProfileOutput) - - /// - On failure, responds with [`SdkError`](crate::error::UpdateIdentityProfileError) - pub fn update_identity_profile(&self) -> fluent_builders::UpdateIdentityProfile { - fluent_builders::UpdateIdentityProfile::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`UpdateIdentityStatus`](crate::client::fluent_builders::UpdateIdentityStatus) operation. - /// - /// - The fluent builder is configurable: - /// - [`status(IdentityStatus)`](crate::client::fluent_builders::UpdateIdentityStatus::status) / [`set_status(Option)`](crate::client::fluent_builders::UpdateIdentityStatus::set_status): The current status of an identity. This helps players understand if another player is currently playing or has their game in the background. - /// - On success, responds with [`UpdateIdentityStatusOutput`](crate::output::UpdateIdentityStatusOutput) - - /// - On failure, responds with [`SdkError`](crate::error::UpdateIdentityStatusError) - pub fn update_identity_status(&self) -> fluent_builders::UpdateIdentityStatus { - fluent_builders::UpdateIdentityStatus::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`ValidateIdentityProfile`](crate::client::fluent_builders::ValidateIdentityProfile) operation. - /// - /// - The fluent builder is configurable: - /// - [`display_name(impl Into)`](crate::client::fluent_builders::ValidateIdentityProfile::display_name) / [`set_display_name(Option)`](crate::client::fluent_builders::ValidateIdentityProfile::set_display_name): Represent a resource's readable display name. - /// - [`account_number(i32)`](crate::client::fluent_builders::ValidateIdentityProfile::account_number) / [`set_account_number(Option)`](crate::client::fluent_builders::ValidateIdentityProfile::set_account_number): Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - /// - [`bio(impl Into)`](crate::client::fluent_builders::ValidateIdentityProfile::bio) / [`set_bio(Option)`](crate::client::fluent_builders::ValidateIdentityProfile::set_bio): Detailed information about a profile. - /// - On success, responds with [`ValidateIdentityProfileOutput`](crate::output::ValidateIdentityProfileOutput) with field(s): - /// - [`errors(Option>)`](crate::output::ValidateIdentityProfileOutput::errors): A list of validation errors. - /// - On failure, responds with [`SdkError`](crate::error::ValidateIdentityProfileError) - pub fn validate_identity_profile(&self) -> fluent_builders::ValidateIdentityProfile { - fluent_builders::ValidateIdentityProfile::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`WatchEvents`](crate::client::fluent_builders::WatchEvents) operation. - /// - /// - The fluent builder is configurable: - /// - [`watch_index(impl Into)`](crate::client::fluent_builders::WatchEvents::watch_index) / [`set_watch_index(Option)`](crate::client::fluent_builders::WatchEvents::set_watch_index): A query parameter denoting the requests watch index. - /// - On success, responds with [`WatchEventsOutput`](crate::output::WatchEventsOutput) with field(s): - /// - [`events(Option>)`](crate::output::WatchEventsOutput::events): A list of global events. Ordered old to new. - /// - [`watch(Option)`](crate::output::WatchEventsOutput::watch): Provided by watchable endpoints used in blocking loops. - /// - On failure, responds with [`SdkError`](crate::error::WatchEventsError) - pub fn watch_events(&self) -> fluent_builders::WatchEvents { - fluent_builders::WatchEvents::new(self.handle.clone()) - } -} -pub mod fluent_builders { - //! - //! Utilities to ergonomically construct a request to the service. - //! - //! Fluent builders are created through the [`Client`](crate::client::Client) by calling - //! one if its operation methods. After parameters are set using the builder methods, - //! the `send` method can be called to initiate the request. - //! - /// Fluent builder constructing a request to `CancelGameLink`. - /// - /// Cancels a game link. It can no longer be used to link after cancellation. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct CancelGameLink { - handle: std::sync::Arc>, - inner: crate::input::cancel_game_link_input::Builder, - } - impl CancelGameLink - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `CancelGameLink`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::CancelGameLinkOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::CancelGameLinkInputOperationOutputAlias, - crate::output::CancelGameLinkOutput, - crate::error::CancelGameLinkError, - crate::input::CancelGameLinkInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn identity_link_token(mut self, input: impl Into) -> Self { - self.inner = self.inner.identity_link_token(input.into()); - self - } - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn set_identity_link_token( - mut self, - input: std::option::Option, - ) -> Self { - self.inner = self.inner.set_identity_link_token(input); - self - } - } - /// Fluent builder constructing a request to `CompleteGameLink`. - /// - /// Completes a game link process and returns whether or not the link is valid. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct CompleteGameLink { - handle: std::sync::Arc>, - inner: crate::input::complete_game_link_input::Builder, - } - impl CompleteGameLink - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `CompleteGameLink`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::CompleteGameLinkOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::CompleteGameLinkInputOperationOutputAlias, - crate::output::CompleteGameLinkOutput, - crate::error::CompleteGameLinkError, - crate::input::CompleteGameLinkInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn identity_link_token(mut self, input: impl Into) -> Self { - self.inner = self.inner.identity_link_token(input.into()); - self - } - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn set_identity_link_token( - mut self, - input: std::option::Option, - ) -> Self { - self.inner = self.inner.set_identity_link_token(input); - self - } - } - /// Fluent builder constructing a request to `CompleteIdentityAvatarUpload`. - /// - /// Completes an avatar image upload. Must be called after the file upload process completes. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct CompleteIdentityAvatarUpload { - handle: std::sync::Arc>, - inner: crate::input::complete_identity_avatar_upload_input::Builder, - } - impl CompleteIdentityAvatarUpload - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `CompleteIdentityAvatarUpload`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::CompleteIdentityAvatarUploadOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::CompleteIdentityAvatarUploadInputOperationOutputAlias, - crate::output::CompleteIdentityAvatarUploadOutput, - crate::error::CompleteIdentityAvatarUploadError, - crate::input::CompleteIdentityAvatarUploadInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn upload_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.upload_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_upload_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_upload_id(input); - self - } - } - /// Fluent builder constructing a request to `FollowIdentity`. - /// - /// Follows the given identity. In order for identities to be "friends", the other identity has to also follow this identity. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct FollowIdentity { - handle: std::sync::Arc>, - inner: crate::input::follow_identity_input::Builder, - } - impl FollowIdentity - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `FollowIdentity`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::FollowIdentityOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::FollowIdentityInputOperationOutputAlias, - crate::output::FollowIdentityOutput, - crate::error::FollowIdentityError, - crate::input::FollowIdentityInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.identity_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_identity_id(input); - self - } - } - /// Fluent builder constructing a request to `GetGameLink`. - /// - /// Returns the current status of a linking process. Once `status` is `complete`, the identity's profile should be fetched again since they may have switched accounts. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GetGameLink { - handle: std::sync::Arc>, - inner: crate::input::get_game_link_input::Builder, - } - impl GetGameLink - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GetGameLink`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GetGameLinkOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GetGameLinkInputOperationOutputAlias, - crate::output::GetGameLinkOutput, - crate::error::GetGameLinkError, - crate::input::GetGameLinkInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// `identity_link_token` returned by `PrepareGameLink`. - pub fn identity_link_token(mut self, input: impl Into) -> Self { - self.inner = self.inner.identity_link_token(input.into()); - self - } - /// `identity_link_token` returned by `PrepareGameLink`. - pub fn set_identity_link_token( - mut self, - input: std::option::Option, - ) -> Self { - self.inner = self.inner.set_identity_link_token(input); - self - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.inner = self.inner.watch_index(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_watch_index(input); - self - } - } - /// Fluent builder constructing a request to `GetIdentityHandles`. - /// - /// Fetches a list of identity handles. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GetIdentityHandles { - handle: std::sync::Arc>, - inner: crate::input::get_identity_handles_input::Builder, - } - impl GetIdentityHandles - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GetIdentityHandles`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GetIdentityHandlesOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GetIdentityHandlesInputOperationOutputAlias, - crate::output::GetIdentityHandlesOutput, - crate::error::GetIdentityHandlesError, - crate::input::GetIdentityHandlesInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// Appends an item to `identity_ids`. - /// - /// To override the contents of this collection use [`set_identity_ids`](Self::set_identity_ids). - /// - /// A list of identity IDs. - pub fn identity_ids(mut self, input: impl Into) -> Self { - self.inner = self.inner.identity_ids(input.into()); - self - } - /// A list of identity IDs. - pub fn set_identity_ids( - mut self, - input: std::option::Option>, - ) -> Self { - self.inner = self.inner.set_identity_ids(input); - self - } - } - /// Fluent builder constructing a request to `GetIdentityProfile`. - /// - /// Fetches an identity profile. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GetIdentityProfile { - handle: std::sync::Arc>, - inner: crate::input::get_identity_profile_input::Builder, - } - impl GetIdentityProfile - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GetIdentityProfile`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GetIdentityProfileOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GetIdentityProfileInputOperationOutputAlias, - crate::output::GetIdentityProfileOutput, - crate::error::GetIdentityProfileError, - crate::input::GetIdentityProfileInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.identity_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_identity_id(input); - self - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.inner = self.inner.watch_index(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_watch_index(input); - self - } - } - /// Fluent builder constructing a request to `GetIdentitySelfProfile`. - /// - /// Fetches the current identity's profile. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GetIdentitySelfProfile { - handle: std::sync::Arc>, - inner: crate::input::get_identity_self_profile_input::Builder, - } - impl GetIdentitySelfProfile - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GetIdentitySelfProfile`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GetIdentitySelfProfileOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GetIdentitySelfProfileInputOperationOutputAlias, - crate::output::GetIdentitySelfProfileOutput, - crate::error::GetIdentitySelfProfileError, - crate::input::GetIdentitySelfProfileInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.inner = self.inner.watch_index(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_watch_index(input); - self - } - } - /// Fluent builder constructing a request to `GetIdentitySummaries`. - /// - /// Fetches a list of identity summaries. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GetIdentitySummaries { - handle: std::sync::Arc>, - inner: crate::input::get_identity_summaries_input::Builder, - } - impl GetIdentitySummaries - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GetIdentitySummaries`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GetIdentitySummariesOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GetIdentitySummariesInputOperationOutputAlias, - crate::output::GetIdentitySummariesOutput, - crate::error::GetIdentitySummariesError, - crate::input::GetIdentitySummariesInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// Appends an item to `identity_ids`. - /// - /// To override the contents of this collection use [`set_identity_ids`](Self::set_identity_ids). - /// - /// A list of identity IDs. - pub fn identity_ids(mut self, input: impl Into) -> Self { - self.inner = self.inner.identity_ids(input.into()); - self - } - /// A list of identity IDs. - pub fn set_identity_ids( - mut self, - input: std::option::Option>, - ) -> Self { - self.inner = self.inner.set_identity_ids(input); - self - } - } - /// Fluent builder constructing a request to `ListActivities`. - /// - /// Returns an overview of all players currently online or in game. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct ListActivities { - handle: std::sync::Arc>, - inner: crate::input::list_activities_input::Builder, - } - impl ListActivities - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `ListActivities`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::ListActivitiesOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::ListActivitiesInputOperationOutputAlias, - crate::output::ListActivitiesOutput, - crate::error::ListActivitiesError, - crate::input::ListActivitiesInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.inner = self.inner.watch_index(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_watch_index(input); - self - } - } - /// Fluent builder constructing a request to `ListFollowers`. - /// - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct ListFollowers { - handle: std::sync::Arc>, - inner: crate::input::list_followers_input::Builder, - } - impl ListFollowers - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `ListFollowers`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::ListFollowersOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::ListFollowersInputOperationOutputAlias, - crate::output::ListFollowersOutput, - crate::error::ListFollowersError, - crate::input::ListFollowersInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.identity_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_identity_id(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn anchor(mut self, input: impl Into) -> Self { - self.inner = self.inner.anchor(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_anchor(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_anchor(input); - self - } - /// Unsigned 32 bit integer. - pub fn count(mut self, input: i32) -> Self { - self.inner = self.inner.count(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_count(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_count(input); - self - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.inner = self.inner.watch_index(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_watch_index(input); - self - } - } - /// Fluent builder constructing a request to `ListFollowing`. - /// - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct ListFollowing { - handle: std::sync::Arc>, - inner: crate::input::list_following_input::Builder, - } - impl ListFollowing - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `ListFollowing`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::ListFollowingOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::ListFollowingInputOperationOutputAlias, - crate::output::ListFollowingOutput, - crate::error::ListFollowingError, - crate::input::ListFollowingInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.identity_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_identity_id(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn anchor(mut self, input: impl Into) -> Self { - self.inner = self.inner.anchor(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_anchor(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_anchor(input); - self - } - /// Unsigned 32 bit integer. - pub fn count(mut self, input: i32) -> Self { - self.inner = self.inner.count(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_count(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_count(input); - self - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.inner = self.inner.watch_index(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_watch_index(input); - self - } - } - /// Fluent builder constructing a request to `ListFriends`. - /// - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct ListFriends { - handle: std::sync::Arc>, - inner: crate::input::list_friends_input::Builder, - } - impl ListFriends - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `ListFriends`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::ListFriendsOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::ListFriendsInputOperationOutputAlias, - crate::output::ListFriendsOutput, - crate::error::ListFriendsError, - crate::input::ListFriendsInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - #[allow(missing_docs)] // documentation missing in model - pub fn anchor(mut self, input: impl Into) -> Self { - self.inner = self.inner.anchor(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_anchor(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_anchor(input); - self - } - /// Unsigned 32 bit integer. - pub fn count(mut self, input: i32) -> Self { - self.inner = self.inner.count(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_count(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_count(input); - self - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.inner = self.inner.watch_index(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_watch_index(input); - self - } - } - /// Fluent builder constructing a request to `ListMutualFriends`. - /// - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct ListMutualFriends { - handle: std::sync::Arc>, - inner: crate::input::list_mutual_friends_input::Builder, - } - impl ListMutualFriends - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `ListMutualFriends`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::ListMutualFriendsOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::ListMutualFriendsInputOperationOutputAlias, - crate::output::ListMutualFriendsOutput, - crate::error::ListMutualFriendsError, - crate::input::ListMutualFriendsInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.identity_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_identity_id(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn anchor(mut self, input: impl Into) -> Self { - self.inner = self.inner.anchor(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_anchor(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_anchor(input); - self - } - /// Unsigned 32 bit integer. - pub fn count(mut self, input: i32) -> Self { - self.inner = self.inner.count(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_count(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_count(input); - self - } - } - /// Fluent builder constructing a request to `ListRecentFollowers`. - /// - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct ListRecentFollowers { - handle: std::sync::Arc>, - inner: crate::input::list_recent_followers_input::Builder, - } - impl ListRecentFollowers - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `ListRecentFollowers`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::ListRecentFollowersOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::ListRecentFollowersInputOperationOutputAlias, - crate::output::ListRecentFollowersOutput, - crate::error::ListRecentFollowersError, - crate::input::ListRecentFollowersInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - #[allow(missing_docs)] // documentation missing in model - pub fn anchor(mut self, input: impl Into) -> Self { - self.inner = self.inner.anchor(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_anchor(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_anchor(input); - self - } - /// Unsigned 32 bit integer. - pub fn count(mut self, input: i32) -> Self { - self.inner = self.inner.count(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_count(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_count(input); - self - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.inner = self.inner.watch_index(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_watch_index(input); - self - } - } - /// Fluent builder constructing a request to `MarkDeletion`. - /// - /// Marks this identity for deletion. After 30 days the identity and all of it's content will be deleted, including chat messages and - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct MarkDeletion { - handle: std::sync::Arc>, - inner: crate::input::mark_deletion_input::Builder, - } - impl MarkDeletion - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `MarkDeletion`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::MarkDeletionOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::MarkDeletionInputOperationOutputAlias, - crate::output::MarkDeletionOutput, - crate::error::MarkDeletionError, - crate::input::MarkDeletionInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - } - /// Fluent builder constructing a request to `PrepareGameLink`. - /// - /// Begins the process for linking an identity with the Rivet Hub. # Importance of Linking Identities When an identity is created via `rivet.api.identity#SetupIdentity`, the identity is temporary and is not shared with other games the user plays. In order to make the identity permanent and synchronize the identity with other games, the identity must be linked with the hub. # Linking Process The linking process works by opening `identity_link_url` in a browser then polling `rivet.api.identity#GetGameLink` to wait for it to complete. This is designed to be as flexible as possible so `identity_link_url` can be opened on any device. For example, when playing a console game, the user can scan a QR code for `identity_link_url` to authenticate on their phone. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct PrepareGameLink { - handle: std::sync::Arc>, - inner: crate::input::prepare_game_link_input::Builder, - } - impl PrepareGameLink - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `PrepareGameLink`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::PrepareGameLinkOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::PrepareGameLinkInputOperationOutputAlias, - crate::output::PrepareGameLinkOutput, - crate::error::PrepareGameLinkError, - crate::input::PrepareGameLinkInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - } - /// Fluent builder constructing a request to `PrepareIdentityAvatarUpload`. - /// - /// Prepares an avatar image upload. Complete upload with `rivet.api.identity#CompleteIdentityAvatarUpload`. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct PrepareIdentityAvatarUpload { - handle: std::sync::Arc>, - inner: crate::input::prepare_identity_avatar_upload_input::Builder, - } - impl PrepareIdentityAvatarUpload - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `PrepareIdentityAvatarUpload`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::PrepareIdentityAvatarUploadOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::PrepareIdentityAvatarUploadInputOperationOutputAlias, - crate::output::PrepareIdentityAvatarUploadOutput, - crate::error::PrepareIdentityAvatarUploadError, - crate::input::PrepareIdentityAvatarUploadInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// The path/filename of the identity avatar. - pub fn path(mut self, input: impl Into) -> Self { - self.inner = self.inner.path(input.into()); - self - } - /// The path/filename of the identity avatar. - pub fn set_path(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_path(input); - self - } - /// The MIME type of the identity avatar. - pub fn mime(mut self, input: impl Into) -> Self { - self.inner = self.inner.mime(input.into()); - self - } - /// The MIME type of the identity avatar. - pub fn set_mime(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_mime(input); - self - } - /// Unsigned 64 bit integer. - pub fn content_length(mut self, input: i64) -> Self { - self.inner = self.inner.content_length(input); - self - } - /// Unsigned 64 bit integer. - pub fn set_content_length(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_content_length(input); - self - } - } - /// Fluent builder constructing a request to `RecentFollowerIgnore`. - /// - /// Ignores a recent follower, removing them from your recent followers list. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct RecentFollowerIgnore { - handle: std::sync::Arc>, - inner: crate::input::recent_follower_ignore_input::Builder, - } - impl RecentFollowerIgnore - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `RecentFollowerIgnore`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::RecentFollowerIgnoreOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::RecentFollowerIgnoreInputOperationOutputAlias, - crate::output::RecentFollowerIgnoreOutput, - crate::error::RecentFollowerIgnoreError, - crate::input::RecentFollowerIgnoreInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.identity_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_identity_id(input); - self - } - } - /// Fluent builder constructing a request to `RemoveIdentityGameActivity`. - /// - /// Removes the current identity's game activity. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct RemoveIdentityGameActivity { - handle: std::sync::Arc>, - inner: crate::input::remove_identity_game_activity_input::Builder, - } - impl RemoveIdentityGameActivity - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `RemoveIdentityGameActivity`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::RemoveIdentityGameActivityOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::RemoveIdentityGameActivityInputOperationOutputAlias, - crate::output::RemoveIdentityGameActivityOutput, - crate::error::RemoveIdentityGameActivityError, - crate::input::RemoveIdentityGameActivityInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - } - /// Fluent builder constructing a request to `ReportIdentity`. - /// - /// Creates an abuse report for an identity. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct ReportIdentity { - handle: std::sync::Arc>, - inner: crate::input::report_identity_input::Builder, - } - impl ReportIdentity - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `ReportIdentity`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::ReportIdentityOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::ReportIdentityInputOperationOutputAlias, - crate::output::ReportIdentityOutput, - crate::error::ReportIdentityError, - crate::input::ReportIdentityInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.identity_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_identity_id(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn reason(mut self, input: impl Into) -> Self { - self.inner = self.inner.reason(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_reason(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_reason(input); - self - } - } - /// Fluent builder constructing a request to `SearchIdentities`. - /// - /// Fuzzy search for identities. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct SearchIdentities { - handle: std::sync::Arc>, - inner: crate::input::search_identities_input::Builder, - } - impl SearchIdentities - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `SearchIdentities`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::SearchIdentitiesOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::SearchIdentitiesInputOperationOutputAlias, - crate::output::SearchIdentitiesOutput, - crate::error::SearchIdentitiesError, - crate::input::SearchIdentitiesInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// The query to match identity display names and account numbers against. - pub fn query(mut self, input: impl Into) -> Self { - self.inner = self.inner.query(input.into()); - self - } - /// The query to match identity display names and account numbers against. - pub fn set_query(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_query(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn anchor(mut self, input: impl Into) -> Self { - self.inner = self.inner.anchor(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_anchor(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_anchor(input); - self - } - /// Unsigned 32 bit integer. - pub fn limit(mut self, input: i32) -> Self { - self.inner = self.inner.limit(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_limit(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_limit(input); - self - } - } - /// Fluent builder constructing a request to `SetIdentityGameActivity`. - /// - /// Sets the current identity's game activity. This activity will automatically be removed when the identity goes offline. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct SetIdentityGameActivity { - handle: std::sync::Arc>, - inner: crate::input::set_identity_game_activity_input::Builder, - } - impl SetIdentityGameActivity - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `SetIdentityGameActivity`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::SetIdentityGameActivityOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::SetIdentityGameActivityInputOperationOutputAlias, - crate::output::SetIdentityGameActivityOutput, - crate::error::SetIdentityGameActivityError, - crate::input::SetIdentityGameActivityInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// Information about the identity's current game. This is information that all other identities can see about what the current identity is doing. - pub fn game_activity(mut self, input: crate::model::UpdateIdentityGameActivity) -> Self { - self.inner = self.inner.game_activity(input); - self - } - /// Information about the identity's current game. This is information that all other identities can see about what the current identity is doing. - pub fn set_game_activity( - mut self, - input: std::option::Option, - ) -> Self { - self.inner = self.inner.set_game_activity(input); - self - } - } - /// Fluent builder constructing a request to `SetupIdentity`. - /// - /// Gets or creates an identity. Passing an existing identity token in the body refreshes the token. # Temporary Accounts Until the identity is linked with the Rivet Hub (see `rivet.api.identity#PrepareGameLink`), this identity will be temporary but still behave like all other identities. This is intended to allow users to play the game without signing up while still having the benefits of having an account. When they are ready to save their account, they should be instructed to link their account (see `rivet.api.identity#PrepareGameLink`). # Storing Token `identity_token` should be stored in some form of persistent storage. The token should be read from storage and passed to `rivet.api.identity#SetupIdentity` every time the client starts. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct SetupIdentity { - handle: std::sync::Arc>, - inner: crate::input::setup_identity_input::Builder, - } - impl SetupIdentity - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `SetupIdentity`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::SetupIdentityOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::SetupIdentityInputOperationOutputAlias, - crate::output::SetupIdentityOutput, - crate::error::SetupIdentityError, - crate::input::SetupIdentityInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// Token returned from previous call to `rivet.api.identity#SetupIdentity`. If this token is invalid, a new identity will be returned. - pub fn existing_identity_token(mut self, input: impl Into) -> Self { - self.inner = self.inner.existing_identity_token(input.into()); - self - } - /// Token returned from previous call to `rivet.api.identity#SetupIdentity`. If this token is invalid, a new identity will be returned. - pub fn set_existing_identity_token( - mut self, - input: std::option::Option, - ) -> Self { - self.inner = self.inner.set_existing_identity_token(input); - self - } - } - /// Fluent builder constructing a request to `SignupForBeta`. - /// - /// Submits a beta signup form. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct SignupForBeta { - handle: std::sync::Arc>, - inner: crate::input::signup_for_beta_input::Builder, - } - impl SignupForBeta - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `SignupForBeta`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::SignupForBetaOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::SignupForBetaInputOperationOutputAlias, - crate::output::SignupForBetaOutput, - crate::error::SignupForBetaError, - crate::input::SignupForBetaInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - #[allow(missing_docs)] // documentation missing in model - pub fn name(mut self, input: impl Into) -> Self { - self.inner = self.inner.name(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_name(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_name(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn company_name(mut self, input: impl Into) -> Self { - self.inner = self.inner.company_name(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_company_name(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_company_name(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn company_size(mut self, input: impl Into) -> Self { - self.inner = self.inner.company_size(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_company_size(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_company_size(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn preferred_tools(mut self, input: impl Into) -> Self { - self.inner = self.inner.preferred_tools(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_preferred_tools( - mut self, - input: std::option::Option, - ) -> Self { - self.inner = self.inner.set_preferred_tools(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn goals(mut self, input: impl Into) -> Self { - self.inner = self.inner.goals(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_goals(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_goals(input); - self - } - } - /// Fluent builder constructing a request to `UnfollowIdentity`. - /// - /// Unfollows the given identity. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct UnfollowIdentity { - handle: std::sync::Arc>, - inner: crate::input::unfollow_identity_input::Builder, - } - impl UnfollowIdentity - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `UnfollowIdentity`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::UnfollowIdentityOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::UnfollowIdentityInputOperationOutputAlias, - crate::output::UnfollowIdentityOutput, - crate::error::UnfollowIdentityError, - crate::input::UnfollowIdentityInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.identity_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_identity_id(input); - self - } - } - /// Fluent builder constructing a request to `UnmarkDeletion`. - /// - /// Unmarks this identity from deletion. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct UnmarkDeletion { - handle: std::sync::Arc>, - inner: crate::input::unmark_deletion_input::Builder, - } - impl UnmarkDeletion - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `UnmarkDeletion`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::UnmarkDeletionOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::UnmarkDeletionInputOperationOutputAlias, - crate::output::UnmarkDeletionOutput, - crate::error::UnmarkDeletionError, - crate::input::UnmarkDeletionInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - } - /// Fluent builder constructing a request to `UpdateIdentityProfile`. - /// - /// Updates profile of the current identity. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct UpdateIdentityProfile { - handle: std::sync::Arc>, - inner: crate::input::update_identity_profile_input::Builder, - } - impl UpdateIdentityProfile - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `UpdateIdentityProfile`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::UpdateIdentityProfileOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::UpdateIdentityProfileInputOperationOutputAlias, - crate::output::UpdateIdentityProfileOutput, - crate::error::UpdateIdentityProfileError, - crate::input::UpdateIdentityProfileInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.inner = self.inner.display_name(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_display_name(input); - self - } - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub fn account_number(mut self, input: i32) -> Self { - self.inner = self.inner.account_number(input); - self - } - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub fn set_account_number(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_account_number(input); - self - } - /// Detailed information about a profile. - pub fn bio(mut self, input: impl Into) -> Self { - self.inner = self.inner.bio(input.into()); - self - } - /// Detailed information about a profile. - pub fn set_bio(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_bio(input); - self - } - } - /// Fluent builder constructing a request to `UpdateIdentityStatus`. - /// - /// Updates the current identity's status. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct UpdateIdentityStatus { - handle: std::sync::Arc>, - inner: crate::input::update_identity_status_input::Builder, - } - impl UpdateIdentityStatus - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `UpdateIdentityStatus`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::UpdateIdentityStatusOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::UpdateIdentityStatusInputOperationOutputAlias, - crate::output::UpdateIdentityStatusOutput, - crate::error::UpdateIdentityStatusError, - crate::input::UpdateIdentityStatusInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// The current status of an identity. This helps players understand if another player is currently playing or has their game in the background. - pub fn status(mut self, input: crate::model::IdentityStatus) -> Self { - self.inner = self.inner.status(input); - self - } - /// The current status of an identity. This helps players understand if another player is currently playing or has their game in the background. - pub fn set_status( - mut self, - input: std::option::Option, - ) -> Self { - self.inner = self.inner.set_status(input); - self - } - } - /// Fluent builder constructing a request to `ValidateIdentityProfile`. - /// - /// Validate contents of identity profile. Use to provide immediate feedback on profile changes before committing them. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct ValidateIdentityProfile { - handle: std::sync::Arc>, - inner: crate::input::validate_identity_profile_input::Builder, - } - impl ValidateIdentityProfile - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `ValidateIdentityProfile`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::ValidateIdentityProfileOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::ValidateIdentityProfileInputOperationOutputAlias, - crate::output::ValidateIdentityProfileOutput, - crate::error::ValidateIdentityProfileError, - crate::input::ValidateIdentityProfileInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.inner = self.inner.display_name(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_display_name(input); - self - } - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub fn account_number(mut self, input: i32) -> Self { - self.inner = self.inner.account_number(input); - self - } - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub fn set_account_number(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_account_number(input); - self - } - /// Detailed information about a profile. - pub fn bio(mut self, input: impl Into) -> Self { - self.inner = self.inner.bio(input.into()); - self - } - /// Detailed information about a profile. - pub fn set_bio(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_bio(input); - self - } - } - /// Fluent builder constructing a request to `WatchEvents`. - /// - /// Returns all events relative to the current identity. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct WatchEvents { - handle: std::sync::Arc>, - inner: crate::input::watch_events_input::Builder, - } - impl WatchEvents - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `WatchEvents`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::WatchEventsOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::WatchEventsInputOperationOutputAlias, - crate::output::WatchEventsOutput, - crate::error::WatchEventsError, - crate::input::WatchEventsInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.inner = self.inner.watch_index(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_watch_index(input); - self - } - } -} -/// A wrapper around [`Client`]. Helps reduce external imports. -pub struct ClientWrapper { - pub(crate) client: Client, -} - -impl std::ops::Deref for ClientWrapper { - type Target = Client; - - fn deref(&self) -> &Self::Target { - &self.client - } -} diff --git a/lib/smithy-output/api-identity/rust/rust/src/config.rs b/lib/smithy-output/api-identity/rust/rust/src/config.rs deleted file mode 100644 index 141b6abb2..000000000 --- a/lib/smithy-output/api-identity/rust/rust/src/config.rs +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Service config. -/// -pub struct Config { - pub(crate) auth: Option, - pub(crate) uri: String, -} -impl std::fmt::Debug for Config { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut config = f.debug_struct("Config"); - config.finish() - } -} -impl Config { - /// Constructs a config builder. - pub fn builder() -> Builder { - Builder::default() - } -} -/// Builder for creating a `Config`. -#[derive(Default)] -pub struct Builder { - pub(crate) auth: Option, - pub(crate) uri: Option, -} -impl Builder { - /// Constructs a config builder. - pub fn new() -> Self { - Self::default() - } - /// Sets the bearer token to be used with the Smithy client. - pub fn set_bearer_token(mut self, bearer_token: impl std::fmt::Display) -> Self { - self.auth = Some(format!("Bearer {}", bearer_token)); - self - } - /// Sets the base URI to be used with the Smithy client. - pub fn set_uri(mut self, uri: impl ToString) -> Self { - self.uri = Some(uri.to_string()); - self - } - /// Builds a [`Config`]. - pub fn build(self) -> Config { - Config { - auth: self - .auth - .or_else(|| std::env::var("RIVET_LOBBY_TOKEN").ok()) - .or_else(|| std::env::var("RIVET_CLIENT_TOKEN").ok()), - uri: self - .uri - .or_else(|| std::env::var("RIVET_IDENTITY_API_URL").ok()) - .unwrap_or_else(|| "https://identity.api.rivet.gg/v1".to_string()), - } - } - /// Builds a default [`Client`] from the given config. - pub fn build_client(self) -> crate::client::ClientWrapper { - let raw_client = aws_smithy_client::Builder::dyn_https() - .middleware(tower::layer::util::Identity::new()) - .sleep_impl(None) - .build(); - crate::client::ClientWrapper { - client: crate::Client::with_config(raw_client, self.build()), - } - } -} diff --git a/lib/smithy-output/api-identity/rust/rust/src/error.rs b/lib/smithy-output/api-identity/rust/rust/src/error.rs deleted file mode 100644 index 2de316350..000000000 --- a/lib/smithy-output/api-identity/rust/rust/src/error.rs +++ /dev/null @@ -1,5141 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Error type for the `CancelGameLink` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct CancelGameLinkError { - /// Kind of error that occurred. - pub kind: CancelGameLinkErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `CancelGameLink` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum CancelGameLinkErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for CancelGameLinkError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - CancelGameLinkErrorKind::InternalError(_inner) => _inner.fmt(f), - CancelGameLinkErrorKind::RateLimitError(_inner) => _inner.fmt(f), - CancelGameLinkErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - CancelGameLinkErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - CancelGameLinkErrorKind::NotFoundError(_inner) => _inner.fmt(f), - CancelGameLinkErrorKind::BadRequestError(_inner) => _inner.fmt(f), - CancelGameLinkErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for CancelGameLinkError { - fn code(&self) -> Option<&str> { - CancelGameLinkError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - CancelGameLinkErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - CancelGameLinkErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl CancelGameLinkError { - /// Creates a new `CancelGameLinkError`. - pub fn new(kind: CancelGameLinkErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `CancelGameLinkError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: CancelGameLinkErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `CancelGameLinkError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: CancelGameLinkErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `CancelGameLinkErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, CancelGameLinkErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `CancelGameLinkErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, CancelGameLinkErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `CancelGameLinkErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, CancelGameLinkErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `CancelGameLinkErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, CancelGameLinkErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `CancelGameLinkErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, CancelGameLinkErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `CancelGameLinkErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, CancelGameLinkErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for CancelGameLinkError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - CancelGameLinkErrorKind::InternalError(_inner) => Some(_inner), - CancelGameLinkErrorKind::RateLimitError(_inner) => Some(_inner), - CancelGameLinkErrorKind::ForbiddenError(_inner) => Some(_inner), - CancelGameLinkErrorKind::UnauthorizedError(_inner) => Some(_inner), - CancelGameLinkErrorKind::NotFoundError(_inner) => Some(_inner), - CancelGameLinkErrorKind::BadRequestError(_inner) => Some(_inner), - CancelGameLinkErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `CompleteGameLink` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct CompleteGameLinkError { - /// Kind of error that occurred. - pub kind: CompleteGameLinkErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `CompleteGameLink` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum CompleteGameLinkErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for CompleteGameLinkError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - CompleteGameLinkErrorKind::InternalError(_inner) => _inner.fmt(f), - CompleteGameLinkErrorKind::RateLimitError(_inner) => _inner.fmt(f), - CompleteGameLinkErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - CompleteGameLinkErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - CompleteGameLinkErrorKind::NotFoundError(_inner) => _inner.fmt(f), - CompleteGameLinkErrorKind::BadRequestError(_inner) => _inner.fmt(f), - CompleteGameLinkErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for CompleteGameLinkError { - fn code(&self) -> Option<&str> { - CompleteGameLinkError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - CompleteGameLinkErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - CompleteGameLinkErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl CompleteGameLinkError { - /// Creates a new `CompleteGameLinkError`. - pub fn new(kind: CompleteGameLinkErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `CompleteGameLinkError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: CompleteGameLinkErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `CompleteGameLinkError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: CompleteGameLinkErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `CompleteGameLinkErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, CompleteGameLinkErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `CompleteGameLinkErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, CompleteGameLinkErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `CompleteGameLinkErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, CompleteGameLinkErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `CompleteGameLinkErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, CompleteGameLinkErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `CompleteGameLinkErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, CompleteGameLinkErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `CompleteGameLinkErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, CompleteGameLinkErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for CompleteGameLinkError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - CompleteGameLinkErrorKind::InternalError(_inner) => Some(_inner), - CompleteGameLinkErrorKind::RateLimitError(_inner) => Some(_inner), - CompleteGameLinkErrorKind::ForbiddenError(_inner) => Some(_inner), - CompleteGameLinkErrorKind::UnauthorizedError(_inner) => Some(_inner), - CompleteGameLinkErrorKind::NotFoundError(_inner) => Some(_inner), - CompleteGameLinkErrorKind::BadRequestError(_inner) => Some(_inner), - CompleteGameLinkErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `CompleteIdentityAvatarUpload` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct CompleteIdentityAvatarUploadError { - /// Kind of error that occurred. - pub kind: CompleteIdentityAvatarUploadErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `CompleteIdentityAvatarUpload` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum CompleteIdentityAvatarUploadErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for CompleteIdentityAvatarUploadError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - CompleteIdentityAvatarUploadErrorKind::InternalError(_inner) => _inner.fmt(f), - CompleteIdentityAvatarUploadErrorKind::RateLimitError(_inner) => _inner.fmt(f), - CompleteIdentityAvatarUploadErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - CompleteIdentityAvatarUploadErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - CompleteIdentityAvatarUploadErrorKind::NotFoundError(_inner) => _inner.fmt(f), - CompleteIdentityAvatarUploadErrorKind::BadRequestError(_inner) => _inner.fmt(f), - CompleteIdentityAvatarUploadErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for CompleteIdentityAvatarUploadError { - fn code(&self) -> Option<&str> { - CompleteIdentityAvatarUploadError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - CompleteIdentityAvatarUploadErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - CompleteIdentityAvatarUploadErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl CompleteIdentityAvatarUploadError { - /// Creates a new `CompleteIdentityAvatarUploadError`. - pub fn new(kind: CompleteIdentityAvatarUploadErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `CompleteIdentityAvatarUploadError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: CompleteIdentityAvatarUploadErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `CompleteIdentityAvatarUploadError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: CompleteIdentityAvatarUploadErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `CompleteIdentityAvatarUploadErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!( - &self.kind, - CompleteIdentityAvatarUploadErrorKind::InternalError(_) - ) - } - /// Returns `true` if the error kind is `CompleteIdentityAvatarUploadErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - CompleteIdentityAvatarUploadErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `CompleteIdentityAvatarUploadErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - CompleteIdentityAvatarUploadErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `CompleteIdentityAvatarUploadErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - CompleteIdentityAvatarUploadErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `CompleteIdentityAvatarUploadErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!( - &self.kind, - CompleteIdentityAvatarUploadErrorKind::NotFoundError(_) - ) - } - /// Returns `true` if the error kind is `CompleteIdentityAvatarUploadErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - CompleteIdentityAvatarUploadErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for CompleteIdentityAvatarUploadError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - CompleteIdentityAvatarUploadErrorKind::InternalError(_inner) => Some(_inner), - CompleteIdentityAvatarUploadErrorKind::RateLimitError(_inner) => Some(_inner), - CompleteIdentityAvatarUploadErrorKind::ForbiddenError(_inner) => Some(_inner), - CompleteIdentityAvatarUploadErrorKind::UnauthorizedError(_inner) => Some(_inner), - CompleteIdentityAvatarUploadErrorKind::NotFoundError(_inner) => Some(_inner), - CompleteIdentityAvatarUploadErrorKind::BadRequestError(_inner) => Some(_inner), - CompleteIdentityAvatarUploadErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `FollowIdentity` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct FollowIdentityError { - /// Kind of error that occurred. - pub kind: FollowIdentityErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `FollowIdentity` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum FollowIdentityErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for FollowIdentityError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - FollowIdentityErrorKind::InternalError(_inner) => _inner.fmt(f), - FollowIdentityErrorKind::RateLimitError(_inner) => _inner.fmt(f), - FollowIdentityErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - FollowIdentityErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - FollowIdentityErrorKind::NotFoundError(_inner) => _inner.fmt(f), - FollowIdentityErrorKind::BadRequestError(_inner) => _inner.fmt(f), - FollowIdentityErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for FollowIdentityError { - fn code(&self) -> Option<&str> { - FollowIdentityError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - FollowIdentityErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - FollowIdentityErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl FollowIdentityError { - /// Creates a new `FollowIdentityError`. - pub fn new(kind: FollowIdentityErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `FollowIdentityError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: FollowIdentityErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `FollowIdentityError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: FollowIdentityErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `FollowIdentityErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, FollowIdentityErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `FollowIdentityErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, FollowIdentityErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `FollowIdentityErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, FollowIdentityErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `FollowIdentityErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, FollowIdentityErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `FollowIdentityErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, FollowIdentityErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `FollowIdentityErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, FollowIdentityErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for FollowIdentityError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - FollowIdentityErrorKind::InternalError(_inner) => Some(_inner), - FollowIdentityErrorKind::RateLimitError(_inner) => Some(_inner), - FollowIdentityErrorKind::ForbiddenError(_inner) => Some(_inner), - FollowIdentityErrorKind::UnauthorizedError(_inner) => Some(_inner), - FollowIdentityErrorKind::NotFoundError(_inner) => Some(_inner), - FollowIdentityErrorKind::BadRequestError(_inner) => Some(_inner), - FollowIdentityErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `GetGameLink` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GetGameLinkError { - /// Kind of error that occurred. - pub kind: GetGameLinkErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GetGameLink` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GetGameLinkErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GetGameLinkError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GetGameLinkErrorKind::InternalError(_inner) => _inner.fmt(f), - GetGameLinkErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GetGameLinkErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GetGameLinkErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GetGameLinkErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GetGameLinkErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GetGameLinkErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GetGameLinkError { - fn code(&self) -> Option<&str> { - GetGameLinkError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GetGameLinkErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - GetGameLinkErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl GetGameLinkError { - /// Creates a new `GetGameLinkError`. - pub fn new(kind: GetGameLinkErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GetGameLinkError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GetGameLinkErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GetGameLinkError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GetGameLinkErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GetGameLinkErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, GetGameLinkErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `GetGameLinkErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, GetGameLinkErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `GetGameLinkErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, GetGameLinkErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `GetGameLinkErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, GetGameLinkErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `GetGameLinkErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, GetGameLinkErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `GetGameLinkErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, GetGameLinkErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for GetGameLinkError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GetGameLinkErrorKind::InternalError(_inner) => Some(_inner), - GetGameLinkErrorKind::RateLimitError(_inner) => Some(_inner), - GetGameLinkErrorKind::ForbiddenError(_inner) => Some(_inner), - GetGameLinkErrorKind::UnauthorizedError(_inner) => Some(_inner), - GetGameLinkErrorKind::NotFoundError(_inner) => Some(_inner), - GetGameLinkErrorKind::BadRequestError(_inner) => Some(_inner), - GetGameLinkErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `GetIdentityHandles` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GetIdentityHandlesError { - /// Kind of error that occurred. - pub kind: GetIdentityHandlesErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GetIdentityHandles` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GetIdentityHandlesErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GetIdentityHandlesError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GetIdentityHandlesErrorKind::InternalError(_inner) => _inner.fmt(f), - GetIdentityHandlesErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GetIdentityHandlesErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GetIdentityHandlesErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GetIdentityHandlesErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GetIdentityHandlesErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GetIdentityHandlesErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GetIdentityHandlesError { - fn code(&self) -> Option<&str> { - GetIdentityHandlesError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GetIdentityHandlesErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - GetIdentityHandlesErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl GetIdentityHandlesError { - /// Creates a new `GetIdentityHandlesError`. - pub fn new(kind: GetIdentityHandlesErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GetIdentityHandlesError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GetIdentityHandlesErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GetIdentityHandlesError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GetIdentityHandlesErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GetIdentityHandlesErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, GetIdentityHandlesErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `GetIdentityHandlesErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, GetIdentityHandlesErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `GetIdentityHandlesErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, GetIdentityHandlesErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `GetIdentityHandlesErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - GetIdentityHandlesErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `GetIdentityHandlesErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, GetIdentityHandlesErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `GetIdentityHandlesErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, GetIdentityHandlesErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for GetIdentityHandlesError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GetIdentityHandlesErrorKind::InternalError(_inner) => Some(_inner), - GetIdentityHandlesErrorKind::RateLimitError(_inner) => Some(_inner), - GetIdentityHandlesErrorKind::ForbiddenError(_inner) => Some(_inner), - GetIdentityHandlesErrorKind::UnauthorizedError(_inner) => Some(_inner), - GetIdentityHandlesErrorKind::NotFoundError(_inner) => Some(_inner), - GetIdentityHandlesErrorKind::BadRequestError(_inner) => Some(_inner), - GetIdentityHandlesErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `GetIdentityProfile` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GetIdentityProfileError { - /// Kind of error that occurred. - pub kind: GetIdentityProfileErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GetIdentityProfile` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GetIdentityProfileErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GetIdentityProfileError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GetIdentityProfileErrorKind::InternalError(_inner) => _inner.fmt(f), - GetIdentityProfileErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GetIdentityProfileErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GetIdentityProfileErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GetIdentityProfileErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GetIdentityProfileErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GetIdentityProfileErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GetIdentityProfileError { - fn code(&self) -> Option<&str> { - GetIdentityProfileError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GetIdentityProfileErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - GetIdentityProfileErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl GetIdentityProfileError { - /// Creates a new `GetIdentityProfileError`. - pub fn new(kind: GetIdentityProfileErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GetIdentityProfileError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GetIdentityProfileErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GetIdentityProfileError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GetIdentityProfileErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GetIdentityProfileErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, GetIdentityProfileErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `GetIdentityProfileErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, GetIdentityProfileErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `GetIdentityProfileErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, GetIdentityProfileErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `GetIdentityProfileErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - GetIdentityProfileErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `GetIdentityProfileErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, GetIdentityProfileErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `GetIdentityProfileErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, GetIdentityProfileErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for GetIdentityProfileError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GetIdentityProfileErrorKind::InternalError(_inner) => Some(_inner), - GetIdentityProfileErrorKind::RateLimitError(_inner) => Some(_inner), - GetIdentityProfileErrorKind::ForbiddenError(_inner) => Some(_inner), - GetIdentityProfileErrorKind::UnauthorizedError(_inner) => Some(_inner), - GetIdentityProfileErrorKind::NotFoundError(_inner) => Some(_inner), - GetIdentityProfileErrorKind::BadRequestError(_inner) => Some(_inner), - GetIdentityProfileErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `GetIdentitySelfProfile` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GetIdentitySelfProfileError { - /// Kind of error that occurred. - pub kind: GetIdentitySelfProfileErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GetIdentitySelfProfile` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GetIdentitySelfProfileErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GetIdentitySelfProfileError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GetIdentitySelfProfileErrorKind::InternalError(_inner) => _inner.fmt(f), - GetIdentitySelfProfileErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GetIdentitySelfProfileErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GetIdentitySelfProfileErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GetIdentitySelfProfileErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GetIdentitySelfProfileErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GetIdentitySelfProfileErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GetIdentitySelfProfileError { - fn code(&self) -> Option<&str> { - GetIdentitySelfProfileError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GetIdentitySelfProfileErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - GetIdentitySelfProfileErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl GetIdentitySelfProfileError { - /// Creates a new `GetIdentitySelfProfileError`. - pub fn new(kind: GetIdentitySelfProfileErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GetIdentitySelfProfileError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GetIdentitySelfProfileErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GetIdentitySelfProfileError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GetIdentitySelfProfileErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GetIdentitySelfProfileErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!( - &self.kind, - GetIdentitySelfProfileErrorKind::InternalError(_) - ) - } - /// Returns `true` if the error kind is `GetIdentitySelfProfileErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - GetIdentitySelfProfileErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `GetIdentitySelfProfileErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - GetIdentitySelfProfileErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `GetIdentitySelfProfileErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - GetIdentitySelfProfileErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `GetIdentitySelfProfileErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!( - &self.kind, - GetIdentitySelfProfileErrorKind::NotFoundError(_) - ) - } - /// Returns `true` if the error kind is `GetIdentitySelfProfileErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - GetIdentitySelfProfileErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for GetIdentitySelfProfileError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GetIdentitySelfProfileErrorKind::InternalError(_inner) => Some(_inner), - GetIdentitySelfProfileErrorKind::RateLimitError(_inner) => Some(_inner), - GetIdentitySelfProfileErrorKind::ForbiddenError(_inner) => Some(_inner), - GetIdentitySelfProfileErrorKind::UnauthorizedError(_inner) => Some(_inner), - GetIdentitySelfProfileErrorKind::NotFoundError(_inner) => Some(_inner), - GetIdentitySelfProfileErrorKind::BadRequestError(_inner) => Some(_inner), - GetIdentitySelfProfileErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `GetIdentitySummaries` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GetIdentitySummariesError { - /// Kind of error that occurred. - pub kind: GetIdentitySummariesErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GetIdentitySummaries` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GetIdentitySummariesErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GetIdentitySummariesError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GetIdentitySummariesErrorKind::InternalError(_inner) => _inner.fmt(f), - GetIdentitySummariesErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GetIdentitySummariesErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GetIdentitySummariesErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GetIdentitySummariesErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GetIdentitySummariesErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GetIdentitySummariesErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GetIdentitySummariesError { - fn code(&self) -> Option<&str> { - GetIdentitySummariesError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GetIdentitySummariesErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - GetIdentitySummariesErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl GetIdentitySummariesError { - /// Creates a new `GetIdentitySummariesError`. - pub fn new(kind: GetIdentitySummariesErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GetIdentitySummariesError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GetIdentitySummariesErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GetIdentitySummariesError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GetIdentitySummariesErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GetIdentitySummariesErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, GetIdentitySummariesErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `GetIdentitySummariesErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, GetIdentitySummariesErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `GetIdentitySummariesErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, GetIdentitySummariesErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `GetIdentitySummariesErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - GetIdentitySummariesErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `GetIdentitySummariesErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, GetIdentitySummariesErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `GetIdentitySummariesErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - GetIdentitySummariesErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for GetIdentitySummariesError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GetIdentitySummariesErrorKind::InternalError(_inner) => Some(_inner), - GetIdentitySummariesErrorKind::RateLimitError(_inner) => Some(_inner), - GetIdentitySummariesErrorKind::ForbiddenError(_inner) => Some(_inner), - GetIdentitySummariesErrorKind::UnauthorizedError(_inner) => Some(_inner), - GetIdentitySummariesErrorKind::NotFoundError(_inner) => Some(_inner), - GetIdentitySummariesErrorKind::BadRequestError(_inner) => Some(_inner), - GetIdentitySummariesErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `ListActivities` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct ListActivitiesError { - /// Kind of error that occurred. - pub kind: ListActivitiesErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `ListActivities` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum ListActivitiesErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for ListActivitiesError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - ListActivitiesErrorKind::InternalError(_inner) => _inner.fmt(f), - ListActivitiesErrorKind::RateLimitError(_inner) => _inner.fmt(f), - ListActivitiesErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - ListActivitiesErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - ListActivitiesErrorKind::NotFoundError(_inner) => _inner.fmt(f), - ListActivitiesErrorKind::BadRequestError(_inner) => _inner.fmt(f), - ListActivitiesErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for ListActivitiesError { - fn code(&self) -> Option<&str> { - ListActivitiesError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - ListActivitiesErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - ListActivitiesErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl ListActivitiesError { - /// Creates a new `ListActivitiesError`. - pub fn new(kind: ListActivitiesErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `ListActivitiesError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: ListActivitiesErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `ListActivitiesError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: ListActivitiesErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `ListActivitiesErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, ListActivitiesErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `ListActivitiesErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, ListActivitiesErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `ListActivitiesErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, ListActivitiesErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `ListActivitiesErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, ListActivitiesErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `ListActivitiesErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, ListActivitiesErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `ListActivitiesErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, ListActivitiesErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for ListActivitiesError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - ListActivitiesErrorKind::InternalError(_inner) => Some(_inner), - ListActivitiesErrorKind::RateLimitError(_inner) => Some(_inner), - ListActivitiesErrorKind::ForbiddenError(_inner) => Some(_inner), - ListActivitiesErrorKind::UnauthorizedError(_inner) => Some(_inner), - ListActivitiesErrorKind::NotFoundError(_inner) => Some(_inner), - ListActivitiesErrorKind::BadRequestError(_inner) => Some(_inner), - ListActivitiesErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `ListFollowers` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct ListFollowersError { - /// Kind of error that occurred. - pub kind: ListFollowersErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `ListFollowers` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum ListFollowersErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for ListFollowersError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - ListFollowersErrorKind::InternalError(_inner) => _inner.fmt(f), - ListFollowersErrorKind::RateLimitError(_inner) => _inner.fmt(f), - ListFollowersErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - ListFollowersErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - ListFollowersErrorKind::NotFoundError(_inner) => _inner.fmt(f), - ListFollowersErrorKind::BadRequestError(_inner) => _inner.fmt(f), - ListFollowersErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for ListFollowersError { - fn code(&self) -> Option<&str> { - ListFollowersError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - ListFollowersErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - ListFollowersErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl ListFollowersError { - /// Creates a new `ListFollowersError`. - pub fn new(kind: ListFollowersErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `ListFollowersError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: ListFollowersErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `ListFollowersError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: ListFollowersErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `ListFollowersErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, ListFollowersErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `ListFollowersErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, ListFollowersErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `ListFollowersErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, ListFollowersErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `ListFollowersErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, ListFollowersErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `ListFollowersErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, ListFollowersErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `ListFollowersErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, ListFollowersErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for ListFollowersError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - ListFollowersErrorKind::InternalError(_inner) => Some(_inner), - ListFollowersErrorKind::RateLimitError(_inner) => Some(_inner), - ListFollowersErrorKind::ForbiddenError(_inner) => Some(_inner), - ListFollowersErrorKind::UnauthorizedError(_inner) => Some(_inner), - ListFollowersErrorKind::NotFoundError(_inner) => Some(_inner), - ListFollowersErrorKind::BadRequestError(_inner) => Some(_inner), - ListFollowersErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `ListFollowing` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct ListFollowingError { - /// Kind of error that occurred. - pub kind: ListFollowingErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `ListFollowing` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum ListFollowingErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for ListFollowingError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - ListFollowingErrorKind::InternalError(_inner) => _inner.fmt(f), - ListFollowingErrorKind::RateLimitError(_inner) => _inner.fmt(f), - ListFollowingErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - ListFollowingErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - ListFollowingErrorKind::NotFoundError(_inner) => _inner.fmt(f), - ListFollowingErrorKind::BadRequestError(_inner) => _inner.fmt(f), - ListFollowingErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for ListFollowingError { - fn code(&self) -> Option<&str> { - ListFollowingError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - ListFollowingErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - ListFollowingErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl ListFollowingError { - /// Creates a new `ListFollowingError`. - pub fn new(kind: ListFollowingErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `ListFollowingError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: ListFollowingErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `ListFollowingError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: ListFollowingErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `ListFollowingErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, ListFollowingErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `ListFollowingErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, ListFollowingErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `ListFollowingErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, ListFollowingErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `ListFollowingErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, ListFollowingErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `ListFollowingErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, ListFollowingErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `ListFollowingErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, ListFollowingErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for ListFollowingError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - ListFollowingErrorKind::InternalError(_inner) => Some(_inner), - ListFollowingErrorKind::RateLimitError(_inner) => Some(_inner), - ListFollowingErrorKind::ForbiddenError(_inner) => Some(_inner), - ListFollowingErrorKind::UnauthorizedError(_inner) => Some(_inner), - ListFollowingErrorKind::NotFoundError(_inner) => Some(_inner), - ListFollowingErrorKind::BadRequestError(_inner) => Some(_inner), - ListFollowingErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `ListFriends` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct ListFriendsError { - /// Kind of error that occurred. - pub kind: ListFriendsErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `ListFriends` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum ListFriendsErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for ListFriendsError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - ListFriendsErrorKind::InternalError(_inner) => _inner.fmt(f), - ListFriendsErrorKind::RateLimitError(_inner) => _inner.fmt(f), - ListFriendsErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - ListFriendsErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - ListFriendsErrorKind::NotFoundError(_inner) => _inner.fmt(f), - ListFriendsErrorKind::BadRequestError(_inner) => _inner.fmt(f), - ListFriendsErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for ListFriendsError { - fn code(&self) -> Option<&str> { - ListFriendsError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - ListFriendsErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - ListFriendsErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl ListFriendsError { - /// Creates a new `ListFriendsError`. - pub fn new(kind: ListFriendsErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `ListFriendsError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: ListFriendsErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `ListFriendsError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: ListFriendsErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `ListFriendsErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, ListFriendsErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `ListFriendsErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, ListFriendsErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `ListFriendsErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, ListFriendsErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `ListFriendsErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, ListFriendsErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `ListFriendsErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, ListFriendsErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `ListFriendsErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, ListFriendsErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for ListFriendsError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - ListFriendsErrorKind::InternalError(_inner) => Some(_inner), - ListFriendsErrorKind::RateLimitError(_inner) => Some(_inner), - ListFriendsErrorKind::ForbiddenError(_inner) => Some(_inner), - ListFriendsErrorKind::UnauthorizedError(_inner) => Some(_inner), - ListFriendsErrorKind::NotFoundError(_inner) => Some(_inner), - ListFriendsErrorKind::BadRequestError(_inner) => Some(_inner), - ListFriendsErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `ListMutualFriends` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct ListMutualFriendsError { - /// Kind of error that occurred. - pub kind: ListMutualFriendsErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `ListMutualFriends` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum ListMutualFriendsErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for ListMutualFriendsError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - ListMutualFriendsErrorKind::InternalError(_inner) => _inner.fmt(f), - ListMutualFriendsErrorKind::RateLimitError(_inner) => _inner.fmt(f), - ListMutualFriendsErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - ListMutualFriendsErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - ListMutualFriendsErrorKind::NotFoundError(_inner) => _inner.fmt(f), - ListMutualFriendsErrorKind::BadRequestError(_inner) => _inner.fmt(f), - ListMutualFriendsErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for ListMutualFriendsError { - fn code(&self) -> Option<&str> { - ListMutualFriendsError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - ListMutualFriendsErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - ListMutualFriendsErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl ListMutualFriendsError { - /// Creates a new `ListMutualFriendsError`. - pub fn new(kind: ListMutualFriendsErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `ListMutualFriendsError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: ListMutualFriendsErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `ListMutualFriendsError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: ListMutualFriendsErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `ListMutualFriendsErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, ListMutualFriendsErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `ListMutualFriendsErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, ListMutualFriendsErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `ListMutualFriendsErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, ListMutualFriendsErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `ListMutualFriendsErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, ListMutualFriendsErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `ListMutualFriendsErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, ListMutualFriendsErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `ListMutualFriendsErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, ListMutualFriendsErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for ListMutualFriendsError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - ListMutualFriendsErrorKind::InternalError(_inner) => Some(_inner), - ListMutualFriendsErrorKind::RateLimitError(_inner) => Some(_inner), - ListMutualFriendsErrorKind::ForbiddenError(_inner) => Some(_inner), - ListMutualFriendsErrorKind::UnauthorizedError(_inner) => Some(_inner), - ListMutualFriendsErrorKind::NotFoundError(_inner) => Some(_inner), - ListMutualFriendsErrorKind::BadRequestError(_inner) => Some(_inner), - ListMutualFriendsErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `ListRecentFollowers` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct ListRecentFollowersError { - /// Kind of error that occurred. - pub kind: ListRecentFollowersErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `ListRecentFollowers` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum ListRecentFollowersErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for ListRecentFollowersError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - ListRecentFollowersErrorKind::InternalError(_inner) => _inner.fmt(f), - ListRecentFollowersErrorKind::RateLimitError(_inner) => _inner.fmt(f), - ListRecentFollowersErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - ListRecentFollowersErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - ListRecentFollowersErrorKind::NotFoundError(_inner) => _inner.fmt(f), - ListRecentFollowersErrorKind::BadRequestError(_inner) => _inner.fmt(f), - ListRecentFollowersErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for ListRecentFollowersError { - fn code(&self) -> Option<&str> { - ListRecentFollowersError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - ListRecentFollowersErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - ListRecentFollowersErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl ListRecentFollowersError { - /// Creates a new `ListRecentFollowersError`. - pub fn new(kind: ListRecentFollowersErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `ListRecentFollowersError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: ListRecentFollowersErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `ListRecentFollowersError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: ListRecentFollowersErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `ListRecentFollowersErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, ListRecentFollowersErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `ListRecentFollowersErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, ListRecentFollowersErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `ListRecentFollowersErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, ListRecentFollowersErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `ListRecentFollowersErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - ListRecentFollowersErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `ListRecentFollowersErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, ListRecentFollowersErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `ListRecentFollowersErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, ListRecentFollowersErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for ListRecentFollowersError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - ListRecentFollowersErrorKind::InternalError(_inner) => Some(_inner), - ListRecentFollowersErrorKind::RateLimitError(_inner) => Some(_inner), - ListRecentFollowersErrorKind::ForbiddenError(_inner) => Some(_inner), - ListRecentFollowersErrorKind::UnauthorizedError(_inner) => Some(_inner), - ListRecentFollowersErrorKind::NotFoundError(_inner) => Some(_inner), - ListRecentFollowersErrorKind::BadRequestError(_inner) => Some(_inner), - ListRecentFollowersErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `MarkDeletion` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct MarkDeletionError { - /// Kind of error that occurred. - pub kind: MarkDeletionErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `MarkDeletion` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum MarkDeletionErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for MarkDeletionError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - MarkDeletionErrorKind::InternalError(_inner) => _inner.fmt(f), - MarkDeletionErrorKind::RateLimitError(_inner) => _inner.fmt(f), - MarkDeletionErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - MarkDeletionErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - MarkDeletionErrorKind::NotFoundError(_inner) => _inner.fmt(f), - MarkDeletionErrorKind::BadRequestError(_inner) => _inner.fmt(f), - MarkDeletionErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for MarkDeletionError { - fn code(&self) -> Option<&str> { - MarkDeletionError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - MarkDeletionErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - MarkDeletionErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl MarkDeletionError { - /// Creates a new `MarkDeletionError`. - pub fn new(kind: MarkDeletionErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `MarkDeletionError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: MarkDeletionErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `MarkDeletionError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: MarkDeletionErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `MarkDeletionErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, MarkDeletionErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `MarkDeletionErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, MarkDeletionErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `MarkDeletionErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, MarkDeletionErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `MarkDeletionErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, MarkDeletionErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `MarkDeletionErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, MarkDeletionErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `MarkDeletionErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, MarkDeletionErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for MarkDeletionError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - MarkDeletionErrorKind::InternalError(_inner) => Some(_inner), - MarkDeletionErrorKind::RateLimitError(_inner) => Some(_inner), - MarkDeletionErrorKind::ForbiddenError(_inner) => Some(_inner), - MarkDeletionErrorKind::UnauthorizedError(_inner) => Some(_inner), - MarkDeletionErrorKind::NotFoundError(_inner) => Some(_inner), - MarkDeletionErrorKind::BadRequestError(_inner) => Some(_inner), - MarkDeletionErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `PrepareGameLink` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct PrepareGameLinkError { - /// Kind of error that occurred. - pub kind: PrepareGameLinkErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `PrepareGameLink` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum PrepareGameLinkErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for PrepareGameLinkError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - PrepareGameLinkErrorKind::InternalError(_inner) => _inner.fmt(f), - PrepareGameLinkErrorKind::RateLimitError(_inner) => _inner.fmt(f), - PrepareGameLinkErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - PrepareGameLinkErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - PrepareGameLinkErrorKind::NotFoundError(_inner) => _inner.fmt(f), - PrepareGameLinkErrorKind::BadRequestError(_inner) => _inner.fmt(f), - PrepareGameLinkErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for PrepareGameLinkError { - fn code(&self) -> Option<&str> { - PrepareGameLinkError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - PrepareGameLinkErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - PrepareGameLinkErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl PrepareGameLinkError { - /// Creates a new `PrepareGameLinkError`. - pub fn new(kind: PrepareGameLinkErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `PrepareGameLinkError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: PrepareGameLinkErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `PrepareGameLinkError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: PrepareGameLinkErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `PrepareGameLinkErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, PrepareGameLinkErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `PrepareGameLinkErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, PrepareGameLinkErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `PrepareGameLinkErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, PrepareGameLinkErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `PrepareGameLinkErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, PrepareGameLinkErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `PrepareGameLinkErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, PrepareGameLinkErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `PrepareGameLinkErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, PrepareGameLinkErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for PrepareGameLinkError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - PrepareGameLinkErrorKind::InternalError(_inner) => Some(_inner), - PrepareGameLinkErrorKind::RateLimitError(_inner) => Some(_inner), - PrepareGameLinkErrorKind::ForbiddenError(_inner) => Some(_inner), - PrepareGameLinkErrorKind::UnauthorizedError(_inner) => Some(_inner), - PrepareGameLinkErrorKind::NotFoundError(_inner) => Some(_inner), - PrepareGameLinkErrorKind::BadRequestError(_inner) => Some(_inner), - PrepareGameLinkErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `PrepareIdentityAvatarUpload` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct PrepareIdentityAvatarUploadError { - /// Kind of error that occurred. - pub kind: PrepareIdentityAvatarUploadErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `PrepareIdentityAvatarUpload` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum PrepareIdentityAvatarUploadErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for PrepareIdentityAvatarUploadError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - PrepareIdentityAvatarUploadErrorKind::InternalError(_inner) => _inner.fmt(f), - PrepareIdentityAvatarUploadErrorKind::RateLimitError(_inner) => _inner.fmt(f), - PrepareIdentityAvatarUploadErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - PrepareIdentityAvatarUploadErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - PrepareIdentityAvatarUploadErrorKind::NotFoundError(_inner) => _inner.fmt(f), - PrepareIdentityAvatarUploadErrorKind::BadRequestError(_inner) => _inner.fmt(f), - PrepareIdentityAvatarUploadErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for PrepareIdentityAvatarUploadError { - fn code(&self) -> Option<&str> { - PrepareIdentityAvatarUploadError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - PrepareIdentityAvatarUploadErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - PrepareIdentityAvatarUploadErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl PrepareIdentityAvatarUploadError { - /// Creates a new `PrepareIdentityAvatarUploadError`. - pub fn new(kind: PrepareIdentityAvatarUploadErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `PrepareIdentityAvatarUploadError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: PrepareIdentityAvatarUploadErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `PrepareIdentityAvatarUploadError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: PrepareIdentityAvatarUploadErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `PrepareIdentityAvatarUploadErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!( - &self.kind, - PrepareIdentityAvatarUploadErrorKind::InternalError(_) - ) - } - /// Returns `true` if the error kind is `PrepareIdentityAvatarUploadErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - PrepareIdentityAvatarUploadErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `PrepareIdentityAvatarUploadErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - PrepareIdentityAvatarUploadErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `PrepareIdentityAvatarUploadErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - PrepareIdentityAvatarUploadErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `PrepareIdentityAvatarUploadErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!( - &self.kind, - PrepareIdentityAvatarUploadErrorKind::NotFoundError(_) - ) - } - /// Returns `true` if the error kind is `PrepareIdentityAvatarUploadErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - PrepareIdentityAvatarUploadErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for PrepareIdentityAvatarUploadError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - PrepareIdentityAvatarUploadErrorKind::InternalError(_inner) => Some(_inner), - PrepareIdentityAvatarUploadErrorKind::RateLimitError(_inner) => Some(_inner), - PrepareIdentityAvatarUploadErrorKind::ForbiddenError(_inner) => Some(_inner), - PrepareIdentityAvatarUploadErrorKind::UnauthorizedError(_inner) => Some(_inner), - PrepareIdentityAvatarUploadErrorKind::NotFoundError(_inner) => Some(_inner), - PrepareIdentityAvatarUploadErrorKind::BadRequestError(_inner) => Some(_inner), - PrepareIdentityAvatarUploadErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `RecentFollowerIgnore` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct RecentFollowerIgnoreError { - /// Kind of error that occurred. - pub kind: RecentFollowerIgnoreErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `RecentFollowerIgnore` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum RecentFollowerIgnoreErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for RecentFollowerIgnoreError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - RecentFollowerIgnoreErrorKind::InternalError(_inner) => _inner.fmt(f), - RecentFollowerIgnoreErrorKind::RateLimitError(_inner) => _inner.fmt(f), - RecentFollowerIgnoreErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - RecentFollowerIgnoreErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - RecentFollowerIgnoreErrorKind::NotFoundError(_inner) => _inner.fmt(f), - RecentFollowerIgnoreErrorKind::BadRequestError(_inner) => _inner.fmt(f), - RecentFollowerIgnoreErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for RecentFollowerIgnoreError { - fn code(&self) -> Option<&str> { - RecentFollowerIgnoreError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - RecentFollowerIgnoreErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - RecentFollowerIgnoreErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl RecentFollowerIgnoreError { - /// Creates a new `RecentFollowerIgnoreError`. - pub fn new(kind: RecentFollowerIgnoreErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `RecentFollowerIgnoreError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: RecentFollowerIgnoreErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `RecentFollowerIgnoreError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: RecentFollowerIgnoreErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `RecentFollowerIgnoreErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, RecentFollowerIgnoreErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `RecentFollowerIgnoreErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, RecentFollowerIgnoreErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `RecentFollowerIgnoreErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, RecentFollowerIgnoreErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `RecentFollowerIgnoreErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - RecentFollowerIgnoreErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `RecentFollowerIgnoreErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, RecentFollowerIgnoreErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `RecentFollowerIgnoreErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - RecentFollowerIgnoreErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for RecentFollowerIgnoreError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - RecentFollowerIgnoreErrorKind::InternalError(_inner) => Some(_inner), - RecentFollowerIgnoreErrorKind::RateLimitError(_inner) => Some(_inner), - RecentFollowerIgnoreErrorKind::ForbiddenError(_inner) => Some(_inner), - RecentFollowerIgnoreErrorKind::UnauthorizedError(_inner) => Some(_inner), - RecentFollowerIgnoreErrorKind::NotFoundError(_inner) => Some(_inner), - RecentFollowerIgnoreErrorKind::BadRequestError(_inner) => Some(_inner), - RecentFollowerIgnoreErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `RemoveIdentityGameActivity` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct RemoveIdentityGameActivityError { - /// Kind of error that occurred. - pub kind: RemoveIdentityGameActivityErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `RemoveIdentityGameActivity` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum RemoveIdentityGameActivityErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for RemoveIdentityGameActivityError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - RemoveIdentityGameActivityErrorKind::InternalError(_inner) => _inner.fmt(f), - RemoveIdentityGameActivityErrorKind::RateLimitError(_inner) => _inner.fmt(f), - RemoveIdentityGameActivityErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - RemoveIdentityGameActivityErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - RemoveIdentityGameActivityErrorKind::NotFoundError(_inner) => _inner.fmt(f), - RemoveIdentityGameActivityErrorKind::BadRequestError(_inner) => _inner.fmt(f), - RemoveIdentityGameActivityErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for RemoveIdentityGameActivityError { - fn code(&self) -> Option<&str> { - RemoveIdentityGameActivityError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - RemoveIdentityGameActivityErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - RemoveIdentityGameActivityErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl RemoveIdentityGameActivityError { - /// Creates a new `RemoveIdentityGameActivityError`. - pub fn new(kind: RemoveIdentityGameActivityErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `RemoveIdentityGameActivityError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: RemoveIdentityGameActivityErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `RemoveIdentityGameActivityError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: RemoveIdentityGameActivityErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `RemoveIdentityGameActivityErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!( - &self.kind, - RemoveIdentityGameActivityErrorKind::InternalError(_) - ) - } - /// Returns `true` if the error kind is `RemoveIdentityGameActivityErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - RemoveIdentityGameActivityErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `RemoveIdentityGameActivityErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - RemoveIdentityGameActivityErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `RemoveIdentityGameActivityErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - RemoveIdentityGameActivityErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `RemoveIdentityGameActivityErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!( - &self.kind, - RemoveIdentityGameActivityErrorKind::NotFoundError(_) - ) - } - /// Returns `true` if the error kind is `RemoveIdentityGameActivityErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - RemoveIdentityGameActivityErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for RemoveIdentityGameActivityError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - RemoveIdentityGameActivityErrorKind::InternalError(_inner) => Some(_inner), - RemoveIdentityGameActivityErrorKind::RateLimitError(_inner) => Some(_inner), - RemoveIdentityGameActivityErrorKind::ForbiddenError(_inner) => Some(_inner), - RemoveIdentityGameActivityErrorKind::UnauthorizedError(_inner) => Some(_inner), - RemoveIdentityGameActivityErrorKind::NotFoundError(_inner) => Some(_inner), - RemoveIdentityGameActivityErrorKind::BadRequestError(_inner) => Some(_inner), - RemoveIdentityGameActivityErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `ReportIdentity` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct ReportIdentityError { - /// Kind of error that occurred. - pub kind: ReportIdentityErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `ReportIdentity` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum ReportIdentityErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for ReportIdentityError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - ReportIdentityErrorKind::InternalError(_inner) => _inner.fmt(f), - ReportIdentityErrorKind::RateLimitError(_inner) => _inner.fmt(f), - ReportIdentityErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - ReportIdentityErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - ReportIdentityErrorKind::NotFoundError(_inner) => _inner.fmt(f), - ReportIdentityErrorKind::BadRequestError(_inner) => _inner.fmt(f), - ReportIdentityErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for ReportIdentityError { - fn code(&self) -> Option<&str> { - ReportIdentityError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - ReportIdentityErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - ReportIdentityErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl ReportIdentityError { - /// Creates a new `ReportIdentityError`. - pub fn new(kind: ReportIdentityErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `ReportIdentityError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: ReportIdentityErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `ReportIdentityError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: ReportIdentityErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `ReportIdentityErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, ReportIdentityErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `ReportIdentityErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, ReportIdentityErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `ReportIdentityErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, ReportIdentityErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `ReportIdentityErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, ReportIdentityErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `ReportIdentityErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, ReportIdentityErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `ReportIdentityErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, ReportIdentityErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for ReportIdentityError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - ReportIdentityErrorKind::InternalError(_inner) => Some(_inner), - ReportIdentityErrorKind::RateLimitError(_inner) => Some(_inner), - ReportIdentityErrorKind::ForbiddenError(_inner) => Some(_inner), - ReportIdentityErrorKind::UnauthorizedError(_inner) => Some(_inner), - ReportIdentityErrorKind::NotFoundError(_inner) => Some(_inner), - ReportIdentityErrorKind::BadRequestError(_inner) => Some(_inner), - ReportIdentityErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `SearchIdentities` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct SearchIdentitiesError { - /// Kind of error that occurred. - pub kind: SearchIdentitiesErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `SearchIdentities` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum SearchIdentitiesErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for SearchIdentitiesError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - SearchIdentitiesErrorKind::InternalError(_inner) => _inner.fmt(f), - SearchIdentitiesErrorKind::RateLimitError(_inner) => _inner.fmt(f), - SearchIdentitiesErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - SearchIdentitiesErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - SearchIdentitiesErrorKind::NotFoundError(_inner) => _inner.fmt(f), - SearchIdentitiesErrorKind::BadRequestError(_inner) => _inner.fmt(f), - SearchIdentitiesErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for SearchIdentitiesError { - fn code(&self) -> Option<&str> { - SearchIdentitiesError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - SearchIdentitiesErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - SearchIdentitiesErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl SearchIdentitiesError { - /// Creates a new `SearchIdentitiesError`. - pub fn new(kind: SearchIdentitiesErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `SearchIdentitiesError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: SearchIdentitiesErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `SearchIdentitiesError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: SearchIdentitiesErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `SearchIdentitiesErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, SearchIdentitiesErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `SearchIdentitiesErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, SearchIdentitiesErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `SearchIdentitiesErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, SearchIdentitiesErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `SearchIdentitiesErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, SearchIdentitiesErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `SearchIdentitiesErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, SearchIdentitiesErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `SearchIdentitiesErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, SearchIdentitiesErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for SearchIdentitiesError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - SearchIdentitiesErrorKind::InternalError(_inner) => Some(_inner), - SearchIdentitiesErrorKind::RateLimitError(_inner) => Some(_inner), - SearchIdentitiesErrorKind::ForbiddenError(_inner) => Some(_inner), - SearchIdentitiesErrorKind::UnauthorizedError(_inner) => Some(_inner), - SearchIdentitiesErrorKind::NotFoundError(_inner) => Some(_inner), - SearchIdentitiesErrorKind::BadRequestError(_inner) => Some(_inner), - SearchIdentitiesErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `SetIdentityGameActivity` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct SetIdentityGameActivityError { - /// Kind of error that occurred. - pub kind: SetIdentityGameActivityErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `SetIdentityGameActivity` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum SetIdentityGameActivityErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for SetIdentityGameActivityError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - SetIdentityGameActivityErrorKind::InternalError(_inner) => _inner.fmt(f), - SetIdentityGameActivityErrorKind::RateLimitError(_inner) => _inner.fmt(f), - SetIdentityGameActivityErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - SetIdentityGameActivityErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - SetIdentityGameActivityErrorKind::NotFoundError(_inner) => _inner.fmt(f), - SetIdentityGameActivityErrorKind::BadRequestError(_inner) => _inner.fmt(f), - SetIdentityGameActivityErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for SetIdentityGameActivityError { - fn code(&self) -> Option<&str> { - SetIdentityGameActivityError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - SetIdentityGameActivityErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - SetIdentityGameActivityErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl SetIdentityGameActivityError { - /// Creates a new `SetIdentityGameActivityError`. - pub fn new(kind: SetIdentityGameActivityErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `SetIdentityGameActivityError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: SetIdentityGameActivityErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `SetIdentityGameActivityError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: SetIdentityGameActivityErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `SetIdentityGameActivityErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!( - &self.kind, - SetIdentityGameActivityErrorKind::InternalError(_) - ) - } - /// Returns `true` if the error kind is `SetIdentityGameActivityErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - SetIdentityGameActivityErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `SetIdentityGameActivityErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - SetIdentityGameActivityErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `SetIdentityGameActivityErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - SetIdentityGameActivityErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `SetIdentityGameActivityErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!( - &self.kind, - SetIdentityGameActivityErrorKind::NotFoundError(_) - ) - } - /// Returns `true` if the error kind is `SetIdentityGameActivityErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - SetIdentityGameActivityErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for SetIdentityGameActivityError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - SetIdentityGameActivityErrorKind::InternalError(_inner) => Some(_inner), - SetIdentityGameActivityErrorKind::RateLimitError(_inner) => Some(_inner), - SetIdentityGameActivityErrorKind::ForbiddenError(_inner) => Some(_inner), - SetIdentityGameActivityErrorKind::UnauthorizedError(_inner) => Some(_inner), - SetIdentityGameActivityErrorKind::NotFoundError(_inner) => Some(_inner), - SetIdentityGameActivityErrorKind::BadRequestError(_inner) => Some(_inner), - SetIdentityGameActivityErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `SetupIdentity` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct SetupIdentityError { - /// Kind of error that occurred. - pub kind: SetupIdentityErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `SetupIdentity` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum SetupIdentityErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for SetupIdentityError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - SetupIdentityErrorKind::InternalError(_inner) => _inner.fmt(f), - SetupIdentityErrorKind::RateLimitError(_inner) => _inner.fmt(f), - SetupIdentityErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - SetupIdentityErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - SetupIdentityErrorKind::NotFoundError(_inner) => _inner.fmt(f), - SetupIdentityErrorKind::BadRequestError(_inner) => _inner.fmt(f), - SetupIdentityErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for SetupIdentityError { - fn code(&self) -> Option<&str> { - SetupIdentityError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - SetupIdentityErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - SetupIdentityErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl SetupIdentityError { - /// Creates a new `SetupIdentityError`. - pub fn new(kind: SetupIdentityErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `SetupIdentityError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: SetupIdentityErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `SetupIdentityError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: SetupIdentityErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `SetupIdentityErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, SetupIdentityErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `SetupIdentityErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, SetupIdentityErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `SetupIdentityErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, SetupIdentityErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `SetupIdentityErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, SetupIdentityErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `SetupIdentityErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, SetupIdentityErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `SetupIdentityErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, SetupIdentityErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for SetupIdentityError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - SetupIdentityErrorKind::InternalError(_inner) => Some(_inner), - SetupIdentityErrorKind::RateLimitError(_inner) => Some(_inner), - SetupIdentityErrorKind::ForbiddenError(_inner) => Some(_inner), - SetupIdentityErrorKind::UnauthorizedError(_inner) => Some(_inner), - SetupIdentityErrorKind::NotFoundError(_inner) => Some(_inner), - SetupIdentityErrorKind::BadRequestError(_inner) => Some(_inner), - SetupIdentityErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `SignupForBeta` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct SignupForBetaError { - /// Kind of error that occurred. - pub kind: SignupForBetaErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `SignupForBeta` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum SignupForBetaErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for SignupForBetaError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - SignupForBetaErrorKind::InternalError(_inner) => _inner.fmt(f), - SignupForBetaErrorKind::RateLimitError(_inner) => _inner.fmt(f), - SignupForBetaErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - SignupForBetaErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - SignupForBetaErrorKind::NotFoundError(_inner) => _inner.fmt(f), - SignupForBetaErrorKind::BadRequestError(_inner) => _inner.fmt(f), - SignupForBetaErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for SignupForBetaError { - fn code(&self) -> Option<&str> { - SignupForBetaError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - SignupForBetaErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - SignupForBetaErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl SignupForBetaError { - /// Creates a new `SignupForBetaError`. - pub fn new(kind: SignupForBetaErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `SignupForBetaError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: SignupForBetaErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `SignupForBetaError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: SignupForBetaErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `SignupForBetaErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, SignupForBetaErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `SignupForBetaErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, SignupForBetaErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `SignupForBetaErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, SignupForBetaErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `SignupForBetaErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, SignupForBetaErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `SignupForBetaErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, SignupForBetaErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `SignupForBetaErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, SignupForBetaErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for SignupForBetaError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - SignupForBetaErrorKind::InternalError(_inner) => Some(_inner), - SignupForBetaErrorKind::RateLimitError(_inner) => Some(_inner), - SignupForBetaErrorKind::ForbiddenError(_inner) => Some(_inner), - SignupForBetaErrorKind::UnauthorizedError(_inner) => Some(_inner), - SignupForBetaErrorKind::NotFoundError(_inner) => Some(_inner), - SignupForBetaErrorKind::BadRequestError(_inner) => Some(_inner), - SignupForBetaErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `UnfollowIdentity` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct UnfollowIdentityError { - /// Kind of error that occurred. - pub kind: UnfollowIdentityErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `UnfollowIdentity` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum UnfollowIdentityErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for UnfollowIdentityError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - UnfollowIdentityErrorKind::InternalError(_inner) => _inner.fmt(f), - UnfollowIdentityErrorKind::RateLimitError(_inner) => _inner.fmt(f), - UnfollowIdentityErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - UnfollowIdentityErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - UnfollowIdentityErrorKind::NotFoundError(_inner) => _inner.fmt(f), - UnfollowIdentityErrorKind::BadRequestError(_inner) => _inner.fmt(f), - UnfollowIdentityErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for UnfollowIdentityError { - fn code(&self) -> Option<&str> { - UnfollowIdentityError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - UnfollowIdentityErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - UnfollowIdentityErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl UnfollowIdentityError { - /// Creates a new `UnfollowIdentityError`. - pub fn new(kind: UnfollowIdentityErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `UnfollowIdentityError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: UnfollowIdentityErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `UnfollowIdentityError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: UnfollowIdentityErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `UnfollowIdentityErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, UnfollowIdentityErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `UnfollowIdentityErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, UnfollowIdentityErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `UnfollowIdentityErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, UnfollowIdentityErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `UnfollowIdentityErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, UnfollowIdentityErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `UnfollowIdentityErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, UnfollowIdentityErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `UnfollowIdentityErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, UnfollowIdentityErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for UnfollowIdentityError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - UnfollowIdentityErrorKind::InternalError(_inner) => Some(_inner), - UnfollowIdentityErrorKind::RateLimitError(_inner) => Some(_inner), - UnfollowIdentityErrorKind::ForbiddenError(_inner) => Some(_inner), - UnfollowIdentityErrorKind::UnauthorizedError(_inner) => Some(_inner), - UnfollowIdentityErrorKind::NotFoundError(_inner) => Some(_inner), - UnfollowIdentityErrorKind::BadRequestError(_inner) => Some(_inner), - UnfollowIdentityErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `UnmarkDeletion` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct UnmarkDeletionError { - /// Kind of error that occurred. - pub kind: UnmarkDeletionErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `UnmarkDeletion` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum UnmarkDeletionErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for UnmarkDeletionError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - UnmarkDeletionErrorKind::InternalError(_inner) => _inner.fmt(f), - UnmarkDeletionErrorKind::RateLimitError(_inner) => _inner.fmt(f), - UnmarkDeletionErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - UnmarkDeletionErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - UnmarkDeletionErrorKind::NotFoundError(_inner) => _inner.fmt(f), - UnmarkDeletionErrorKind::BadRequestError(_inner) => _inner.fmt(f), - UnmarkDeletionErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for UnmarkDeletionError { - fn code(&self) -> Option<&str> { - UnmarkDeletionError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - UnmarkDeletionErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - UnmarkDeletionErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl UnmarkDeletionError { - /// Creates a new `UnmarkDeletionError`. - pub fn new(kind: UnmarkDeletionErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `UnmarkDeletionError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: UnmarkDeletionErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `UnmarkDeletionError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: UnmarkDeletionErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `UnmarkDeletionErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, UnmarkDeletionErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `UnmarkDeletionErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, UnmarkDeletionErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `UnmarkDeletionErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, UnmarkDeletionErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `UnmarkDeletionErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, UnmarkDeletionErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `UnmarkDeletionErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, UnmarkDeletionErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `UnmarkDeletionErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, UnmarkDeletionErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for UnmarkDeletionError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - UnmarkDeletionErrorKind::InternalError(_inner) => Some(_inner), - UnmarkDeletionErrorKind::RateLimitError(_inner) => Some(_inner), - UnmarkDeletionErrorKind::ForbiddenError(_inner) => Some(_inner), - UnmarkDeletionErrorKind::UnauthorizedError(_inner) => Some(_inner), - UnmarkDeletionErrorKind::NotFoundError(_inner) => Some(_inner), - UnmarkDeletionErrorKind::BadRequestError(_inner) => Some(_inner), - UnmarkDeletionErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `UpdateIdentityProfile` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct UpdateIdentityProfileError { - /// Kind of error that occurred. - pub kind: UpdateIdentityProfileErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `UpdateIdentityProfile` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum UpdateIdentityProfileErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for UpdateIdentityProfileError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - UpdateIdentityProfileErrorKind::InternalError(_inner) => _inner.fmt(f), - UpdateIdentityProfileErrorKind::RateLimitError(_inner) => _inner.fmt(f), - UpdateIdentityProfileErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - UpdateIdentityProfileErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - UpdateIdentityProfileErrorKind::NotFoundError(_inner) => _inner.fmt(f), - UpdateIdentityProfileErrorKind::BadRequestError(_inner) => _inner.fmt(f), - UpdateIdentityProfileErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for UpdateIdentityProfileError { - fn code(&self) -> Option<&str> { - UpdateIdentityProfileError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - UpdateIdentityProfileErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - UpdateIdentityProfileErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl UpdateIdentityProfileError { - /// Creates a new `UpdateIdentityProfileError`. - pub fn new(kind: UpdateIdentityProfileErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `UpdateIdentityProfileError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: UpdateIdentityProfileErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `UpdateIdentityProfileError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: UpdateIdentityProfileErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `UpdateIdentityProfileErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, UpdateIdentityProfileErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `UpdateIdentityProfileErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - UpdateIdentityProfileErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `UpdateIdentityProfileErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - UpdateIdentityProfileErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `UpdateIdentityProfileErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - UpdateIdentityProfileErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `UpdateIdentityProfileErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, UpdateIdentityProfileErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `UpdateIdentityProfileErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - UpdateIdentityProfileErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for UpdateIdentityProfileError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - UpdateIdentityProfileErrorKind::InternalError(_inner) => Some(_inner), - UpdateIdentityProfileErrorKind::RateLimitError(_inner) => Some(_inner), - UpdateIdentityProfileErrorKind::ForbiddenError(_inner) => Some(_inner), - UpdateIdentityProfileErrorKind::UnauthorizedError(_inner) => Some(_inner), - UpdateIdentityProfileErrorKind::NotFoundError(_inner) => Some(_inner), - UpdateIdentityProfileErrorKind::BadRequestError(_inner) => Some(_inner), - UpdateIdentityProfileErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `UpdateIdentityStatus` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct UpdateIdentityStatusError { - /// Kind of error that occurred. - pub kind: UpdateIdentityStatusErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `UpdateIdentityStatus` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum UpdateIdentityStatusErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for UpdateIdentityStatusError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - UpdateIdentityStatusErrorKind::InternalError(_inner) => _inner.fmt(f), - UpdateIdentityStatusErrorKind::RateLimitError(_inner) => _inner.fmt(f), - UpdateIdentityStatusErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - UpdateIdentityStatusErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - UpdateIdentityStatusErrorKind::NotFoundError(_inner) => _inner.fmt(f), - UpdateIdentityStatusErrorKind::BadRequestError(_inner) => _inner.fmt(f), - UpdateIdentityStatusErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for UpdateIdentityStatusError { - fn code(&self) -> Option<&str> { - UpdateIdentityStatusError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - UpdateIdentityStatusErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - UpdateIdentityStatusErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl UpdateIdentityStatusError { - /// Creates a new `UpdateIdentityStatusError`. - pub fn new(kind: UpdateIdentityStatusErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `UpdateIdentityStatusError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: UpdateIdentityStatusErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `UpdateIdentityStatusError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: UpdateIdentityStatusErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `UpdateIdentityStatusErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, UpdateIdentityStatusErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `UpdateIdentityStatusErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, UpdateIdentityStatusErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `UpdateIdentityStatusErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, UpdateIdentityStatusErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `UpdateIdentityStatusErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - UpdateIdentityStatusErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `UpdateIdentityStatusErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, UpdateIdentityStatusErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `UpdateIdentityStatusErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - UpdateIdentityStatusErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for UpdateIdentityStatusError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - UpdateIdentityStatusErrorKind::InternalError(_inner) => Some(_inner), - UpdateIdentityStatusErrorKind::RateLimitError(_inner) => Some(_inner), - UpdateIdentityStatusErrorKind::ForbiddenError(_inner) => Some(_inner), - UpdateIdentityStatusErrorKind::UnauthorizedError(_inner) => Some(_inner), - UpdateIdentityStatusErrorKind::NotFoundError(_inner) => Some(_inner), - UpdateIdentityStatusErrorKind::BadRequestError(_inner) => Some(_inner), - UpdateIdentityStatusErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `ValidateIdentityProfile` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct ValidateIdentityProfileError { - /// Kind of error that occurred. - pub kind: ValidateIdentityProfileErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `ValidateIdentityProfile` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum ValidateIdentityProfileErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for ValidateIdentityProfileError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - ValidateIdentityProfileErrorKind::InternalError(_inner) => _inner.fmt(f), - ValidateIdentityProfileErrorKind::RateLimitError(_inner) => _inner.fmt(f), - ValidateIdentityProfileErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - ValidateIdentityProfileErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - ValidateIdentityProfileErrorKind::NotFoundError(_inner) => _inner.fmt(f), - ValidateIdentityProfileErrorKind::BadRequestError(_inner) => _inner.fmt(f), - ValidateIdentityProfileErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for ValidateIdentityProfileError { - fn code(&self) -> Option<&str> { - ValidateIdentityProfileError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - ValidateIdentityProfileErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - ValidateIdentityProfileErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl ValidateIdentityProfileError { - /// Creates a new `ValidateIdentityProfileError`. - pub fn new(kind: ValidateIdentityProfileErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `ValidateIdentityProfileError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: ValidateIdentityProfileErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `ValidateIdentityProfileError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: ValidateIdentityProfileErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `ValidateIdentityProfileErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!( - &self.kind, - ValidateIdentityProfileErrorKind::InternalError(_) - ) - } - /// Returns `true` if the error kind is `ValidateIdentityProfileErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - ValidateIdentityProfileErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `ValidateIdentityProfileErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - ValidateIdentityProfileErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `ValidateIdentityProfileErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - ValidateIdentityProfileErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `ValidateIdentityProfileErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!( - &self.kind, - ValidateIdentityProfileErrorKind::NotFoundError(_) - ) - } - /// Returns `true` if the error kind is `ValidateIdentityProfileErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - ValidateIdentityProfileErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for ValidateIdentityProfileError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - ValidateIdentityProfileErrorKind::InternalError(_inner) => Some(_inner), - ValidateIdentityProfileErrorKind::RateLimitError(_inner) => Some(_inner), - ValidateIdentityProfileErrorKind::ForbiddenError(_inner) => Some(_inner), - ValidateIdentityProfileErrorKind::UnauthorizedError(_inner) => Some(_inner), - ValidateIdentityProfileErrorKind::NotFoundError(_inner) => Some(_inner), - ValidateIdentityProfileErrorKind::BadRequestError(_inner) => Some(_inner), - ValidateIdentityProfileErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `WatchEvents` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct WatchEventsError { - /// Kind of error that occurred. - pub kind: WatchEventsErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `WatchEvents` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum WatchEventsErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for WatchEventsError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - WatchEventsErrorKind::InternalError(_inner) => _inner.fmt(f), - WatchEventsErrorKind::RateLimitError(_inner) => _inner.fmt(f), - WatchEventsErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - WatchEventsErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - WatchEventsErrorKind::NotFoundError(_inner) => _inner.fmt(f), - WatchEventsErrorKind::BadRequestError(_inner) => _inner.fmt(f), - WatchEventsErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for WatchEventsError { - fn code(&self) -> Option<&str> { - WatchEventsError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - WatchEventsErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - WatchEventsErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl WatchEventsError { - /// Creates a new `WatchEventsError`. - pub fn new(kind: WatchEventsErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `WatchEventsError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: WatchEventsErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `WatchEventsError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: WatchEventsErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `WatchEventsErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, WatchEventsErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `WatchEventsErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, WatchEventsErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `WatchEventsErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, WatchEventsErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `WatchEventsErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, WatchEventsErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `WatchEventsErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, WatchEventsErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `WatchEventsErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, WatchEventsErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for WatchEventsError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - WatchEventsErrorKind::InternalError(_inner) => Some(_inner), - WatchEventsErrorKind::RateLimitError(_inner) => Some(_inner), - WatchEventsErrorKind::ForbiddenError(_inner) => Some(_inner), - WatchEventsErrorKind::UnauthorizedError(_inner) => Some(_inner), - WatchEventsErrorKind::NotFoundError(_inner) => Some(_inner), - WatchEventsErrorKind::BadRequestError(_inner) => Some(_inner), - WatchEventsErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// An error thrown when the requestee has sent an invalid or malformed request. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct BadRequestError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl BadRequestError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for BadRequestError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("BadRequestError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl BadRequestError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for BadRequestError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "BadRequestError")?; - if let Some(inner_1) = &self.message { - write!(f, ": {}", inner_1)?; - } - Ok(()) - } -} -impl std::error::Error for BadRequestError {} -/// See [`BadRequestError`](crate::error::BadRequestError) -pub mod bad_request_error { - /// A builder for [`BadRequestError`](crate::error::BadRequestError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`BadRequestError`](crate::error::BadRequestError) - pub fn build(self) -> crate::error::BadRequestError { - crate::error::BadRequestError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl BadRequestError { - /// Creates a new builder-style object to manufacture [`BadRequestError`](crate::error::BadRequestError) - pub fn builder() -> crate::error::bad_request_error::Builder { - crate::error::bad_request_error::Builder::default() - } -} - -/// An error thrown when the requestee requests a non existent resource. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct NotFoundError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl NotFoundError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for NotFoundError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("NotFoundError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl NotFoundError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for NotFoundError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "NotFoundError")?; - if let Some(inner_2) = &self.message { - write!(f, ": {}", inner_2)?; - } - Ok(()) - } -} -impl std::error::Error for NotFoundError {} -/// See [`NotFoundError`](crate::error::NotFoundError) -pub mod not_found_error { - /// A builder for [`NotFoundError`](crate::error::NotFoundError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`NotFoundError`](crate::error::NotFoundError) - pub fn build(self) -> crate::error::NotFoundError { - crate::error::NotFoundError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl NotFoundError { - /// Creates a new builder-style object to manufacture [`NotFoundError`](crate::error::NotFoundError) - pub fn builder() -> crate::error::not_found_error::Builder { - crate::error::not_found_error::Builder::default() - } -} - -/// An error thrown when the requestee is not authenticated. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UnauthorizedError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl UnauthorizedError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for UnauthorizedError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UnauthorizedError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl UnauthorizedError { - /// Returns `Some(ErrorKind)` if the error is retryable. Otherwise, returns `None`. - pub fn retryable_error_kind(&self) -> aws_smithy_types::retry::ErrorKind { - aws_smithy_types::retry::ErrorKind::ClientError - } - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for UnauthorizedError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "UnauthorizedError")?; - if let Some(inner_3) = &self.message { - write!(f, ": {}", inner_3)?; - } - Ok(()) - } -} -impl std::error::Error for UnauthorizedError {} -/// See [`UnauthorizedError`](crate::error::UnauthorizedError) -pub mod unauthorized_error { - /// A builder for [`UnauthorizedError`](crate::error::UnauthorizedError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`UnauthorizedError`](crate::error::UnauthorizedError) - pub fn build(self) -> crate::error::UnauthorizedError { - crate::error::UnauthorizedError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl UnauthorizedError { - /// Creates a new builder-style object to manufacture [`UnauthorizedError`](crate::error::UnauthorizedError) - pub fn builder() -> crate::error::unauthorized_error::Builder { - crate::error::unauthorized_error::Builder::default() - } -} - -/// An error thrown when the requestee requests a resource they do not have access to. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ForbiddenError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl ForbiddenError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for ForbiddenError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ForbiddenError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl ForbiddenError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for ForbiddenError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "ForbiddenError")?; - if let Some(inner_4) = &self.message { - write!(f, ": {}", inner_4)?; - } - Ok(()) - } -} -impl std::error::Error for ForbiddenError {} -/// See [`ForbiddenError`](crate::error::ForbiddenError) -pub mod forbidden_error { - /// A builder for [`ForbiddenError`](crate::error::ForbiddenError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`ForbiddenError`](crate::error::ForbiddenError) - pub fn build(self) -> crate::error::ForbiddenError { - crate::error::ForbiddenError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl ForbiddenError { - /// Creates a new builder-style object to manufacture [`ForbiddenError`](crate::error::ForbiddenError) - pub fn builder() -> crate::error::forbidden_error::Builder { - crate::error::forbidden_error::Builder::default() - } -} - -/// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct RateLimitError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl RateLimitError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for RateLimitError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("RateLimitError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl RateLimitError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for RateLimitError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "RateLimitError")?; - if let Some(inner_5) = &self.message { - write!(f, ": {}", inner_5)?; - } - Ok(()) - } -} -impl std::error::Error for RateLimitError {} -/// See [`RateLimitError`](crate::error::RateLimitError) -pub mod rate_limit_error { - /// A builder for [`RateLimitError`](crate::error::RateLimitError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`RateLimitError`](crate::error::RateLimitError) - pub fn build(self) -> crate::error::RateLimitError { - crate::error::RateLimitError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl RateLimitError { - /// Creates a new builder-style object to manufacture [`RateLimitError`](crate::error::RateLimitError) - pub fn builder() -> crate::error::rate_limit_error::Builder { - crate::error::rate_limit_error::Builder::default() - } -} - -/// An error caused by internal server problems. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct InternalError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl InternalError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for InternalError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("InternalError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl InternalError { - /// Returns `Some(ErrorKind)` if the error is retryable. Otherwise, returns `None`. - pub fn retryable_error_kind(&self) -> aws_smithy_types::retry::ErrorKind { - aws_smithy_types::retry::ErrorKind::ServerError - } - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for InternalError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "InternalError")?; - if let Some(inner_6) = &self.message { - write!(f, ": {}", inner_6)?; - } - Ok(()) - } -} -impl std::error::Error for InternalError {} -/// See [`InternalError`](crate::error::InternalError) -pub mod internal_error { - /// A builder for [`InternalError`](crate::error::InternalError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`InternalError`](crate::error::InternalError) - pub fn build(self) -> crate::error::InternalError { - crate::error::InternalError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl InternalError { - /// Creates a new builder-style object to manufacture [`InternalError`](crate::error::InternalError) - pub fn builder() -> crate::error::internal_error::Builder { - crate::error::internal_error::Builder::default() - } -} diff --git a/lib/smithy-output/api-identity/rust/rust/src/error_meta.rs b/lib/smithy-output/api-identity/rust/rust/src/error_meta.rs deleted file mode 100644 index 2363cf57b..000000000 --- a/lib/smithy-output/api-identity/rust/rust/src/error_meta.rs +++ /dev/null @@ -1,1073 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// All possible error types for this service. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum Error { - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An unhandled error occurred. - Unhandled(Box), -} -impl std::fmt::Display for Error { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Error::BadRequestError(inner) => inner.fmt(f), - Error::ForbiddenError(inner) => inner.fmt(f), - Error::InternalError(inner) => inner.fmt(f), - Error::NotFoundError(inner) => inner.fmt(f), - Error::RateLimitError(inner) => inner.fmt(f), - Error::UnauthorizedError(inner) => inner.fmt(f), - Error::Unhandled(inner) => inner.fmt(f), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::CancelGameLinkErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::CancelGameLinkErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::CancelGameLinkErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::CancelGameLinkErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::CancelGameLinkErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::CancelGameLinkErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::CancelGameLinkErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::CompleteGameLinkErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::CompleteGameLinkErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::CompleteGameLinkErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::CompleteGameLinkErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::CompleteGameLinkErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::CompleteGameLinkErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::CompleteGameLinkErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::CompleteIdentityAvatarUploadErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::CompleteIdentityAvatarUploadErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::CompleteIdentityAvatarUploadErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::CompleteIdentityAvatarUploadErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::CompleteIdentityAvatarUploadErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::CompleteIdentityAvatarUploadErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::CompleteIdentityAvatarUploadErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::FollowIdentityErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::FollowIdentityErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::FollowIdentityErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::FollowIdentityErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::FollowIdentityErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::FollowIdentityErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::FollowIdentityErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GetGameLinkErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GetGameLinkErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GetGameLinkErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GetGameLinkErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GetGameLinkErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GetGameLinkErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GetGameLinkErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GetIdentityHandlesErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GetIdentityHandlesErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GetIdentityHandlesErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GetIdentityHandlesErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GetIdentityHandlesErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GetIdentityHandlesErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GetIdentityHandlesErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GetIdentityProfileErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GetIdentityProfileErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GetIdentityProfileErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GetIdentityProfileErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GetIdentityProfileErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GetIdentityProfileErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GetIdentityProfileErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GetIdentitySelfProfileErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GetIdentitySelfProfileErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GetIdentitySelfProfileErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GetIdentitySelfProfileErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GetIdentitySelfProfileErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GetIdentitySelfProfileErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GetIdentitySelfProfileErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GetIdentitySummariesErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GetIdentitySummariesErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GetIdentitySummariesErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GetIdentitySummariesErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GetIdentitySummariesErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GetIdentitySummariesErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GetIdentitySummariesErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::ListActivitiesErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::ListActivitiesErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::ListActivitiesErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::ListActivitiesErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::ListActivitiesErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::ListActivitiesErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::ListActivitiesErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::ListFollowersErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::ListFollowersErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::ListFollowersErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::ListFollowersErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::ListFollowersErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::ListFollowersErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::ListFollowersErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::ListFollowingErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::ListFollowingErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::ListFollowingErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::ListFollowingErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::ListFollowingErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::ListFollowingErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::ListFollowingErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::ListFriendsErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::ListFriendsErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::ListFriendsErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::ListFriendsErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::ListFriendsErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::ListFriendsErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::ListFriendsErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::ListMutualFriendsErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::ListMutualFriendsErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::ListMutualFriendsErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::ListMutualFriendsErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::ListMutualFriendsErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::ListMutualFriendsErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::ListMutualFriendsErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::ListRecentFollowersErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::ListRecentFollowersErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::ListRecentFollowersErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::ListRecentFollowersErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::ListRecentFollowersErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::ListRecentFollowersErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::ListRecentFollowersErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::MarkDeletionErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::MarkDeletionErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::MarkDeletionErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::MarkDeletionErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::MarkDeletionErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::MarkDeletionErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::MarkDeletionErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::PrepareGameLinkErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::PrepareGameLinkErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::PrepareGameLinkErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::PrepareGameLinkErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::PrepareGameLinkErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::PrepareGameLinkErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::PrepareGameLinkErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::PrepareIdentityAvatarUploadErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::PrepareIdentityAvatarUploadErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::PrepareIdentityAvatarUploadErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::PrepareIdentityAvatarUploadErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::PrepareIdentityAvatarUploadErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::PrepareIdentityAvatarUploadErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::PrepareIdentityAvatarUploadErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::RecentFollowerIgnoreErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::RecentFollowerIgnoreErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::RecentFollowerIgnoreErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::RecentFollowerIgnoreErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::RecentFollowerIgnoreErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::RecentFollowerIgnoreErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::RecentFollowerIgnoreErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::RemoveIdentityGameActivityErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::RemoveIdentityGameActivityErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::RemoveIdentityGameActivityErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::RemoveIdentityGameActivityErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::RemoveIdentityGameActivityErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::RemoveIdentityGameActivityErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::RemoveIdentityGameActivityErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::ReportIdentityErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::ReportIdentityErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::ReportIdentityErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::ReportIdentityErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::ReportIdentityErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::ReportIdentityErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::ReportIdentityErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::SearchIdentitiesErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::SearchIdentitiesErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::SearchIdentitiesErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::SearchIdentitiesErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::SearchIdentitiesErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::SearchIdentitiesErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::SearchIdentitiesErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::SetIdentityGameActivityErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::SetIdentityGameActivityErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::SetIdentityGameActivityErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::SetIdentityGameActivityErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::SetIdentityGameActivityErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::SetIdentityGameActivityErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::SetIdentityGameActivityErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::SetupIdentityErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::SetupIdentityErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::SetupIdentityErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::SetupIdentityErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::SetupIdentityErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::SetupIdentityErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::SetupIdentityErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::SignupForBetaErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::SignupForBetaErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::SignupForBetaErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::SignupForBetaErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::SignupForBetaErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::SignupForBetaErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::SignupForBetaErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::UnfollowIdentityErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::UnfollowIdentityErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::UnfollowIdentityErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::UnfollowIdentityErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::UnfollowIdentityErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::UnfollowIdentityErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::UnfollowIdentityErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::UnmarkDeletionErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::UnmarkDeletionErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::UnmarkDeletionErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::UnmarkDeletionErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::UnmarkDeletionErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::UnmarkDeletionErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::UnmarkDeletionErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::UpdateIdentityProfileErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::UpdateIdentityProfileErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::UpdateIdentityProfileErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::UpdateIdentityProfileErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::UpdateIdentityProfileErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::UpdateIdentityProfileErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::UpdateIdentityProfileErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::UpdateIdentityStatusErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::UpdateIdentityStatusErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::UpdateIdentityStatusErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::UpdateIdentityStatusErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::UpdateIdentityStatusErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::UpdateIdentityStatusErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::UpdateIdentityStatusErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::ValidateIdentityProfileErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::ValidateIdentityProfileErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::ValidateIdentityProfileErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::ValidateIdentityProfileErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::ValidateIdentityProfileErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::ValidateIdentityProfileErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::ValidateIdentityProfileErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::WatchEventsErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::WatchEventsErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::WatchEventsErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::WatchEventsErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::WatchEventsErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::WatchEventsErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::WatchEventsErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl std::error::Error for Error {} diff --git a/lib/smithy-output/api-identity/rust/rust/src/input.rs b/lib/smithy-output/api-identity/rust/rust/src/input.rs deleted file mode 100644 index 558188b17..000000000 --- a/lib/smithy-output/api-identity/rust/rust/src/input.rs +++ /dev/null @@ -1,4767 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -use std::fmt::Write; -/// See [`CancelGameLinkInput`](crate::input::CancelGameLinkInput) -pub mod cancel_game_link_input { - /// A builder for [`CancelGameLinkInput`](crate::input::CancelGameLinkInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity_link_token: std::option::Option, - } - impl Builder { - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn identity_link_token(mut self, input: impl Into) -> Self { - self.identity_link_token = Some(input.into()); - self - } - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn set_identity_link_token( - mut self, - input: std::option::Option, - ) -> Self { - self.identity_link_token = input; - self - } - /// Consumes the builder and constructs a [`CancelGameLinkInput`](crate::input::CancelGameLinkInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::CancelGameLinkInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::CancelGameLinkInput { - identity_link_token: self.identity_link_token, - }) - } - } -} -#[doc(hidden)] -pub type CancelGameLinkInputOperationOutputAlias = crate::operation::CancelGameLink; -#[doc(hidden)] -pub type CancelGameLinkInputOperationRetryAlias = (); -impl CancelGameLinkInput { - /// Consumes the builder and constructs an Operation<[`CancelGameLink`](crate::operation::CancelGameLink)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::CancelGameLinkInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/game-links/cancel").expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::CancelGameLinkInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_cancel_game_link(&self)?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::CancelGameLink::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "CancelGameLink", - "IdentityService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`CancelGameLinkInput`](crate::input::CancelGameLinkInput) - pub fn builder() -> crate::input::cancel_game_link_input::Builder { - crate::input::cancel_game_link_input::Builder::default() - } -} - -/// See [`CompleteGameLinkInput`](crate::input::CompleteGameLinkInput) -pub mod complete_game_link_input { - /// A builder for [`CompleteGameLinkInput`](crate::input::CompleteGameLinkInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity_link_token: std::option::Option, - } - impl Builder { - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn identity_link_token(mut self, input: impl Into) -> Self { - self.identity_link_token = Some(input.into()); - self - } - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn set_identity_link_token( - mut self, - input: std::option::Option, - ) -> Self { - self.identity_link_token = input; - self - } - /// Consumes the builder and constructs a [`CompleteGameLinkInput`](crate::input::CompleteGameLinkInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::CompleteGameLinkInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::CompleteGameLinkInput { - identity_link_token: self.identity_link_token, - }) - } - } -} -#[doc(hidden)] -pub type CompleteGameLinkInputOperationOutputAlias = crate::operation::CompleteGameLink; -#[doc(hidden)] -pub type CompleteGameLinkInputOperationRetryAlias = (); -impl CompleteGameLinkInput { - /// Consumes the builder and constructs an Operation<[`CompleteGameLink`](crate::operation::CompleteGameLink)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::CompleteGameLinkInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/game-links/complete").expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::CompleteGameLinkInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_complete_game_link(&self)?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::CompleteGameLink::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "CompleteGameLink", - "IdentityService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`CompleteGameLinkInput`](crate::input::CompleteGameLinkInput) - pub fn builder() -> crate::input::complete_game_link_input::Builder { - crate::input::complete_game_link_input::Builder::default() - } -} - -/// See [`CompleteIdentityAvatarUploadInput`](crate::input::CompleteIdentityAvatarUploadInput) -pub mod complete_identity_avatar_upload_input { - /// A builder for [`CompleteIdentityAvatarUploadInput`](crate::input::CompleteIdentityAvatarUploadInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) upload_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn upload_id(mut self, input: impl Into) -> Self { - self.upload_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_upload_id(mut self, input: std::option::Option) -> Self { - self.upload_id = input; - self - } - /// Consumes the builder and constructs a [`CompleteIdentityAvatarUploadInput`](crate::input::CompleteIdentityAvatarUploadInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::CompleteIdentityAvatarUploadInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::CompleteIdentityAvatarUploadInput { - upload_id: self.upload_id, - }) - } - } -} -#[doc(hidden)] -pub type CompleteIdentityAvatarUploadInputOperationOutputAlias = - crate::operation::CompleteIdentityAvatarUpload; -#[doc(hidden)] -pub type CompleteIdentityAvatarUploadInputOperationRetryAlias = (); -impl CompleteIdentityAvatarUploadInput { - /// Consumes the builder and constructs an Operation<[`CompleteIdentityAvatarUpload`](crate::operation::CompleteIdentityAvatarUpload)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::CompleteIdentityAvatarUploadInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_1 = &_input.upload_id; - let input_1 = input_1.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "upload_id", - details: "cannot be empty or unset", - }, - )?; - let upload_id = aws_smithy_http::label::fmt_string(input_1, false); - if upload_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "upload_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/identities/avatar-upload/{upload_id}/complete", - upload_id = upload_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::CompleteIdentityAvatarUploadInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from("{}"); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::CompleteIdentityAvatarUpload::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "CompleteIdentityAvatarUpload", - "IdentityService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`CompleteIdentityAvatarUploadInput`](crate::input::CompleteIdentityAvatarUploadInput) - pub fn builder() -> crate::input::complete_identity_avatar_upload_input::Builder { - crate::input::complete_identity_avatar_upload_input::Builder::default() - } -} - -/// See [`FollowIdentityInput`](crate::input::FollowIdentityInput) -pub mod follow_identity_input { - /// A builder for [`FollowIdentityInput`](crate::input::FollowIdentityInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.identity_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.identity_id = input; - self - } - /// Consumes the builder and constructs a [`FollowIdentityInput`](crate::input::FollowIdentityInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::FollowIdentityInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::FollowIdentityInput { - identity_id: self.identity_id, - }) - } - } -} -#[doc(hidden)] -pub type FollowIdentityInputOperationOutputAlias = crate::operation::FollowIdentity; -#[doc(hidden)] -pub type FollowIdentityInputOperationRetryAlias = (); -impl FollowIdentityInput { - /// Consumes the builder and constructs an Operation<[`FollowIdentity`](crate::operation::FollowIdentity)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::FollowIdentityInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_2 = &_input.identity_id; - let input_2 = input_2.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "identity_id", - details: "cannot be empty or unset", - }, - )?; - let identity_id = aws_smithy_http::label::fmt_string(input_2, false); - if identity_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "identity_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/identities/{identity_id}/follow", - identity_id = identity_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::FollowIdentityInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from("{}"); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::FollowIdentity::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "FollowIdentity", - "IdentityService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`FollowIdentityInput`](crate::input::FollowIdentityInput) - pub fn builder() -> crate::input::follow_identity_input::Builder { - crate::input::follow_identity_input::Builder::default() - } -} - -/// See [`GetGameLinkInput`](crate::input::GetGameLinkInput) -pub mod get_game_link_input { - /// A builder for [`GetGameLinkInput`](crate::input::GetGameLinkInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity_link_token: std::option::Option, - pub(crate) watch_index: std::option::Option, - } - impl Builder { - /// `identity_link_token` returned by `PrepareGameLink`. - pub fn identity_link_token(mut self, input: impl Into) -> Self { - self.identity_link_token = Some(input.into()); - self - } - /// `identity_link_token` returned by `PrepareGameLink`. - pub fn set_identity_link_token( - mut self, - input: std::option::Option, - ) -> Self { - self.identity_link_token = input; - self - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.watch_index = Some(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.watch_index = input; - self - } - /// Consumes the builder and constructs a [`GetGameLinkInput`](crate::input::GetGameLinkInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::GetGameLinkInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::GetGameLinkInput { - identity_link_token: self.identity_link_token, - watch_index: self.watch_index, - }) - } - } -} -#[doc(hidden)] -pub type GetGameLinkInputOperationOutputAlias = crate::operation::GetGameLink; -#[doc(hidden)] -pub type GetGameLinkInputOperationRetryAlias = (); -impl GetGameLinkInput { - /// Consumes the builder and constructs an Operation<[`GetGameLink`](crate::operation::GetGameLink)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GetGameLinkInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/game-links").expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::GetGameLinkInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_3) = &_input.identity_link_token { - query.push_kv( - "identity_link_token", - &aws_smithy_http::query::fmt_string(&inner_3), - ); - } - if let Some(inner_4) = &_input.watch_index { - query.push_kv("watch_index", &aws_smithy_http::query::fmt_string(&inner_4)); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GetGameLinkInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::GetGameLink::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GetGameLink", - "IdentityService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GetGameLinkInput`](crate::input::GetGameLinkInput) - pub fn builder() -> crate::input::get_game_link_input::Builder { - crate::input::get_game_link_input::Builder::default() - } -} - -/// See [`GetIdentityHandlesInput`](crate::input::GetIdentityHandlesInput) -pub mod get_identity_handles_input { - /// A builder for [`GetIdentityHandlesInput`](crate::input::GetIdentityHandlesInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity_ids: std::option::Option>, - } - impl Builder { - /// Appends an item to `identity_ids`. - /// - /// To override the contents of this collection use [`set_identity_ids`](Self::set_identity_ids). - /// - /// A list of identity IDs. - pub fn identity_ids(mut self, input: impl Into) -> Self { - let mut v = self.identity_ids.unwrap_or_default(); - v.push(input.into()); - self.identity_ids = Some(v); - self - } - /// A list of identity IDs. - pub fn set_identity_ids( - mut self, - input: std::option::Option>, - ) -> Self { - self.identity_ids = input; - self - } - /// Consumes the builder and constructs a [`GetIdentityHandlesInput`](crate::input::GetIdentityHandlesInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::GetIdentityHandlesInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::GetIdentityHandlesInput { - identity_ids: self.identity_ids, - }) - } - } -} -#[doc(hidden)] -pub type GetIdentityHandlesInputOperationOutputAlias = crate::operation::GetIdentityHandles; -#[doc(hidden)] -pub type GetIdentityHandlesInputOperationRetryAlias = (); -impl GetIdentityHandlesInput { - /// Consumes the builder and constructs an Operation<[`GetIdentityHandles`](crate::operation::GetIdentityHandles)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GetIdentityHandlesInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/identities/batch/handle").expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::GetIdentityHandlesInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_5) = &_input.identity_ids { - for inner_6 in inner_5 { - query.push_kv( - "identity_ids", - &aws_smithy_http::query::fmt_string(&inner_6), - ); - } - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GetIdentityHandlesInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::GetIdentityHandles::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GetIdentityHandles", - "IdentityService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GetIdentityHandlesInput`](crate::input::GetIdentityHandlesInput) - pub fn builder() -> crate::input::get_identity_handles_input::Builder { - crate::input::get_identity_handles_input::Builder::default() - } -} - -/// See [`GetIdentityProfileInput`](crate::input::GetIdentityProfileInput) -pub mod get_identity_profile_input { - /// A builder for [`GetIdentityProfileInput`](crate::input::GetIdentityProfileInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity_id: std::option::Option, - pub(crate) watch_index: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.identity_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.identity_id = input; - self - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.watch_index = Some(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.watch_index = input; - self - } - /// Consumes the builder and constructs a [`GetIdentityProfileInput`](crate::input::GetIdentityProfileInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::GetIdentityProfileInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::GetIdentityProfileInput { - identity_id: self.identity_id, - watch_index: self.watch_index, - }) - } - } -} -#[doc(hidden)] -pub type GetIdentityProfileInputOperationOutputAlias = crate::operation::GetIdentityProfile; -#[doc(hidden)] -pub type GetIdentityProfileInputOperationRetryAlias = (); -impl GetIdentityProfileInput { - /// Consumes the builder and constructs an Operation<[`GetIdentityProfile`](crate::operation::GetIdentityProfile)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GetIdentityProfileInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_7 = &_input.identity_id; - let input_7 = input_7.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "identity_id", - details: "cannot be empty or unset", - }, - )?; - let identity_id = aws_smithy_http::label::fmt_string(input_7, false); - if identity_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "identity_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/identities/{identity_id}/profile", - identity_id = identity_id - ) - .expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::GetIdentityProfileInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_8) = &_input.watch_index { - query.push_kv("watch_index", &aws_smithy_http::query::fmt_string(&inner_8)); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GetIdentityProfileInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::GetIdentityProfile::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GetIdentityProfile", - "IdentityService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GetIdentityProfileInput`](crate::input::GetIdentityProfileInput) - pub fn builder() -> crate::input::get_identity_profile_input::Builder { - crate::input::get_identity_profile_input::Builder::default() - } -} - -/// See [`GetIdentitySelfProfileInput`](crate::input::GetIdentitySelfProfileInput) -pub mod get_identity_self_profile_input { - /// A builder for [`GetIdentitySelfProfileInput`](crate::input::GetIdentitySelfProfileInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) watch_index: std::option::Option, - } - impl Builder { - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.watch_index = Some(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.watch_index = input; - self - } - /// Consumes the builder and constructs a [`GetIdentitySelfProfileInput`](crate::input::GetIdentitySelfProfileInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::GetIdentitySelfProfileInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::GetIdentitySelfProfileInput { - watch_index: self.watch_index, - }) - } - } -} -#[doc(hidden)] -pub type GetIdentitySelfProfileInputOperationOutputAlias = crate::operation::GetIdentitySelfProfile; -#[doc(hidden)] -pub type GetIdentitySelfProfileInputOperationRetryAlias = (); -impl GetIdentitySelfProfileInput { - /// Consumes the builder and constructs an Operation<[`GetIdentitySelfProfile`](crate::operation::GetIdentitySelfProfile)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GetIdentitySelfProfileInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/identities/self/profile").expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::GetIdentitySelfProfileInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_9) = &_input.watch_index { - query.push_kv("watch_index", &aws_smithy_http::query::fmt_string(&inner_9)); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GetIdentitySelfProfileInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::GetIdentitySelfProfile::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GetIdentitySelfProfile", - "IdentityService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GetIdentitySelfProfileInput`](crate::input::GetIdentitySelfProfileInput) - pub fn builder() -> crate::input::get_identity_self_profile_input::Builder { - crate::input::get_identity_self_profile_input::Builder::default() - } -} - -/// See [`GetIdentitySummariesInput`](crate::input::GetIdentitySummariesInput) -pub mod get_identity_summaries_input { - /// A builder for [`GetIdentitySummariesInput`](crate::input::GetIdentitySummariesInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity_ids: std::option::Option>, - } - impl Builder { - /// Appends an item to `identity_ids`. - /// - /// To override the contents of this collection use [`set_identity_ids`](Self::set_identity_ids). - /// - /// A list of identity IDs. - pub fn identity_ids(mut self, input: impl Into) -> Self { - let mut v = self.identity_ids.unwrap_or_default(); - v.push(input.into()); - self.identity_ids = Some(v); - self - } - /// A list of identity IDs. - pub fn set_identity_ids( - mut self, - input: std::option::Option>, - ) -> Self { - self.identity_ids = input; - self - } - /// Consumes the builder and constructs a [`GetIdentitySummariesInput`](crate::input::GetIdentitySummariesInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::GetIdentitySummariesInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::GetIdentitySummariesInput { - identity_ids: self.identity_ids, - }) - } - } -} -#[doc(hidden)] -pub type GetIdentitySummariesInputOperationOutputAlias = crate::operation::GetIdentitySummaries; -#[doc(hidden)] -pub type GetIdentitySummariesInputOperationRetryAlias = (); -impl GetIdentitySummariesInput { - /// Consumes the builder and constructs an Operation<[`GetIdentitySummaries`](crate::operation::GetIdentitySummaries)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GetIdentitySummariesInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/identities/batch/summary").expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::GetIdentitySummariesInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_10) = &_input.identity_ids { - for inner_11 in inner_10 { - query.push_kv( - "identity_ids", - &aws_smithy_http::query::fmt_string(&inner_11), - ); - } - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GetIdentitySummariesInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::GetIdentitySummaries::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GetIdentitySummaries", - "IdentityService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GetIdentitySummariesInput`](crate::input::GetIdentitySummariesInput) - pub fn builder() -> crate::input::get_identity_summaries_input::Builder { - crate::input::get_identity_summaries_input::Builder::default() - } -} - -/// See [`ListActivitiesInput`](crate::input::ListActivitiesInput) -pub mod list_activities_input { - /// A builder for [`ListActivitiesInput`](crate::input::ListActivitiesInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) watch_index: std::option::Option, - } - impl Builder { - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.watch_index = Some(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.watch_index = input; - self - } - /// Consumes the builder and constructs a [`ListActivitiesInput`](crate::input::ListActivitiesInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::ListActivitiesInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::ListActivitiesInput { - watch_index: self.watch_index, - }) - } - } -} -#[doc(hidden)] -pub type ListActivitiesInputOperationOutputAlias = crate::operation::ListActivities; -#[doc(hidden)] -pub type ListActivitiesInputOperationRetryAlias = (); -impl ListActivitiesInput { - /// Consumes the builder and constructs an Operation<[`ListActivities`](crate::operation::ListActivities)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::ListActivitiesInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/activities").expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::ListActivitiesInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_12) = &_input.watch_index { - query.push_kv( - "watch_index", - &aws_smithy_http::query::fmt_string(&inner_12), - ); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::ListActivitiesInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::ListActivities::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "ListActivities", - "IdentityService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`ListActivitiesInput`](crate::input::ListActivitiesInput) - pub fn builder() -> crate::input::list_activities_input::Builder { - crate::input::list_activities_input::Builder::default() - } -} - -/// See [`ListFollowersInput`](crate::input::ListFollowersInput) -pub mod list_followers_input { - /// A builder for [`ListFollowersInput`](crate::input::ListFollowersInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity_id: std::option::Option, - pub(crate) anchor: std::option::Option, - pub(crate) count: std::option::Option, - pub(crate) watch_index: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.identity_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.identity_id = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn anchor(mut self, input: impl Into) -> Self { - self.anchor = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_anchor(mut self, input: std::option::Option) -> Self { - self.anchor = input; - self - } - /// Unsigned 32 bit integer. - pub fn count(mut self, input: i32) -> Self { - self.count = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_count(mut self, input: std::option::Option) -> Self { - self.count = input; - self - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.watch_index = Some(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.watch_index = input; - self - } - /// Consumes the builder and constructs a [`ListFollowersInput`](crate::input::ListFollowersInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::ListFollowersInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::ListFollowersInput { - identity_id: self.identity_id, - anchor: self.anchor, - count: self.count, - watch_index: self.watch_index, - }) - } - } -} -#[doc(hidden)] -pub type ListFollowersInputOperationOutputAlias = crate::operation::ListFollowers; -#[doc(hidden)] -pub type ListFollowersInputOperationRetryAlias = (); -impl ListFollowersInput { - /// Consumes the builder and constructs an Operation<[`ListFollowers`](crate::operation::ListFollowers)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::ListFollowersInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_13 = &_input.identity_id; - let input_13 = input_13.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "identity_id", - details: "cannot be empty or unset", - }, - )?; - let identity_id = aws_smithy_http::label::fmt_string(input_13, false); - if identity_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "identity_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/identities/{identity_id}/followers", - identity_id = identity_id - ) - .expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::ListFollowersInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_14) = &_input.anchor { - query.push_kv("anchor", &aws_smithy_http::query::fmt_string(&inner_14)); - } - if let Some(inner_15) = &_input.count { - query.push_kv( - "count", - aws_smithy_types::primitive::Encoder::from(*inner_15).encode(), - ); - } - if let Some(inner_16) = &_input.watch_index { - query.push_kv( - "watch_index", - &aws_smithy_http::query::fmt_string(&inner_16), - ); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::ListFollowersInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::ListFollowers::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "ListFollowers", - "IdentityService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`ListFollowersInput`](crate::input::ListFollowersInput) - pub fn builder() -> crate::input::list_followers_input::Builder { - crate::input::list_followers_input::Builder::default() - } -} - -/// See [`ListFollowingInput`](crate::input::ListFollowingInput) -pub mod list_following_input { - /// A builder for [`ListFollowingInput`](crate::input::ListFollowingInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity_id: std::option::Option, - pub(crate) anchor: std::option::Option, - pub(crate) count: std::option::Option, - pub(crate) watch_index: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.identity_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.identity_id = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn anchor(mut self, input: impl Into) -> Self { - self.anchor = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_anchor(mut self, input: std::option::Option) -> Self { - self.anchor = input; - self - } - /// Unsigned 32 bit integer. - pub fn count(mut self, input: i32) -> Self { - self.count = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_count(mut self, input: std::option::Option) -> Self { - self.count = input; - self - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.watch_index = Some(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.watch_index = input; - self - } - /// Consumes the builder and constructs a [`ListFollowingInput`](crate::input::ListFollowingInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::ListFollowingInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::ListFollowingInput { - identity_id: self.identity_id, - anchor: self.anchor, - count: self.count, - watch_index: self.watch_index, - }) - } - } -} -#[doc(hidden)] -pub type ListFollowingInputOperationOutputAlias = crate::operation::ListFollowing; -#[doc(hidden)] -pub type ListFollowingInputOperationRetryAlias = (); -impl ListFollowingInput { - /// Consumes the builder and constructs an Operation<[`ListFollowing`](crate::operation::ListFollowing)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::ListFollowingInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_17 = &_input.identity_id; - let input_17 = input_17.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "identity_id", - details: "cannot be empty or unset", - }, - )?; - let identity_id = aws_smithy_http::label::fmt_string(input_17, false); - if identity_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "identity_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/identities/{identity_id}/following", - identity_id = identity_id - ) - .expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::ListFollowingInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_18) = &_input.anchor { - query.push_kv("anchor", &aws_smithy_http::query::fmt_string(&inner_18)); - } - if let Some(inner_19) = &_input.count { - query.push_kv( - "count", - aws_smithy_types::primitive::Encoder::from(*inner_19).encode(), - ); - } - if let Some(inner_20) = &_input.watch_index { - query.push_kv( - "watch_index", - &aws_smithy_http::query::fmt_string(&inner_20), - ); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::ListFollowingInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::ListFollowing::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "ListFollowing", - "IdentityService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`ListFollowingInput`](crate::input::ListFollowingInput) - pub fn builder() -> crate::input::list_following_input::Builder { - crate::input::list_following_input::Builder::default() - } -} - -/// See [`ListFriendsInput`](crate::input::ListFriendsInput) -pub mod list_friends_input { - /// A builder for [`ListFriendsInput`](crate::input::ListFriendsInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) anchor: std::option::Option, - pub(crate) count: std::option::Option, - pub(crate) watch_index: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn anchor(mut self, input: impl Into) -> Self { - self.anchor = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_anchor(mut self, input: std::option::Option) -> Self { - self.anchor = input; - self - } - /// Unsigned 32 bit integer. - pub fn count(mut self, input: i32) -> Self { - self.count = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_count(mut self, input: std::option::Option) -> Self { - self.count = input; - self - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.watch_index = Some(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.watch_index = input; - self - } - /// Consumes the builder and constructs a [`ListFriendsInput`](crate::input::ListFriendsInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::ListFriendsInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::ListFriendsInput { - anchor: self.anchor, - count: self.count, - watch_index: self.watch_index, - }) - } - } -} -#[doc(hidden)] -pub type ListFriendsInputOperationOutputAlias = crate::operation::ListFriends; -#[doc(hidden)] -pub type ListFriendsInputOperationRetryAlias = (); -impl ListFriendsInput { - /// Consumes the builder and constructs an Operation<[`ListFriends`](crate::operation::ListFriends)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::ListFriendsInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/identities/self/friends").expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::ListFriendsInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_21) = &_input.anchor { - query.push_kv("anchor", &aws_smithy_http::query::fmt_string(&inner_21)); - } - if let Some(inner_22) = &_input.count { - query.push_kv( - "count", - aws_smithy_types::primitive::Encoder::from(*inner_22).encode(), - ); - } - if let Some(inner_23) = &_input.watch_index { - query.push_kv( - "watch_index", - &aws_smithy_http::query::fmt_string(&inner_23), - ); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::ListFriendsInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::ListFriends::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "ListFriends", - "IdentityService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`ListFriendsInput`](crate::input::ListFriendsInput) - pub fn builder() -> crate::input::list_friends_input::Builder { - crate::input::list_friends_input::Builder::default() - } -} - -/// See [`ListMutualFriendsInput`](crate::input::ListMutualFriendsInput) -pub mod list_mutual_friends_input { - /// A builder for [`ListMutualFriendsInput`](crate::input::ListMutualFriendsInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity_id: std::option::Option, - pub(crate) anchor: std::option::Option, - pub(crate) count: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.identity_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.identity_id = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn anchor(mut self, input: impl Into) -> Self { - self.anchor = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_anchor(mut self, input: std::option::Option) -> Self { - self.anchor = input; - self - } - /// Unsigned 32 bit integer. - pub fn count(mut self, input: i32) -> Self { - self.count = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_count(mut self, input: std::option::Option) -> Self { - self.count = input; - self - } - /// Consumes the builder and constructs a [`ListMutualFriendsInput`](crate::input::ListMutualFriendsInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::ListMutualFriendsInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::ListMutualFriendsInput { - identity_id: self.identity_id, - anchor: self.anchor, - count: self.count, - }) - } - } -} -#[doc(hidden)] -pub type ListMutualFriendsInputOperationOutputAlias = crate::operation::ListMutualFriends; -#[doc(hidden)] -pub type ListMutualFriendsInputOperationRetryAlias = (); -impl ListMutualFriendsInput { - /// Consumes the builder and constructs an Operation<[`ListMutualFriends`](crate::operation::ListMutualFriends)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::ListMutualFriendsInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_24 = &_input.identity_id; - let input_24 = input_24.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "identity_id", - details: "cannot be empty or unset", - }, - )?; - let identity_id = aws_smithy_http::label::fmt_string(input_24, false); - if identity_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "identity_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/identities/{identity_id}/mutual-friends", - identity_id = identity_id - ) - .expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::ListMutualFriendsInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_25) = &_input.anchor { - query.push_kv("anchor", &aws_smithy_http::query::fmt_string(&inner_25)); - } - if let Some(inner_26) = &_input.count { - query.push_kv( - "count", - aws_smithy_types::primitive::Encoder::from(*inner_26).encode(), - ); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::ListMutualFriendsInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::ListMutualFriends::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "ListMutualFriends", - "IdentityService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`ListMutualFriendsInput`](crate::input::ListMutualFriendsInput) - pub fn builder() -> crate::input::list_mutual_friends_input::Builder { - crate::input::list_mutual_friends_input::Builder::default() - } -} - -/// See [`ListRecentFollowersInput`](crate::input::ListRecentFollowersInput) -pub mod list_recent_followers_input { - /// A builder for [`ListRecentFollowersInput`](crate::input::ListRecentFollowersInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) anchor: std::option::Option, - pub(crate) count: std::option::Option, - pub(crate) watch_index: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn anchor(mut self, input: impl Into) -> Self { - self.anchor = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_anchor(mut self, input: std::option::Option) -> Self { - self.anchor = input; - self - } - /// Unsigned 32 bit integer. - pub fn count(mut self, input: i32) -> Self { - self.count = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_count(mut self, input: std::option::Option) -> Self { - self.count = input; - self - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.watch_index = Some(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.watch_index = input; - self - } - /// Consumes the builder and constructs a [`ListRecentFollowersInput`](crate::input::ListRecentFollowersInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::ListRecentFollowersInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::ListRecentFollowersInput { - anchor: self.anchor, - count: self.count, - watch_index: self.watch_index, - }) - } - } -} -#[doc(hidden)] -pub type ListRecentFollowersInputOperationOutputAlias = crate::operation::ListRecentFollowers; -#[doc(hidden)] -pub type ListRecentFollowersInputOperationRetryAlias = (); -impl ListRecentFollowersInput { - /// Consumes the builder and constructs an Operation<[`ListRecentFollowers`](crate::operation::ListRecentFollowers)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::ListRecentFollowersInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/identities/self/recent-followers") - .expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::ListRecentFollowersInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_27) = &_input.anchor { - query.push_kv("anchor", &aws_smithy_http::query::fmt_string(&inner_27)); - } - if let Some(inner_28) = &_input.count { - query.push_kv( - "count", - aws_smithy_types::primitive::Encoder::from(*inner_28).encode(), - ); - } - if let Some(inner_29) = &_input.watch_index { - query.push_kv( - "watch_index", - &aws_smithy_http::query::fmt_string(&inner_29), - ); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::ListRecentFollowersInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::ListRecentFollowers::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "ListRecentFollowers", - "IdentityService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`ListRecentFollowersInput`](crate::input::ListRecentFollowersInput) - pub fn builder() -> crate::input::list_recent_followers_input::Builder { - crate::input::list_recent_followers_input::Builder::default() - } -} - -/// See [`MarkDeletionInput`](crate::input::MarkDeletionInput) -pub mod mark_deletion_input { - /// A builder for [`MarkDeletionInput`](crate::input::MarkDeletionInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`MarkDeletionInput`](crate::input::MarkDeletionInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::MarkDeletionInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::MarkDeletionInput {}) - } - } -} -#[doc(hidden)] -pub type MarkDeletionInputOperationOutputAlias = crate::operation::MarkDeletion; -#[doc(hidden)] -pub type MarkDeletionInputOperationRetryAlias = (); -impl MarkDeletionInput { - /// Consumes the builder and constructs an Operation<[`MarkDeletion`](crate::operation::MarkDeletion)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::MarkDeletionInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/identities/self/delete-request") - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::MarkDeletionInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from("{}"); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::MarkDeletion::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "MarkDeletion", - "IdentityService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`MarkDeletionInput`](crate::input::MarkDeletionInput) - pub fn builder() -> crate::input::mark_deletion_input::Builder { - crate::input::mark_deletion_input::Builder::default() - } -} - -/// See [`PrepareGameLinkInput`](crate::input::PrepareGameLinkInput) -pub mod prepare_game_link_input { - /// A builder for [`PrepareGameLinkInput`](crate::input::PrepareGameLinkInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`PrepareGameLinkInput`](crate::input::PrepareGameLinkInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::PrepareGameLinkInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::PrepareGameLinkInput {}) - } - } -} -#[doc(hidden)] -pub type PrepareGameLinkInputOperationOutputAlias = crate::operation::PrepareGameLink; -#[doc(hidden)] -pub type PrepareGameLinkInputOperationRetryAlias = (); -impl PrepareGameLinkInput { - /// Consumes the builder and constructs an Operation<[`PrepareGameLink`](crate::operation::PrepareGameLink)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::PrepareGameLinkInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/game-links").expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::PrepareGameLinkInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from("{}"); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::PrepareGameLink::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "PrepareGameLink", - "IdentityService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`PrepareGameLinkInput`](crate::input::PrepareGameLinkInput) - pub fn builder() -> crate::input::prepare_game_link_input::Builder { - crate::input::prepare_game_link_input::Builder::default() - } -} - -/// See [`PrepareIdentityAvatarUploadInput`](crate::input::PrepareIdentityAvatarUploadInput) -pub mod prepare_identity_avatar_upload_input { - /// A builder for [`PrepareIdentityAvatarUploadInput`](crate::input::PrepareIdentityAvatarUploadInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) path: std::option::Option, - pub(crate) mime: std::option::Option, - pub(crate) content_length: std::option::Option, - } - impl Builder { - /// The path/filename of the identity avatar. - pub fn path(mut self, input: impl Into) -> Self { - self.path = Some(input.into()); - self - } - /// The path/filename of the identity avatar. - pub fn set_path(mut self, input: std::option::Option) -> Self { - self.path = input; - self - } - /// The MIME type of the identity avatar. - pub fn mime(mut self, input: impl Into) -> Self { - self.mime = Some(input.into()); - self - } - /// The MIME type of the identity avatar. - pub fn set_mime(mut self, input: std::option::Option) -> Self { - self.mime = input; - self - } - /// Unsigned 64 bit integer. - pub fn content_length(mut self, input: i64) -> Self { - self.content_length = Some(input); - self - } - /// Unsigned 64 bit integer. - pub fn set_content_length(mut self, input: std::option::Option) -> Self { - self.content_length = input; - self - } - /// Consumes the builder and constructs a [`PrepareIdentityAvatarUploadInput`](crate::input::PrepareIdentityAvatarUploadInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::PrepareIdentityAvatarUploadInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::PrepareIdentityAvatarUploadInput { - path: self.path, - mime: self.mime, - content_length: self.content_length, - }) - } - } -} -#[doc(hidden)] -pub type PrepareIdentityAvatarUploadInputOperationOutputAlias = - crate::operation::PrepareIdentityAvatarUpload; -#[doc(hidden)] -pub type PrepareIdentityAvatarUploadInputOperationRetryAlias = (); -impl PrepareIdentityAvatarUploadInput { - /// Consumes the builder and constructs an Operation<[`PrepareIdentityAvatarUpload`](crate::operation::PrepareIdentityAvatarUpload)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::PrepareIdentityAvatarUploadInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/identities/avatar-upload/prepare") - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::PrepareIdentityAvatarUploadInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)]let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_prepare_identity_avatar_upload(&self)? - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::PrepareIdentityAvatarUpload::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "PrepareIdentityAvatarUpload", - "IdentityService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`PrepareIdentityAvatarUploadInput`](crate::input::PrepareIdentityAvatarUploadInput) - pub fn builder() -> crate::input::prepare_identity_avatar_upload_input::Builder { - crate::input::prepare_identity_avatar_upload_input::Builder::default() - } -} - -/// See [`RecentFollowerIgnoreInput`](crate::input::RecentFollowerIgnoreInput) -pub mod recent_follower_ignore_input { - /// A builder for [`RecentFollowerIgnoreInput`](crate::input::RecentFollowerIgnoreInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.identity_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.identity_id = input; - self - } - /// Consumes the builder and constructs a [`RecentFollowerIgnoreInput`](crate::input::RecentFollowerIgnoreInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::RecentFollowerIgnoreInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::RecentFollowerIgnoreInput { - identity_id: self.identity_id, - }) - } - } -} -#[doc(hidden)] -pub type RecentFollowerIgnoreInputOperationOutputAlias = crate::operation::RecentFollowerIgnore; -#[doc(hidden)] -pub type RecentFollowerIgnoreInputOperationRetryAlias = (); -impl RecentFollowerIgnoreInput { - /// Consumes the builder and constructs an Operation<[`RecentFollowerIgnore`](crate::operation::RecentFollowerIgnore)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::RecentFollowerIgnoreInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_30 = &_input.identity_id; - let input_30 = input_30.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "identity_id", - details: "cannot be empty or unset", - }, - )?; - let identity_id = aws_smithy_http::label::fmt_string(input_30, false); - if identity_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "identity_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/identities/self/recent-followers/{identity_id}/ignore", - identity_id = identity_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::RecentFollowerIgnoreInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from("{}"); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::RecentFollowerIgnore::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "RecentFollowerIgnore", - "IdentityService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`RecentFollowerIgnoreInput`](crate::input::RecentFollowerIgnoreInput) - pub fn builder() -> crate::input::recent_follower_ignore_input::Builder { - crate::input::recent_follower_ignore_input::Builder::default() - } -} - -/// See [`RemoveIdentityGameActivityInput`](crate::input::RemoveIdentityGameActivityInput) -pub mod remove_identity_game_activity_input { - /// A builder for [`RemoveIdentityGameActivityInput`](crate::input::RemoveIdentityGameActivityInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`RemoveIdentityGameActivityInput`](crate::input::RemoveIdentityGameActivityInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::RemoveIdentityGameActivityInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::RemoveIdentityGameActivityInput {}) - } - } -} -#[doc(hidden)] -pub type RemoveIdentityGameActivityInputOperationOutputAlias = - crate::operation::RemoveIdentityGameActivity; -#[doc(hidden)] -pub type RemoveIdentityGameActivityInputOperationRetryAlias = (); -impl RemoveIdentityGameActivityInput { - /// Consumes the builder and constructs an Operation<[`RemoveIdentityGameActivity`](crate::operation::RemoveIdentityGameActivity)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::RemoveIdentityGameActivityInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/identities/self/activity").expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::RemoveIdentityGameActivityInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("DELETE").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::RemoveIdentityGameActivity::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "RemoveIdentityGameActivity", - "IdentityService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`RemoveIdentityGameActivityInput`](crate::input::RemoveIdentityGameActivityInput) - pub fn builder() -> crate::input::remove_identity_game_activity_input::Builder { - crate::input::remove_identity_game_activity_input::Builder::default() - } -} - -/// See [`ReportIdentityInput`](crate::input::ReportIdentityInput) -pub mod report_identity_input { - /// A builder for [`ReportIdentityInput`](crate::input::ReportIdentityInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity_id: std::option::Option, - pub(crate) reason: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.identity_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.identity_id = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn reason(mut self, input: impl Into) -> Self { - self.reason = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_reason(mut self, input: std::option::Option) -> Self { - self.reason = input; - self - } - /// Consumes the builder and constructs a [`ReportIdentityInput`](crate::input::ReportIdentityInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::ReportIdentityInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::ReportIdentityInput { - identity_id: self.identity_id, - reason: self.reason, - }) - } - } -} -#[doc(hidden)] -pub type ReportIdentityInputOperationOutputAlias = crate::operation::ReportIdentity; -#[doc(hidden)] -pub type ReportIdentityInputOperationRetryAlias = (); -impl ReportIdentityInput { - /// Consumes the builder and constructs an Operation<[`ReportIdentity`](crate::operation::ReportIdentity)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::ReportIdentityInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_31 = &_input.identity_id; - let input_31 = input_31.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "identity_id", - details: "cannot be empty or unset", - }, - )?; - let identity_id = aws_smithy_http::label::fmt_string(input_31, false); - if identity_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "identity_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/identities/{identity_id}/report", - identity_id = identity_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::ReportIdentityInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_report_identity(&self)?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::ReportIdentity::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "ReportIdentity", - "IdentityService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`ReportIdentityInput`](crate::input::ReportIdentityInput) - pub fn builder() -> crate::input::report_identity_input::Builder { - crate::input::report_identity_input::Builder::default() - } -} - -/// See [`SearchIdentitiesInput`](crate::input::SearchIdentitiesInput) -pub mod search_identities_input { - /// A builder for [`SearchIdentitiesInput`](crate::input::SearchIdentitiesInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) query: std::option::Option, - pub(crate) anchor: std::option::Option, - pub(crate) limit: std::option::Option, - } - impl Builder { - /// The query to match identity display names and account numbers against. - pub fn query(mut self, input: impl Into) -> Self { - self.query = Some(input.into()); - self - } - /// The query to match identity display names and account numbers against. - pub fn set_query(mut self, input: std::option::Option) -> Self { - self.query = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn anchor(mut self, input: impl Into) -> Self { - self.anchor = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_anchor(mut self, input: std::option::Option) -> Self { - self.anchor = input; - self - } - /// Unsigned 32 bit integer. - pub fn limit(mut self, input: i32) -> Self { - self.limit = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_limit(mut self, input: std::option::Option) -> Self { - self.limit = input; - self - } - /// Consumes the builder and constructs a [`SearchIdentitiesInput`](crate::input::SearchIdentitiesInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::SearchIdentitiesInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::SearchIdentitiesInput { - query: self.query, - anchor: self.anchor, - limit: self.limit, - }) - } - } -} -#[doc(hidden)] -pub type SearchIdentitiesInputOperationOutputAlias = crate::operation::SearchIdentities; -#[doc(hidden)] -pub type SearchIdentitiesInputOperationRetryAlias = (); -impl SearchIdentitiesInput { - /// Consumes the builder and constructs an Operation<[`SearchIdentities`](crate::operation::SearchIdentities)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::SearchIdentitiesInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/identities/search").expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::SearchIdentitiesInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_32) = &_input.query { - query.push_kv("query", &aws_smithy_http::query::fmt_string(&inner_32)); - } - if let Some(inner_33) = &_input.anchor { - query.push_kv("anchor", &aws_smithy_http::query::fmt_string(&inner_33)); - } - if let Some(inner_34) = &_input.limit { - query.push_kv( - "limit", - aws_smithy_types::primitive::Encoder::from(*inner_34).encode(), - ); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::SearchIdentitiesInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::SearchIdentities::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "SearchIdentities", - "IdentityService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`SearchIdentitiesInput`](crate::input::SearchIdentitiesInput) - pub fn builder() -> crate::input::search_identities_input::Builder { - crate::input::search_identities_input::Builder::default() - } -} - -/// See [`SetIdentityGameActivityInput`](crate::input::SetIdentityGameActivityInput) -pub mod set_identity_game_activity_input { - /// A builder for [`SetIdentityGameActivityInput`](crate::input::SetIdentityGameActivityInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_activity: std::option::Option, - } - impl Builder { - /// Information about the identity's current game. This is information that all other identities can see about what the current identity is doing. - pub fn game_activity(mut self, input: crate::model::UpdateIdentityGameActivity) -> Self { - self.game_activity = Some(input); - self - } - /// Information about the identity's current game. This is information that all other identities can see about what the current identity is doing. - pub fn set_game_activity( - mut self, - input: std::option::Option, - ) -> Self { - self.game_activity = input; - self - } - /// Consumes the builder and constructs a [`SetIdentityGameActivityInput`](crate::input::SetIdentityGameActivityInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::SetIdentityGameActivityInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::SetIdentityGameActivityInput { - game_activity: self.game_activity, - }) - } - } -} -#[doc(hidden)] -pub type SetIdentityGameActivityInputOperationOutputAlias = - crate::operation::SetIdentityGameActivity; -#[doc(hidden)] -pub type SetIdentityGameActivityInputOperationRetryAlias = (); -impl SetIdentityGameActivityInput { - /// Consumes the builder and constructs an Operation<[`SetIdentityGameActivity`](crate::operation::SetIdentityGameActivity)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::SetIdentityGameActivityInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/identities/self/activity").expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::SetIdentityGameActivityInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_set_identity_game_activity( - &self, - )?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::SetIdentityGameActivity::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "SetIdentityGameActivity", - "IdentityService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`SetIdentityGameActivityInput`](crate::input::SetIdentityGameActivityInput) - pub fn builder() -> crate::input::set_identity_game_activity_input::Builder { - crate::input::set_identity_game_activity_input::Builder::default() - } -} - -/// See [`SetupIdentityInput`](crate::input::SetupIdentityInput) -pub mod setup_identity_input { - /// A builder for [`SetupIdentityInput`](crate::input::SetupIdentityInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) existing_identity_token: std::option::Option, - } - impl Builder { - /// Token returned from previous call to `rivet.api.identity#SetupIdentity`. If this token is invalid, a new identity will be returned. - pub fn existing_identity_token(mut self, input: impl Into) -> Self { - self.existing_identity_token = Some(input.into()); - self - } - /// Token returned from previous call to `rivet.api.identity#SetupIdentity`. If this token is invalid, a new identity will be returned. - pub fn set_existing_identity_token( - mut self, - input: std::option::Option, - ) -> Self { - self.existing_identity_token = input; - self - } - /// Consumes the builder and constructs a [`SetupIdentityInput`](crate::input::SetupIdentityInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::SetupIdentityInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::SetupIdentityInput { - existing_identity_token: self.existing_identity_token, - }) - } - } -} -#[doc(hidden)] -pub type SetupIdentityInputOperationOutputAlias = crate::operation::SetupIdentity; -#[doc(hidden)] -pub type SetupIdentityInputOperationRetryAlias = (); -impl SetupIdentityInput { - /// Consumes the builder and constructs an Operation<[`SetupIdentity`](crate::operation::SetupIdentity)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::SetupIdentityInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/identities").expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::SetupIdentityInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_setup_identity(&self)?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::SetupIdentity::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "SetupIdentity", - "IdentityService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`SetupIdentityInput`](crate::input::SetupIdentityInput) - pub fn builder() -> crate::input::setup_identity_input::Builder { - crate::input::setup_identity_input::Builder::default() - } -} - -/// See [`SignupForBetaInput`](crate::input::SignupForBetaInput) -pub mod signup_for_beta_input { - /// A builder for [`SignupForBetaInput`](crate::input::SignupForBetaInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) name: std::option::Option, - pub(crate) company_name: std::option::Option, - pub(crate) company_size: std::option::Option, - pub(crate) preferred_tools: std::option::Option, - pub(crate) goals: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn name(mut self, input: impl Into) -> Self { - self.name = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_name(mut self, input: std::option::Option) -> Self { - self.name = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn company_name(mut self, input: impl Into) -> Self { - self.company_name = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_company_name(mut self, input: std::option::Option) -> Self { - self.company_name = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn company_size(mut self, input: impl Into) -> Self { - self.company_size = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_company_size(mut self, input: std::option::Option) -> Self { - self.company_size = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn preferred_tools(mut self, input: impl Into) -> Self { - self.preferred_tools = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_preferred_tools( - mut self, - input: std::option::Option, - ) -> Self { - self.preferred_tools = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn goals(mut self, input: impl Into) -> Self { - self.goals = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_goals(mut self, input: std::option::Option) -> Self { - self.goals = input; - self - } - /// Consumes the builder and constructs a [`SignupForBetaInput`](crate::input::SignupForBetaInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::SignupForBetaInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::SignupForBetaInput { - name: self.name, - company_name: self.company_name, - company_size: self.company_size, - preferred_tools: self.preferred_tools, - goals: self.goals, - }) - } - } -} -#[doc(hidden)] -pub type SignupForBetaInputOperationOutputAlias = crate::operation::SignupForBeta; -#[doc(hidden)] -pub type SignupForBetaInputOperationRetryAlias = (); -impl SignupForBetaInput { - /// Consumes the builder and constructs an Operation<[`SignupForBeta`](crate::operation::SignupForBeta)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::SignupForBetaInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/identities/self/beta-signup").expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::SignupForBetaInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_signup_for_beta(&self)?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::SignupForBeta::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "SignupForBeta", - "IdentityService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`SignupForBetaInput`](crate::input::SignupForBetaInput) - pub fn builder() -> crate::input::signup_for_beta_input::Builder { - crate::input::signup_for_beta_input::Builder::default() - } -} - -/// See [`UnfollowIdentityInput`](crate::input::UnfollowIdentityInput) -pub mod unfollow_identity_input { - /// A builder for [`UnfollowIdentityInput`](crate::input::UnfollowIdentityInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.identity_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.identity_id = input; - self - } - /// Consumes the builder and constructs a [`UnfollowIdentityInput`](crate::input::UnfollowIdentityInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::UnfollowIdentityInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::UnfollowIdentityInput { - identity_id: self.identity_id, - }) - } - } -} -#[doc(hidden)] -pub type UnfollowIdentityInputOperationOutputAlias = crate::operation::UnfollowIdentity; -#[doc(hidden)] -pub type UnfollowIdentityInputOperationRetryAlias = (); -impl UnfollowIdentityInput { - /// Consumes the builder and constructs an Operation<[`UnfollowIdentity`](crate::operation::UnfollowIdentity)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::UnfollowIdentityInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_35 = &_input.identity_id; - let input_35 = input_35.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "identity_id", - details: "cannot be empty or unset", - }, - )?; - let identity_id = aws_smithy_http::label::fmt_string(input_35, false); - if identity_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "identity_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/identities/{identity_id}/follow", - identity_id = identity_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::UnfollowIdentityInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("DELETE").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::UnfollowIdentity::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "UnfollowIdentity", - "IdentityService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`UnfollowIdentityInput`](crate::input::UnfollowIdentityInput) - pub fn builder() -> crate::input::unfollow_identity_input::Builder { - crate::input::unfollow_identity_input::Builder::default() - } -} - -/// See [`UnmarkDeletionInput`](crate::input::UnmarkDeletionInput) -pub mod unmark_deletion_input { - /// A builder for [`UnmarkDeletionInput`](crate::input::UnmarkDeletionInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`UnmarkDeletionInput`](crate::input::UnmarkDeletionInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::UnmarkDeletionInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::UnmarkDeletionInput {}) - } - } -} -#[doc(hidden)] -pub type UnmarkDeletionInputOperationOutputAlias = crate::operation::UnmarkDeletion; -#[doc(hidden)] -pub type UnmarkDeletionInputOperationRetryAlias = (); -impl UnmarkDeletionInput { - /// Consumes the builder and constructs an Operation<[`UnmarkDeletion`](crate::operation::UnmarkDeletion)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::UnmarkDeletionInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/identities/self/delete-request") - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::UnmarkDeletionInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("DELETE").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::UnmarkDeletion::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "UnmarkDeletion", - "IdentityService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`UnmarkDeletionInput`](crate::input::UnmarkDeletionInput) - pub fn builder() -> crate::input::unmark_deletion_input::Builder { - crate::input::unmark_deletion_input::Builder::default() - } -} - -/// See [`UpdateIdentityProfileInput`](crate::input::UpdateIdentityProfileInput) -pub mod update_identity_profile_input { - /// A builder for [`UpdateIdentityProfileInput`](crate::input::UpdateIdentityProfileInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) display_name: std::option::Option, - pub(crate) account_number: std::option::Option, - pub(crate) bio: std::option::Option, - } - impl Builder { - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub fn account_number(mut self, input: i32) -> Self { - self.account_number = Some(input); - self - } - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub fn set_account_number(mut self, input: std::option::Option) -> Self { - self.account_number = input; - self - } - /// Detailed information about a profile. - pub fn bio(mut self, input: impl Into) -> Self { - self.bio = Some(input.into()); - self - } - /// Detailed information about a profile. - pub fn set_bio(mut self, input: std::option::Option) -> Self { - self.bio = input; - self - } - /// Consumes the builder and constructs a [`UpdateIdentityProfileInput`](crate::input::UpdateIdentityProfileInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::UpdateIdentityProfileInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::UpdateIdentityProfileInput { - display_name: self.display_name, - account_number: self.account_number, - bio: self.bio, - }) - } - } -} -#[doc(hidden)] -pub type UpdateIdentityProfileInputOperationOutputAlias = crate::operation::UpdateIdentityProfile; -#[doc(hidden)] -pub type UpdateIdentityProfileInputOperationRetryAlias = (); -impl UpdateIdentityProfileInput { - /// Consumes the builder and constructs an Operation<[`UpdateIdentityProfile`](crate::operation::UpdateIdentityProfile)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::UpdateIdentityProfileInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/identities/self/profile").expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::UpdateIdentityProfileInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_update_identity_profile( - &self, - )?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::UpdateIdentityProfile::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "UpdateIdentityProfile", - "IdentityService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`UpdateIdentityProfileInput`](crate::input::UpdateIdentityProfileInput) - pub fn builder() -> crate::input::update_identity_profile_input::Builder { - crate::input::update_identity_profile_input::Builder::default() - } -} - -/// See [`UpdateIdentityStatusInput`](crate::input::UpdateIdentityStatusInput) -pub mod update_identity_status_input { - /// A builder for [`UpdateIdentityStatusInput`](crate::input::UpdateIdentityStatusInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) status: std::option::Option, - } - impl Builder { - /// The current status of an identity. This helps players understand if another player is currently playing or has their game in the background. - pub fn status(mut self, input: crate::model::IdentityStatus) -> Self { - self.status = Some(input); - self - } - /// The current status of an identity. This helps players understand if another player is currently playing or has their game in the background. - pub fn set_status( - mut self, - input: std::option::Option, - ) -> Self { - self.status = input; - self - } - /// Consumes the builder and constructs a [`UpdateIdentityStatusInput`](crate::input::UpdateIdentityStatusInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::UpdateIdentityStatusInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::UpdateIdentityStatusInput { - status: self.status, - }) - } - } -} -#[doc(hidden)] -pub type UpdateIdentityStatusInputOperationOutputAlias = crate::operation::UpdateIdentityStatus; -#[doc(hidden)] -pub type UpdateIdentityStatusInputOperationRetryAlias = (); -impl UpdateIdentityStatusInput { - /// Consumes the builder and constructs an Operation<[`UpdateIdentityStatus`](crate::operation::UpdateIdentityStatus)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::UpdateIdentityStatusInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/identities/self/status").expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::UpdateIdentityStatusInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_update_identity_status( - &self, - )?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::UpdateIdentityStatus::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "UpdateIdentityStatus", - "IdentityService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`UpdateIdentityStatusInput`](crate::input::UpdateIdentityStatusInput) - pub fn builder() -> crate::input::update_identity_status_input::Builder { - crate::input::update_identity_status_input::Builder::default() - } -} - -/// See [`ValidateIdentityProfileInput`](crate::input::ValidateIdentityProfileInput) -pub mod validate_identity_profile_input { - /// A builder for [`ValidateIdentityProfileInput`](crate::input::ValidateIdentityProfileInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) display_name: std::option::Option, - pub(crate) account_number: std::option::Option, - pub(crate) bio: std::option::Option, - } - impl Builder { - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub fn account_number(mut self, input: i32) -> Self { - self.account_number = Some(input); - self - } - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub fn set_account_number(mut self, input: std::option::Option) -> Self { - self.account_number = input; - self - } - /// Detailed information about a profile. - pub fn bio(mut self, input: impl Into) -> Self { - self.bio = Some(input.into()); - self - } - /// Detailed information about a profile. - pub fn set_bio(mut self, input: std::option::Option) -> Self { - self.bio = input; - self - } - /// Consumes the builder and constructs a [`ValidateIdentityProfileInput`](crate::input::ValidateIdentityProfileInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::ValidateIdentityProfileInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::ValidateIdentityProfileInput { - display_name: self.display_name, - account_number: self.account_number, - bio: self.bio, - }) - } - } -} -#[doc(hidden)] -pub type ValidateIdentityProfileInputOperationOutputAlias = - crate::operation::ValidateIdentityProfile; -#[doc(hidden)] -pub type ValidateIdentityProfileInputOperationRetryAlias = (); -impl ValidateIdentityProfileInput { - /// Consumes the builder and constructs an Operation<[`ValidateIdentityProfile`](crate::operation::ValidateIdentityProfile)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::ValidateIdentityProfileInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/identities/self/profile/validate") - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::ValidateIdentityProfileInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_validate_identity_profile( - &self, - )?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::ValidateIdentityProfile::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "ValidateIdentityProfile", - "IdentityService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`ValidateIdentityProfileInput`](crate::input::ValidateIdentityProfileInput) - pub fn builder() -> crate::input::validate_identity_profile_input::Builder { - crate::input::validate_identity_profile_input::Builder::default() - } -} - -/// See [`WatchEventsInput`](crate::input::WatchEventsInput) -pub mod watch_events_input { - /// A builder for [`WatchEventsInput`](crate::input::WatchEventsInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) watch_index: std::option::Option, - } - impl Builder { - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.watch_index = Some(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.watch_index = input; - self - } - /// Consumes the builder and constructs a [`WatchEventsInput`](crate::input::WatchEventsInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::WatchEventsInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::WatchEventsInput { - watch_index: self.watch_index, - }) - } - } -} -#[doc(hidden)] -pub type WatchEventsInputOperationOutputAlias = crate::operation::WatchEvents; -#[doc(hidden)] -pub type WatchEventsInputOperationRetryAlias = (); -impl WatchEventsInput { - /// Consumes the builder and constructs an Operation<[`WatchEvents`](crate::operation::WatchEvents)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::WatchEventsInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/events/live").expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::WatchEventsInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_36) = &_input.watch_index { - query.push_kv( - "watch_index", - &aws_smithy_http::query::fmt_string(&inner_36), - ); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::WatchEventsInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::WatchEvents::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "WatchEvents", - "IdentityService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`WatchEventsInput`](crate::input::WatchEventsInput) - pub fn builder() -> crate::input::watch_events_input::Builder { - crate::input::watch_events_input::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ListActivitiesInput { - /// A query parameter denoting the requests watch index. - pub watch_index: std::option::Option, -} -impl ListActivitiesInput { - /// A query parameter denoting the requests watch index. - pub fn watch_index(&self) -> std::option::Option<&str> { - self.watch_index.as_deref() - } -} -impl std::fmt::Debug for ListActivitiesInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ListActivitiesInput"); - formatter.field("watch_index", &self.watch_index); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CancelGameLinkInput { - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub identity_link_token: std::option::Option, -} -impl CancelGameLinkInput { - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn identity_link_token(&self) -> std::option::Option<&str> { - self.identity_link_token.as_deref() - } -} -impl std::fmt::Debug for CancelGameLinkInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CancelGameLinkInput"); - formatter.field("identity_link_token", &"*** Sensitive Data Redacted ***"); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CompleteGameLinkInput { - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub identity_link_token: std::option::Option, -} -impl CompleteGameLinkInput { - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn identity_link_token(&self) -> std::option::Option<&str> { - self.identity_link_token.as_deref() - } -} -impl std::fmt::Debug for CompleteGameLinkInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CompleteGameLinkInput"); - formatter.field("identity_link_token", &"*** Sensitive Data Redacted ***"); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetGameLinkInput { - /// `identity_link_token` returned by `PrepareGameLink`. - pub identity_link_token: std::option::Option, - /// A query parameter denoting the requests watch index. - pub watch_index: std::option::Option, -} -impl GetGameLinkInput { - /// `identity_link_token` returned by `PrepareGameLink`. - pub fn identity_link_token(&self) -> std::option::Option<&str> { - self.identity_link_token.as_deref() - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(&self) -> std::option::Option<&str> { - self.watch_index.as_deref() - } -} -impl std::fmt::Debug for GetGameLinkInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetGameLinkInput"); - formatter.field("identity_link_token", &"*** Sensitive Data Redacted ***"); - formatter.field("watch_index", &self.watch_index); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PrepareGameLinkInput {} -impl std::fmt::Debug for PrepareGameLinkInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PrepareGameLinkInput"); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct WatchEventsInput { - /// A query parameter denoting the requests watch index. - pub watch_index: std::option::Option, -} -impl WatchEventsInput { - /// A query parameter denoting the requests watch index. - pub fn watch_index(&self) -> std::option::Option<&str> { - self.watch_index.as_deref() - } -} -impl std::fmt::Debug for WatchEventsInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("WatchEventsInput"); - formatter.field("watch_index", &self.watch_index); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UnmarkDeletionInput {} -impl std::fmt::Debug for UnmarkDeletionInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UnmarkDeletionInput"); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct MarkDeletionInput {} -impl std::fmt::Debug for MarkDeletionInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("MarkDeletionInput"); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ListMutualFriendsInput { - /// A universally unique identifier. - pub identity_id: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub anchor: std::option::Option, - /// Unsigned 32 bit integer. - pub count: std::option::Option, -} -impl ListMutualFriendsInput { - /// A universally unique identifier. - pub fn identity_id(&self) -> std::option::Option<&str> { - self.identity_id.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn anchor(&self) -> std::option::Option<&str> { - self.anchor.as_deref() - } - /// Unsigned 32 bit integer. - pub fn count(&self) -> std::option::Option { - self.count - } -} -impl std::fmt::Debug for ListMutualFriendsInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ListMutualFriendsInput"); - formatter.field("identity_id", &self.identity_id); - formatter.field("anchor", &self.anchor); - formatter.field("count", &self.count); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct RecentFollowerIgnoreInput { - /// A universally unique identifier. - pub identity_id: std::option::Option, -} -impl RecentFollowerIgnoreInput { - /// A universally unique identifier. - pub fn identity_id(&self) -> std::option::Option<&str> { - self.identity_id.as_deref() - } -} -impl std::fmt::Debug for RecentFollowerIgnoreInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("RecentFollowerIgnoreInput"); - formatter.field("identity_id", &self.identity_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ListRecentFollowersInput { - #[allow(missing_docs)] // documentation missing in model - pub anchor: std::option::Option, - /// Unsigned 32 bit integer. - pub count: std::option::Option, - /// A query parameter denoting the requests watch index. - pub watch_index: std::option::Option, -} -impl ListRecentFollowersInput { - #[allow(missing_docs)] // documentation missing in model - pub fn anchor(&self) -> std::option::Option<&str> { - self.anchor.as_deref() - } - /// Unsigned 32 bit integer. - pub fn count(&self) -> std::option::Option { - self.count - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(&self) -> std::option::Option<&str> { - self.watch_index.as_deref() - } -} -impl std::fmt::Debug for ListRecentFollowersInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ListRecentFollowersInput"); - formatter.field("anchor", &self.anchor); - formatter.field("count", &self.count); - formatter.field("watch_index", &self.watch_index); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetIdentitySummariesInput { - /// A list of identity IDs. - pub identity_ids: std::option::Option>, -} -impl GetIdentitySummariesInput { - /// A list of identity IDs. - pub fn identity_ids(&self) -> std::option::Option<&[std::string::String]> { - self.identity_ids.as_deref() - } -} -impl std::fmt::Debug for GetIdentitySummariesInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetIdentitySummariesInput"); - formatter.field("identity_ids", &self.identity_ids); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetIdentityHandlesInput { - /// A list of identity IDs. - pub identity_ids: std::option::Option>, -} -impl GetIdentityHandlesInput { - /// A list of identity IDs. - pub fn identity_ids(&self) -> std::option::Option<&[std::string::String]> { - self.identity_ids.as_deref() - } -} -impl std::fmt::Debug for GetIdentityHandlesInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetIdentityHandlesInput"); - formatter.field("identity_ids", &self.identity_ids); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ReportIdentityInput { - /// A universally unique identifier. - pub identity_id: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub reason: std::option::Option, -} -impl ReportIdentityInput { - /// A universally unique identifier. - pub fn identity_id(&self) -> std::option::Option<&str> { - self.identity_id.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn reason(&self) -> std::option::Option<&str> { - self.reason.as_deref() - } -} -impl std::fmt::Debug for ReportIdentityInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ReportIdentityInput"); - formatter.field("identity_id", &self.identity_id); - formatter.field("reason", &self.reason); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ListFriendsInput { - #[allow(missing_docs)] // documentation missing in model - pub anchor: std::option::Option, - /// Unsigned 32 bit integer. - pub count: std::option::Option, - /// A query parameter denoting the requests watch index. - pub watch_index: std::option::Option, -} -impl ListFriendsInput { - #[allow(missing_docs)] // documentation missing in model - pub fn anchor(&self) -> std::option::Option<&str> { - self.anchor.as_deref() - } - /// Unsigned 32 bit integer. - pub fn count(&self) -> std::option::Option { - self.count - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(&self) -> std::option::Option<&str> { - self.watch_index.as_deref() - } -} -impl std::fmt::Debug for ListFriendsInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ListFriendsInput"); - formatter.field("anchor", &self.anchor); - formatter.field("count", &self.count); - formatter.field("watch_index", &self.watch_index); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ListFollowingInput { - /// A universally unique identifier. - pub identity_id: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub anchor: std::option::Option, - /// Unsigned 32 bit integer. - pub count: std::option::Option, - /// A query parameter denoting the requests watch index. - pub watch_index: std::option::Option, -} -impl ListFollowingInput { - /// A universally unique identifier. - pub fn identity_id(&self) -> std::option::Option<&str> { - self.identity_id.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn anchor(&self) -> std::option::Option<&str> { - self.anchor.as_deref() - } - /// Unsigned 32 bit integer. - pub fn count(&self) -> std::option::Option { - self.count - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(&self) -> std::option::Option<&str> { - self.watch_index.as_deref() - } -} -impl std::fmt::Debug for ListFollowingInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ListFollowingInput"); - formatter.field("identity_id", &self.identity_id); - formatter.field("anchor", &self.anchor); - formatter.field("count", &self.count); - formatter.field("watch_index", &self.watch_index); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ListFollowersInput { - /// A universally unique identifier. - pub identity_id: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub anchor: std::option::Option, - /// Unsigned 32 bit integer. - pub count: std::option::Option, - /// A query parameter denoting the requests watch index. - pub watch_index: std::option::Option, -} -impl ListFollowersInput { - /// A universally unique identifier. - pub fn identity_id(&self) -> std::option::Option<&str> { - self.identity_id.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn anchor(&self) -> std::option::Option<&str> { - self.anchor.as_deref() - } - /// Unsigned 32 bit integer. - pub fn count(&self) -> std::option::Option { - self.count - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(&self) -> std::option::Option<&str> { - self.watch_index.as_deref() - } -} -impl std::fmt::Debug for ListFollowersInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ListFollowersInput"); - formatter.field("identity_id", &self.identity_id); - formatter.field("anchor", &self.anchor); - formatter.field("count", &self.count); - formatter.field("watch_index", &self.watch_index); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct SignupForBetaInput { - #[allow(missing_docs)] // documentation missing in model - pub name: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub company_name: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub company_size: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub preferred_tools: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub goals: std::option::Option, -} -impl SignupForBetaInput { - #[allow(missing_docs)] // documentation missing in model - pub fn name(&self) -> std::option::Option<&str> { - self.name.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn company_name(&self) -> std::option::Option<&str> { - self.company_name.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn company_size(&self) -> std::option::Option<&str> { - self.company_size.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn preferred_tools(&self) -> std::option::Option<&str> { - self.preferred_tools.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn goals(&self) -> std::option::Option<&str> { - self.goals.as_deref() - } -} -impl std::fmt::Debug for SignupForBetaInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("SignupForBetaInput"); - formatter.field("name", &self.name); - formatter.field("company_name", &self.company_name); - formatter.field("company_size", &self.company_size); - formatter.field("preferred_tools", &self.preferred_tools); - formatter.field("goals", &self.goals); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CompleteIdentityAvatarUploadInput { - /// A universally unique identifier. - pub upload_id: std::option::Option, -} -impl CompleteIdentityAvatarUploadInput { - /// A universally unique identifier. - pub fn upload_id(&self) -> std::option::Option<&str> { - self.upload_id.as_deref() - } -} -impl std::fmt::Debug for CompleteIdentityAvatarUploadInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CompleteIdentityAvatarUploadInput"); - formatter.field("upload_id", &self.upload_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PrepareIdentityAvatarUploadInput { - /// The path/filename of the identity avatar. - pub path: std::option::Option, - /// The MIME type of the identity avatar. - pub mime: std::option::Option, - /// Unsigned 64 bit integer. - pub content_length: std::option::Option, -} -impl PrepareIdentityAvatarUploadInput { - /// The path/filename of the identity avatar. - pub fn path(&self) -> std::option::Option<&str> { - self.path.as_deref() - } - /// The MIME type of the identity avatar. - pub fn mime(&self) -> std::option::Option<&str> { - self.mime.as_deref() - } - /// Unsigned 64 bit integer. - pub fn content_length(&self) -> std::option::Option { - self.content_length - } -} -impl std::fmt::Debug for PrepareIdentityAvatarUploadInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PrepareIdentityAvatarUploadInput"); - formatter.field("path", &self.path); - formatter.field("mime", &self.mime); - formatter.field("content_length", &self.content_length); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UnfollowIdentityInput { - /// A universally unique identifier. - pub identity_id: std::option::Option, -} -impl UnfollowIdentityInput { - /// A universally unique identifier. - pub fn identity_id(&self) -> std::option::Option<&str> { - self.identity_id.as_deref() - } -} -impl std::fmt::Debug for UnfollowIdentityInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UnfollowIdentityInput"); - formatter.field("identity_id", &self.identity_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct FollowIdentityInput { - /// A universally unique identifier. - pub identity_id: std::option::Option, -} -impl FollowIdentityInput { - /// A universally unique identifier. - pub fn identity_id(&self) -> std::option::Option<&str> { - self.identity_id.as_deref() - } -} -impl std::fmt::Debug for FollowIdentityInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("FollowIdentityInput"); - formatter.field("identity_id", &self.identity_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UpdateIdentityStatusInput { - /// The current status of an identity. This helps players understand if another player is currently playing or has their game in the background. - pub status: std::option::Option, -} -impl UpdateIdentityStatusInput { - /// The current status of an identity. This helps players understand if another player is currently playing or has their game in the background. - pub fn status(&self) -> std::option::Option<&crate::model::IdentityStatus> { - self.status.as_ref() - } -} -impl std::fmt::Debug for UpdateIdentityStatusInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UpdateIdentityStatusInput"); - formatter.field("status", &self.status); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct RemoveIdentityGameActivityInput {} -impl std::fmt::Debug for RemoveIdentityGameActivityInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("RemoveIdentityGameActivityInput"); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct SetIdentityGameActivityInput { - /// Information about the identity's current game. This is information that all other identities can see about what the current identity is doing. - pub game_activity: std::option::Option, -} -impl SetIdentityGameActivityInput { - /// Information about the identity's current game. This is information that all other identities can see about what the current identity is doing. - pub fn game_activity(&self) -> std::option::Option<&crate::model::UpdateIdentityGameActivity> { - self.game_activity.as_ref() - } -} -impl std::fmt::Debug for SetIdentityGameActivityInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("SetIdentityGameActivityInput"); - formatter.field("game_activity", &self.game_activity); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct SearchIdentitiesInput { - /// The query to match identity display names and account numbers against. - pub query: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub anchor: std::option::Option, - /// Unsigned 32 bit integer. - pub limit: std::option::Option, -} -impl SearchIdentitiesInput { - /// The query to match identity display names and account numbers against. - pub fn query(&self) -> std::option::Option<&str> { - self.query.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn anchor(&self) -> std::option::Option<&str> { - self.anchor.as_deref() - } - /// Unsigned 32 bit integer. - pub fn limit(&self) -> std::option::Option { - self.limit - } -} -impl std::fmt::Debug for SearchIdentitiesInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("SearchIdentitiesInput"); - formatter.field("query", &self.query); - formatter.field("anchor", &self.anchor); - formatter.field("limit", &self.limit); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ValidateIdentityProfileInput { - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub account_number: std::option::Option, - /// Detailed information about a profile. - pub bio: std::option::Option, -} -impl ValidateIdentityProfileInput { - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub fn account_number(&self) -> std::option::Option { - self.account_number - } - /// Detailed information about a profile. - pub fn bio(&self) -> std::option::Option<&str> { - self.bio.as_deref() - } -} -impl std::fmt::Debug for ValidateIdentityProfileInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ValidateIdentityProfileInput"); - formatter.field("display_name", &self.display_name); - formatter.field("account_number", &self.account_number); - formatter.field("bio", &self.bio); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UpdateIdentityProfileInput { - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub account_number: std::option::Option, - /// Detailed information about a profile. - pub bio: std::option::Option, -} -impl UpdateIdentityProfileInput { - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub fn account_number(&self) -> std::option::Option { - self.account_number - } - /// Detailed information about a profile. - pub fn bio(&self) -> std::option::Option<&str> { - self.bio.as_deref() - } -} -impl std::fmt::Debug for UpdateIdentityProfileInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UpdateIdentityProfileInput"); - formatter.field("display_name", &self.display_name); - formatter.field("account_number", &self.account_number); - formatter.field("bio", &self.bio); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetIdentitySelfProfileInput { - /// A query parameter denoting the requests watch index. - pub watch_index: std::option::Option, -} -impl GetIdentitySelfProfileInput { - /// A query parameter denoting the requests watch index. - pub fn watch_index(&self) -> std::option::Option<&str> { - self.watch_index.as_deref() - } -} -impl std::fmt::Debug for GetIdentitySelfProfileInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetIdentitySelfProfileInput"); - formatter.field("watch_index", &self.watch_index); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetIdentityProfileInput { - /// A universally unique identifier. - pub identity_id: std::option::Option, - /// A query parameter denoting the requests watch index. - pub watch_index: std::option::Option, -} -impl GetIdentityProfileInput { - /// A universally unique identifier. - pub fn identity_id(&self) -> std::option::Option<&str> { - self.identity_id.as_deref() - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(&self) -> std::option::Option<&str> { - self.watch_index.as_deref() - } -} -impl std::fmt::Debug for GetIdentityProfileInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetIdentityProfileInput"); - formatter.field("identity_id", &self.identity_id); - formatter.field("watch_index", &self.watch_index); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct SetupIdentityInput { - /// Token returned from previous call to `rivet.api.identity#SetupIdentity`. If this token is invalid, a new identity will be returned. - pub existing_identity_token: std::option::Option, -} -impl SetupIdentityInput { - /// Token returned from previous call to `rivet.api.identity#SetupIdentity`. If this token is invalid, a new identity will be returned. - pub fn existing_identity_token(&self) -> std::option::Option<&str> { - self.existing_identity_token.as_deref() - } -} -impl std::fmt::Debug for SetupIdentityInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("SetupIdentityInput"); - formatter.field( - "existing_identity_token", - &"*** Sensitive Data Redacted ***", - ); - formatter.finish() - } -} diff --git a/lib/smithy-output/api-identity/rust/rust/src/json_deser.rs b/lib/smithy-output/api-identity/rust/rust/src/json_deser.rs deleted file mode 100644 index 25948e9c7..000000000 --- a/lib/smithy-output/api-identity/rust/rust/src/json_deser.rs +++ /dev/null @@ -1,6063 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub fn parse_http_generic_error( - response: &http::Response, -) -> Result { - crate::json_errors::parse_generic_error(response.body(), response.headers()) -} - -pub fn deser_structure_crate_error_internal_error_json_err( - value: &[u8], - mut builder: crate::error::internal_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_rate_limit_error_json_err( - value: &[u8], - mut builder: crate::error::rate_limit_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_forbidden_error_json_err( - value: &[u8], - mut builder: crate::error::forbidden_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_unauthorized_error_json_err( - value: &[u8], - mut builder: crate::error::unauthorized_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_not_found_error_json_err( - value: &[u8], - mut builder: crate::error::not_found_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_bad_request_error_json_err( - value: &[u8], - mut builder: crate::error::bad_request_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_get_game_link( - value: &[u8], - mut builder: crate::output::get_game_link_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "current_identity" => { - builder = builder.set_current_identity( - crate::json_deser::deser_structure_crate_model_identity_handle(tokens)?, - ); - } - "game" => { - builder = builder.set_game( - crate::json_deser::deser_structure_crate_model_game_handle(tokens)?, - ); - } - "new_identity" => { - builder = builder.set_new_identity( - crate::json_deser::deser_structure_crate_model_get_game_link_new_identity(tokens)? - ); - } - "status" => { - builder = builder.set_status( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| { - s.to_unescaped() - .map(|u| crate::model::GameLinkStatus::from(u.as_ref())) - }) - .transpose()?, - ); - } - "watch" => { - builder = builder.set_watch( - crate::json_deser::deser_structure_crate_model_watch_response(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_get_identity_handles( - value: &[u8], - mut builder: crate::output::get_identity_handles_output::Builder, -) -> Result -{ - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "identities" => { - builder = builder.set_identities( - crate::json_deser::deser_list_rivet_identity_identity_handles(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_get_identity_profile( - value: &[u8], - mut builder: crate::output::get_identity_profile_output::Builder, -) -> Result -{ - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "identity" => { - builder = builder.set_identity( - crate::json_deser::deser_structure_crate_model_identity_profile( - tokens, - )?, - ); - } - "watch" => { - builder = builder.set_watch( - crate::json_deser::deser_structure_crate_model_watch_response(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_get_identity_self_profile( - value: &[u8], - mut builder: crate::output::get_identity_self_profile_output::Builder, -) -> Result< - crate::output::get_identity_self_profile_output::Builder, - aws_smithy_json::deserialize::Error, -> { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "identity" => { - builder = builder.set_identity( - crate::json_deser::deser_structure_crate_model_identity_profile( - tokens, - )?, - ); - } - "watch" => { - builder = builder.set_watch( - crate::json_deser::deser_structure_crate_model_watch_response(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_get_identity_summaries( - value: &[u8], - mut builder: crate::output::get_identity_summaries_output::Builder, -) -> Result< - crate::output::get_identity_summaries_output::Builder, - aws_smithy_json::deserialize::Error, -> { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "identities" => { - builder = builder.set_identities( - crate::json_deser::deser_list_rivet_identity_identity_summaries( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_list_activities( - value: &[u8], - mut builder: crate::output::list_activities_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "games" => { - builder = builder.set_games( - crate::json_deser::deser_list_rivet_game_game_summaries(tokens)?, - ); - } - "identities" => { - builder = builder.set_identities( - crate::json_deser::deser_list_rivet_identity_identity_handles(tokens)?, - ); - } - "parties" => { - builder = builder.set_parties( - crate::json_deser::deser_list_rivet_party_party_summaries(tokens)?, - ); - } - "suggested_groups" => { - builder = builder.set_suggested_groups( - crate::json_deser::deser_list_rivet_group_group_summaries(tokens)?, - ); - } - "suggested_players" => { - builder = builder.set_suggested_players( - crate::json_deser::deser_list_rivet_identity_identity_handles(tokens)?, - ); - } - "watch" => { - builder = builder.set_watch( - crate::json_deser::deser_structure_crate_model_watch_response(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_list_followers( - value: &[u8], - mut builder: crate::output::list_followers_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "anchor" => { - builder = builder.set_anchor( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "identities" => { - builder = builder.set_identities( - crate::json_deser::deser_list_rivet_identity_identity_handles(tokens)?, - ); - } - "watch" => { - builder = builder.set_watch( - crate::json_deser::deser_structure_crate_model_watch_response(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_list_following( - value: &[u8], - mut builder: crate::output::list_following_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "anchor" => { - builder = builder.set_anchor( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "identities" => { - builder = builder.set_identities( - crate::json_deser::deser_list_rivet_identity_identity_handles(tokens)?, - ); - } - "watch" => { - builder = builder.set_watch( - crate::json_deser::deser_structure_crate_model_watch_response(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_list_friends( - value: &[u8], - mut builder: crate::output::list_friends_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "anchor" => { - builder = builder.set_anchor( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "identities" => { - builder = builder.set_identities( - crate::json_deser::deser_list_rivet_identity_identity_handles(tokens)?, - ); - } - "watch" => { - builder = builder.set_watch( - crate::json_deser::deser_structure_crate_model_watch_response(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_list_mutual_friends( - value: &[u8], - mut builder: crate::output::list_mutual_friends_output::Builder, -) -> Result -{ - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "anchor" => { - builder = builder.set_anchor( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "identities" => { - builder = builder.set_identities( - crate::json_deser::deser_list_rivet_identity_identity_handles(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_list_recent_followers( - value: &[u8], - mut builder: crate::output::list_recent_followers_output::Builder, -) -> Result -{ - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "anchor" => { - builder = builder.set_anchor( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "identities" => { - builder = builder.set_identities( - crate::json_deser::deser_list_rivet_identity_identity_handles(tokens)?, - ); - } - "watch" => { - builder = builder.set_watch( - crate::json_deser::deser_structure_crate_model_watch_response(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_prepare_game_link( - value: &[u8], - mut builder: crate::output::prepare_game_link_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "expire_ts" => { - builder = builder.set_expire_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "identity_link_token" => { - builder = builder.set_identity_link_token( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "identity_link_url" => { - builder = builder.set_identity_link_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_prepare_identity_avatar_upload( - value: &[u8], - mut builder: crate::output::prepare_identity_avatar_upload_output::Builder, -) -> Result< - crate::output::prepare_identity_avatar_upload_output::Builder, - aws_smithy_json::deserialize::Error, -> { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "presigned_request" => { - builder = builder.set_presigned_request( - crate::json_deser::deser_structure_crate_model_upload_presigned_request(tokens)? - ); - } - "upload_id" => { - builder = builder.set_upload_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_search_identities( - value: &[u8], - mut builder: crate::output::search_identities_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "anchor" => { - builder = builder.set_anchor( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "identities" => { - builder = builder.set_identities( - crate::json_deser::deser_list_rivet_identity_identity_handles(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_setup_identity( - value: &[u8], - mut builder: crate::output::setup_identity_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "game_id" => { - builder = builder.set_game_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "identity" => { - builder = builder.set_identity( - crate::json_deser::deser_structure_crate_model_identity_profile( - tokens, - )?, - ); - } - "identity_token" => { - builder = builder.set_identity_token( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "identity_token_expire_ts" => { - builder = builder.set_identity_token_expire_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_validate_identity_profile( - value: &[u8], - mut builder: crate::output::validate_identity_profile_output::Builder, -) -> Result< - crate::output::validate_identity_profile_output::Builder, - aws_smithy_json::deserialize::Error, -> { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "errors" => { - builder = builder.set_errors( - crate::json_deser::deser_list_rivet_common_validation_errors(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_watch_events( - value: &[u8], - mut builder: crate::output::watch_events_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "events" => { - builder = builder.set_events( - crate::json_deser::deser_list_rivet_api_identity_common_global_events( - tokens, - )?, - ); - } - "watch" => { - builder = builder.set_watch( - crate::json_deser::deser_structure_crate_model_watch_response(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn or_empty_doc(data: &[u8]) -> &[u8] { - if data.is_empty() { - b"{}" - } else { - data - } -} - -pub fn deser_structure_crate_model_identity_handle<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::IdentityHandle::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "identity_id" => { - builder = builder.set_identity_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "display_name" => { - builder = builder.set_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "account_number" => { - builder = builder.set_account_number( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "avatar_url" => { - builder = builder.set_avatar_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "presence" => { - builder = builder.set_presence( - crate::json_deser::deser_structure_crate_model_identity_presence(tokens)? - ); - } - "party" => { - builder = builder.set_party( - crate::json_deser::deser_structure_crate_model_party_handle( - tokens, - )?, - ); - } - "is_registered" => { - builder = builder.set_is_registered( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - "external" => { - builder = builder.set_external( - crate::json_deser::deser_structure_crate_model_identity_external_links(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_game_handle<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GameHandle::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "game_id" => { - builder = builder.set_game_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "name_id" => { - builder = builder.set_name_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "display_name" => { - builder = builder.set_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "logo_url" => { - builder = builder.set_logo_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "banner_url" => { - builder = builder.set_banner_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_get_game_link_new_identity<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GetGameLinkNewIdentity::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "identity_token" => { - builder = builder.set_identity_token( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "identity_token_expire_ts" => { - builder = builder.set_identity_token_expire_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "identity" => { - builder = builder.set_identity( - crate::json_deser::deser_structure_crate_model_identity_profile(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_watch_response<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::WatchResponse::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "index" => { - builder = builder.set_index( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_identity_identity_handles<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_identity_handle(tokens)?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_structure_crate_model_identity_profile<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::IdentityProfile::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "identity_id" => { - builder = builder.set_identity_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "display_name" => { - builder = builder.set_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "account_number" => { - builder = builder.set_account_number( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "avatar_url" => { - builder = builder.set_avatar_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "presence" => { - builder = builder.set_presence( - crate::json_deser::deser_structure_crate_model_identity_presence(tokens)? - ); - } - "party" => { - builder = builder.set_party( - crate::json_deser::deser_structure_crate_model_party_summary( - tokens, - )?, - ); - } - "is_registered" => { - builder = builder.set_is_registered( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - "external" => { - builder = builder.set_external( - crate::json_deser::deser_structure_crate_model_identity_external_links(tokens)? - ); - } - "is_admin" => { - builder = builder.set_is_admin( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - "is_game_linked" => { - builder = builder.set_is_game_linked( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - "dev_state" => { - builder = builder.set_dev_state( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| { - s.to_unescaped().map(|u| { - crate::model::IdentityDevState::from(u.as_ref()) - }) - }) - .transpose()?, - ); - } - "follower_count" => { - builder = builder.set_follower_count( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i64()), - ); - } - "following_count" => { - builder = builder.set_following_count( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i64()), - ); - } - "following" => { - builder = builder.set_following( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - "is_following_me" => { - builder = builder.set_is_following_me( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - "is_mutual_following" => { - builder = builder.set_is_mutual_following( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - "join_ts" => { - builder = builder.set_join_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "bio" => { - builder = builder.set_bio( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "linked_accounts" => { - builder = builder.set_linked_accounts( - crate::json_deser::deser_list_rivet_identity_identity_linked_accounts(tokens)? - ); - } - "groups" => { - builder = builder.set_groups( - crate::json_deser::deser_list_rivet_identity_identity_groups( - tokens, - )?, - ); - } - "games" => { - builder = builder.set_games( - crate::json_deser::deser_list_rivet_game_game_stat_summaries( - tokens, - )?, - ); - } - "awaiting_deletion" => { - builder = builder.set_awaiting_deletion( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_identity_identity_summaries<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_identity_summary( - tokens, - )?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_game_game_summaries<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_game_summary(tokens)?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_party_party_summaries<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_party_summary(tokens)?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_group_group_summaries<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_group_summary(tokens)?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_structure_crate_model_upload_presigned_request<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::UploadPresignedRequest::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "path" => { - builder = builder.set_path( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "url" => { - builder = builder.set_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_common_validation_errors<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_validation_error( - tokens, - )?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_api_identity_common_global_events<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_global_event(tokens)?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_structure_crate_model_identity_presence<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::IdentityPresence::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "update_ts" => { - builder = builder.set_update_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "status" => { - builder = builder.set_status( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| { - s.to_unescaped() - .map(|u| crate::model::IdentityStatus::from(u.as_ref())) - }) - .transpose()?, - ); - } - "game_activity" => { - builder = builder.set_game_activity( - crate::json_deser::deser_structure_crate_model_identity_game_activity(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_party_handle<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PartyHandle::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "party_id" => { - builder = builder.set_party_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "create_ts" => { - builder = builder.set_create_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "activity" => { - builder = builder.set_activity( - crate::json_deser::deser_union_crate_model_party_activity( - tokens, - )?, - ); - } - "external" => { - builder = builder.set_external( - crate::json_deser::deser_structure_crate_model_party_external_links(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_identity_external_links<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::IdentityExternalLinks::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "profile" => { - builder = builder.set_profile( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "settings" => { - builder = builder.set_settings( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "chat" => { - builder = builder.set_chat( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_party_summary<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PartySummary::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "party_id" => { - builder = builder.set_party_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "create_ts" => { - builder = builder.set_create_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "activity" => { - builder = builder.set_activity( - crate::json_deser::deser_union_crate_model_party_activity( - tokens, - )?, - ); - } - "external" => { - builder = builder.set_external( - crate::json_deser::deser_structure_crate_model_party_external_links(tokens)? - ); - } - "publicity" => { - builder = builder.set_publicity( - crate::json_deser::deser_structure_crate_model_party_publicity( - tokens, - )?, - ); - } - "party_size" => { - builder = builder.set_party_size( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "members" => { - builder = builder.set_members( - crate::json_deser::deser_list_rivet_party_party_member_summaries(tokens)? - ); - } - "thread_id" => { - builder = builder.set_thread_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_identity_identity_linked_accounts<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option>, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_union_crate_model_identity_linked_account( - tokens, - )?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_identity_identity_groups<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_identity_group(tokens)?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_game_game_stat_summaries<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_game_stat_summary( - tokens, - )?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_structure_crate_model_identity_summary<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::IdentitySummary::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "identity_id" => { - builder = builder.set_identity_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "display_name" => { - builder = builder.set_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "account_number" => { - builder = builder.set_account_number( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "avatar_url" => { - builder = builder.set_avatar_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "presence" => { - builder = builder.set_presence( - crate::json_deser::deser_structure_crate_model_identity_presence(tokens)? - ); - } - "party" => { - builder = builder.set_party( - crate::json_deser::deser_structure_crate_model_party_handle( - tokens, - )?, - ); - } - "is_registered" => { - builder = builder.set_is_registered( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - "external" => { - builder = builder.set_external( - crate::json_deser::deser_structure_crate_model_identity_external_links(tokens)? - ); - } - "following" => { - builder = builder.set_following( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - "is_following_me" => { - builder = builder.set_is_following_me( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - "is_mutual_following" => { - builder = builder.set_is_mutual_following( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_game_summary<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GameSummary::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "game_id" => { - builder = builder.set_game_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "name_id" => { - builder = builder.set_name_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "display_name" => { - builder = builder.set_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "logo_url" => { - builder = builder.set_logo_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "banner_url" => { - builder = builder.set_banner_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "url" => { - builder = builder.set_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "developer" => { - builder = builder.set_developer( - crate::json_deser::deser_structure_crate_model_group_handle( - tokens, - )?, - ); - } - "tags" => { - builder = builder.set_tags( - crate::json_deser::deser_list_rivet_game_game_tags(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_group_summary<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GroupSummary::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "group_id" => { - builder = builder.set_group_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "display_name" => { - builder = builder.set_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "avatar_url" => { - builder = builder.set_avatar_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "external" => { - builder = builder.set_external( - crate::json_deser::deser_structure_crate_model_group_external_links(tokens)? - ); - } - "is_developer" => { - builder = builder.set_is_developer( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - "bio" => { - builder = builder.set_bio( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "is_current_identity_member" => { - builder = builder.set_is_current_identity_member( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - "publicity" => { - builder = builder.set_publicity( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| { - s.to_unescaped() - .map(|u| crate::model::GroupPublicity::from(u.as_ref())) - }) - .transpose()?, - ); - } - "member_count" => { - builder = builder.set_member_count( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "owner_identity_id" => { - builder = builder.set_owner_identity_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_validation_error<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::ValidationError::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "path" => { - builder = builder.set_path( - crate::json_deser::deser_list_rivet_common_validation_error_path(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_global_event<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GlobalEvent::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "ts" => { - builder = builder.set_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "kind" => { - builder = builder.set_kind( - crate::json_deser::deser_union_crate_model_global_event_kind( - tokens, - )?, - ); - } - "notification" => { - builder = builder.set_notification( - crate::json_deser::deser_structure_crate_model_global_event_notification(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_identity_game_activity<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::IdentityGameActivity::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "game" => { - builder = builder.set_game( - crate::json_deser::deser_structure_crate_model_game_handle( - tokens, - )?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "public_metadata" => { - builder = builder.set_public_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - "mutual_metadata" => { - builder = builder.set_mutual_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_union_crate_model_party_activity<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - let mut variant = None; - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - if variant.is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "encountered mixed variants in union", - )); - } - variant = match key.to_unescaped()?.as_ref() { - "idle" => { - Some(crate::model::PartyActivity::Idle( - crate::json_deser::deser_structure_crate_model_party_activity_idle(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'idle' cannot be null"))? - )) - } - "matchmaker_finding_lobby" => { - Some(crate::model::PartyActivity::MatchmakerFindingLobby( - crate::json_deser::deser_structure_crate_model_party_activity_matchmaker_finding_lobby(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'matchmaker_finding_lobby' cannot be null"))? - )) - } - "matchmaker_lobby" => { - Some(crate::model::PartyActivity::MatchmakerLobby( - crate::json_deser::deser_structure_crate_model_party_activity_matchmaker_lobby(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'matchmaker_lobby' cannot be null"))? - )) - } - _ => { - aws_smithy_json::deserialize::token::skip_value(tokens)?; - Some(crate::model::PartyActivity::Unknown) - } - }; - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - }, - _ => { - return Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )) - } - } - Ok(variant) -} - -pub fn deser_structure_crate_model_party_external_links<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PartyExternalLinks::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "chat" => { - builder = builder.set_chat( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_party_publicity<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PartyPublicity::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "public" => { - builder = builder.set_public( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| { - s.to_unescaped().map(|u| { - crate::model::PartyPublicityLevel::from(u.as_ref()) - }) - }) - .transpose()?, - ); - } - "mutual_followers" => { - builder = builder.set_mutual_followers( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| { - s.to_unescaped().map(|u| { - crate::model::PartyPublicityLevel::from(u.as_ref()) - }) - }) - .transpose()?, - ); - } - "groups" => { - builder = builder.set_groups( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| { - s.to_unescaped().map(|u| { - crate::model::PartyPublicityLevel::from(u.as_ref()) - }) - }) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_party_party_member_summaries<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option>, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_party_member_summary( - tokens, - )?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_union_crate_model_identity_linked_account<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - let mut variant = None; - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - if variant.is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "encountered mixed variants in union", - )); - } - variant = match key.to_unescaped()?.as_ref() { - "email" => { - Some(crate::model::IdentityLinkedAccount::Email( - crate::json_deser::deser_structure_crate_model_identity_email_linked_account(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'email' cannot be null"))? - )) - } - _ => { - aws_smithy_json::deserialize::token::skip_value(tokens)?; - Some(crate::model::IdentityLinkedAccount::Unknown) - } - }; - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - }, - _ => { - return Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )) - } - } - Ok(variant) -} - -pub fn deser_structure_crate_model_identity_group<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::IdentityGroup::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "group" => { - builder = builder.set_group( - crate::json_deser::deser_structure_crate_model_group_handle( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_game_stat_summary<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GameStatSummary::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "game" => { - builder = builder.set_game( - crate::json_deser::deser_structure_crate_model_game_handle( - tokens, - )?, - ); - } - "stats" => { - builder = builder.set_stats( - crate::json_deser::deser_list_rivet_game_game_stats(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_group_handle<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GroupHandle::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "group_id" => { - builder = builder.set_group_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "display_name" => { - builder = builder.set_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "avatar_url" => { - builder = builder.set_avatar_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "external" => { - builder = builder.set_external( - crate::json_deser::deser_structure_crate_model_group_external_links(tokens)? - ); - } - "is_developer" => { - builder = builder.set_is_developer( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_game_game_tags<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_structure_crate_model_group_external_links<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GroupExternalLinks::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "profile" => { - builder = builder.set_profile( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "chat" => { - builder = builder.set_chat( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_common_validation_error_path<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_union_crate_model_global_event_kind<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - let mut variant = None; - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - if variant.is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "encountered mixed variants in union", - )); - } - variant = match key.to_unescaped()?.as_ref() { - "chat_message" => { - Some(crate::model::GlobalEventKind::ChatMessage( - crate::json_deser::deser_structure_crate_model_global_event_chat_message(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'chat_message' cannot be null"))? - )) - } - "chat_read" => { - Some(crate::model::GlobalEventKind::ChatRead( - crate::json_deser::deser_structure_crate_model_global_event_chat_read(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'chat_read' cannot be null"))? - )) - } - "party_update" => { - Some(crate::model::GlobalEventKind::PartyUpdate( - crate::json_deser::deser_structure_crate_model_global_event_party_update(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'party_update' cannot be null"))? - )) - } - "identity_update" => { - Some(crate::model::GlobalEventKind::IdentityUpdate( - crate::json_deser::deser_structure_crate_model_global_event_identity_update(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'identity_update' cannot be null"))? - )) - } - "matchmaker_lobby_join" => { - Some(crate::model::GlobalEventKind::MatchmakerLobbyJoin( - crate::json_deser::deser_structure_crate_model_global_event_matchmaker_lobby_join(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'matchmaker_lobby_join' cannot be null"))? - )) - } - "chat_thread_remove" => { - Some(crate::model::GlobalEventKind::ChatThreadRemove( - crate::json_deser::deser_structure_crate_model_global_event_chat_thread_remove(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'chat_thread_remove' cannot be null"))? - )) - } - _ => { - aws_smithy_json::deserialize::token::skip_value(tokens)?; - Some(crate::model::GlobalEventKind::Unknown) - } - }; - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - }, - _ => { - return Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )) - } - } - Ok(variant) -} - -pub fn deser_structure_crate_model_global_event_notification<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GlobalEventNotification::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "title" => { - builder = builder.set_title( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "description" => { - builder = builder.set_description( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "thumbnail_url" => { - builder = builder.set_thumbnail_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "url" => { - builder = builder.set_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_party_activity_idle<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PartyActivityIdle::builder(); - aws_smithy_json::deserialize::token::skip_to_end(tokens)?; - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_party_activity_matchmaker_finding_lobby<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PartyActivityMatchmakerFindingLobby::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "game" => { - builder = builder.set_game( - crate::json_deser::deser_structure_crate_model_game_handle( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_party_activity_matchmaker_lobby<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PartyActivityMatchmakerLobby::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "lobby" => { - builder = builder.set_lobby( - crate::json_deser::deser_structure_crate_model_party_matchmaker_lobby(tokens)? - ); - } - "game" => { - builder = builder.set_game( - crate::json_deser::deser_structure_crate_model_game_handle( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_party_member_summary<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PartyMemberSummary::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "identity" => { - builder = builder.set_identity( - crate::json_deser::deser_structure_crate_model_identity_handle( - tokens, - )?, - ); - } - "is_leader" => { - builder = builder.set_is_leader( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - "join_ts" => { - builder = builder.set_join_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "state" => { - builder = builder.set_state( - crate::json_deser::deser_union_crate_model_party_member_state( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_identity_email_linked_account<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::IdentityEmailLinkedAccount::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "email" => { - builder = builder.set_email( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_game_game_stats<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_game_stat(tokens)?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_structure_crate_model_global_event_chat_message<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GlobalEventChatMessage::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "thread" => { - builder = builder.set_thread( - crate::json_deser::deser_structure_crate_model_chat_thread( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_global_event_chat_read<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GlobalEventChatRead::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "thread_id" => { - builder = builder.set_thread_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "read_ts" => { - builder = builder.set_read_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_global_event_party_update<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GlobalEventPartyUpdate::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "party" => { - builder = builder.set_party( - crate::json_deser::deser_structure_crate_model_party_summary( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_global_event_identity_update<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GlobalEventIdentityUpdate::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "identity" => { - builder = builder.set_identity( - crate::json_deser::deser_structure_crate_model_identity_profile(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_global_event_matchmaker_lobby_join<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GlobalEventMatchmakerLobbyJoin::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "lobby" => { - builder = builder.set_lobby( - crate::json_deser::deser_structure_crate_model_matchmaker_lobby_join_info(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_global_event_chat_thread_remove<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GlobalEventChatThreadRemove::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "thread_id" => { - builder = builder.set_thread_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_party_matchmaker_lobby<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PartyMatchmakerLobby::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "lobby_id" => { - builder = builder.set_lobby_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_union_crate_model_party_member_state<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - let mut variant = None; - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - if variant.is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "encountered mixed variants in union", - )); - } - variant = match key.to_unescaped()?.as_ref() { - "inactive" => { - Some(crate::model::PartyMemberState::Inactive( - crate::json_deser::deser_structure_crate_model_party_member_state_inactive(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'inactive' cannot be null"))? - )) - } - "matchmaker_ready" => { - Some(crate::model::PartyMemberState::MatchmakerReady( - crate::json_deser::deser_structure_crate_model_party_member_state_matchmaker_ready(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'matchmaker_ready' cannot be null"))? - )) - } - "matchmaker_finding_lobby" => { - Some(crate::model::PartyMemberState::MatchmakerFindingLobby( - crate::json_deser::deser_structure_crate_model_party_member_state_matchmaker_finding_lobby(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'matchmaker_finding_lobby' cannot be null"))? - )) - } - "matchmaker_lobby" => { - Some(crate::model::PartyMemberState::MatchmakerLobby( - crate::json_deser::deser_structure_crate_model_party_member_state_matchmaker_lobby(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'matchmaker_lobby' cannot be null"))? - )) - } - _ => { - aws_smithy_json::deserialize::token::skip_value(tokens)?; - Some(crate::model::PartyMemberState::Unknown) - } - }; - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - }, - _ => { - return Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )) - } - } - Ok(variant) -} - -pub fn deser_structure_crate_model_game_stat<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GameStat::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "config" => { - builder = builder.set_config( - crate::json_deser::deser_structure_crate_model_game_stat_config(tokens)? - ); - } - "overall_value" => { - builder = builder.set_overall_value( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_f32()), - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_chat_thread<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::ChatThread::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "thread_id" => { - builder = builder.set_thread_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "create_ts" => { - builder = builder.set_create_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "topic" => { - builder = builder.set_topic( - crate::json_deser::deser_union_crate_model_chat_topic(tokens)?, - ); - } - "tail_message" => { - builder = builder.set_tail_message( - crate::json_deser::deser_structure_crate_model_chat_message( - tokens, - )?, - ); - } - "last_read_ts" => { - builder = builder.set_last_read_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "unread_count" => { - builder = builder.set_unread_count( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i64()), - ); - } - "external" => { - builder = builder.set_external( - crate::json_deser::deser_structure_crate_model_chat_thread_external_links(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_matchmaker_lobby_join_info<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::MatchmakerLobbyJoinInfo::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "lobby_id" => { - builder = builder.set_lobby_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "region" => { - builder = builder.set_region( - crate::json_deser::deser_structure_crate_model_matchmaker_lobby_join_info_region(tokens)? - ); - } - "ports" => { - builder = builder.set_ports( - crate::json_deser::deser_map_rivet_matchmaker_matchmaker_lobby_join_info_ports(tokens)? - ); - } - "player" => { - builder = builder.set_player( - crate::json_deser::deser_structure_crate_model_matchmaker_lobby_join_info_player(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_party_member_state_inactive<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PartyMemberStateInactive::builder(); - aws_smithy_json::deserialize::token::skip_to_end(tokens)?; - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_party_member_state_matchmaker_ready<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PartyMemberStateMatchmakerReady::builder(); - aws_smithy_json::deserialize::token::skip_to_end(tokens)?; - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_party_member_state_matchmaker_finding_lobby<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PartyMemberStateMatchmakerFindingLobby::builder(); - aws_smithy_json::deserialize::token::skip_to_end(tokens)?; - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_party_member_state_matchmaker_lobby<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PartyMemberStateMatchmakerLobby::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "player_id" => { - builder = builder.set_player_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_game_stat_config<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GameStatConfig::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "record_id" => { - builder = builder.set_record_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "icon_id" => { - builder = builder.set_icon_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "format" => { - builder = builder.set_format( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| { - s.to_unescaped().map(|u| { - crate::model::GameStatFormatMethod::from(u.as_ref()) - }) - }) - .transpose()?, - ); - } - "aggregation" => { - builder = builder.set_aggregation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| { - s.to_unescaped().map(|u| { - crate::model::GameStatAggregationMethod::from( - u.as_ref(), - ) - }) - }) - .transpose()?, - ); - } - "sorting" => { - builder = builder.set_sorting( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| { - s.to_unescaped().map(|u| { - crate::model::GameStatSortingMethod::from(u.as_ref()) - }) - }) - .transpose()?, - ); - } - "priority" => { - builder = builder.set_priority( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "display_name" => { - builder = builder.set_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "postfix_singular" => { - builder = builder.set_postfix_singular( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "postfix_plural" => { - builder = builder.set_postfix_plural( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "prefix_singular" => { - builder = builder.set_prefix_singular( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "prefix_plural" => { - builder = builder.set_prefix_plural( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_union_crate_model_chat_topic<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - let mut variant = None; - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - if variant.is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "encountered mixed variants in union", - )); - } - variant = match key.to_unescaped()?.as_ref() { - "group" => Some(crate::model::ChatTopic::Group( - crate::json_deser::deser_structure_crate_model_chat_topic_group( - tokens, - )? - .ok_or_else(|| { - aws_smithy_json::deserialize::Error::custom( - "value for 'group' cannot be null", - ) - })?, - )), - "party" => Some(crate::model::ChatTopic::Party( - crate::json_deser::deser_structure_crate_model_chat_topic_party( - tokens, - )? - .ok_or_else(|| { - aws_smithy_json::deserialize::Error::custom( - "value for 'party' cannot be null", - ) - })?, - )), - "direct" => Some(crate::model::ChatTopic::Direct( - crate::json_deser::deser_structure_crate_model_chat_topic_direct( - tokens, - )? - .ok_or_else(|| { - aws_smithy_json::deserialize::Error::custom( - "value for 'direct' cannot be null", - ) - })?, - )), - _ => { - aws_smithy_json::deserialize::token::skip_value(tokens)?; - Some(crate::model::ChatTopic::Unknown) - } - }; - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - }, - _ => { - return Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )) - } - } - Ok(variant) -} - -pub fn deser_structure_crate_model_chat_message<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::ChatMessage::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "chat_message_id" => { - builder = builder.set_chat_message_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "thread_id" => { - builder = builder.set_thread_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "send_ts" => { - builder = builder.set_send_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "body" => { - builder = builder.set_body( - crate::json_deser::deser_union_crate_model_chat_message_body( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_chat_thread_external_links<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::ChatThreadExternalLinks::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "chat" => { - builder = builder.set_chat( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_matchmaker_lobby_join_info_region<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::MatchmakerLobbyJoinInfoRegion::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "region_id" => { - builder = builder.set_region_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "display_name" => { - builder = builder.set_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_map_rivet_matchmaker_matchmaker_lobby_join_info_ports<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option< - std::collections::HashMap, - >, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - let mut map = std::collections::HashMap::new(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - let key = key.to_unescaped().map(|u| u.into_owned())?; - let value = - crate::json_deser::deser_structure_crate_model_matchmaker_lobby_join_info_port(tokens)? - ; - if let Some(value) = value { - map.insert(key, value); - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(map)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_matchmaker_lobby_join_info_player<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::MatchmakerLobbyJoinInfoPlayer::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "token" => { - builder = builder.set_token( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_chat_topic_group<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::ChatTopicGroup::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "group" => { - builder = builder.set_group( - crate::json_deser::deser_structure_crate_model_group_handle( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_chat_topic_party<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::ChatTopicParty::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "party" => { - builder = builder.set_party( - crate::json_deser::deser_structure_crate_model_party_handle( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_chat_topic_direct<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::ChatTopicDirect::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "identity_a" => { - builder = builder.set_identity_a( - crate::json_deser::deser_structure_crate_model_identity_handle( - tokens, - )?, - ); - } - "identity_b" => { - builder = builder.set_identity_b( - crate::json_deser::deser_structure_crate_model_identity_handle( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_union_crate_model_chat_message_body<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - let mut variant = None; - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - if variant.is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "encountered mixed variants in union", - )); - } - variant = match key.to_unescaped()?.as_ref() { - "text" => { - Some(crate::model::ChatMessageBody::Text( - crate::json_deser::deser_structure_crate_model_chat_message_body_text(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'text' cannot be null"))? - )) - } - "chat_create" => { - Some(crate::model::ChatMessageBody::ChatCreate( - crate::json_deser::deser_structure_crate_model_chat_message_body_chat_create(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'chat_create' cannot be null"))? - )) - } - "deleted" => { - Some(crate::model::ChatMessageBody::Deleted( - crate::json_deser::deser_structure_crate_model_chat_message_body_deleted(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'deleted' cannot be null"))? - )) - } - "identity_follow" => { - Some(crate::model::ChatMessageBody::IdentityFollow( - crate::json_deser::deser_structure_crate_model_chat_message_body_identity_follow(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'identity_follow' cannot be null"))? - )) - } - "group_join" => { - Some(crate::model::ChatMessageBody::GroupJoin( - crate::json_deser::deser_structure_crate_model_chat_message_body_group_join(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'group_join' cannot be null"))? - )) - } - "group_leave" => { - Some(crate::model::ChatMessageBody::GroupLeave( - crate::json_deser::deser_structure_crate_model_chat_message_body_group_leave(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'group_leave' cannot be null"))? - )) - } - "group_member_kick" => { - Some(crate::model::ChatMessageBody::GroupMemberKick( - crate::json_deser::deser_structure_crate_model_chat_message_body_group_member_kick(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'group_member_kick' cannot be null"))? - )) - } - "party_invite" => { - Some(crate::model::ChatMessageBody::PartyInvite( - crate::json_deser::deser_structure_crate_model_chat_message_body_party_invite(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'party_invite' cannot be null"))? - )) - } - "party_join_request" => { - Some(crate::model::ChatMessageBody::PartyJoinRequest( - crate::json_deser::deser_structure_crate_model_chat_message_body_party_join_request(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'party_join_request' cannot be null"))? - )) - } - "party_join" => { - Some(crate::model::ChatMessageBody::PartyJoin( - crate::json_deser::deser_structure_crate_model_chat_message_body_party_join(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'party_join' cannot be null"))? - )) - } - "party_leave" => { - Some(crate::model::ChatMessageBody::PartyLeave( - crate::json_deser::deser_structure_crate_model_chat_message_body_party_leave(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'party_leave' cannot be null"))? - )) - } - "party_activity_change" => { - Some(crate::model::ChatMessageBody::PartyActivityChange( - crate::json_deser::deser_structure_crate_model_chat_message_body_party_activity_change(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'party_activity_change' cannot be null"))? - )) - } - _ => { - aws_smithy_json::deserialize::token::skip_value(tokens)?; - Some(crate::model::ChatMessageBody::Unknown) - } - }; - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - }, - _ => { - return Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )) - } - } - Ok(variant) -} - -pub fn deser_structure_crate_model_matchmaker_lobby_join_info_port<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::MatchmakerLobbyJoinInfoPort::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "host" => { - builder = builder.set_host( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "hostname" => { - builder = builder.set_hostname( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "port" => { - builder = builder.set_port( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "port_range" => { - builder = builder.set_port_range( - crate::json_deser::deser_structure_crate_model_matchmaker_lobby_join_info_port_range(tokens)? - ); - } - "is_tls" => { - builder = builder.set_is_tls( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_chat_message_body_text<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::ChatMessageBodyText::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "sender" => { - builder = builder.set_sender( - crate::json_deser::deser_structure_crate_model_identity_handle( - tokens, - )?, - ); - } - "body" => { - builder = builder.set_body( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_chat_message_body_chat_create<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::ChatMessageBodyChatCreate::builder(); - aws_smithy_json::deserialize::token::skip_to_end(tokens)?; - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_chat_message_body_deleted<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::ChatMessageBodyDeleted::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "sender" => { - builder = builder.set_sender( - crate::json_deser::deser_structure_crate_model_identity_handle( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_chat_message_body_identity_follow<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::ChatMessageBodyIdentityFollow::builder(); - aws_smithy_json::deserialize::token::skip_to_end(tokens)?; - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_chat_message_body_group_join<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::ChatMessageBodyGroupJoin::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "identity" => { - builder = builder.set_identity( - crate::json_deser::deser_structure_crate_model_identity_handle( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_chat_message_body_group_leave<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::ChatMessageBodyGroupLeave::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "identity" => { - builder = builder.set_identity( - crate::json_deser::deser_structure_crate_model_identity_handle( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_chat_message_body_group_member_kick<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::ChatMessageBodyGroupMemberKick::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "identity" => { - builder = builder.set_identity( - crate::json_deser::deser_structure_crate_model_identity_handle( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_chat_message_body_party_invite<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::ChatMessageBodyPartyInvite::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "sender" => { - builder = builder.set_sender( - crate::json_deser::deser_structure_crate_model_identity_handle( - tokens, - )?, - ); - } - "party" => { - builder = builder.set_party( - crate::json_deser::deser_structure_crate_model_party_handle( - tokens, - )?, - ); - } - "invite_token" => { - builder = builder.set_invite_token( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_chat_message_body_party_join_request<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::ChatMessageBodyPartyJoinRequest::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "sender" => { - builder = builder.set_sender( - crate::json_deser::deser_structure_crate_model_identity_handle( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_chat_message_body_party_join<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::ChatMessageBodyPartyJoin::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "identity" => { - builder = builder.set_identity( - crate::json_deser::deser_structure_crate_model_identity_handle( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_chat_message_body_party_leave<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::ChatMessageBodyPartyLeave::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "identity" => { - builder = builder.set_identity( - crate::json_deser::deser_structure_crate_model_identity_handle( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_chat_message_body_party_activity_change<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::ChatMessageBodyPartyActivityChange::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "activity" => { - builder = builder.set_activity( - crate::json_deser::deser_union_crate_model_party_activity( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_matchmaker_lobby_join_info_port_range<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::MatchmakerLobbyJoinInfoPortRange::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "min" => { - builder = builder.set_min( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "max" => { - builder = builder.set_max( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} diff --git a/lib/smithy-output/api-identity/rust/rust/src/json_errors.rs b/lib/smithy-output/api-identity/rust/rust/src/json_errors.rs deleted file mode 100644 index 7b7574319..000000000 --- a/lib/smithy-output/api-identity/rust/rust/src/json_errors.rs +++ /dev/null @@ -1,220 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -use aws_smithy_json::deserialize::token::skip_value; -use aws_smithy_json::deserialize::{json_token_iter, Error as DeserializeError, Token}; -use aws_smithy_types::Error as SmithyError; -use bytes::Bytes; -use http::header::ToStrError; -use http::{HeaderMap, HeaderValue}; -use std::borrow::Cow; - -// currently only used by AwsJson -#[allow(unused)] -pub fn is_error(response: &http::Response) -> bool { - !response.status().is_success() -} - -fn sanitize_error_code(error_code: &str) -> &str { - // Trim a trailing URL from the error code, beginning with a `:` - let error_code = match error_code.find(':') { - Some(idx) => &error_code[..idx], - None => error_code, - }; - - // Trim a prefixing namespace from the error code, beginning with a `#` - match error_code.find('#') { - Some(idx) => &error_code[idx + 1..], - None => error_code, - } -} - -struct ErrorBody<'a> { - code: Option>, - message: Option>, -} - -fn parse_error_body(bytes: &[u8]) -> Result { - let mut tokens = json_token_iter(bytes).peekable(); - let (mut typ, mut code, mut message) = (None, None, None); - if let Some(Token::StartObject { .. }) = tokens.next().transpose()? { - loop { - match tokens.next().transpose()? { - Some(Token::EndObject { .. }) => break, - Some(Token::ObjectKey { key, .. }) => { - if let Some(Ok(Token::ValueString { value, .. })) = tokens.peek() { - match key.as_escaped_str() { - "code" => code = Some(value.to_unescaped()?), - "__type" => typ = Some(value.to_unescaped()?), - "message" | "Message" | "errorMessage" => { - message = Some(value.to_unescaped()?) - } - _ => {} - } - } - skip_value(&mut tokens)?; - } - _ => { - return Err(DeserializeError::custom( - "expected object key or end object", - )) - } - } - } - if tokens.next().is_some() { - return Err(DeserializeError::custom( - "found more JSON tokens after completing parsing", - )); - } - } - Ok(ErrorBody { - code: code.or(typ), - message, - }) -} - -fn error_type_from_header(headers: &HeaderMap) -> Result, ToStrError> { - headers - .get("X-Amzn-Errortype") - .map(|v| v.to_str()) - .transpose() -} - -fn request_id(headers: &HeaderMap) -> Option<&str> { - headers - .get("X-Amzn-Requestid") - .and_then(|v| v.to_str().ok()) -} - -pub fn parse_generic_error( - payload: &Bytes, - headers: &HeaderMap, -) -> Result { - let ErrorBody { code, message } = parse_error_body(payload.as_ref())?; - - let mut err_builder = SmithyError::builder(); - if let Some(code) = error_type_from_header(headers) - .map_err(|_| DeserializeError::custom("X-Amzn-Errortype header was not valid UTF-8"))? - .or_else(|| code.as_deref()) - .map(sanitize_error_code) - { - err_builder.code(code); - } - if let Some(message) = message { - err_builder.message(message); - } - if let Some(request_id) = request_id(headers) { - err_builder.request_id(request_id); - } - Ok(err_builder.build()) -} - -#[cfg(test)] -mod test { - use crate::json_errors::{parse_error_body, parse_generic_error, sanitize_error_code}; - use aws_smithy_types::Error; - use bytes::Bytes; - use std::borrow::Cow; - - #[test] - fn generic_error() { - let response = http::Response::builder() - .header("X-Amzn-Requestid", "1234") - .body(Bytes::from_static( - br#"{ "__type": "FooError", "message": "Go to foo" }"#, - )) - .unwrap(); - assert_eq!( - parse_generic_error(response.body(), response.headers()).unwrap(), - Error::builder() - .code("FooError") - .message("Go to foo") - .request_id("1234") - .build() - ) - } - - #[test] - fn error_type() { - assert_eq!( - Some(Cow::Borrowed("FooError")), - parse_error_body(br#"{ "__type": "FooError" }"#) - .unwrap() - .code - ); - } - - #[test] - fn code_takes_priority() { - assert_eq!( - Some(Cow::Borrowed("BarError")), - parse_error_body(br#"{ "code": "BarError", "__type": "FooError" }"#) - .unwrap() - .code - ); - } - - #[test] - fn ignore_unrecognized_fields() { - assert_eq!( - Some(Cow::Borrowed("FooError")), - parse_error_body(br#"{ "__type": "FooError", "asdf": 5, "fdsa": {}, "foo": "1" }"#) - .unwrap() - .code - ); - } - - #[test] - fn sanitize_namespace_and_url() { - assert_eq!( - sanitize_error_code("aws.protocoltests.restjson#FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/"), - "FooError"); - } - - #[test] - fn sanitize_noop() { - assert_eq!(sanitize_error_code("FooError"), "FooError"); - } - - #[test] - fn sanitize_url() { - assert_eq!( - sanitize_error_code( - "FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/" - ), - "FooError" - ); - } - - #[test] - fn sanitize_namespace() { - assert_eq!( - sanitize_error_code("aws.protocoltests.restjson#FooError"), - "FooError" - ); - } - - // services like lambda use an alternate `Message` instead of `message` - #[test] - fn alternative_error_message_names() { - let response = http::Response::builder() - .header("x-amzn-errortype", "ResourceNotFoundException") - .body(Bytes::from_static( - br#"{ - "Type": "User", - "Message": "Functions from 'us-west-2' are not reachable from us-east-1" - }"#, - )) - .unwrap(); - assert_eq!( - parse_generic_error(response.body(), response.headers()).unwrap(), - Error::builder() - .code("ResourceNotFoundException") - .message("Functions from 'us-west-2' are not reachable from us-east-1") - .build() - ); - } -} diff --git a/lib/smithy-output/api-identity/rust/rust/src/json_ser.rs b/lib/smithy-output/api-identity/rust/rust/src/json_ser.rs deleted file mode 100644 index a7ee76ac1..000000000 --- a/lib/smithy-output/api-identity/rust/rust/src/json_ser.rs +++ /dev/null @@ -1,160 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub fn serialize_structure_crate_input_cancel_game_link_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::CancelGameLinkInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_1) = &input.identity_link_token { - object.key("identity_link_token").string(var_1.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_complete_game_link_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::CompleteGameLinkInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_2) = &input.identity_link_token { - object.key("identity_link_token").string(var_2.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_prepare_identity_avatar_upload_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::PrepareIdentityAvatarUploadInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_3) = &input.content_length { - object.key("content_length").number( - #[allow(clippy::useless_conversion)] - aws_smithy_types::Number::NegInt((*var_3).into()), - ); - } - if let Some(var_4) = &input.mime { - object.key("mime").string(var_4.as_str()); - } - if let Some(var_5) = &input.path { - object.key("path").string(var_5.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_report_identity_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::ReportIdentityInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_6) = &input.reason { - object.key("reason").string(var_6.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_set_identity_game_activity_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::SetIdentityGameActivityInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_7) = &input.game_activity { - let mut object_8 = object.key("game_activity").start_object(); - crate::json_ser::serialize_structure_crate_model_update_identity_game_activity( - &mut object_8, - var_7, - )?; - object_8.finish(); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_setup_identity_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::SetupIdentityInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_9) = &input.existing_identity_token { - object.key("existing_identity_token").string(var_9.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_signup_for_beta_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::SignupForBetaInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_10) = &input.company_name { - object.key("company_name").string(var_10.as_str()); - } - if let Some(var_11) = &input.company_size { - object.key("company_size").string(var_11.as_str()); - } - if let Some(var_12) = &input.goals { - object.key("goals").string(var_12.as_str()); - } - if let Some(var_13) = &input.name { - object.key("name").string(var_13.as_str()); - } - if let Some(var_14) = &input.preferred_tools { - object.key("preferred_tools").string(var_14.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_update_identity_profile_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::UpdateIdentityProfileInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_15) = &input.account_number { - object.key("account_number").number( - #[allow(clippy::useless_conversion)] - aws_smithy_types::Number::NegInt((*var_15).into()), - ); - } - if let Some(var_16) = &input.bio { - object.key("bio").string(var_16.as_str()); - } - if let Some(var_17) = &input.display_name { - object.key("display_name").string(var_17.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_update_identity_status_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::UpdateIdentityStatusInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_18) = &input.status { - object.key("status").string(var_18.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_validate_identity_profile_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::ValidateIdentityProfileInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_19) = &input.account_number { - object.key("account_number").number( - #[allow(clippy::useless_conversion)] - aws_smithy_types::Number::NegInt((*var_19).into()), - ); - } - if let Some(var_20) = &input.bio { - object.key("bio").string(var_20.as_str()); - } - if let Some(var_21) = &input.display_name { - object.key("display_name").string(var_21.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_model_update_identity_game_activity( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::UpdateIdentityGameActivity, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_22) = &input.message { - object.key("message").string(var_22.as_str()); - } - if let Some(var_23) = &input.public_metadata { - object.key("public_metadata").document(var_23); - } - if let Some(var_24) = &input.mutual_metadata { - object.key("mutual_metadata").document(var_24); - } - Ok(()) -} diff --git a/lib/smithy-output/api-identity/rust/rust/src/lib.rs b/lib/smithy-output/api-identity/rust/rust/src/lib.rs deleted file mode 100644 index 1b07e2231..000000000 --- a/lib/smithy-output/api-identity/rust/rust/src/lib.rs +++ /dev/null @@ -1,57 +0,0 @@ -#![allow(clippy::module_inception)] -#![allow(clippy::upper_case_acronyms)] -#![allow(clippy::large_enum_variant)] -#![allow(clippy::wrong_self_convention)] -#![allow(clippy::should_implement_trait)] -#![allow(clippy::blacklisted_name)] -#![allow(clippy::vec_init_then_push)] -#![allow(rustdoc::bare_urls)] -#![warn(missing_docs)] -//! rivet-identity -//! -//! # Crate Organization -//! -//! The entry point for most customers will be [`Client`]. [`Client`] exposes one method for each API offered -//! by the service. -//! -//! Some APIs require complex or nested arguments. These exist in [`model`](crate::model). -//! -//! Lastly, errors that can be returned by the service are contained within [`error`]. [`Error`] defines a meta -//! error encompassing all possible errors that can be returned by the service. -//! -//! The other modules within this crate are not required for normal usage. - -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use error_meta::Error; - -#[doc(inline)] -pub use config::Config; - -/// Client and fluent builders for calling the service. -pub mod client; -/// Configuration for the service. -pub mod config; -/// Errors that can occur when calling the service. -pub mod error; -mod error_meta; -/// Input structures for operations. -pub mod input; -mod json_deser; -mod json_errors; -mod json_ser; -/// Data structures used by operation inputs/outputs. -pub mod model; -/// All operations that this crate can perform. -pub mod operation; -mod operation_deser; -mod operation_ser; -/// Output structures for operations. -pub mod output; -pub use client::{Builder, Client, ClientWrapper}; -/// Crate version number. -pub static PKG_VERSION: &str = env!("CARGO_PKG_VERSION"); -/// Re-exported types from supporting crates. -pub mod types { - pub use aws_smithy_http::result::SdkError; - pub use aws_smithy_types::DateTime; -} diff --git a/lib/smithy-output/api-identity/rust/rust/src/model.rs b/lib/smithy-output/api-identity/rust/rust/src/model.rs deleted file mode 100644 index c04f05ac1..000000000 --- a/lib/smithy-output/api-identity/rust/rust/src/model.rs +++ /dev/null @@ -1,7247 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Provided by watchable endpoints used in blocking loops. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct WatchResponse { - /// Index indicating the version of the data responded. Pas this to `rivet.common#WatchQuery` to block and wait for the next response. - pub index: std::option::Option, -} -impl WatchResponse { - /// Index indicating the version of the data responded. Pas this to `rivet.common#WatchQuery` to block and wait for the next response. - pub fn index(&self) -> std::option::Option<&str> { - self.index.as_deref() - } -} -impl std::fmt::Debug for WatchResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("WatchResponse"); - formatter.field("index", &self.index); - formatter.finish() - } -} -/// See [`WatchResponse`](crate::model::WatchResponse) -pub mod watch_response { - /// A builder for [`WatchResponse`](crate::model::WatchResponse) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) index: std::option::Option, - } - impl Builder { - /// Index indicating the version of the data responded. Pas this to `rivet.common#WatchQuery` to block and wait for the next response. - pub fn index(mut self, input: impl Into) -> Self { - self.index = Some(input.into()); - self - } - /// Index indicating the version of the data responded. Pas this to `rivet.common#WatchQuery` to block and wait for the next response. - pub fn set_index(mut self, input: std::option::Option) -> Self { - self.index = input; - self - } - /// Consumes the builder and constructs a [`WatchResponse`](crate::model::WatchResponse) - pub fn build(self) -> crate::model::WatchResponse { - crate::model::WatchResponse { index: self.index } - } - } -} -impl WatchResponse { - /// Creates a new builder-style object to manufacture [`WatchResponse`](crate::model::WatchResponse) - pub fn builder() -> crate::model::watch_response::Builder { - crate::model::watch_response::Builder::default() - } -} - -/// An identity handle. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct IdentityHandle { - /// A universally unique identifier. - pub identity_id: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub account_number: std::option::Option, - /// The URL of this identity's avatar image. - pub avatar_url: std::option::Option, - /// Information about the identity's current status, party, and active game. - pub presence: std::option::Option, - /// A party handle. - pub party: std::option::Option, - /// Whether or not this identity is registered with a linked account. - pub is_registered: std::option::Option, - /// External links for an identity. - pub external: std::option::Option, -} -impl IdentityHandle { - /// A universally unique identifier. - pub fn identity_id(&self) -> std::option::Option<&str> { - self.identity_id.as_deref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub fn account_number(&self) -> std::option::Option { - self.account_number - } - /// The URL of this identity's avatar image. - pub fn avatar_url(&self) -> std::option::Option<&str> { - self.avatar_url.as_deref() - } - /// Information about the identity's current status, party, and active game. - pub fn presence(&self) -> std::option::Option<&crate::model::IdentityPresence> { - self.presence.as_ref() - } - /// A party handle. - pub fn party(&self) -> std::option::Option<&crate::model::PartyHandle> { - self.party.as_ref() - } - /// Whether or not this identity is registered with a linked account. - pub fn is_registered(&self) -> std::option::Option { - self.is_registered - } - /// External links for an identity. - pub fn external(&self) -> std::option::Option<&crate::model::IdentityExternalLinks> { - self.external.as_ref() - } -} -impl std::fmt::Debug for IdentityHandle { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("IdentityHandle"); - formatter.field("identity_id", &self.identity_id); - formatter.field("display_name", &self.display_name); - formatter.field("account_number", &self.account_number); - formatter.field("avatar_url", &self.avatar_url); - formatter.field("presence", &self.presence); - formatter.field("party", &self.party); - formatter.field("is_registered", &self.is_registered); - formatter.field("external", &self.external); - formatter.finish() - } -} -/// See [`IdentityHandle`](crate::model::IdentityHandle) -pub mod identity_handle { - /// A builder for [`IdentityHandle`](crate::model::IdentityHandle) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity_id: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) account_number: std::option::Option, - pub(crate) avatar_url: std::option::Option, - pub(crate) presence: std::option::Option, - pub(crate) party: std::option::Option, - pub(crate) is_registered: std::option::Option, - pub(crate) external: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.identity_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.identity_id = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub fn account_number(mut self, input: i32) -> Self { - self.account_number = Some(input); - self - } - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub fn set_account_number(mut self, input: std::option::Option) -> Self { - self.account_number = input; - self - } - /// The URL of this identity's avatar image. - pub fn avatar_url(mut self, input: impl Into) -> Self { - self.avatar_url = Some(input.into()); - self - } - /// The URL of this identity's avatar image. - pub fn set_avatar_url(mut self, input: std::option::Option) -> Self { - self.avatar_url = input; - self - } - /// Information about the identity's current status, party, and active game. - pub fn presence(mut self, input: crate::model::IdentityPresence) -> Self { - self.presence = Some(input); - self - } - /// Information about the identity's current status, party, and active game. - pub fn set_presence( - mut self, - input: std::option::Option, - ) -> Self { - self.presence = input; - self - } - /// A party handle. - pub fn party(mut self, input: crate::model::PartyHandle) -> Self { - self.party = Some(input); - self - } - /// A party handle. - pub fn set_party(mut self, input: std::option::Option) -> Self { - self.party = input; - self - } - /// Whether or not this identity is registered with a linked account. - pub fn is_registered(mut self, input: bool) -> Self { - self.is_registered = Some(input); - self - } - /// Whether or not this identity is registered with a linked account. - pub fn set_is_registered(mut self, input: std::option::Option) -> Self { - self.is_registered = input; - self - } - /// External links for an identity. - pub fn external(mut self, input: crate::model::IdentityExternalLinks) -> Self { - self.external = Some(input); - self - } - /// External links for an identity. - pub fn set_external( - mut self, - input: std::option::Option, - ) -> Self { - self.external = input; - self - } - /// Consumes the builder and constructs a [`IdentityHandle`](crate::model::IdentityHandle) - pub fn build(self) -> crate::model::IdentityHandle { - crate::model::IdentityHandle { - identity_id: self.identity_id, - display_name: self.display_name, - account_number: self.account_number, - avatar_url: self.avatar_url, - presence: self.presence, - party: self.party, - is_registered: self.is_registered, - external: self.external, - } - } - } -} -impl IdentityHandle { - /// Creates a new builder-style object to manufacture [`IdentityHandle`](crate::model::IdentityHandle) - pub fn builder() -> crate::model::identity_handle::Builder { - crate::model::identity_handle::Builder::default() - } -} - -/// External links for an identity. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct IdentityExternalLinks { - /// A link to this identity's profile page. - pub profile: std::option::Option, - /// A link to the Rivet settings page. - pub settings: std::option::Option, - /// A link to a chat page with the given identity. - pub chat: std::option::Option, -} -impl IdentityExternalLinks { - /// A link to this identity's profile page. - pub fn profile(&self) -> std::option::Option<&str> { - self.profile.as_deref() - } - /// A link to the Rivet settings page. - pub fn settings(&self) -> std::option::Option<&str> { - self.settings.as_deref() - } - /// A link to a chat page with the given identity. - pub fn chat(&self) -> std::option::Option<&str> { - self.chat.as_deref() - } -} -impl std::fmt::Debug for IdentityExternalLinks { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("IdentityExternalLinks"); - formatter.field("profile", &self.profile); - formatter.field("settings", &self.settings); - formatter.field("chat", &self.chat); - formatter.finish() - } -} -/// See [`IdentityExternalLinks`](crate::model::IdentityExternalLinks) -pub mod identity_external_links { - /// A builder for [`IdentityExternalLinks`](crate::model::IdentityExternalLinks) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) profile: std::option::Option, - pub(crate) settings: std::option::Option, - pub(crate) chat: std::option::Option, - } - impl Builder { - /// A link to this identity's profile page. - pub fn profile(mut self, input: impl Into) -> Self { - self.profile = Some(input.into()); - self - } - /// A link to this identity's profile page. - pub fn set_profile(mut self, input: std::option::Option) -> Self { - self.profile = input; - self - } - /// A link to the Rivet settings page. - pub fn settings(mut self, input: impl Into) -> Self { - self.settings = Some(input.into()); - self - } - /// A link to the Rivet settings page. - pub fn set_settings(mut self, input: std::option::Option) -> Self { - self.settings = input; - self - } - /// A link to a chat page with the given identity. - pub fn chat(mut self, input: impl Into) -> Self { - self.chat = Some(input.into()); - self - } - /// A link to a chat page with the given identity. - pub fn set_chat(mut self, input: std::option::Option) -> Self { - self.chat = input; - self - } - /// Consumes the builder and constructs a [`IdentityExternalLinks`](crate::model::IdentityExternalLinks) - pub fn build(self) -> crate::model::IdentityExternalLinks { - crate::model::IdentityExternalLinks { - profile: self.profile, - settings: self.settings, - chat: self.chat, - } - } - } -} -impl IdentityExternalLinks { - /// Creates a new builder-style object to manufacture [`IdentityExternalLinks`](crate::model::IdentityExternalLinks) - pub fn builder() -> crate::model::identity_external_links::Builder { - crate::model::identity_external_links::Builder::default() - } -} - -/// A party handle. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PartyHandle { - /// A universally unique identifier. - pub party_id: std::option::Option, - /// RFC3339 timestamp. - pub create_ts: std::option::Option, - /// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. - pub activity: std::option::Option, - /// External links for a party. - pub external: std::option::Option, -} -impl PartyHandle { - /// A universally unique identifier. - pub fn party_id(&self) -> std::option::Option<&str> { - self.party_id.as_deref() - } - /// RFC3339 timestamp. - pub fn create_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.create_ts.as_ref() - } - /// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. - pub fn activity(&self) -> std::option::Option<&crate::model::PartyActivity> { - self.activity.as_ref() - } - /// External links for a party. - pub fn external(&self) -> std::option::Option<&crate::model::PartyExternalLinks> { - self.external.as_ref() - } -} -impl std::fmt::Debug for PartyHandle { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PartyHandle"); - formatter.field("party_id", &self.party_id); - formatter.field("create_ts", &self.create_ts); - formatter.field("activity", &self.activity); - formatter.field("external", &self.external); - formatter.finish() - } -} -/// See [`PartyHandle`](crate::model::PartyHandle) -pub mod party_handle { - /// A builder for [`PartyHandle`](crate::model::PartyHandle) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) party_id: std::option::Option, - pub(crate) create_ts: std::option::Option, - pub(crate) activity: std::option::Option, - pub(crate) external: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn party_id(mut self, input: impl Into) -> Self { - self.party_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_party_id(mut self, input: std::option::Option) -> Self { - self.party_id = input; - self - } - /// RFC3339 timestamp. - pub fn create_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.create_ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_create_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.create_ts = input; - self - } - /// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. - pub fn activity(mut self, input: crate::model::PartyActivity) -> Self { - self.activity = Some(input); - self - } - /// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. - pub fn set_activity( - mut self, - input: std::option::Option, - ) -> Self { - self.activity = input; - self - } - /// External links for a party. - pub fn external(mut self, input: crate::model::PartyExternalLinks) -> Self { - self.external = Some(input); - self - } - /// External links for a party. - pub fn set_external( - mut self, - input: std::option::Option, - ) -> Self { - self.external = input; - self - } - /// Consumes the builder and constructs a [`PartyHandle`](crate::model::PartyHandle) - pub fn build(self) -> crate::model::PartyHandle { - crate::model::PartyHandle { - party_id: self.party_id, - create_ts: self.create_ts, - activity: self.activity, - external: self.external, - } - } - } -} -impl PartyHandle { - /// Creates a new builder-style object to manufacture [`PartyHandle`](crate::model::PartyHandle) - pub fn builder() -> crate::model::party_handle::Builder { - crate::model::party_handle::Builder::default() - } -} - -/// External links for a party. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PartyExternalLinks { - /// A link to the given party's chat thread. - pub chat: std::option::Option, -} -impl PartyExternalLinks { - /// A link to the given party's chat thread. - pub fn chat(&self) -> std::option::Option<&str> { - self.chat.as_deref() - } -} -impl std::fmt::Debug for PartyExternalLinks { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PartyExternalLinks"); - formatter.field("chat", &self.chat); - formatter.finish() - } -} -/// See [`PartyExternalLinks`](crate::model::PartyExternalLinks) -pub mod party_external_links { - /// A builder for [`PartyExternalLinks`](crate::model::PartyExternalLinks) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) chat: std::option::Option, - } - impl Builder { - /// A link to the given party's chat thread. - pub fn chat(mut self, input: impl Into) -> Self { - self.chat = Some(input.into()); - self - } - /// A link to the given party's chat thread. - pub fn set_chat(mut self, input: std::option::Option) -> Self { - self.chat = input; - self - } - /// Consumes the builder and constructs a [`PartyExternalLinks`](crate::model::PartyExternalLinks) - pub fn build(self) -> crate::model::PartyExternalLinks { - crate::model::PartyExternalLinks { chat: self.chat } - } - } -} -impl PartyExternalLinks { - /// Creates a new builder-style object to manufacture [`PartyExternalLinks`](crate::model::PartyExternalLinks) - pub fn builder() -> crate::model::party_external_links::Builder { - crate::model::party_external_links::Builder::default() - } -} - -/// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] -pub enum PartyActivity { - /// A party activity denoting that the party is idle. - Idle(crate::model::PartyActivityIdle), - /// A party activity denoting that the party is currently searching for a lobby. - MatchmakerFindingLobby(crate::model::PartyActivityMatchmakerFindingLobby), - /// A party activity denoting that the party is currently in a lobby. - MatchmakerLobby(crate::model::PartyActivityMatchmakerLobby), - /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version. - /// An unknown enum variant - /// - /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._ - /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized - /// by the client. This can happen when the server adds new functionality, but the client has not been updated. - /// To investigate this, consider turning on debug logging to print the raw HTTP response. - #[non_exhaustive] - Unknown, -} -impl PartyActivity { - /// Tries to convert the enum instance into [`Idle`](crate::model::PartyActivity::Idle), extracting the inner [`PartyActivityIdle`](crate::model::PartyActivityIdle). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_idle(&self) -> std::result::Result<&crate::model::PartyActivityIdle, &Self> { - if let PartyActivity::Idle(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`Idle`](crate::model::PartyActivity::Idle). - pub fn is_idle(&self) -> bool { - self.as_idle().is_ok() - } - /// Tries to convert the enum instance into [`MatchmakerFindingLobby`](crate::model::PartyActivity::MatchmakerFindingLobby), extracting the inner [`PartyActivityMatchmakerFindingLobby`](crate::model::PartyActivityMatchmakerFindingLobby). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_matchmaker_finding_lobby( - &self, - ) -> std::result::Result<&crate::model::PartyActivityMatchmakerFindingLobby, &Self> { - if let PartyActivity::MatchmakerFindingLobby(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`MatchmakerFindingLobby`](crate::model::PartyActivity::MatchmakerFindingLobby). - pub fn is_matchmaker_finding_lobby(&self) -> bool { - self.as_matchmaker_finding_lobby().is_ok() - } - /// Tries to convert the enum instance into [`MatchmakerLobby`](crate::model::PartyActivity::MatchmakerLobby), extracting the inner [`PartyActivityMatchmakerLobby`](crate::model::PartyActivityMatchmakerLobby). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_matchmaker_lobby( - &self, - ) -> std::result::Result<&crate::model::PartyActivityMatchmakerLobby, &Self> { - if let PartyActivity::MatchmakerLobby(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`MatchmakerLobby`](crate::model::PartyActivity::MatchmakerLobby). - pub fn is_matchmaker_lobby(&self) -> bool { - self.as_matchmaker_lobby().is_ok() - } - /// Returns true if the enum instance is the `Unknown` variant. - pub fn is_unknown(&self) -> bool { - matches!(self, Self::Unknown) - } -} - -/// A party activity denoting that the party is currently in a lobby. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PartyActivityMatchmakerLobby { - /// A party lobby. - pub lobby: std::option::Option, - /// A game handle. - pub game: std::option::Option, -} -impl PartyActivityMatchmakerLobby { - /// A party lobby. - pub fn lobby(&self) -> std::option::Option<&crate::model::PartyMatchmakerLobby> { - self.lobby.as_ref() - } - /// A game handle. - pub fn game(&self) -> std::option::Option<&crate::model::GameHandle> { - self.game.as_ref() - } -} -impl std::fmt::Debug for PartyActivityMatchmakerLobby { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PartyActivityMatchmakerLobby"); - formatter.field("lobby", &self.lobby); - formatter.field("game", &self.game); - formatter.finish() - } -} -/// See [`PartyActivityMatchmakerLobby`](crate::model::PartyActivityMatchmakerLobby) -pub mod party_activity_matchmaker_lobby { - /// A builder for [`PartyActivityMatchmakerLobby`](crate::model::PartyActivityMatchmakerLobby) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) lobby: std::option::Option, - pub(crate) game: std::option::Option, - } - impl Builder { - /// A party lobby. - pub fn lobby(mut self, input: crate::model::PartyMatchmakerLobby) -> Self { - self.lobby = Some(input); - self - } - /// A party lobby. - pub fn set_lobby( - mut self, - input: std::option::Option, - ) -> Self { - self.lobby = input; - self - } - /// A game handle. - pub fn game(mut self, input: crate::model::GameHandle) -> Self { - self.game = Some(input); - self - } - /// A game handle. - pub fn set_game(mut self, input: std::option::Option) -> Self { - self.game = input; - self - } - /// Consumes the builder and constructs a [`PartyActivityMatchmakerLobby`](crate::model::PartyActivityMatchmakerLobby) - pub fn build(self) -> crate::model::PartyActivityMatchmakerLobby { - crate::model::PartyActivityMatchmakerLobby { - lobby: self.lobby, - game: self.game, - } - } - } -} -impl PartyActivityMatchmakerLobby { - /// Creates a new builder-style object to manufacture [`PartyActivityMatchmakerLobby`](crate::model::PartyActivityMatchmakerLobby) - pub fn builder() -> crate::model::party_activity_matchmaker_lobby::Builder { - crate::model::party_activity_matchmaker_lobby::Builder::default() - } -} - -/// A game handle. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GameHandle { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub name_id: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// The URL of this game's logo image. - pub logo_url: std::option::Option, - /// The URL of this game's banner image. - pub banner_url: std::option::Option, -} -impl GameHandle { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn name_id(&self) -> std::option::Option<&str> { - self.name_id.as_deref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// The URL of this game's logo image. - pub fn logo_url(&self) -> std::option::Option<&str> { - self.logo_url.as_deref() - } - /// The URL of this game's banner image. - pub fn banner_url(&self) -> std::option::Option<&str> { - self.banner_url.as_deref() - } -} -impl std::fmt::Debug for GameHandle { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GameHandle"); - formatter.field("game_id", &self.game_id); - formatter.field("name_id", &self.name_id); - formatter.field("display_name", &self.display_name); - formatter.field("logo_url", &self.logo_url); - formatter.field("banner_url", &self.banner_url); - formatter.finish() - } -} -/// See [`GameHandle`](crate::model::GameHandle) -pub mod game_handle { - /// A builder for [`GameHandle`](crate::model::GameHandle) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) name_id: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) logo_url: std::option::Option, - pub(crate) banner_url: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn name_id(mut self, input: impl Into) -> Self { - self.name_id = Some(input.into()); - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn set_name_id(mut self, input: std::option::Option) -> Self { - self.name_id = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// The URL of this game's logo image. - pub fn logo_url(mut self, input: impl Into) -> Self { - self.logo_url = Some(input.into()); - self - } - /// The URL of this game's logo image. - pub fn set_logo_url(mut self, input: std::option::Option) -> Self { - self.logo_url = input; - self - } - /// The URL of this game's banner image. - pub fn banner_url(mut self, input: impl Into) -> Self { - self.banner_url = Some(input.into()); - self - } - /// The URL of this game's banner image. - pub fn set_banner_url(mut self, input: std::option::Option) -> Self { - self.banner_url = input; - self - } - /// Consumes the builder and constructs a [`GameHandle`](crate::model::GameHandle) - pub fn build(self) -> crate::model::GameHandle { - crate::model::GameHandle { - game_id: self.game_id, - name_id: self.name_id, - display_name: self.display_name, - logo_url: self.logo_url, - banner_url: self.banner_url, - } - } - } -} -impl GameHandle { - /// Creates a new builder-style object to manufacture [`GameHandle`](crate::model::GameHandle) - pub fn builder() -> crate::model::game_handle::Builder { - crate::model::game_handle::Builder::default() - } -} - -/// A party lobby. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PartyMatchmakerLobby { - /// A universally unique identifier. - pub lobby_id: std::option::Option, -} -impl PartyMatchmakerLobby { - /// A universally unique identifier. - pub fn lobby_id(&self) -> std::option::Option<&str> { - self.lobby_id.as_deref() - } -} -impl std::fmt::Debug for PartyMatchmakerLobby { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PartyMatchmakerLobby"); - formatter.field("lobby_id", &self.lobby_id); - formatter.finish() - } -} -/// See [`PartyMatchmakerLobby`](crate::model::PartyMatchmakerLobby) -pub mod party_matchmaker_lobby { - /// A builder for [`PartyMatchmakerLobby`](crate::model::PartyMatchmakerLobby) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) lobby_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn lobby_id(mut self, input: impl Into) -> Self { - self.lobby_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_lobby_id(mut self, input: std::option::Option) -> Self { - self.lobby_id = input; - self - } - /// Consumes the builder and constructs a [`PartyMatchmakerLobby`](crate::model::PartyMatchmakerLobby) - pub fn build(self) -> crate::model::PartyMatchmakerLobby { - crate::model::PartyMatchmakerLobby { - lobby_id: self.lobby_id, - } - } - } -} -impl PartyMatchmakerLobby { - /// Creates a new builder-style object to manufacture [`PartyMatchmakerLobby`](crate::model::PartyMatchmakerLobby) - pub fn builder() -> crate::model::party_matchmaker_lobby::Builder { - crate::model::party_matchmaker_lobby::Builder::default() - } -} - -/// A party activity denoting that the party is currently searching for a lobby. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PartyActivityMatchmakerFindingLobby { - /// A game handle. - pub game: std::option::Option, -} -impl PartyActivityMatchmakerFindingLobby { - /// A game handle. - pub fn game(&self) -> std::option::Option<&crate::model::GameHandle> { - self.game.as_ref() - } -} -impl std::fmt::Debug for PartyActivityMatchmakerFindingLobby { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PartyActivityMatchmakerFindingLobby"); - formatter.field("game", &self.game); - formatter.finish() - } -} -/// See [`PartyActivityMatchmakerFindingLobby`](crate::model::PartyActivityMatchmakerFindingLobby) -pub mod party_activity_matchmaker_finding_lobby { - /// A builder for [`PartyActivityMatchmakerFindingLobby`](crate::model::PartyActivityMatchmakerFindingLobby) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game: std::option::Option, - } - impl Builder { - /// A game handle. - pub fn game(mut self, input: crate::model::GameHandle) -> Self { - self.game = Some(input); - self - } - /// A game handle. - pub fn set_game(mut self, input: std::option::Option) -> Self { - self.game = input; - self - } - /// Consumes the builder and constructs a [`PartyActivityMatchmakerFindingLobby`](crate::model::PartyActivityMatchmakerFindingLobby) - pub fn build(self) -> crate::model::PartyActivityMatchmakerFindingLobby { - crate::model::PartyActivityMatchmakerFindingLobby { game: self.game } - } - } -} -impl PartyActivityMatchmakerFindingLobby { - /// Creates a new builder-style object to manufacture [`PartyActivityMatchmakerFindingLobby`](crate::model::PartyActivityMatchmakerFindingLobby) - pub fn builder() -> crate::model::party_activity_matchmaker_finding_lobby::Builder { - crate::model::party_activity_matchmaker_finding_lobby::Builder::default() - } -} - -/// A party activity denoting that the party is idle. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PartyActivityIdle {} -impl std::fmt::Debug for PartyActivityIdle { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PartyActivityIdle"); - formatter.finish() - } -} -/// See [`PartyActivityIdle`](crate::model::PartyActivityIdle) -pub mod party_activity_idle { - /// A builder for [`PartyActivityIdle`](crate::model::PartyActivityIdle) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`PartyActivityIdle`](crate::model::PartyActivityIdle) - pub fn build(self) -> crate::model::PartyActivityIdle { - crate::model::PartyActivityIdle {} - } - } -} -impl PartyActivityIdle { - /// Creates a new builder-style object to manufacture [`PartyActivityIdle`](crate::model::PartyActivityIdle) - pub fn builder() -> crate::model::party_activity_idle::Builder { - crate::model::party_activity_idle::Builder::default() - } -} - -/// Information about the identity's current status, party, and active game. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct IdentityPresence { - /// RFC3339 timestamp. - pub update_ts: std::option::Option, - /// The current status of an identity. This helps players understand if another player is currently playing or has their game in the background. - pub status: std::option::Option, - /// The game an identity is currently participating in. - pub game_activity: std::option::Option, -} -impl IdentityPresence { - /// RFC3339 timestamp. - pub fn update_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.update_ts.as_ref() - } - /// The current status of an identity. This helps players understand if another player is currently playing or has their game in the background. - pub fn status(&self) -> std::option::Option<&crate::model::IdentityStatus> { - self.status.as_ref() - } - /// The game an identity is currently participating in. - pub fn game_activity(&self) -> std::option::Option<&crate::model::IdentityGameActivity> { - self.game_activity.as_ref() - } -} -impl std::fmt::Debug for IdentityPresence { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("IdentityPresence"); - formatter.field("update_ts", &self.update_ts); - formatter.field("status", &self.status); - formatter.field("game_activity", &self.game_activity); - formatter.finish() - } -} -/// See [`IdentityPresence`](crate::model::IdentityPresence) -pub mod identity_presence { - /// A builder for [`IdentityPresence`](crate::model::IdentityPresence) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) update_ts: std::option::Option, - pub(crate) status: std::option::Option, - pub(crate) game_activity: std::option::Option, - } - impl Builder { - /// RFC3339 timestamp. - pub fn update_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.update_ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_update_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.update_ts = input; - self - } - /// The current status of an identity. This helps players understand if another player is currently playing or has their game in the background. - pub fn status(mut self, input: crate::model::IdentityStatus) -> Self { - self.status = Some(input); - self - } - /// The current status of an identity. This helps players understand if another player is currently playing or has their game in the background. - pub fn set_status( - mut self, - input: std::option::Option, - ) -> Self { - self.status = input; - self - } - /// The game an identity is currently participating in. - pub fn game_activity(mut self, input: crate::model::IdentityGameActivity) -> Self { - self.game_activity = Some(input); - self - } - /// The game an identity is currently participating in. - pub fn set_game_activity( - mut self, - input: std::option::Option, - ) -> Self { - self.game_activity = input; - self - } - /// Consumes the builder and constructs a [`IdentityPresence`](crate::model::IdentityPresence) - pub fn build(self) -> crate::model::IdentityPresence { - crate::model::IdentityPresence { - update_ts: self.update_ts, - status: self.status, - game_activity: self.game_activity, - } - } - } -} -impl IdentityPresence { - /// Creates a new builder-style object to manufacture [`IdentityPresence`](crate::model::IdentityPresence) - pub fn builder() -> crate::model::identity_presence::Builder { - crate::model::identity_presence::Builder::default() - } -} - -/// The game an identity is currently participating in. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct IdentityGameActivity { - /// A game handle. - pub game: std::option::Option, - /// A short activity message about the current game activity. - pub message: std::option::Option, - /// JSON data seen by anyone. - pub public_metadata: std::option::Option, - /// JSON data seen only by the given identity and their mutual followers. - pub mutual_metadata: std::option::Option, -} -impl IdentityGameActivity { - /// A game handle. - pub fn game(&self) -> std::option::Option<&crate::model::GameHandle> { - self.game.as_ref() - } - /// A short activity message about the current game activity. - pub fn message(&self) -> std::option::Option<&str> { - self.message.as_deref() - } - /// JSON data seen by anyone. - pub fn public_metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.public_metadata.as_ref() - } - /// JSON data seen only by the given identity and their mutual followers. - pub fn mutual_metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.mutual_metadata.as_ref() - } -} -impl std::fmt::Debug for IdentityGameActivity { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("IdentityGameActivity"); - formatter.field("game", &self.game); - formatter.field("message", &self.message); - formatter.field("public_metadata", &self.public_metadata); - formatter.field("mutual_metadata", &self.mutual_metadata); - formatter.finish() - } -} -/// See [`IdentityGameActivity`](crate::model::IdentityGameActivity) -pub mod identity_game_activity { - /// A builder for [`IdentityGameActivity`](crate::model::IdentityGameActivity) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) public_metadata: std::option::Option, - pub(crate) mutual_metadata: std::option::Option, - } - impl Builder { - /// A game handle. - pub fn game(mut self, input: crate::model::GameHandle) -> Self { - self.game = Some(input); - self - } - /// A game handle. - pub fn set_game(mut self, input: std::option::Option) -> Self { - self.game = input; - self - } - /// A short activity message about the current game activity. - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - /// A short activity message about the current game activity. - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - /// JSON data seen by anyone. - pub fn public_metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.public_metadata = Some(input); - self - } - /// JSON data seen by anyone. - pub fn set_public_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.public_metadata = input; - self - } - /// JSON data seen only by the given identity and their mutual followers. - pub fn mutual_metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.mutual_metadata = Some(input); - self - } - /// JSON data seen only by the given identity and their mutual followers. - pub fn set_mutual_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.mutual_metadata = input; - self - } - /// Consumes the builder and constructs a [`IdentityGameActivity`](crate::model::IdentityGameActivity) - pub fn build(self) -> crate::model::IdentityGameActivity { - crate::model::IdentityGameActivity { - game: self.game, - message: self.message, - public_metadata: self.public_metadata, - mutual_metadata: self.mutual_metadata, - } - } - } -} -impl IdentityGameActivity { - /// Creates a new builder-style object to manufacture [`IdentityGameActivity`](crate::model::IdentityGameActivity) - pub fn builder() -> crate::model::identity_game_activity::Builder { - crate::model::identity_game_activity::Builder::default() - } -} - -/// The current status of an identity. This helps players understand if another -/// player is currently playing or has their game in the background. -#[non_exhaustive] -#[derive( - std::clone::Clone, - std::cmp::Eq, - std::cmp::Ord, - std::cmp::PartialEq, - std::cmp::PartialOrd, - std::fmt::Debug, - std::hash::Hash, -)] -pub enum IdentityStatus { - #[allow(missing_docs)] // documentation missing in model - Away, - #[allow(missing_docs)] // documentation missing in model - Offline, - #[allow(missing_docs)] // documentation missing in model - Online, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for IdentityStatus { - fn from(s: &str) -> Self { - match s { - "away" => IdentityStatus::Away, - "offline" => IdentityStatus::Offline, - "online" => IdentityStatus::Online, - other => IdentityStatus::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for IdentityStatus { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(IdentityStatus::from(s)) - } -} -impl IdentityStatus { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - IdentityStatus::Away => "away", - IdentityStatus::Offline => "offline", - IdentityStatus::Online => "online", - IdentityStatus::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["away", "offline", "online"] - } -} -impl AsRef for IdentityStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// A group summary. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GroupSummary { - /// A universally unique identifier. - pub group_id: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// The URL of this group's avatar image. - pub avatar_url: std::option::Option, - /// External links for this group. - pub external: std::option::Option, - /// Whether or not this group is a developer. - pub is_developer: std::option::Option, - /// Detailed information about a profile. - pub bio: std::option::Option, - /// Whether or not the current identity is a member of this group. - pub is_current_identity_member: std::option::Option, - /// The current publicity value for the given group. - pub publicity: std::option::Option, - /// Unsigned 32 bit integer. - pub member_count: std::option::Option, - /// A universally unique identifier. - pub owner_identity_id: std::option::Option, -} -impl GroupSummary { - /// A universally unique identifier. - pub fn group_id(&self) -> std::option::Option<&str> { - self.group_id.as_deref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// The URL of this group's avatar image. - pub fn avatar_url(&self) -> std::option::Option<&str> { - self.avatar_url.as_deref() - } - /// External links for this group. - pub fn external(&self) -> std::option::Option<&crate::model::GroupExternalLinks> { - self.external.as_ref() - } - /// Whether or not this group is a developer. - pub fn is_developer(&self) -> std::option::Option { - self.is_developer - } - /// Detailed information about a profile. - pub fn bio(&self) -> std::option::Option<&str> { - self.bio.as_deref() - } - /// Whether or not the current identity is a member of this group. - pub fn is_current_identity_member(&self) -> std::option::Option { - self.is_current_identity_member - } - /// The current publicity value for the given group. - pub fn publicity(&self) -> std::option::Option<&crate::model::GroupPublicity> { - self.publicity.as_ref() - } - /// Unsigned 32 bit integer. - pub fn member_count(&self) -> std::option::Option { - self.member_count - } - /// A universally unique identifier. - pub fn owner_identity_id(&self) -> std::option::Option<&str> { - self.owner_identity_id.as_deref() - } -} -impl std::fmt::Debug for GroupSummary { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GroupSummary"); - formatter.field("group_id", &self.group_id); - formatter.field("display_name", &self.display_name); - formatter.field("avatar_url", &self.avatar_url); - formatter.field("external", &self.external); - formatter.field("is_developer", &self.is_developer); - formatter.field("bio", &self.bio); - formatter.field( - "is_current_identity_member", - &self.is_current_identity_member, - ); - formatter.field("publicity", &self.publicity); - formatter.field("member_count", &self.member_count); - formatter.field("owner_identity_id", &self.owner_identity_id); - formatter.finish() - } -} -/// See [`GroupSummary`](crate::model::GroupSummary) -pub mod group_summary { - /// A builder for [`GroupSummary`](crate::model::GroupSummary) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) group_id: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) avatar_url: std::option::Option, - pub(crate) external: std::option::Option, - pub(crate) is_developer: std::option::Option, - pub(crate) bio: std::option::Option, - pub(crate) is_current_identity_member: std::option::Option, - pub(crate) publicity: std::option::Option, - pub(crate) member_count: std::option::Option, - pub(crate) owner_identity_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.group_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.group_id = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// The URL of this group's avatar image. - pub fn avatar_url(mut self, input: impl Into) -> Self { - self.avatar_url = Some(input.into()); - self - } - /// The URL of this group's avatar image. - pub fn set_avatar_url(mut self, input: std::option::Option) -> Self { - self.avatar_url = input; - self - } - /// External links for this group. - pub fn external(mut self, input: crate::model::GroupExternalLinks) -> Self { - self.external = Some(input); - self - } - /// External links for this group. - pub fn set_external( - mut self, - input: std::option::Option, - ) -> Self { - self.external = input; - self - } - /// Whether or not this group is a developer. - pub fn is_developer(mut self, input: bool) -> Self { - self.is_developer = Some(input); - self - } - /// Whether or not this group is a developer. - pub fn set_is_developer(mut self, input: std::option::Option) -> Self { - self.is_developer = input; - self - } - /// Detailed information about a profile. - pub fn bio(mut self, input: impl Into) -> Self { - self.bio = Some(input.into()); - self - } - /// Detailed information about a profile. - pub fn set_bio(mut self, input: std::option::Option) -> Self { - self.bio = input; - self - } - /// Whether or not the current identity is a member of this group. - pub fn is_current_identity_member(mut self, input: bool) -> Self { - self.is_current_identity_member = Some(input); - self - } - /// Whether or not the current identity is a member of this group. - pub fn set_is_current_identity_member(mut self, input: std::option::Option) -> Self { - self.is_current_identity_member = input; - self - } - /// The current publicity value for the given group. - pub fn publicity(mut self, input: crate::model::GroupPublicity) -> Self { - self.publicity = Some(input); - self - } - /// The current publicity value for the given group. - pub fn set_publicity( - mut self, - input: std::option::Option, - ) -> Self { - self.publicity = input; - self - } - /// Unsigned 32 bit integer. - pub fn member_count(mut self, input: i32) -> Self { - self.member_count = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_member_count(mut self, input: std::option::Option) -> Self { - self.member_count = input; - self - } - /// A universally unique identifier. - pub fn owner_identity_id(mut self, input: impl Into) -> Self { - self.owner_identity_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_owner_identity_id( - mut self, - input: std::option::Option, - ) -> Self { - self.owner_identity_id = input; - self - } - /// Consumes the builder and constructs a [`GroupSummary`](crate::model::GroupSummary) - pub fn build(self) -> crate::model::GroupSummary { - crate::model::GroupSummary { - group_id: self.group_id, - display_name: self.display_name, - avatar_url: self.avatar_url, - external: self.external, - is_developer: self.is_developer, - bio: self.bio, - is_current_identity_member: self.is_current_identity_member, - publicity: self.publicity, - member_count: self.member_count, - owner_identity_id: self.owner_identity_id, - } - } - } -} -impl GroupSummary { - /// Creates a new builder-style object to manufacture [`GroupSummary`](crate::model::GroupSummary) - pub fn builder() -> crate::model::group_summary::Builder { - crate::model::group_summary::Builder::default() - } -} - -/// The current publicity value for the given group. -#[non_exhaustive] -#[derive( - std::clone::Clone, - std::cmp::Eq, - std::cmp::Ord, - std::cmp::PartialEq, - std::cmp::PartialOrd, - std::fmt::Debug, - std::hash::Hash, -)] -pub enum GroupPublicity { - #[allow(missing_docs)] // documentation missing in model - Closed, - #[allow(missing_docs)] // documentation missing in model - Open, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for GroupPublicity { - fn from(s: &str) -> Self { - match s { - "closed" => GroupPublicity::Closed, - "open" => GroupPublicity::Open, - other => GroupPublicity::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for GroupPublicity { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(GroupPublicity::from(s)) - } -} -impl GroupPublicity { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - GroupPublicity::Closed => "closed", - GroupPublicity::Open => "open", - GroupPublicity::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["closed", "open"] - } -} -impl AsRef for GroupPublicity { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// External links for this group. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GroupExternalLinks { - /// A link to this group's profile page. - pub profile: std::option::Option, - /// A link to this group's chat page. - pub chat: std::option::Option, -} -impl GroupExternalLinks { - /// A link to this group's profile page. - pub fn profile(&self) -> std::option::Option<&str> { - self.profile.as_deref() - } - /// A link to this group's chat page. - pub fn chat(&self) -> std::option::Option<&str> { - self.chat.as_deref() - } -} -impl std::fmt::Debug for GroupExternalLinks { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GroupExternalLinks"); - formatter.field("profile", &self.profile); - formatter.field("chat", &self.chat); - formatter.finish() - } -} -/// See [`GroupExternalLinks`](crate::model::GroupExternalLinks) -pub mod group_external_links { - /// A builder for [`GroupExternalLinks`](crate::model::GroupExternalLinks) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) profile: std::option::Option, - pub(crate) chat: std::option::Option, - } - impl Builder { - /// A link to this group's profile page. - pub fn profile(mut self, input: impl Into) -> Self { - self.profile = Some(input.into()); - self - } - /// A link to this group's profile page. - pub fn set_profile(mut self, input: std::option::Option) -> Self { - self.profile = input; - self - } - /// A link to this group's chat page. - pub fn chat(mut self, input: impl Into) -> Self { - self.chat = Some(input.into()); - self - } - /// A link to this group's chat page. - pub fn set_chat(mut self, input: std::option::Option) -> Self { - self.chat = input; - self - } - /// Consumes the builder and constructs a [`GroupExternalLinks`](crate::model::GroupExternalLinks) - pub fn build(self) -> crate::model::GroupExternalLinks { - crate::model::GroupExternalLinks { - profile: self.profile, - chat: self.chat, - } - } - } -} -impl GroupExternalLinks { - /// Creates a new builder-style object to manufacture [`GroupExternalLinks`](crate::model::GroupExternalLinks) - pub fn builder() -> crate::model::group_external_links::Builder { - crate::model::group_external_links::Builder::default() - } -} - -/// A party summary. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PartySummary { - /// A universally unique identifier. - pub party_id: std::option::Option, - /// RFC3339 timestamp. - pub create_ts: std::option::Option, - /// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. - pub activity: std::option::Option, - /// External links for a party. - pub external: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub publicity: std::option::Option, - /// Unsigned 32 bit integer. - pub party_size: std::option::Option, - /// A list of party members. - pub members: std::option::Option>, - /// A universally unique identifier. - pub thread_id: std::option::Option, -} -impl PartySummary { - /// A universally unique identifier. - pub fn party_id(&self) -> std::option::Option<&str> { - self.party_id.as_deref() - } - /// RFC3339 timestamp. - pub fn create_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.create_ts.as_ref() - } - /// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. - pub fn activity(&self) -> std::option::Option<&crate::model::PartyActivity> { - self.activity.as_ref() - } - /// External links for a party. - pub fn external(&self) -> std::option::Option<&crate::model::PartyExternalLinks> { - self.external.as_ref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn publicity(&self) -> std::option::Option<&crate::model::PartyPublicity> { - self.publicity.as_ref() - } - /// Unsigned 32 bit integer. - pub fn party_size(&self) -> std::option::Option { - self.party_size - } - /// A list of party members. - pub fn members(&self) -> std::option::Option<&[crate::model::PartyMemberSummary]> { - self.members.as_deref() - } - /// A universally unique identifier. - pub fn thread_id(&self) -> std::option::Option<&str> { - self.thread_id.as_deref() - } -} -impl std::fmt::Debug for PartySummary { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PartySummary"); - formatter.field("party_id", &self.party_id); - formatter.field("create_ts", &self.create_ts); - formatter.field("activity", &self.activity); - formatter.field("external", &self.external); - formatter.field("publicity", &self.publicity); - formatter.field("party_size", &self.party_size); - formatter.field("members", &self.members); - formatter.field("thread_id", &self.thread_id); - formatter.finish() - } -} -/// See [`PartySummary`](crate::model::PartySummary) -pub mod party_summary { - /// A builder for [`PartySummary`](crate::model::PartySummary) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) party_id: std::option::Option, - pub(crate) create_ts: std::option::Option, - pub(crate) activity: std::option::Option, - pub(crate) external: std::option::Option, - pub(crate) publicity: std::option::Option, - pub(crate) party_size: std::option::Option, - pub(crate) members: std::option::Option>, - pub(crate) thread_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn party_id(mut self, input: impl Into) -> Self { - self.party_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_party_id(mut self, input: std::option::Option) -> Self { - self.party_id = input; - self - } - /// RFC3339 timestamp. - pub fn create_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.create_ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_create_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.create_ts = input; - self - } - /// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. - pub fn activity(mut self, input: crate::model::PartyActivity) -> Self { - self.activity = Some(input); - self - } - /// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. - pub fn set_activity( - mut self, - input: std::option::Option, - ) -> Self { - self.activity = input; - self - } - /// External links for a party. - pub fn external(mut self, input: crate::model::PartyExternalLinks) -> Self { - self.external = Some(input); - self - } - /// External links for a party. - pub fn set_external( - mut self, - input: std::option::Option, - ) -> Self { - self.external = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn publicity(mut self, input: crate::model::PartyPublicity) -> Self { - self.publicity = Some(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_publicity( - mut self, - input: std::option::Option, - ) -> Self { - self.publicity = input; - self - } - /// Unsigned 32 bit integer. - pub fn party_size(mut self, input: i32) -> Self { - self.party_size = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_party_size(mut self, input: std::option::Option) -> Self { - self.party_size = input; - self - } - /// Appends an item to `members`. - /// - /// To override the contents of this collection use [`set_members`](Self::set_members). - /// - /// A list of party members. - pub fn members(mut self, input: crate::model::PartyMemberSummary) -> Self { - let mut v = self.members.unwrap_or_default(); - v.push(input); - self.members = Some(v); - self - } - /// A list of party members. - pub fn set_members( - mut self, - input: std::option::Option>, - ) -> Self { - self.members = input; - self - } - /// A universally unique identifier. - pub fn thread_id(mut self, input: impl Into) -> Self { - self.thread_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_thread_id(mut self, input: std::option::Option) -> Self { - self.thread_id = input; - self - } - /// Consumes the builder and constructs a [`PartySummary`](crate::model::PartySummary) - pub fn build(self) -> crate::model::PartySummary { - crate::model::PartySummary { - party_id: self.party_id, - create_ts: self.create_ts, - activity: self.activity, - external: self.external, - publicity: self.publicity, - party_size: self.party_size, - members: self.members, - thread_id: self.thread_id, - } - } - } -} -impl PartySummary { - /// Creates a new builder-style object to manufacture [`PartySummary`](crate::model::PartySummary) - pub fn builder() -> crate::model::party_summary::Builder { - crate::model::party_summary::Builder::default() - } -} - -/// A party member summary. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PartyMemberSummary { - /// An identity handle. - pub identity: std::option::Option, - /// Whether or not this party member is the leader of the given party. - pub is_leader: std::option::Option, - /// RFC3339 timestamp. - pub join_ts: std::option::Option, - /// A union representing the current state of a party member. - `Inactive`: The player is not doing anything. For example, the player can be sitting in the game menu or hanging out on the hub. - It's possible for the member to be in an inactive state while the party is in a lobby; this means the player is simply observing/interacting with others in the party and not part of the matchmaking process. - `MatchmakerReady`: This means the member wants a player created for them. - Members can be in the ready state while the party is in an idle state. This means that the player will get a player created for them. - Members can be in the ready state while the party is in a lobby. This means that the player could not join the lobby because it was full or the player left the lobby unintentionally. - `MatchmakerFindingLobby`: A find request is in progress for the member. - `MatchmakerLobby`: The member is in a lobby. - pub state: std::option::Option, -} -impl PartyMemberSummary { - /// An identity handle. - pub fn identity(&self) -> std::option::Option<&crate::model::IdentityHandle> { - self.identity.as_ref() - } - /// Whether or not this party member is the leader of the given party. - pub fn is_leader(&self) -> std::option::Option { - self.is_leader - } - /// RFC3339 timestamp. - pub fn join_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.join_ts.as_ref() - } - /// A union representing the current state of a party member. - `Inactive`: The player is not doing anything. For example, the player can be sitting in the game menu or hanging out on the hub. - It's possible for the member to be in an inactive state while the party is in a lobby; this means the player is simply observing/interacting with others in the party and not part of the matchmaking process. - `MatchmakerReady`: This means the member wants a player created for them. - Members can be in the ready state while the party is in an idle state. This means that the player will get a player created for them. - Members can be in the ready state while the party is in a lobby. This means that the player could not join the lobby because it was full or the player left the lobby unintentionally. - `MatchmakerFindingLobby`: A find request is in progress for the member. - `MatchmakerLobby`: The member is in a lobby. - pub fn state(&self) -> std::option::Option<&crate::model::PartyMemberState> { - self.state.as_ref() - } -} -impl std::fmt::Debug for PartyMemberSummary { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PartyMemberSummary"); - formatter.field("identity", &self.identity); - formatter.field("is_leader", &self.is_leader); - formatter.field("join_ts", &self.join_ts); - formatter.field("state", &self.state); - formatter.finish() - } -} -/// See [`PartyMemberSummary`](crate::model::PartyMemberSummary) -pub mod party_member_summary { - /// A builder for [`PartyMemberSummary`](crate::model::PartyMemberSummary) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity: std::option::Option, - pub(crate) is_leader: std::option::Option, - pub(crate) join_ts: std::option::Option, - pub(crate) state: std::option::Option, - } - impl Builder { - /// An identity handle. - pub fn identity(mut self, input: crate::model::IdentityHandle) -> Self { - self.identity = Some(input); - self - } - /// An identity handle. - pub fn set_identity( - mut self, - input: std::option::Option, - ) -> Self { - self.identity = input; - self - } - /// Whether or not this party member is the leader of the given party. - pub fn is_leader(mut self, input: bool) -> Self { - self.is_leader = Some(input); - self - } - /// Whether or not this party member is the leader of the given party. - pub fn set_is_leader(mut self, input: std::option::Option) -> Self { - self.is_leader = input; - self - } - /// RFC3339 timestamp. - pub fn join_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.join_ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_join_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.join_ts = input; - self - } - /// A union representing the current state of a party member. - `Inactive`: The player is not doing anything. For example, the player can be sitting in the game menu or hanging out on the hub. - It's possible for the member to be in an inactive state while the party is in a lobby; this means the player is simply observing/interacting with others in the party and not part of the matchmaking process. - `MatchmakerReady`: This means the member wants a player created for them. - Members can be in the ready state while the party is in an idle state. This means that the player will get a player created for them. - Members can be in the ready state while the party is in a lobby. This means that the player could not join the lobby because it was full or the player left the lobby unintentionally. - `MatchmakerFindingLobby`: A find request is in progress for the member. - `MatchmakerLobby`: The member is in a lobby. - pub fn state(mut self, input: crate::model::PartyMemberState) -> Self { - self.state = Some(input); - self - } - /// A union representing the current state of a party member. - `Inactive`: The player is not doing anything. For example, the player can be sitting in the game menu or hanging out on the hub. - It's possible for the member to be in an inactive state while the party is in a lobby; this means the player is simply observing/interacting with others in the party and not part of the matchmaking process. - `MatchmakerReady`: This means the member wants a player created for them. - Members can be in the ready state while the party is in an idle state. This means that the player will get a player created for them. - Members can be in the ready state while the party is in a lobby. This means that the player could not join the lobby because it was full or the player left the lobby unintentionally. - `MatchmakerFindingLobby`: A find request is in progress for the member. - `MatchmakerLobby`: The member is in a lobby. - pub fn set_state( - mut self, - input: std::option::Option, - ) -> Self { - self.state = input; - self - } - /// Consumes the builder and constructs a [`PartyMemberSummary`](crate::model::PartyMemberSummary) - pub fn build(self) -> crate::model::PartyMemberSummary { - crate::model::PartyMemberSummary { - identity: self.identity, - is_leader: self.is_leader, - join_ts: self.join_ts, - state: self.state, - } - } - } -} -impl PartyMemberSummary { - /// Creates a new builder-style object to manufacture [`PartyMemberSummary`](crate::model::PartyMemberSummary) - pub fn builder() -> crate::model::party_member_summary::Builder { - crate::model::party_member_summary::Builder::default() - } -} - -/// A union representing the current state of a party member. - `Inactive`: The player is not doing anything. For example, the player can be sitting in the game menu or hanging out on the hub. - It's possible for the member to be in an inactive state while the party is in a lobby; this means the player is simply observing/interacting with others in the party and not part of the matchmaking process. - `MatchmakerReady`: This means the member wants a player created for them. - Members can be in the ready state while the party is in an idle state. This means that the player will get a player created for them. - Members can be in the ready state while the party is in a lobby. This means that the player could not join the lobby because it was full or the player left the lobby unintentionally. - `MatchmakerFindingLobby`: A find request is in progress for the member. - `MatchmakerLobby`: The member is in a lobby. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] -pub enum PartyMemberState { - /// A party member state denoting that the member is inactive. - Inactive(crate::model::PartyMemberStateInactive), - /// A party member state denoting that the member is currently searching for a lobby. - MatchmakerFindingLobby(crate::model::PartyMemberStateMatchmakerFindingLobby), - /// A party member state denoting that the member is in a lobby. - MatchmakerLobby(crate::model::PartyMemberStateMatchmakerLobby), - /// A party member state denoting that the member is currently waiting to start matchmaking. - MatchmakerReady(crate::model::PartyMemberStateMatchmakerReady), - /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version. - /// An unknown enum variant - /// - /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._ - /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized - /// by the client. This can happen when the server adds new functionality, but the client has not been updated. - /// To investigate this, consider turning on debug logging to print the raw HTTP response. - #[non_exhaustive] - Unknown, -} -impl PartyMemberState { - /// Tries to convert the enum instance into [`Inactive`](crate::model::PartyMemberState::Inactive), extracting the inner [`PartyMemberStateInactive`](crate::model::PartyMemberStateInactive). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_inactive( - &self, - ) -> std::result::Result<&crate::model::PartyMemberStateInactive, &Self> { - if let PartyMemberState::Inactive(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`Inactive`](crate::model::PartyMemberState::Inactive). - pub fn is_inactive(&self) -> bool { - self.as_inactive().is_ok() - } - /// Tries to convert the enum instance into [`MatchmakerFindingLobby`](crate::model::PartyMemberState::MatchmakerFindingLobby), extracting the inner [`PartyMemberStateMatchmakerFindingLobby`](crate::model::PartyMemberStateMatchmakerFindingLobby). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_matchmaker_finding_lobby( - &self, - ) -> std::result::Result<&crate::model::PartyMemberStateMatchmakerFindingLobby, &Self> { - if let PartyMemberState::MatchmakerFindingLobby(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`MatchmakerFindingLobby`](crate::model::PartyMemberState::MatchmakerFindingLobby). - pub fn is_matchmaker_finding_lobby(&self) -> bool { - self.as_matchmaker_finding_lobby().is_ok() - } - /// Tries to convert the enum instance into [`MatchmakerLobby`](crate::model::PartyMemberState::MatchmakerLobby), extracting the inner [`PartyMemberStateMatchmakerLobby`](crate::model::PartyMemberStateMatchmakerLobby). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_matchmaker_lobby( - &self, - ) -> std::result::Result<&crate::model::PartyMemberStateMatchmakerLobby, &Self> { - if let PartyMemberState::MatchmakerLobby(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`MatchmakerLobby`](crate::model::PartyMemberState::MatchmakerLobby). - pub fn is_matchmaker_lobby(&self) -> bool { - self.as_matchmaker_lobby().is_ok() - } - /// Tries to convert the enum instance into [`MatchmakerReady`](crate::model::PartyMemberState::MatchmakerReady), extracting the inner [`PartyMemberStateMatchmakerReady`](crate::model::PartyMemberStateMatchmakerReady). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_matchmaker_ready( - &self, - ) -> std::result::Result<&crate::model::PartyMemberStateMatchmakerReady, &Self> { - if let PartyMemberState::MatchmakerReady(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`MatchmakerReady`](crate::model::PartyMemberState::MatchmakerReady). - pub fn is_matchmaker_ready(&self) -> bool { - self.as_matchmaker_ready().is_ok() - } - /// Returns true if the enum instance is the `Unknown` variant. - pub fn is_unknown(&self) -> bool { - matches!(self, Self::Unknown) - } -} - -/// A party member state denoting that the member is in a lobby. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PartyMemberStateMatchmakerLobby { - /// A universally unique identifier. - pub player_id: std::option::Option, -} -impl PartyMemberStateMatchmakerLobby { - /// A universally unique identifier. - pub fn player_id(&self) -> std::option::Option<&str> { - self.player_id.as_deref() - } -} -impl std::fmt::Debug for PartyMemberStateMatchmakerLobby { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PartyMemberStateMatchmakerLobby"); - formatter.field("player_id", &self.player_id); - formatter.finish() - } -} -/// See [`PartyMemberStateMatchmakerLobby`](crate::model::PartyMemberStateMatchmakerLobby) -pub mod party_member_state_matchmaker_lobby { - /// A builder for [`PartyMemberStateMatchmakerLobby`](crate::model::PartyMemberStateMatchmakerLobby) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) player_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn player_id(mut self, input: impl Into) -> Self { - self.player_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_player_id(mut self, input: std::option::Option) -> Self { - self.player_id = input; - self - } - /// Consumes the builder and constructs a [`PartyMemberStateMatchmakerLobby`](crate::model::PartyMemberStateMatchmakerLobby) - pub fn build(self) -> crate::model::PartyMemberStateMatchmakerLobby { - crate::model::PartyMemberStateMatchmakerLobby { - player_id: self.player_id, - } - } - } -} -impl PartyMemberStateMatchmakerLobby { - /// Creates a new builder-style object to manufacture [`PartyMemberStateMatchmakerLobby`](crate::model::PartyMemberStateMatchmakerLobby) - pub fn builder() -> crate::model::party_member_state_matchmaker_lobby::Builder { - crate::model::party_member_state_matchmaker_lobby::Builder::default() - } -} - -/// A party member state denoting that the member is currently searching for a lobby. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PartyMemberStateMatchmakerFindingLobby {} -impl std::fmt::Debug for PartyMemberStateMatchmakerFindingLobby { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PartyMemberStateMatchmakerFindingLobby"); - formatter.finish() - } -} -/// See [`PartyMemberStateMatchmakerFindingLobby`](crate::model::PartyMemberStateMatchmakerFindingLobby) -pub mod party_member_state_matchmaker_finding_lobby { - /// A builder for [`PartyMemberStateMatchmakerFindingLobby`](crate::model::PartyMemberStateMatchmakerFindingLobby) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`PartyMemberStateMatchmakerFindingLobby`](crate::model::PartyMemberStateMatchmakerFindingLobby) - pub fn build(self) -> crate::model::PartyMemberStateMatchmakerFindingLobby { - crate::model::PartyMemberStateMatchmakerFindingLobby {} - } - } -} -impl PartyMemberStateMatchmakerFindingLobby { - /// Creates a new builder-style object to manufacture [`PartyMemberStateMatchmakerFindingLobby`](crate::model::PartyMemberStateMatchmakerFindingLobby) - pub fn builder() -> crate::model::party_member_state_matchmaker_finding_lobby::Builder { - crate::model::party_member_state_matchmaker_finding_lobby::Builder::default() - } -} - -/// A party member state denoting that the member is currently waiting to start matchmaking. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PartyMemberStateMatchmakerReady {} -impl std::fmt::Debug for PartyMemberStateMatchmakerReady { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PartyMemberStateMatchmakerReady"); - formatter.finish() - } -} -/// See [`PartyMemberStateMatchmakerReady`](crate::model::PartyMemberStateMatchmakerReady) -pub mod party_member_state_matchmaker_ready { - /// A builder for [`PartyMemberStateMatchmakerReady`](crate::model::PartyMemberStateMatchmakerReady) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`PartyMemberStateMatchmakerReady`](crate::model::PartyMemberStateMatchmakerReady) - pub fn build(self) -> crate::model::PartyMemberStateMatchmakerReady { - crate::model::PartyMemberStateMatchmakerReady {} - } - } -} -impl PartyMemberStateMatchmakerReady { - /// Creates a new builder-style object to manufacture [`PartyMemberStateMatchmakerReady`](crate::model::PartyMemberStateMatchmakerReady) - pub fn builder() -> crate::model::party_member_state_matchmaker_ready::Builder { - crate::model::party_member_state_matchmaker_ready::Builder::default() - } -} - -/// A party member state denoting that the member is inactive. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PartyMemberStateInactive {} -impl std::fmt::Debug for PartyMemberStateInactive { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PartyMemberStateInactive"); - formatter.finish() - } -} -/// See [`PartyMemberStateInactive`](crate::model::PartyMemberStateInactive) -pub mod party_member_state_inactive { - /// A builder for [`PartyMemberStateInactive`](crate::model::PartyMemberStateInactive) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`PartyMemberStateInactive`](crate::model::PartyMemberStateInactive) - pub fn build(self) -> crate::model::PartyMemberStateInactive { - crate::model::PartyMemberStateInactive {} - } - } -} -impl PartyMemberStateInactive { - /// Creates a new builder-style object to manufacture [`PartyMemberStateInactive`](crate::model::PartyMemberStateInactive) - pub fn builder() -> crate::model::party_member_state_inactive::Builder { - crate::model::party_member_state_inactive::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PartyPublicity { - #[allow(missing_docs)] // documentation missing in model - pub public: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub mutual_followers: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub groups: std::option::Option, -} -impl PartyPublicity { - #[allow(missing_docs)] // documentation missing in model - pub fn public(&self) -> std::option::Option<&crate::model::PartyPublicityLevel> { - self.public.as_ref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn mutual_followers(&self) -> std::option::Option<&crate::model::PartyPublicityLevel> { - self.mutual_followers.as_ref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn groups(&self) -> std::option::Option<&crate::model::PartyPublicityLevel> { - self.groups.as_ref() - } -} -impl std::fmt::Debug for PartyPublicity { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PartyPublicity"); - formatter.field("public", &self.public); - formatter.field("mutual_followers", &self.mutual_followers); - formatter.field("groups", &self.groups); - formatter.finish() - } -} -/// See [`PartyPublicity`](crate::model::PartyPublicity) -pub mod party_publicity { - /// A builder for [`PartyPublicity`](crate::model::PartyPublicity) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) public: std::option::Option, - pub(crate) mutual_followers: std::option::Option, - pub(crate) groups: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn public(mut self, input: crate::model::PartyPublicityLevel) -> Self { - self.public = Some(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_public( - mut self, - input: std::option::Option, - ) -> Self { - self.public = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn mutual_followers(mut self, input: crate::model::PartyPublicityLevel) -> Self { - self.mutual_followers = Some(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_mutual_followers( - mut self, - input: std::option::Option, - ) -> Self { - self.mutual_followers = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn groups(mut self, input: crate::model::PartyPublicityLevel) -> Self { - self.groups = Some(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_groups( - mut self, - input: std::option::Option, - ) -> Self { - self.groups = input; - self - } - /// Consumes the builder and constructs a [`PartyPublicity`](crate::model::PartyPublicity) - pub fn build(self) -> crate::model::PartyPublicity { - crate::model::PartyPublicity { - public: self.public, - mutual_followers: self.mutual_followers, - groups: self.groups, - } - } - } -} -impl PartyPublicity { - /// Creates a new builder-style object to manufacture [`PartyPublicity`](crate::model::PartyPublicity) - pub fn builder() -> crate::model::party_publicity::Builder { - crate::model::party_publicity::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive( - std::clone::Clone, - std::cmp::Eq, - std::cmp::Ord, - std::cmp::PartialEq, - std::cmp::PartialOrd, - std::fmt::Debug, - std::hash::Hash, -)] -pub enum PartyPublicityLevel { - #[allow(missing_docs)] // documentation missing in model - Join, - #[allow(missing_docs)] // documentation missing in model - None, - #[allow(missing_docs)] // documentation missing in model - View, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for PartyPublicityLevel { - fn from(s: &str) -> Self { - match s { - "join" => PartyPublicityLevel::Join, - "none" => PartyPublicityLevel::None, - "view" => PartyPublicityLevel::View, - other => PartyPublicityLevel::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for PartyPublicityLevel { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(PartyPublicityLevel::from(s)) - } -} -impl PartyPublicityLevel { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - PartyPublicityLevel::Join => "join", - PartyPublicityLevel::None => "none", - PartyPublicityLevel::View => "view", - PartyPublicityLevel::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["join", "none", "view"] - } -} -impl AsRef for PartyPublicityLevel { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GameSummary { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub name_id: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// The URL of this game's logo image. - pub logo_url: std::option::Option, - /// The URL of this game's banner image. - pub banner_url: std::option::Option, - /// The URL to this game's website. - pub url: std::option::Option, - /// A group handle. - pub developer: std::option::Option, - /// A list of game tags. - pub tags: std::option::Option>, -} -impl GameSummary { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn name_id(&self) -> std::option::Option<&str> { - self.name_id.as_deref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// The URL of this game's logo image. - pub fn logo_url(&self) -> std::option::Option<&str> { - self.logo_url.as_deref() - } - /// The URL of this game's banner image. - pub fn banner_url(&self) -> std::option::Option<&str> { - self.banner_url.as_deref() - } - /// The URL to this game's website. - pub fn url(&self) -> std::option::Option<&str> { - self.url.as_deref() - } - /// A group handle. - pub fn developer(&self) -> std::option::Option<&crate::model::GroupHandle> { - self.developer.as_ref() - } - /// A list of game tags. - pub fn tags(&self) -> std::option::Option<&[std::string::String]> { - self.tags.as_deref() - } -} -impl std::fmt::Debug for GameSummary { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GameSummary"); - formatter.field("game_id", &self.game_id); - formatter.field("name_id", &self.name_id); - formatter.field("display_name", &self.display_name); - formatter.field("logo_url", &self.logo_url); - formatter.field("banner_url", &self.banner_url); - formatter.field("url", &self.url); - formatter.field("developer", &self.developer); - formatter.field("tags", &self.tags); - formatter.finish() - } -} -/// See [`GameSummary`](crate::model::GameSummary) -pub mod game_summary { - /// A builder for [`GameSummary`](crate::model::GameSummary) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) name_id: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) logo_url: std::option::Option, - pub(crate) banner_url: std::option::Option, - pub(crate) url: std::option::Option, - pub(crate) developer: std::option::Option, - pub(crate) tags: std::option::Option>, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn name_id(mut self, input: impl Into) -> Self { - self.name_id = Some(input.into()); - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn set_name_id(mut self, input: std::option::Option) -> Self { - self.name_id = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// The URL of this game's logo image. - pub fn logo_url(mut self, input: impl Into) -> Self { - self.logo_url = Some(input.into()); - self - } - /// The URL of this game's logo image. - pub fn set_logo_url(mut self, input: std::option::Option) -> Self { - self.logo_url = input; - self - } - /// The URL of this game's banner image. - pub fn banner_url(mut self, input: impl Into) -> Self { - self.banner_url = Some(input.into()); - self - } - /// The URL of this game's banner image. - pub fn set_banner_url(mut self, input: std::option::Option) -> Self { - self.banner_url = input; - self - } - /// The URL to this game's website. - pub fn url(mut self, input: impl Into) -> Self { - self.url = Some(input.into()); - self - } - /// The URL to this game's website. - pub fn set_url(mut self, input: std::option::Option) -> Self { - self.url = input; - self - } - /// A group handle. - pub fn developer(mut self, input: crate::model::GroupHandle) -> Self { - self.developer = Some(input); - self - } - /// A group handle. - pub fn set_developer( - mut self, - input: std::option::Option, - ) -> Self { - self.developer = input; - self - } - /// Appends an item to `tags`. - /// - /// To override the contents of this collection use [`set_tags`](Self::set_tags). - /// - /// A list of game tags. - pub fn tags(mut self, input: impl Into) -> Self { - let mut v = self.tags.unwrap_or_default(); - v.push(input.into()); - self.tags = Some(v); - self - } - /// A list of game tags. - pub fn set_tags( - mut self, - input: std::option::Option>, - ) -> Self { - self.tags = input; - self - } - /// Consumes the builder and constructs a [`GameSummary`](crate::model::GameSummary) - pub fn build(self) -> crate::model::GameSummary { - crate::model::GameSummary { - game_id: self.game_id, - name_id: self.name_id, - display_name: self.display_name, - logo_url: self.logo_url, - banner_url: self.banner_url, - url: self.url, - developer: self.developer, - tags: self.tags, - } - } - } -} -impl GameSummary { - /// Creates a new builder-style object to manufacture [`GameSummary`](crate::model::GameSummary) - pub fn builder() -> crate::model::game_summary::Builder { - crate::model::game_summary::Builder::default() - } -} - -/// A group handle. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GroupHandle { - /// A universally unique identifier. - pub group_id: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// The URL of this group's avatar image. - pub avatar_url: std::option::Option, - /// External links for this group. - pub external: std::option::Option, - /// Whether or not this group is a developer group. - pub is_developer: std::option::Option, -} -impl GroupHandle { - /// A universally unique identifier. - pub fn group_id(&self) -> std::option::Option<&str> { - self.group_id.as_deref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// The URL of this group's avatar image. - pub fn avatar_url(&self) -> std::option::Option<&str> { - self.avatar_url.as_deref() - } - /// External links for this group. - pub fn external(&self) -> std::option::Option<&crate::model::GroupExternalLinks> { - self.external.as_ref() - } - /// Whether or not this group is a developer group. - pub fn is_developer(&self) -> std::option::Option { - self.is_developer - } -} -impl std::fmt::Debug for GroupHandle { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GroupHandle"); - formatter.field("group_id", &self.group_id); - formatter.field("display_name", &self.display_name); - formatter.field("avatar_url", &self.avatar_url); - formatter.field("external", &self.external); - formatter.field("is_developer", &self.is_developer); - formatter.finish() - } -} -/// See [`GroupHandle`](crate::model::GroupHandle) -pub mod group_handle { - /// A builder for [`GroupHandle`](crate::model::GroupHandle) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) group_id: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) avatar_url: std::option::Option, - pub(crate) external: std::option::Option, - pub(crate) is_developer: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.group_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.group_id = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// The URL of this group's avatar image. - pub fn avatar_url(mut self, input: impl Into) -> Self { - self.avatar_url = Some(input.into()); - self - } - /// The URL of this group's avatar image. - pub fn set_avatar_url(mut self, input: std::option::Option) -> Self { - self.avatar_url = input; - self - } - /// External links for this group. - pub fn external(mut self, input: crate::model::GroupExternalLinks) -> Self { - self.external = Some(input); - self - } - /// External links for this group. - pub fn set_external( - mut self, - input: std::option::Option, - ) -> Self { - self.external = input; - self - } - /// Whether or not this group is a developer group. - pub fn is_developer(mut self, input: bool) -> Self { - self.is_developer = Some(input); - self - } - /// Whether or not this group is a developer group. - pub fn set_is_developer(mut self, input: std::option::Option) -> Self { - self.is_developer = input; - self - } - /// Consumes the builder and constructs a [`GroupHandle`](crate::model::GroupHandle) - pub fn build(self) -> crate::model::GroupHandle { - crate::model::GroupHandle { - group_id: self.group_id, - display_name: self.display_name, - avatar_url: self.avatar_url, - external: self.external, - is_developer: self.is_developer, - } - } - } -} -impl GroupHandle { - /// Creates a new builder-style object to manufacture [`GroupHandle`](crate::model::GroupHandle) - pub fn builder() -> crate::model::group_handle::Builder { - crate::model::group_handle::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetGameLinkNewIdentity { - /// See `rivet.api.identity#SetupIdentityOutput$identity_token`. - pub identity_token: std::option::Option, - /// See `rivet.api.identity#SetupIdentityOutput$identity_token_expire_ts`. - pub identity_token_expire_ts: std::option::Option, - /// See `rivet.api.identity#SetupIdentityOutput$identity`. - pub identity: std::option::Option, -} -impl GetGameLinkNewIdentity { - /// See `rivet.api.identity#SetupIdentityOutput$identity_token`. - pub fn identity_token(&self) -> std::option::Option<&str> { - self.identity_token.as_deref() - } - /// See `rivet.api.identity#SetupIdentityOutput$identity_token_expire_ts`. - pub fn identity_token_expire_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.identity_token_expire_ts.as_ref() - } - /// See `rivet.api.identity#SetupIdentityOutput$identity`. - pub fn identity(&self) -> std::option::Option<&crate::model::IdentityProfile> { - self.identity.as_ref() - } -} -impl std::fmt::Debug for GetGameLinkNewIdentity { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetGameLinkNewIdentity"); - formatter.field("identity_token", &"*** Sensitive Data Redacted ***"); - formatter.field("identity_token_expire_ts", &self.identity_token_expire_ts); - formatter.field("identity", &self.identity); - formatter.finish() - } -} -/// See [`GetGameLinkNewIdentity`](crate::model::GetGameLinkNewIdentity) -pub mod get_game_link_new_identity { - /// A builder for [`GetGameLinkNewIdentity`](crate::model::GetGameLinkNewIdentity) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity_token: std::option::Option, - pub(crate) identity_token_expire_ts: std::option::Option, - pub(crate) identity: std::option::Option, - } - impl Builder { - /// See `rivet.api.identity#SetupIdentityOutput$identity_token`. - pub fn identity_token(mut self, input: impl Into) -> Self { - self.identity_token = Some(input.into()); - self - } - /// See `rivet.api.identity#SetupIdentityOutput$identity_token`. - pub fn set_identity_token( - mut self, - input: std::option::Option, - ) -> Self { - self.identity_token = input; - self - } - /// See `rivet.api.identity#SetupIdentityOutput$identity_token_expire_ts`. - pub fn identity_token_expire_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.identity_token_expire_ts = Some(input); - self - } - /// See `rivet.api.identity#SetupIdentityOutput$identity_token_expire_ts`. - pub fn set_identity_token_expire_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.identity_token_expire_ts = input; - self - } - /// See `rivet.api.identity#SetupIdentityOutput$identity`. - pub fn identity(mut self, input: crate::model::IdentityProfile) -> Self { - self.identity = Some(input); - self - } - /// See `rivet.api.identity#SetupIdentityOutput$identity`. - pub fn set_identity( - mut self, - input: std::option::Option, - ) -> Self { - self.identity = input; - self - } - /// Consumes the builder and constructs a [`GetGameLinkNewIdentity`](crate::model::GetGameLinkNewIdentity) - pub fn build(self) -> crate::model::GetGameLinkNewIdentity { - crate::model::GetGameLinkNewIdentity { - identity_token: self.identity_token, - identity_token_expire_ts: self.identity_token_expire_ts, - identity: self.identity, - } - } - } -} -impl GetGameLinkNewIdentity { - /// Creates a new builder-style object to manufacture [`GetGameLinkNewIdentity`](crate::model::GetGameLinkNewIdentity) - pub fn builder() -> crate::model::get_game_link_new_identity::Builder { - crate::model::get_game_link_new_identity::Builder::default() - } -} - -/// An identity profile. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct IdentityProfile { - /// A universally unique identifier. - pub identity_id: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub account_number: std::option::Option, - /// The URL of this identity's avatar image. - pub avatar_url: std::option::Option, - /// Information about the identity's current status, party, and active game. - pub presence: std::option::Option, - /// A party summary. - pub party: std::option::Option, - /// Whether or not this identity is registered with a linked account. - pub is_registered: std::option::Option, - /// External links for an identity. - pub external: std::option::Option, - /// Whether or not this identity is an admin. - pub is_admin: std::option::Option, - /// Whether or not this game user has been linked through the Rivet dashboard. - pub is_game_linked: std::option::Option, - /// The state of the given identity's developer status. - pub dev_state: std::option::Option, - /// Unsigned 64 bit integer. - pub follower_count: std::option::Option, - /// Unsigned 64 bit integer. - pub following_count: std::option::Option, - /// Whether or not the requestee's identity is following this identity. - pub following: std::option::Option, - /// Whether or not this identity following the requestee's identity. - pub is_following_me: std::option::Option, - /// Whether or not this identity is both following and is followed by the requestee's identity. - pub is_mutual_following: std::option::Option, - /// RFC3339 timestamp. - pub join_ts: std::option::Option, - /// Detailed information about a profile. - pub bio: std::option::Option, - /// A list of an identity's linked accounts. - pub linked_accounts: std::option::Option>, - /// A list of groups that the given identity is in. - pub groups: std::option::Option>, - /// A list of game statistic summaries. - pub games: std::option::Option>, - /// Whether or not this identity is awaiting account deletion. Only visible to when the requestee is this identity. - pub awaiting_deletion: std::option::Option, -} -impl IdentityProfile { - /// A universally unique identifier. - pub fn identity_id(&self) -> std::option::Option<&str> { - self.identity_id.as_deref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub fn account_number(&self) -> std::option::Option { - self.account_number - } - /// The URL of this identity's avatar image. - pub fn avatar_url(&self) -> std::option::Option<&str> { - self.avatar_url.as_deref() - } - /// Information about the identity's current status, party, and active game. - pub fn presence(&self) -> std::option::Option<&crate::model::IdentityPresence> { - self.presence.as_ref() - } - /// A party summary. - pub fn party(&self) -> std::option::Option<&crate::model::PartySummary> { - self.party.as_ref() - } - /// Whether or not this identity is registered with a linked account. - pub fn is_registered(&self) -> std::option::Option { - self.is_registered - } - /// External links for an identity. - pub fn external(&self) -> std::option::Option<&crate::model::IdentityExternalLinks> { - self.external.as_ref() - } - /// Whether or not this identity is an admin. - pub fn is_admin(&self) -> std::option::Option { - self.is_admin - } - /// Whether or not this game user has been linked through the Rivet dashboard. - pub fn is_game_linked(&self) -> std::option::Option { - self.is_game_linked - } - /// The state of the given identity's developer status. - pub fn dev_state(&self) -> std::option::Option<&crate::model::IdentityDevState> { - self.dev_state.as_ref() - } - /// Unsigned 64 bit integer. - pub fn follower_count(&self) -> std::option::Option { - self.follower_count - } - /// Unsigned 64 bit integer. - pub fn following_count(&self) -> std::option::Option { - self.following_count - } - /// Whether or not the requestee's identity is following this identity. - pub fn following(&self) -> std::option::Option { - self.following - } - /// Whether or not this identity following the requestee's identity. - pub fn is_following_me(&self) -> std::option::Option { - self.is_following_me - } - /// Whether or not this identity is both following and is followed by the requestee's identity. - pub fn is_mutual_following(&self) -> std::option::Option { - self.is_mutual_following - } - /// RFC3339 timestamp. - pub fn join_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.join_ts.as_ref() - } - /// Detailed information about a profile. - pub fn bio(&self) -> std::option::Option<&str> { - self.bio.as_deref() - } - /// A list of an identity's linked accounts. - pub fn linked_accounts(&self) -> std::option::Option<&[crate::model::IdentityLinkedAccount]> { - self.linked_accounts.as_deref() - } - /// A list of groups that the given identity is in. - pub fn groups(&self) -> std::option::Option<&[crate::model::IdentityGroup]> { - self.groups.as_deref() - } - /// A list of game statistic summaries. - pub fn games(&self) -> std::option::Option<&[crate::model::GameStatSummary]> { - self.games.as_deref() - } - /// Whether or not this identity is awaiting account deletion. Only visible to when the requestee is this identity. - pub fn awaiting_deletion(&self) -> std::option::Option { - self.awaiting_deletion - } -} -impl std::fmt::Debug for IdentityProfile { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("IdentityProfile"); - formatter.field("identity_id", &self.identity_id); - formatter.field("display_name", &self.display_name); - formatter.field("account_number", &self.account_number); - formatter.field("avatar_url", &self.avatar_url); - formatter.field("presence", &self.presence); - formatter.field("party", &self.party); - formatter.field("is_registered", &self.is_registered); - formatter.field("external", &self.external); - formatter.field("is_admin", &self.is_admin); - formatter.field("is_game_linked", &self.is_game_linked); - formatter.field("dev_state", &self.dev_state); - formatter.field("follower_count", &self.follower_count); - formatter.field("following_count", &self.following_count); - formatter.field("following", &self.following); - formatter.field("is_following_me", &self.is_following_me); - formatter.field("is_mutual_following", &self.is_mutual_following); - formatter.field("join_ts", &self.join_ts); - formatter.field("bio", &self.bio); - formatter.field("linked_accounts", &"*** Sensitive Data Redacted ***"); - formatter.field("groups", &self.groups); - formatter.field("games", &self.games); - formatter.field("awaiting_deletion", &self.awaiting_deletion); - formatter.finish() - } -} -/// See [`IdentityProfile`](crate::model::IdentityProfile) -pub mod identity_profile { - /// A builder for [`IdentityProfile`](crate::model::IdentityProfile) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity_id: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) account_number: std::option::Option, - pub(crate) avatar_url: std::option::Option, - pub(crate) presence: std::option::Option, - pub(crate) party: std::option::Option, - pub(crate) is_registered: std::option::Option, - pub(crate) external: std::option::Option, - pub(crate) is_admin: std::option::Option, - pub(crate) is_game_linked: std::option::Option, - pub(crate) dev_state: std::option::Option, - pub(crate) follower_count: std::option::Option, - pub(crate) following_count: std::option::Option, - pub(crate) following: std::option::Option, - pub(crate) is_following_me: std::option::Option, - pub(crate) is_mutual_following: std::option::Option, - pub(crate) join_ts: std::option::Option, - pub(crate) bio: std::option::Option, - pub(crate) linked_accounts: - std::option::Option>, - pub(crate) groups: std::option::Option>, - pub(crate) games: std::option::Option>, - pub(crate) awaiting_deletion: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.identity_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.identity_id = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub fn account_number(mut self, input: i32) -> Self { - self.account_number = Some(input); - self - } - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub fn set_account_number(mut self, input: std::option::Option) -> Self { - self.account_number = input; - self - } - /// The URL of this identity's avatar image. - pub fn avatar_url(mut self, input: impl Into) -> Self { - self.avatar_url = Some(input.into()); - self - } - /// The URL of this identity's avatar image. - pub fn set_avatar_url(mut self, input: std::option::Option) -> Self { - self.avatar_url = input; - self - } - /// Information about the identity's current status, party, and active game. - pub fn presence(mut self, input: crate::model::IdentityPresence) -> Self { - self.presence = Some(input); - self - } - /// Information about the identity's current status, party, and active game. - pub fn set_presence( - mut self, - input: std::option::Option, - ) -> Self { - self.presence = input; - self - } - /// A party summary. - pub fn party(mut self, input: crate::model::PartySummary) -> Self { - self.party = Some(input); - self - } - /// A party summary. - pub fn set_party(mut self, input: std::option::Option) -> Self { - self.party = input; - self - } - /// Whether or not this identity is registered with a linked account. - pub fn is_registered(mut self, input: bool) -> Self { - self.is_registered = Some(input); - self - } - /// Whether or not this identity is registered with a linked account. - pub fn set_is_registered(mut self, input: std::option::Option) -> Self { - self.is_registered = input; - self - } - /// External links for an identity. - pub fn external(mut self, input: crate::model::IdentityExternalLinks) -> Self { - self.external = Some(input); - self - } - /// External links for an identity. - pub fn set_external( - mut self, - input: std::option::Option, - ) -> Self { - self.external = input; - self - } - /// Whether or not this identity is an admin. - pub fn is_admin(mut self, input: bool) -> Self { - self.is_admin = Some(input); - self - } - /// Whether or not this identity is an admin. - pub fn set_is_admin(mut self, input: std::option::Option) -> Self { - self.is_admin = input; - self - } - /// Whether or not this game user has been linked through the Rivet dashboard. - pub fn is_game_linked(mut self, input: bool) -> Self { - self.is_game_linked = Some(input); - self - } - /// Whether or not this game user has been linked through the Rivet dashboard. - pub fn set_is_game_linked(mut self, input: std::option::Option) -> Self { - self.is_game_linked = input; - self - } - /// The state of the given identity's developer status. - pub fn dev_state(mut self, input: crate::model::IdentityDevState) -> Self { - self.dev_state = Some(input); - self - } - /// The state of the given identity's developer status. - pub fn set_dev_state( - mut self, - input: std::option::Option, - ) -> Self { - self.dev_state = input; - self - } - /// Unsigned 64 bit integer. - pub fn follower_count(mut self, input: i64) -> Self { - self.follower_count = Some(input); - self - } - /// Unsigned 64 bit integer. - pub fn set_follower_count(mut self, input: std::option::Option) -> Self { - self.follower_count = input; - self - } - /// Unsigned 64 bit integer. - pub fn following_count(mut self, input: i64) -> Self { - self.following_count = Some(input); - self - } - /// Unsigned 64 bit integer. - pub fn set_following_count(mut self, input: std::option::Option) -> Self { - self.following_count = input; - self - } - /// Whether or not the requestee's identity is following this identity. - pub fn following(mut self, input: bool) -> Self { - self.following = Some(input); - self - } - /// Whether or not the requestee's identity is following this identity. - pub fn set_following(mut self, input: std::option::Option) -> Self { - self.following = input; - self - } - /// Whether or not this identity following the requestee's identity. - pub fn is_following_me(mut self, input: bool) -> Self { - self.is_following_me = Some(input); - self - } - /// Whether or not this identity following the requestee's identity. - pub fn set_is_following_me(mut self, input: std::option::Option) -> Self { - self.is_following_me = input; - self - } - /// Whether or not this identity is both following and is followed by the requestee's identity. - pub fn is_mutual_following(mut self, input: bool) -> Self { - self.is_mutual_following = Some(input); - self - } - /// Whether or not this identity is both following and is followed by the requestee's identity. - pub fn set_is_mutual_following(mut self, input: std::option::Option) -> Self { - self.is_mutual_following = input; - self - } - /// RFC3339 timestamp. - pub fn join_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.join_ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_join_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.join_ts = input; - self - } - /// Detailed information about a profile. - pub fn bio(mut self, input: impl Into) -> Self { - self.bio = Some(input.into()); - self - } - /// Detailed information about a profile. - pub fn set_bio(mut self, input: std::option::Option) -> Self { - self.bio = input; - self - } - /// Appends an item to `linked_accounts`. - /// - /// To override the contents of this collection use [`set_linked_accounts`](Self::set_linked_accounts). - /// - /// A list of an identity's linked accounts. - pub fn linked_accounts(mut self, input: crate::model::IdentityLinkedAccount) -> Self { - let mut v = self.linked_accounts.unwrap_or_default(); - v.push(input); - self.linked_accounts = Some(v); - self - } - /// A list of an identity's linked accounts. - pub fn set_linked_accounts( - mut self, - input: std::option::Option>, - ) -> Self { - self.linked_accounts = input; - self - } - /// Appends an item to `groups`. - /// - /// To override the contents of this collection use [`set_groups`](Self::set_groups). - /// - /// A list of groups that the given identity is in. - pub fn groups(mut self, input: crate::model::IdentityGroup) -> Self { - let mut v = self.groups.unwrap_or_default(); - v.push(input); - self.groups = Some(v); - self - } - /// A list of groups that the given identity is in. - pub fn set_groups( - mut self, - input: std::option::Option>, - ) -> Self { - self.groups = input; - self - } - /// Appends an item to `games`. - /// - /// To override the contents of this collection use [`set_games`](Self::set_games). - /// - /// A list of game statistic summaries. - pub fn games(mut self, input: crate::model::GameStatSummary) -> Self { - let mut v = self.games.unwrap_or_default(); - v.push(input); - self.games = Some(v); - self - } - /// A list of game statistic summaries. - pub fn set_games( - mut self, - input: std::option::Option>, - ) -> Self { - self.games = input; - self - } - /// Whether or not this identity is awaiting account deletion. Only visible to when the requestee is this identity. - pub fn awaiting_deletion(mut self, input: bool) -> Self { - self.awaiting_deletion = Some(input); - self - } - /// Whether or not this identity is awaiting account deletion. Only visible to when the requestee is this identity. - pub fn set_awaiting_deletion(mut self, input: std::option::Option) -> Self { - self.awaiting_deletion = input; - self - } - /// Consumes the builder and constructs a [`IdentityProfile`](crate::model::IdentityProfile) - pub fn build(self) -> crate::model::IdentityProfile { - crate::model::IdentityProfile { - identity_id: self.identity_id, - display_name: self.display_name, - account_number: self.account_number, - avatar_url: self.avatar_url, - presence: self.presence, - party: self.party, - is_registered: self.is_registered, - external: self.external, - is_admin: self.is_admin, - is_game_linked: self.is_game_linked, - dev_state: self.dev_state, - follower_count: self.follower_count, - following_count: self.following_count, - following: self.following, - is_following_me: self.is_following_me, - is_mutual_following: self.is_mutual_following, - join_ts: self.join_ts, - bio: self.bio, - linked_accounts: self.linked_accounts, - groups: self.groups, - games: self.games, - awaiting_deletion: self.awaiting_deletion, - } - } - } -} -impl IdentityProfile { - /// Creates a new builder-style object to manufacture [`IdentityProfile`](crate::model::IdentityProfile) - pub fn builder() -> crate::model::identity_profile::Builder { - crate::model::identity_profile::Builder::default() - } -} - -/// A game statistic summary. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GameStatSummary { - /// A game handle. - pub game: std::option::Option, - /// A list of game statistics. - pub stats: std::option::Option>, -} -impl GameStatSummary { - /// A game handle. - pub fn game(&self) -> std::option::Option<&crate::model::GameHandle> { - self.game.as_ref() - } - /// A list of game statistics. - pub fn stats(&self) -> std::option::Option<&[crate::model::GameStat]> { - self.stats.as_deref() - } -} -impl std::fmt::Debug for GameStatSummary { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GameStatSummary"); - formatter.field("game", &self.game); - formatter.field("stats", &self.stats); - formatter.finish() - } -} -/// See [`GameStatSummary`](crate::model::GameStatSummary) -pub mod game_stat_summary { - /// A builder for [`GameStatSummary`](crate::model::GameStatSummary) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game: std::option::Option, - pub(crate) stats: std::option::Option>, - } - impl Builder { - /// A game handle. - pub fn game(mut self, input: crate::model::GameHandle) -> Self { - self.game = Some(input); - self - } - /// A game handle. - pub fn set_game(mut self, input: std::option::Option) -> Self { - self.game = input; - self - } - /// Appends an item to `stats`. - /// - /// To override the contents of this collection use [`set_stats`](Self::set_stats). - /// - /// A list of game statistics. - pub fn stats(mut self, input: crate::model::GameStat) -> Self { - let mut v = self.stats.unwrap_or_default(); - v.push(input); - self.stats = Some(v); - self - } - /// A list of game statistics. - pub fn set_stats( - mut self, - input: std::option::Option>, - ) -> Self { - self.stats = input; - self - } - /// Consumes the builder and constructs a [`GameStatSummary`](crate::model::GameStatSummary) - pub fn build(self) -> crate::model::GameStatSummary { - crate::model::GameStatSummary { - game: self.game, - stats: self.stats, - } - } - } -} -impl GameStatSummary { - /// Creates a new builder-style object to manufacture [`GameStatSummary`](crate::model::GameStatSummary) - pub fn builder() -> crate::model::game_stat_summary::Builder { - crate::model::game_stat_summary::Builder::default() - } -} - -/// A game statistic. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GameStat { - /// A game statistic config. - pub config: std::option::Option, - /// A single overall value of the given statistic. - pub overall_value: std::option::Option, -} -impl GameStat { - /// A game statistic config. - pub fn config(&self) -> std::option::Option<&crate::model::GameStatConfig> { - self.config.as_ref() - } - /// A single overall value of the given statistic. - pub fn overall_value(&self) -> std::option::Option { - self.overall_value - } -} -impl std::fmt::Debug for GameStat { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GameStat"); - formatter.field("config", &self.config); - formatter.field("overall_value", &self.overall_value); - formatter.finish() - } -} -/// See [`GameStat`](crate::model::GameStat) -pub mod game_stat { - /// A builder for [`GameStat`](crate::model::GameStat) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) config: std::option::Option, - pub(crate) overall_value: std::option::Option, - } - impl Builder { - /// A game statistic config. - pub fn config(mut self, input: crate::model::GameStatConfig) -> Self { - self.config = Some(input); - self - } - /// A game statistic config. - pub fn set_config( - mut self, - input: std::option::Option, - ) -> Self { - self.config = input; - self - } - /// A single overall value of the given statistic. - pub fn overall_value(mut self, input: f32) -> Self { - self.overall_value = Some(input); - self - } - /// A single overall value of the given statistic. - pub fn set_overall_value(mut self, input: std::option::Option) -> Self { - self.overall_value = input; - self - } - /// Consumes the builder and constructs a [`GameStat`](crate::model::GameStat) - pub fn build(self) -> crate::model::GameStat { - crate::model::GameStat { - config: self.config, - overall_value: self.overall_value, - } - } - } -} -impl GameStat { - /// Creates a new builder-style object to manufacture [`GameStat`](crate::model::GameStat) - pub fn builder() -> crate::model::game_stat::Builder { - crate::model::game_stat::Builder::default() - } -} - -/// A game statistic config. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GameStatConfig { - /// A universally unique identifier. - pub record_id: std::option::Option, - /// A universally unique identifier. - pub icon_id: std::option::Option, - /// A value denoting the format method of a game statistic. - pub format: std::option::Option, - /// A value denoting the aggregation method of a game statistic. - pub aggregation: std::option::Option, - /// A value denoting the sorting method of a game statistic. - pub sorting: std::option::Option, - /// Unsigned 32 bit integer. - pub priority: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// A string appended to the end of a singular game statistic's value. Example: 1 **dollar**. - pub postfix_singular: std::option::Option, - /// A string appended to the end of a game statistic's value that is not exactly 1. Example: 45 **dollars**. - pub postfix_plural: std::option::Option, - /// A string appended to the beginning of a singular game statistic's value. Example: **value** 1. - pub prefix_singular: std::option::Option, - /// A string prepended to the beginning of a game statistic's value that is not exactly 1. Example: **values** 45. - pub prefix_plural: std::option::Option, -} -impl GameStatConfig { - /// A universally unique identifier. - pub fn record_id(&self) -> std::option::Option<&str> { - self.record_id.as_deref() - } - /// A universally unique identifier. - pub fn icon_id(&self) -> std::option::Option<&str> { - self.icon_id.as_deref() - } - /// A value denoting the format method of a game statistic. - pub fn format(&self) -> std::option::Option<&crate::model::GameStatFormatMethod> { - self.format.as_ref() - } - /// A value denoting the aggregation method of a game statistic. - pub fn aggregation(&self) -> std::option::Option<&crate::model::GameStatAggregationMethod> { - self.aggregation.as_ref() - } - /// A value denoting the sorting method of a game statistic. - pub fn sorting(&self) -> std::option::Option<&crate::model::GameStatSortingMethod> { - self.sorting.as_ref() - } - /// Unsigned 32 bit integer. - pub fn priority(&self) -> std::option::Option { - self.priority - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// A string appended to the end of a singular game statistic's value. Example: 1 **dollar**. - pub fn postfix_singular(&self) -> std::option::Option<&str> { - self.postfix_singular.as_deref() - } - /// A string appended to the end of a game statistic's value that is not exactly 1. Example: 45 **dollars**. - pub fn postfix_plural(&self) -> std::option::Option<&str> { - self.postfix_plural.as_deref() - } - /// A string appended to the beginning of a singular game statistic's value. Example: **value** 1. - pub fn prefix_singular(&self) -> std::option::Option<&str> { - self.prefix_singular.as_deref() - } - /// A string prepended to the beginning of a game statistic's value that is not exactly 1. Example: **values** 45. - pub fn prefix_plural(&self) -> std::option::Option<&str> { - self.prefix_plural.as_deref() - } -} -impl std::fmt::Debug for GameStatConfig { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GameStatConfig"); - formatter.field("record_id", &self.record_id); - formatter.field("icon_id", &self.icon_id); - formatter.field("format", &self.format); - formatter.field("aggregation", &self.aggregation); - formatter.field("sorting", &self.sorting); - formatter.field("priority", &self.priority); - formatter.field("display_name", &self.display_name); - formatter.field("postfix_singular", &self.postfix_singular); - formatter.field("postfix_plural", &self.postfix_plural); - formatter.field("prefix_singular", &self.prefix_singular); - formatter.field("prefix_plural", &self.prefix_plural); - formatter.finish() - } -} -/// See [`GameStatConfig`](crate::model::GameStatConfig) -pub mod game_stat_config { - /// A builder for [`GameStatConfig`](crate::model::GameStatConfig) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) record_id: std::option::Option, - pub(crate) icon_id: std::option::Option, - pub(crate) format: std::option::Option, - pub(crate) aggregation: std::option::Option, - pub(crate) sorting: std::option::Option, - pub(crate) priority: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) postfix_singular: std::option::Option, - pub(crate) postfix_plural: std::option::Option, - pub(crate) prefix_singular: std::option::Option, - pub(crate) prefix_plural: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn record_id(mut self, input: impl Into) -> Self { - self.record_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_record_id(mut self, input: std::option::Option) -> Self { - self.record_id = input; - self - } - /// A universally unique identifier. - pub fn icon_id(mut self, input: impl Into) -> Self { - self.icon_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_icon_id(mut self, input: std::option::Option) -> Self { - self.icon_id = input; - self - } - /// A value denoting the format method of a game statistic. - pub fn format(mut self, input: crate::model::GameStatFormatMethod) -> Self { - self.format = Some(input); - self - } - /// A value denoting the format method of a game statistic. - pub fn set_format( - mut self, - input: std::option::Option, - ) -> Self { - self.format = input; - self - } - /// A value denoting the aggregation method of a game statistic. - pub fn aggregation(mut self, input: crate::model::GameStatAggregationMethod) -> Self { - self.aggregation = Some(input); - self - } - /// A value denoting the aggregation method of a game statistic. - pub fn set_aggregation( - mut self, - input: std::option::Option, - ) -> Self { - self.aggregation = input; - self - } - /// A value denoting the sorting method of a game statistic. - pub fn sorting(mut self, input: crate::model::GameStatSortingMethod) -> Self { - self.sorting = Some(input); - self - } - /// A value denoting the sorting method of a game statistic. - pub fn set_sorting( - mut self, - input: std::option::Option, - ) -> Self { - self.sorting = input; - self - } - /// Unsigned 32 bit integer. - pub fn priority(mut self, input: i32) -> Self { - self.priority = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_priority(mut self, input: std::option::Option) -> Self { - self.priority = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// A string appended to the end of a singular game statistic's value. Example: 1 **dollar**. - pub fn postfix_singular(mut self, input: impl Into) -> Self { - self.postfix_singular = Some(input.into()); - self - } - /// A string appended to the end of a singular game statistic's value. Example: 1 **dollar**. - pub fn set_postfix_singular( - mut self, - input: std::option::Option, - ) -> Self { - self.postfix_singular = input; - self - } - /// A string appended to the end of a game statistic's value that is not exactly 1. Example: 45 **dollars**. - pub fn postfix_plural(mut self, input: impl Into) -> Self { - self.postfix_plural = Some(input.into()); - self - } - /// A string appended to the end of a game statistic's value that is not exactly 1. Example: 45 **dollars**. - pub fn set_postfix_plural( - mut self, - input: std::option::Option, - ) -> Self { - self.postfix_plural = input; - self - } - /// A string appended to the beginning of a singular game statistic's value. Example: **value** 1. - pub fn prefix_singular(mut self, input: impl Into) -> Self { - self.prefix_singular = Some(input.into()); - self - } - /// A string appended to the beginning of a singular game statistic's value. Example: **value** 1. - pub fn set_prefix_singular( - mut self, - input: std::option::Option, - ) -> Self { - self.prefix_singular = input; - self - } - /// A string prepended to the beginning of a game statistic's value that is not exactly 1. Example: **values** 45. - pub fn prefix_plural(mut self, input: impl Into) -> Self { - self.prefix_plural = Some(input.into()); - self - } - /// A string prepended to the beginning of a game statistic's value that is not exactly 1. Example: **values** 45. - pub fn set_prefix_plural( - mut self, - input: std::option::Option, - ) -> Self { - self.prefix_plural = input; - self - } - /// Consumes the builder and constructs a [`GameStatConfig`](crate::model::GameStatConfig) - pub fn build(self) -> crate::model::GameStatConfig { - crate::model::GameStatConfig { - record_id: self.record_id, - icon_id: self.icon_id, - format: self.format, - aggregation: self.aggregation, - sorting: self.sorting, - priority: self.priority, - display_name: self.display_name, - postfix_singular: self.postfix_singular, - postfix_plural: self.postfix_plural, - prefix_singular: self.prefix_singular, - prefix_plural: self.prefix_plural, - } - } - } -} -impl GameStatConfig { - /// Creates a new builder-style object to manufacture [`GameStatConfig`](crate::model::GameStatConfig) - pub fn builder() -> crate::model::game_stat_config::Builder { - crate::model::game_stat_config::Builder::default() - } -} - -/// A value denoting the sorting method of a game statistic. -#[non_exhaustive] -#[derive( - std::clone::Clone, - std::cmp::Eq, - std::cmp::Ord, - std::cmp::PartialEq, - std::cmp::PartialOrd, - std::fmt::Debug, - std::hash::Hash, -)] -pub enum GameStatSortingMethod { - /// Ascending sorting. - Asc, - /// Descending sorting. - Desc, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for GameStatSortingMethod { - fn from(s: &str) -> Self { - match s { - "asc" => GameStatSortingMethod::Asc, - "desc" => GameStatSortingMethod::Desc, - other => GameStatSortingMethod::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for GameStatSortingMethod { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(GameStatSortingMethod::from(s)) - } -} -impl GameStatSortingMethod { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - GameStatSortingMethod::Asc => "asc", - GameStatSortingMethod::Desc => "desc", - GameStatSortingMethod::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["asc", "desc"] - } -} -impl AsRef for GameStatSortingMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// A value denoting the aggregation method of a game statistic. -#[non_exhaustive] -#[derive( - std::clone::Clone, - std::cmp::Eq, - std::cmp::Ord, - std::cmp::PartialEq, - std::cmp::PartialOrd, - std::fmt::Debug, - std::hash::Hash, -)] -pub enum GameStatAggregationMethod { - /// Average aggergation. - Average, - /// Maximum value aggregation. - Max, - /// Minimum value aggregation. - Min, - /// Summation aggregation. - Sum, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for GameStatAggregationMethod { - fn from(s: &str) -> Self { - match s { - "average" => GameStatAggregationMethod::Average, - "max" => GameStatAggregationMethod::Max, - "min" => GameStatAggregationMethod::Min, - "sum" => GameStatAggregationMethod::Sum, - other => GameStatAggregationMethod::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for GameStatAggregationMethod { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(GameStatAggregationMethod::from(s)) - } -} -impl GameStatAggregationMethod { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - GameStatAggregationMethod::Average => "average", - GameStatAggregationMethod::Max => "max", - GameStatAggregationMethod::Min => "min", - GameStatAggregationMethod::Sum => "sum", - GameStatAggregationMethod::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["average", "max", "min", "sum"] - } -} -impl AsRef for GameStatAggregationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// A value denoting the format method of a game statistic. -#[non_exhaustive] -#[derive( - std::clone::Clone, - std::cmp::Eq, - std::cmp::Ord, - std::cmp::PartialEq, - std::cmp::PartialOrd, - std::fmt::Debug, - std::hash::Hash, -)] -pub enum GameStatFormatMethod { - /// A duration with hundredth-second precision (1d 2h 45m 21.46s). - DurationHundredthSecond, - /// A duration with minute precision (1d 2h 45m). - DurationMinute, - /// A duration with second precision (1d 2h 45m 21s). - DuractionSecond, - /// A float with 1 decimal (1,234.5). - Float1, - /// A float with 2 decimals (1,234.56). - Float2, - /// A float with 3 decimals (1,234.567). - Float3, - /// An integer with no decimals (1,234). - Integer, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for GameStatFormatMethod { - fn from(s: &str) -> Self { - match s { - "duration_hundredth_second" => GameStatFormatMethod::DurationHundredthSecond, - "duration_minute" => GameStatFormatMethod::DurationMinute, - "duration_second" => GameStatFormatMethod::DuractionSecond, - "float_1" => GameStatFormatMethod::Float1, - "float_2" => GameStatFormatMethod::Float2, - "float_3" => GameStatFormatMethod::Float3, - "integer" => GameStatFormatMethod::Integer, - other => GameStatFormatMethod::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for GameStatFormatMethod { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(GameStatFormatMethod::from(s)) - } -} -impl GameStatFormatMethod { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - GameStatFormatMethod::DurationHundredthSecond => "duration_hundredth_second", - GameStatFormatMethod::DurationMinute => "duration_minute", - GameStatFormatMethod::DuractionSecond => "duration_second", - GameStatFormatMethod::Float1 => "float_1", - GameStatFormatMethod::Float2 => "float_2", - GameStatFormatMethod::Float3 => "float_3", - GameStatFormatMethod::Integer => "integer", - GameStatFormatMethod::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &[ - "duration_hundredth_second", - "duration_minute", - "duration_second", - "float_1", - "float_2", - "float_3", - "integer", - ] - } -} -impl AsRef for GameStatFormatMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// A group that the given identity. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct IdentityGroup { - /// A group handle. - pub group: std::option::Option, -} -impl IdentityGroup { - /// A group handle. - pub fn group(&self) -> std::option::Option<&crate::model::GroupHandle> { - self.group.as_ref() - } -} -impl std::fmt::Debug for IdentityGroup { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("IdentityGroup"); - formatter.field("group", &self.group); - formatter.finish() - } -} -/// See [`IdentityGroup`](crate::model::IdentityGroup) -pub mod identity_group { - /// A builder for [`IdentityGroup`](crate::model::IdentityGroup) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) group: std::option::Option, - } - impl Builder { - /// A group handle. - pub fn group(mut self, input: crate::model::GroupHandle) -> Self { - self.group = Some(input); - self - } - /// A group handle. - pub fn set_group(mut self, input: std::option::Option) -> Self { - self.group = input; - self - } - /// Consumes the builder and constructs a [`IdentityGroup`](crate::model::IdentityGroup) - pub fn build(self) -> crate::model::IdentityGroup { - crate::model::IdentityGroup { group: self.group } - } - } -} -impl IdentityGroup { - /// Creates a new builder-style object to manufacture [`IdentityGroup`](crate::model::IdentityGroup) - pub fn builder() -> crate::model::identity_group::Builder { - crate::model::identity_group::Builder::default() - } -} - -/// A union representing an identity's linked accounts. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] -pub enum IdentityLinkedAccount { - /// An identity's linked email. - Email(crate::model::IdentityEmailLinkedAccount), - /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version. - /// An unknown enum variant - /// - /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._ - /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized - /// by the client. This can happen when the server adds new functionality, but the client has not been updated. - /// To investigate this, consider turning on debug logging to print the raw HTTP response. - #[non_exhaustive] - Unknown, -} -impl IdentityLinkedAccount { - #[allow(irrefutable_let_patterns)] - /// Tries to convert the enum instance into [`Email`](crate::model::IdentityLinkedAccount::Email), extracting the inner [`IdentityEmailLinkedAccount`](crate::model::IdentityEmailLinkedAccount). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_email( - &self, - ) -> std::result::Result<&crate::model::IdentityEmailLinkedAccount, &Self> { - if let IdentityLinkedAccount::Email(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`Email`](crate::model::IdentityLinkedAccount::Email). - pub fn is_email(&self) -> bool { - self.as_email().is_ok() - } - /// Returns true if the enum instance is the `Unknown` variant. - pub fn is_unknown(&self) -> bool { - matches!(self, Self::Unknown) - } -} - -/// An identity's linked email. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct IdentityEmailLinkedAccount { - /// A valid email address. - pub email: std::option::Option, -} -impl IdentityEmailLinkedAccount { - /// A valid email address. - pub fn email(&self) -> std::option::Option<&str> { - self.email.as_deref() - } -} -impl std::fmt::Debug for IdentityEmailLinkedAccount { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("IdentityEmailLinkedAccount"); - formatter.field("email", &"*** Sensitive Data Redacted ***"); - formatter.finish() - } -} -/// See [`IdentityEmailLinkedAccount`](crate::model::IdentityEmailLinkedAccount) -pub mod identity_email_linked_account { - /// A builder for [`IdentityEmailLinkedAccount`](crate::model::IdentityEmailLinkedAccount) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) email: std::option::Option, - } - impl Builder { - /// A valid email address. - pub fn email(mut self, input: impl Into) -> Self { - self.email = Some(input.into()); - self - } - /// A valid email address. - pub fn set_email(mut self, input: std::option::Option) -> Self { - self.email = input; - self - } - /// Consumes the builder and constructs a [`IdentityEmailLinkedAccount`](crate::model::IdentityEmailLinkedAccount) - pub fn build(self) -> crate::model::IdentityEmailLinkedAccount { - crate::model::IdentityEmailLinkedAccount { email: self.email } - } - } -} -impl IdentityEmailLinkedAccount { - /// Creates a new builder-style object to manufacture [`IdentityEmailLinkedAccount`](crate::model::IdentityEmailLinkedAccount) - pub fn builder() -> crate::model::identity_email_linked_account::Builder { - crate::model::identity_email_linked_account::Builder::default() - } -} - -/// The state of the given identity's developer status. -#[non_exhaustive] -#[derive( - std::clone::Clone, - std::cmp::Eq, - std::cmp::Ord, - std::cmp::PartialEq, - std::cmp::PartialOrd, - std::fmt::Debug, - std::hash::Hash, -)] -pub enum IdentityDevState { - #[allow(missing_docs)] // documentation missing in model - Accepted, - #[allow(missing_docs)] // documentation missing in model - Inactive, - #[allow(missing_docs)] // documentation missing in model - Pending, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for IdentityDevState { - fn from(s: &str) -> Self { - match s { - "accepted" => IdentityDevState::Accepted, - "inactive" => IdentityDevState::Inactive, - "pending" => IdentityDevState::Pending, - other => IdentityDevState::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for IdentityDevState { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(IdentityDevState::from(s)) - } -} -impl IdentityDevState { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - IdentityDevState::Accepted => "accepted", - IdentityDevState::Inactive => "inactive", - IdentityDevState::Pending => "pending", - IdentityDevState::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["accepted", "inactive", "pending"] - } -} -impl AsRef for IdentityDevState { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// The link status between an identity and a game user. -#[non_exhaustive] -#[derive( - std::clone::Clone, - std::cmp::Eq, - std::cmp::Ord, - std::cmp::PartialEq, - std::cmp::PartialOrd, - std::fmt::Debug, - std::hash::Hash, -)] -pub enum GameLinkStatus { - #[allow(missing_docs)] // documentation missing in model - Cancelled, - #[allow(missing_docs)] // documentation missing in model - Complete, - #[allow(missing_docs)] // documentation missing in model - Incomplete, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for GameLinkStatus { - fn from(s: &str) -> Self { - match s { - "cancelled" => GameLinkStatus::Cancelled, - "complete" => GameLinkStatus::Complete, - "incomplete" => GameLinkStatus::Incomplete, - other => GameLinkStatus::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for GameLinkStatus { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(GameLinkStatus::from(s)) - } -} -impl GameLinkStatus { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - GameLinkStatus::Cancelled => "cancelled", - GameLinkStatus::Complete => "complete", - GameLinkStatus::Incomplete => "incomplete", - GameLinkStatus::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["cancelled", "complete", "incomplete"] - } -} -impl AsRef for GameLinkStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// An event relevant to the current identity. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GlobalEvent { - /// RFC3339 timestamp. - pub ts: std::option::Option, - /// Kind of event that occurred. - pub kind: std::option::Option, - /// Notifications represent information that should be presented to the user immediately. At the moment, only chat message events have associated notifications. # Display Notifications should be displayed in an unobtrusive manner throughout the entire game. Notifications should disappear after a few seconds if not interacted with. # Interactions If your platform supports it, notifications should be able to be clicked or tapped in order to open the relevant context for the event. For a simple implementation of notification interactions, open `url` in a web browser to present the relevant context. For example, a chat message notification will open the thread the chat message was sent in. For advanced implementations that implement a custom chat UI, use `rivet.api.identity.common#GlobalEvent$kind` to determine what action to take when the notification is interacted with. For example, if the global event kind is `rivet.api.identity.common#GlobalEventChatMessage`, then open the chat UI for the given thread. - pub notification: std::option::Option, -} -impl GlobalEvent { - /// RFC3339 timestamp. - pub fn ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.ts.as_ref() - } - /// Kind of event that occurred. - pub fn kind(&self) -> std::option::Option<&crate::model::GlobalEventKind> { - self.kind.as_ref() - } - /// Notifications represent information that should be presented to the user immediately. At the moment, only chat message events have associated notifications. # Display Notifications should be displayed in an unobtrusive manner throughout the entire game. Notifications should disappear after a few seconds if not interacted with. # Interactions If your platform supports it, notifications should be able to be clicked or tapped in order to open the relevant context for the event. For a simple implementation of notification interactions, open `url` in a web browser to present the relevant context. For example, a chat message notification will open the thread the chat message was sent in. For advanced implementations that implement a custom chat UI, use `rivet.api.identity.common#GlobalEvent$kind` to determine what action to take when the notification is interacted with. For example, if the global event kind is `rivet.api.identity.common#GlobalEventChatMessage`, then open the chat UI for the given thread. - pub fn notification(&self) -> std::option::Option<&crate::model::GlobalEventNotification> { - self.notification.as_ref() - } -} -impl std::fmt::Debug for GlobalEvent { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GlobalEvent"); - formatter.field("ts", &self.ts); - formatter.field("kind", &self.kind); - formatter.field("notification", &self.notification); - formatter.finish() - } -} -/// See [`GlobalEvent`](crate::model::GlobalEvent) -pub mod global_event { - /// A builder for [`GlobalEvent`](crate::model::GlobalEvent) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) ts: std::option::Option, - pub(crate) kind: std::option::Option, - pub(crate) notification: std::option::Option, - } - impl Builder { - /// RFC3339 timestamp. - pub fn ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_ts(mut self, input: std::option::Option) -> Self { - self.ts = input; - self - } - /// Kind of event that occurred. - pub fn kind(mut self, input: crate::model::GlobalEventKind) -> Self { - self.kind = Some(input); - self - } - /// Kind of event that occurred. - pub fn set_kind( - mut self, - input: std::option::Option, - ) -> Self { - self.kind = input; - self - } - /// Notifications represent information that should be presented to the user immediately. At the moment, only chat message events have associated notifications. # Display Notifications should be displayed in an unobtrusive manner throughout the entire game. Notifications should disappear after a few seconds if not interacted with. # Interactions If your platform supports it, notifications should be able to be clicked or tapped in order to open the relevant context for the event. For a simple implementation of notification interactions, open `url` in a web browser to present the relevant context. For example, a chat message notification will open the thread the chat message was sent in. For advanced implementations that implement a custom chat UI, use `rivet.api.identity.common#GlobalEvent$kind` to determine what action to take when the notification is interacted with. For example, if the global event kind is `rivet.api.identity.common#GlobalEventChatMessage`, then open the chat UI for the given thread. - pub fn notification(mut self, input: crate::model::GlobalEventNotification) -> Self { - self.notification = Some(input); - self - } - /// Notifications represent information that should be presented to the user immediately. At the moment, only chat message events have associated notifications. # Display Notifications should be displayed in an unobtrusive manner throughout the entire game. Notifications should disappear after a few seconds if not interacted with. # Interactions If your platform supports it, notifications should be able to be clicked or tapped in order to open the relevant context for the event. For a simple implementation of notification interactions, open `url` in a web browser to present the relevant context. For example, a chat message notification will open the thread the chat message was sent in. For advanced implementations that implement a custom chat UI, use `rivet.api.identity.common#GlobalEvent$kind` to determine what action to take when the notification is interacted with. For example, if the global event kind is `rivet.api.identity.common#GlobalEventChatMessage`, then open the chat UI for the given thread. - pub fn set_notification( - mut self, - input: std::option::Option, - ) -> Self { - self.notification = input; - self - } - /// Consumes the builder and constructs a [`GlobalEvent`](crate::model::GlobalEvent) - pub fn build(self) -> crate::model::GlobalEvent { - crate::model::GlobalEvent { - ts: self.ts, - kind: self.kind, - notification: self.notification, - } - } - } -} -impl GlobalEvent { - /// Creates a new builder-style object to manufacture [`GlobalEvent`](crate::model::GlobalEvent) - pub fn builder() -> crate::model::global_event::Builder { - crate::model::global_event::Builder::default() - } -} - -/// Notifications represent information that should be presented to the user immediately. At the moment, only chat message events have associated notifications. # Display Notifications should be displayed in an unobtrusive manner throughout the entire game. Notifications should disappear after a few seconds if not interacted with. # Interactions If your platform supports it, notifications should be able to be clicked or tapped in order to open the relevant context for the event. For a simple implementation of notification interactions, open `url` in a web browser to present the relevant context. For example, a chat message notification will open the thread the chat message was sent in. For advanced implementations that implement a custom chat UI, use `rivet.api.identity.common#GlobalEvent$kind` to determine what action to take when the notification is interacted with. For example, if the global event kind is `rivet.api.identity.common#GlobalEventChatMessage`, then open the chat UI for the given thread. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GlobalEventNotification { - #[allow(missing_docs)] // documentation missing in model - pub title: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub description: std::option::Option, - /// URL to an image thumbnail that should be shown for this notification. - pub thumbnail_url: std::option::Option, - /// Rivet Hub URL that holds the relevant context for this notification. - pub url: std::option::Option, -} -impl GlobalEventNotification { - #[allow(missing_docs)] // documentation missing in model - pub fn title(&self) -> std::option::Option<&str> { - self.title.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn description(&self) -> std::option::Option<&str> { - self.description.as_deref() - } - /// URL to an image thumbnail that should be shown for this notification. - pub fn thumbnail_url(&self) -> std::option::Option<&str> { - self.thumbnail_url.as_deref() - } - /// Rivet Hub URL that holds the relevant context for this notification. - pub fn url(&self) -> std::option::Option<&str> { - self.url.as_deref() - } -} -impl std::fmt::Debug for GlobalEventNotification { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GlobalEventNotification"); - formatter.field("title", &self.title); - formatter.field("description", &self.description); - formatter.field("thumbnail_url", &self.thumbnail_url); - formatter.field("url", &self.url); - formatter.finish() - } -} -/// See [`GlobalEventNotification`](crate::model::GlobalEventNotification) -pub mod global_event_notification { - /// A builder for [`GlobalEventNotification`](crate::model::GlobalEventNotification) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) title: std::option::Option, - pub(crate) description: std::option::Option, - pub(crate) thumbnail_url: std::option::Option, - pub(crate) url: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn title(mut self, input: impl Into) -> Self { - self.title = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_title(mut self, input: std::option::Option) -> Self { - self.title = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn description(mut self, input: impl Into) -> Self { - self.description = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_description(mut self, input: std::option::Option) -> Self { - self.description = input; - self - } - /// URL to an image thumbnail that should be shown for this notification. - pub fn thumbnail_url(mut self, input: impl Into) -> Self { - self.thumbnail_url = Some(input.into()); - self - } - /// URL to an image thumbnail that should be shown for this notification. - pub fn set_thumbnail_url( - mut self, - input: std::option::Option, - ) -> Self { - self.thumbnail_url = input; - self - } - /// Rivet Hub URL that holds the relevant context for this notification. - pub fn url(mut self, input: impl Into) -> Self { - self.url = Some(input.into()); - self - } - /// Rivet Hub URL that holds the relevant context for this notification. - pub fn set_url(mut self, input: std::option::Option) -> Self { - self.url = input; - self - } - /// Consumes the builder and constructs a [`GlobalEventNotification`](crate::model::GlobalEventNotification) - pub fn build(self) -> crate::model::GlobalEventNotification { - crate::model::GlobalEventNotification { - title: self.title, - description: self.description, - thumbnail_url: self.thumbnail_url, - url: self.url, - } - } - } -} -impl GlobalEventNotification { - /// Creates a new builder-style object to manufacture [`GlobalEventNotification`](crate::model::GlobalEventNotification) - pub fn builder() -> crate::model::global_event_notification::Builder { - crate::model::global_event_notification::Builder::default() - } -} - -/// Kind of event that occurred. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] -pub enum GlobalEventKind { - /// `rivet.api.identity.common#GlobalEventKind` variant for chat messages. Received any time a message is sent to a chat the identity is in. - ChatMessage(crate::model::GlobalEventChatMessage), - /// `rivet.api.identity.common#GlobalEventKind` variant for chat reads. Received any time the last read timestamp is set. Used to update the status of unread indicators on chats. - ChatRead(crate::model::GlobalEventChatRead), - /// `rivet.api.identity.common#GlobalEventKind` variant for a chat thread being removed. Received any time the current identity is no longer able to access the given thread. This can happen if - ChatThreadRemove(crate::model::GlobalEventChatThreadRemove), - /// `rivet.api.identity.common#GlobalEventKind` variant for identity updates. Received any time identity details are changed OR the identity switches. - IdentityUpdate(crate::model::GlobalEventIdentityUpdate), - /// `rivet.api.identity.common#GlobalEventKind` variant for party updates. Received when the identity should be instructed to join a lobby. This needs to be implemented in conjunction with parties in order to force clients to join the same lobby as the party they're in. - MatchmakerLobbyJoin(crate::model::GlobalEventMatchmakerLobbyJoin), - /// `rivet.api.identity.common#GlobalEventKind` variant for party updates. Received any time the identity joins a party, a party is updated, or when the identity leaves a party. - PartyUpdate(crate::model::GlobalEventPartyUpdate), - /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version. - /// An unknown enum variant - /// - /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._ - /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized - /// by the client. This can happen when the server adds new functionality, but the client has not been updated. - /// To investigate this, consider turning on debug logging to print the raw HTTP response. - #[non_exhaustive] - Unknown, -} -impl GlobalEventKind { - /// Tries to convert the enum instance into [`ChatMessage`](crate::model::GlobalEventKind::ChatMessage), extracting the inner [`GlobalEventChatMessage`](crate::model::GlobalEventChatMessage). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_chat_message( - &self, - ) -> std::result::Result<&crate::model::GlobalEventChatMessage, &Self> { - if let GlobalEventKind::ChatMessage(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`ChatMessage`](crate::model::GlobalEventKind::ChatMessage). - pub fn is_chat_message(&self) -> bool { - self.as_chat_message().is_ok() - } - /// Tries to convert the enum instance into [`ChatRead`](crate::model::GlobalEventKind::ChatRead), extracting the inner [`GlobalEventChatRead`](crate::model::GlobalEventChatRead). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_chat_read(&self) -> std::result::Result<&crate::model::GlobalEventChatRead, &Self> { - if let GlobalEventKind::ChatRead(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`ChatRead`](crate::model::GlobalEventKind::ChatRead). - pub fn is_chat_read(&self) -> bool { - self.as_chat_read().is_ok() - } - /// Tries to convert the enum instance into [`ChatThreadRemove`](crate::model::GlobalEventKind::ChatThreadRemove), extracting the inner [`GlobalEventChatThreadRemove`](crate::model::GlobalEventChatThreadRemove). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_chat_thread_remove( - &self, - ) -> std::result::Result<&crate::model::GlobalEventChatThreadRemove, &Self> { - if let GlobalEventKind::ChatThreadRemove(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`ChatThreadRemove`](crate::model::GlobalEventKind::ChatThreadRemove). - pub fn is_chat_thread_remove(&self) -> bool { - self.as_chat_thread_remove().is_ok() - } - /// Tries to convert the enum instance into [`IdentityUpdate`](crate::model::GlobalEventKind::IdentityUpdate), extracting the inner [`GlobalEventIdentityUpdate`](crate::model::GlobalEventIdentityUpdate). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_identity_update( - &self, - ) -> std::result::Result<&crate::model::GlobalEventIdentityUpdate, &Self> { - if let GlobalEventKind::IdentityUpdate(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`IdentityUpdate`](crate::model::GlobalEventKind::IdentityUpdate). - pub fn is_identity_update(&self) -> bool { - self.as_identity_update().is_ok() - } - /// Tries to convert the enum instance into [`MatchmakerLobbyJoin`](crate::model::GlobalEventKind::MatchmakerLobbyJoin), extracting the inner [`GlobalEventMatchmakerLobbyJoin`](crate::model::GlobalEventMatchmakerLobbyJoin). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_matchmaker_lobby_join( - &self, - ) -> std::result::Result<&crate::model::GlobalEventMatchmakerLobbyJoin, &Self> { - if let GlobalEventKind::MatchmakerLobbyJoin(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`MatchmakerLobbyJoin`](crate::model::GlobalEventKind::MatchmakerLobbyJoin). - pub fn is_matchmaker_lobby_join(&self) -> bool { - self.as_matchmaker_lobby_join().is_ok() - } - /// Tries to convert the enum instance into [`PartyUpdate`](crate::model::GlobalEventKind::PartyUpdate), extracting the inner [`GlobalEventPartyUpdate`](crate::model::GlobalEventPartyUpdate). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_party_update( - &self, - ) -> std::result::Result<&crate::model::GlobalEventPartyUpdate, &Self> { - if let GlobalEventKind::PartyUpdate(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`PartyUpdate`](crate::model::GlobalEventKind::PartyUpdate). - pub fn is_party_update(&self) -> bool { - self.as_party_update().is_ok() - } - /// Returns true if the enum instance is the `Unknown` variant. - pub fn is_unknown(&self) -> bool { - matches!(self, Self::Unknown) - } -} - -/// `rivet.api.identity.common#GlobalEventKind` variant for a chat thread being removed. Received any time the current identity is no longer able to access the given thread. This can happen if -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GlobalEventChatThreadRemove { - /// A universally unique identifier. - pub thread_id: std::option::Option, -} -impl GlobalEventChatThreadRemove { - /// A universally unique identifier. - pub fn thread_id(&self) -> std::option::Option<&str> { - self.thread_id.as_deref() - } -} -impl std::fmt::Debug for GlobalEventChatThreadRemove { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GlobalEventChatThreadRemove"); - formatter.field("thread_id", &self.thread_id); - formatter.finish() - } -} -/// See [`GlobalEventChatThreadRemove`](crate::model::GlobalEventChatThreadRemove) -pub mod global_event_chat_thread_remove { - /// A builder for [`GlobalEventChatThreadRemove`](crate::model::GlobalEventChatThreadRemove) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) thread_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn thread_id(mut self, input: impl Into) -> Self { - self.thread_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_thread_id(mut self, input: std::option::Option) -> Self { - self.thread_id = input; - self - } - /// Consumes the builder and constructs a [`GlobalEventChatThreadRemove`](crate::model::GlobalEventChatThreadRemove) - pub fn build(self) -> crate::model::GlobalEventChatThreadRemove { - crate::model::GlobalEventChatThreadRemove { - thread_id: self.thread_id, - } - } - } -} -impl GlobalEventChatThreadRemove { - /// Creates a new builder-style object to manufacture [`GlobalEventChatThreadRemove`](crate::model::GlobalEventChatThreadRemove) - pub fn builder() -> crate::model::global_event_chat_thread_remove::Builder { - crate::model::global_event_chat_thread_remove::Builder::default() - } -} - -/// `rivet.api.identity.common#GlobalEventKind` variant for party updates. Received when the identity should be instructed to join a lobby. This needs to be implemented in conjunction with parties in order to force clients to join the same lobby as the party they're in. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GlobalEventMatchmakerLobbyJoin { - /// A matchmaker lobby. - pub lobby: std::option::Option, -} -impl GlobalEventMatchmakerLobbyJoin { - /// A matchmaker lobby. - pub fn lobby(&self) -> std::option::Option<&crate::model::MatchmakerLobbyJoinInfo> { - self.lobby.as_ref() - } -} -impl std::fmt::Debug for GlobalEventMatchmakerLobbyJoin { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GlobalEventMatchmakerLobbyJoin"); - formatter.field("lobby", &self.lobby); - formatter.finish() - } -} -/// See [`GlobalEventMatchmakerLobbyJoin`](crate::model::GlobalEventMatchmakerLobbyJoin) -pub mod global_event_matchmaker_lobby_join { - /// A builder for [`GlobalEventMatchmakerLobbyJoin`](crate::model::GlobalEventMatchmakerLobbyJoin) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) lobby: std::option::Option, - } - impl Builder { - /// A matchmaker lobby. - pub fn lobby(mut self, input: crate::model::MatchmakerLobbyJoinInfo) -> Self { - self.lobby = Some(input); - self - } - /// A matchmaker lobby. - pub fn set_lobby( - mut self, - input: std::option::Option, - ) -> Self { - self.lobby = input; - self - } - /// Consumes the builder and constructs a [`GlobalEventMatchmakerLobbyJoin`](crate::model::GlobalEventMatchmakerLobbyJoin) - pub fn build(self) -> crate::model::GlobalEventMatchmakerLobbyJoin { - crate::model::GlobalEventMatchmakerLobbyJoin { lobby: self.lobby } - } - } -} -impl GlobalEventMatchmakerLobbyJoin { - /// Creates a new builder-style object to manufacture [`GlobalEventMatchmakerLobbyJoin`](crate::model::GlobalEventMatchmakerLobbyJoin) - pub fn builder() -> crate::model::global_event_matchmaker_lobby_join::Builder { - crate::model::global_event_matchmaker_lobby_join::Builder::default() - } -} - -/// A matchmaker lobby. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct MatchmakerLobbyJoinInfo { - /// A universally unique identifier. - pub lobby_id: std::option::Option, - /// A matchmaker lobby region. - pub region: std::option::Option, - /// A list of lobby ports. - pub ports: std::option::Option< - std::collections::HashMap, - >, - /// A matchmaker lobby player. - pub player: std::option::Option, -} -impl MatchmakerLobbyJoinInfo { - /// A universally unique identifier. - pub fn lobby_id(&self) -> std::option::Option<&str> { - self.lobby_id.as_deref() - } - /// A matchmaker lobby region. - pub fn region(&self) -> std::option::Option<&crate::model::MatchmakerLobbyJoinInfoRegion> { - self.region.as_ref() - } - /// A list of lobby ports. - pub fn ports( - &self, - ) -> std::option::Option< - &std::collections::HashMap, - > { - self.ports.as_ref() - } - /// A matchmaker lobby player. - pub fn player(&self) -> std::option::Option<&crate::model::MatchmakerLobbyJoinInfoPlayer> { - self.player.as_ref() - } -} -impl std::fmt::Debug for MatchmakerLobbyJoinInfo { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("MatchmakerLobbyJoinInfo"); - formatter.field("lobby_id", &self.lobby_id); - formatter.field("region", &self.region); - formatter.field("ports", &self.ports); - formatter.field("player", &self.player); - formatter.finish() - } -} -/// See [`MatchmakerLobbyJoinInfo`](crate::model::MatchmakerLobbyJoinInfo) -pub mod matchmaker_lobby_join_info { - /// A builder for [`MatchmakerLobbyJoinInfo`](crate::model::MatchmakerLobbyJoinInfo) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) lobby_id: std::option::Option, - pub(crate) region: std::option::Option, - pub(crate) ports: std::option::Option< - std::collections::HashMap< - std::string::String, - crate::model::MatchmakerLobbyJoinInfoPort, - >, - >, - pub(crate) player: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn lobby_id(mut self, input: impl Into) -> Self { - self.lobby_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_lobby_id(mut self, input: std::option::Option) -> Self { - self.lobby_id = input; - self - } - /// A matchmaker lobby region. - pub fn region(mut self, input: crate::model::MatchmakerLobbyJoinInfoRegion) -> Self { - self.region = Some(input); - self - } - /// A matchmaker lobby region. - pub fn set_region( - mut self, - input: std::option::Option, - ) -> Self { - self.region = input; - self - } - /// Adds a key-value pair to `ports`. - /// - /// To override the contents of this collection use [`set_ports`](Self::set_ports). - /// - /// A list of lobby ports. - pub fn ports( - mut self, - k: impl Into, - v: crate::model::MatchmakerLobbyJoinInfoPort, - ) -> Self { - let mut hash_map = self.ports.unwrap_or_default(); - hash_map.insert(k.into(), v); - self.ports = Some(hash_map); - self - } - /// A list of lobby ports. - pub fn set_ports( - mut self, - input: std::option::Option< - std::collections::HashMap< - std::string::String, - crate::model::MatchmakerLobbyJoinInfoPort, - >, - >, - ) -> Self { - self.ports = input; - self - } - /// A matchmaker lobby player. - pub fn player(mut self, input: crate::model::MatchmakerLobbyJoinInfoPlayer) -> Self { - self.player = Some(input); - self - } - /// A matchmaker lobby player. - pub fn set_player( - mut self, - input: std::option::Option, - ) -> Self { - self.player = input; - self - } - /// Consumes the builder and constructs a [`MatchmakerLobbyJoinInfo`](crate::model::MatchmakerLobbyJoinInfo) - pub fn build(self) -> crate::model::MatchmakerLobbyJoinInfo { - crate::model::MatchmakerLobbyJoinInfo { - lobby_id: self.lobby_id, - region: self.region, - ports: self.ports, - player: self.player, - } - } - } -} -impl MatchmakerLobbyJoinInfo { - /// Creates a new builder-style object to manufacture [`MatchmakerLobbyJoinInfo`](crate::model::MatchmakerLobbyJoinInfo) - pub fn builder() -> crate::model::matchmaker_lobby_join_info::Builder { - crate::model::matchmaker_lobby_join_info::Builder::default() - } -} - -/// A matchmaker lobby player. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct MatchmakerLobbyJoinInfoPlayer { - /// Pass this token through the socket to the lobby server. The lobby server will validate this token with `rivet.api.matchmaker#PlayerConnected$player_token`. - pub token: std::option::Option, -} -impl MatchmakerLobbyJoinInfoPlayer { - /// Pass this token through the socket to the lobby server. The lobby server will validate this token with `rivet.api.matchmaker#PlayerConnected$player_token`. - pub fn token(&self) -> std::option::Option<&str> { - self.token.as_deref() - } -} -impl std::fmt::Debug for MatchmakerLobbyJoinInfoPlayer { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("MatchmakerLobbyJoinInfoPlayer"); - formatter.field("token", &"*** Sensitive Data Redacted ***"); - formatter.finish() - } -} -/// See [`MatchmakerLobbyJoinInfoPlayer`](crate::model::MatchmakerLobbyJoinInfoPlayer) -pub mod matchmaker_lobby_join_info_player { - /// A builder for [`MatchmakerLobbyJoinInfoPlayer`](crate::model::MatchmakerLobbyJoinInfoPlayer) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) token: std::option::Option, - } - impl Builder { - /// Pass this token through the socket to the lobby server. The lobby server will validate this token with `rivet.api.matchmaker#PlayerConnected$player_token`. - pub fn token(mut self, input: impl Into) -> Self { - self.token = Some(input.into()); - self - } - /// Pass this token through the socket to the lobby server. The lobby server will validate this token with `rivet.api.matchmaker#PlayerConnected$player_token`. - pub fn set_token(mut self, input: std::option::Option) -> Self { - self.token = input; - self - } - /// Consumes the builder and constructs a [`MatchmakerLobbyJoinInfoPlayer`](crate::model::MatchmakerLobbyJoinInfoPlayer) - pub fn build(self) -> crate::model::MatchmakerLobbyJoinInfoPlayer { - crate::model::MatchmakerLobbyJoinInfoPlayer { token: self.token } - } - } -} -impl MatchmakerLobbyJoinInfoPlayer { - /// Creates a new builder-style object to manufacture [`MatchmakerLobbyJoinInfoPlayer`](crate::model::MatchmakerLobbyJoinInfoPlayer) - pub fn builder() -> crate::model::matchmaker_lobby_join_info_player::Builder { - crate::model::matchmaker_lobby_join_info_player::Builder::default() - } -} - -/// A matchmaker lobby port. Configured by `rivet.cloud#LobbyGroupRuntimeDockerPort$label`. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct MatchmakerLobbyJoinInfoPort { - /// The host for the given port. Will be null if using a port range. - pub host: std::option::Option, - /// The hostname for the given port. - pub hostname: std::option::Option, - /// The port number for this lobby. Will be null if using a port range. - pub port: std::option::Option, - /// The port range for this lobby. - pub port_range: std::option::Option, - /// Wether or not this lobby port uses TLS. You cannot mix a non-TLS and TLS ports. - pub is_tls: std::option::Option, -} -impl MatchmakerLobbyJoinInfoPort { - /// The host for the given port. Will be null if using a port range. - pub fn host(&self) -> std::option::Option<&str> { - self.host.as_deref() - } - /// The hostname for the given port. - pub fn hostname(&self) -> std::option::Option<&str> { - self.hostname.as_deref() - } - /// The port number for this lobby. Will be null if using a port range. - pub fn port(&self) -> std::option::Option { - self.port - } - /// The port range for this lobby. - pub fn port_range( - &self, - ) -> std::option::Option<&crate::model::MatchmakerLobbyJoinInfoPortRange> { - self.port_range.as_ref() - } - /// Wether or not this lobby port uses TLS. You cannot mix a non-TLS and TLS ports. - pub fn is_tls(&self) -> std::option::Option { - self.is_tls - } -} -impl std::fmt::Debug for MatchmakerLobbyJoinInfoPort { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("MatchmakerLobbyJoinInfoPort"); - formatter.field("host", &self.host); - formatter.field("hostname", &self.hostname); - formatter.field("port", &self.port); - formatter.field("port_range", &self.port_range); - formatter.field("is_tls", &self.is_tls); - formatter.finish() - } -} -/// See [`MatchmakerLobbyJoinInfoPort`](crate::model::MatchmakerLobbyJoinInfoPort) -pub mod matchmaker_lobby_join_info_port { - /// A builder for [`MatchmakerLobbyJoinInfoPort`](crate::model::MatchmakerLobbyJoinInfoPort) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) host: std::option::Option, - pub(crate) hostname: std::option::Option, - pub(crate) port: std::option::Option, - pub(crate) port_range: std::option::Option, - pub(crate) is_tls: std::option::Option, - } - impl Builder { - /// The host for the given port. Will be null if using a port range. - pub fn host(mut self, input: impl Into) -> Self { - self.host = Some(input.into()); - self - } - /// The host for the given port. Will be null if using a port range. - pub fn set_host(mut self, input: std::option::Option) -> Self { - self.host = input; - self - } - /// The hostname for the given port. - pub fn hostname(mut self, input: impl Into) -> Self { - self.hostname = Some(input.into()); - self - } - /// The hostname for the given port. - pub fn set_hostname(mut self, input: std::option::Option) -> Self { - self.hostname = input; - self - } - /// The port number for this lobby. Will be null if using a port range. - pub fn port(mut self, input: i32) -> Self { - self.port = Some(input); - self - } - /// The port number for this lobby. Will be null if using a port range. - pub fn set_port(mut self, input: std::option::Option) -> Self { - self.port = input; - self - } - /// The port range for this lobby. - pub fn port_range(mut self, input: crate::model::MatchmakerLobbyJoinInfoPortRange) -> Self { - self.port_range = Some(input); - self - } - /// The port range for this lobby. - pub fn set_port_range( - mut self, - input: std::option::Option, - ) -> Self { - self.port_range = input; - self - } - /// Wether or not this lobby port uses TLS. You cannot mix a non-TLS and TLS ports. - pub fn is_tls(mut self, input: bool) -> Self { - self.is_tls = Some(input); - self - } - /// Wether or not this lobby port uses TLS. You cannot mix a non-TLS and TLS ports. - pub fn set_is_tls(mut self, input: std::option::Option) -> Self { - self.is_tls = input; - self - } - /// Consumes the builder and constructs a [`MatchmakerLobbyJoinInfoPort`](crate::model::MatchmakerLobbyJoinInfoPort) - pub fn build(self) -> crate::model::MatchmakerLobbyJoinInfoPort { - crate::model::MatchmakerLobbyJoinInfoPort { - host: self.host, - hostname: self.hostname, - port: self.port, - port_range: self.port_range, - is_tls: self.is_tls, - } - } - } -} -impl MatchmakerLobbyJoinInfoPort { - /// Creates a new builder-style object to manufacture [`MatchmakerLobbyJoinInfoPort`](crate::model::MatchmakerLobbyJoinInfoPort) - pub fn builder() -> crate::model::matchmaker_lobby_join_info_port::Builder { - crate::model::matchmaker_lobby_join_info_port::Builder::default() - } -} - -/// Inclusive range of ports that can be connected to. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct MatchmakerLobbyJoinInfoPortRange { - /// Minimum port that can be connected to. Inclusive range. - pub min: std::option::Option, - /// Maximum port that can be connected to. Inclusive range. - pub max: std::option::Option, -} -impl MatchmakerLobbyJoinInfoPortRange { - /// Minimum port that can be connected to. Inclusive range. - pub fn min(&self) -> std::option::Option { - self.min - } - /// Maximum port that can be connected to. Inclusive range. - pub fn max(&self) -> std::option::Option { - self.max - } -} -impl std::fmt::Debug for MatchmakerLobbyJoinInfoPortRange { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("MatchmakerLobbyJoinInfoPortRange"); - formatter.field("min", &self.min); - formatter.field("max", &self.max); - formatter.finish() - } -} -/// See [`MatchmakerLobbyJoinInfoPortRange`](crate::model::MatchmakerLobbyJoinInfoPortRange) -pub mod matchmaker_lobby_join_info_port_range { - /// A builder for [`MatchmakerLobbyJoinInfoPortRange`](crate::model::MatchmakerLobbyJoinInfoPortRange) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) min: std::option::Option, - pub(crate) max: std::option::Option, - } - impl Builder { - /// Minimum port that can be connected to. Inclusive range. - pub fn min(mut self, input: i32) -> Self { - self.min = Some(input); - self - } - /// Minimum port that can be connected to. Inclusive range. - pub fn set_min(mut self, input: std::option::Option) -> Self { - self.min = input; - self - } - /// Maximum port that can be connected to. Inclusive range. - pub fn max(mut self, input: i32) -> Self { - self.max = Some(input); - self - } - /// Maximum port that can be connected to. Inclusive range. - pub fn set_max(mut self, input: std::option::Option) -> Self { - self.max = input; - self - } - /// Consumes the builder and constructs a [`MatchmakerLobbyJoinInfoPortRange`](crate::model::MatchmakerLobbyJoinInfoPortRange) - pub fn build(self) -> crate::model::MatchmakerLobbyJoinInfoPortRange { - crate::model::MatchmakerLobbyJoinInfoPortRange { - min: self.min, - max: self.max, - } - } - } -} -impl MatchmakerLobbyJoinInfoPortRange { - /// Creates a new builder-style object to manufacture [`MatchmakerLobbyJoinInfoPortRange`](crate::model::MatchmakerLobbyJoinInfoPortRange) - pub fn builder() -> crate::model::matchmaker_lobby_join_info_port_range::Builder { - crate::model::matchmaker_lobby_join_info_port_range::Builder::default() - } -} - -/// A matchmaker lobby region. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct MatchmakerLobbyJoinInfoRegion { - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub region_id: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, -} -impl MatchmakerLobbyJoinInfoRegion { - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn region_id(&self) -> std::option::Option<&str> { - self.region_id.as_deref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } -} -impl std::fmt::Debug for MatchmakerLobbyJoinInfoRegion { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("MatchmakerLobbyJoinInfoRegion"); - formatter.field("region_id", &self.region_id); - formatter.field("display_name", &self.display_name); - formatter.finish() - } -} -/// See [`MatchmakerLobbyJoinInfoRegion`](crate::model::MatchmakerLobbyJoinInfoRegion) -pub mod matchmaker_lobby_join_info_region { - /// A builder for [`MatchmakerLobbyJoinInfoRegion`](crate::model::MatchmakerLobbyJoinInfoRegion) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) region_id: std::option::Option, - pub(crate) display_name: std::option::Option, - } - impl Builder { - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn region_id(mut self, input: impl Into) -> Self { - self.region_id = Some(input.into()); - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn set_region_id(mut self, input: std::option::Option) -> Self { - self.region_id = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// Consumes the builder and constructs a [`MatchmakerLobbyJoinInfoRegion`](crate::model::MatchmakerLobbyJoinInfoRegion) - pub fn build(self) -> crate::model::MatchmakerLobbyJoinInfoRegion { - crate::model::MatchmakerLobbyJoinInfoRegion { - region_id: self.region_id, - display_name: self.display_name, - } - } - } -} -impl MatchmakerLobbyJoinInfoRegion { - /// Creates a new builder-style object to manufacture [`MatchmakerLobbyJoinInfoRegion`](crate::model::MatchmakerLobbyJoinInfoRegion) - pub fn builder() -> crate::model::matchmaker_lobby_join_info_region::Builder { - crate::model::matchmaker_lobby_join_info_region::Builder::default() - } -} - -/// `rivet.api.identity.common#GlobalEventKind` variant for identity updates. Received any time identity details are changed OR the identity switches. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GlobalEventIdentityUpdate { - /// An identity profile. - pub identity: std::option::Option, -} -impl GlobalEventIdentityUpdate { - /// An identity profile. - pub fn identity(&self) -> std::option::Option<&crate::model::IdentityProfile> { - self.identity.as_ref() - } -} -impl std::fmt::Debug for GlobalEventIdentityUpdate { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GlobalEventIdentityUpdate"); - formatter.field("identity", &self.identity); - formatter.finish() - } -} -/// See [`GlobalEventIdentityUpdate`](crate::model::GlobalEventIdentityUpdate) -pub mod global_event_identity_update { - /// A builder for [`GlobalEventIdentityUpdate`](crate::model::GlobalEventIdentityUpdate) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity: std::option::Option, - } - impl Builder { - /// An identity profile. - pub fn identity(mut self, input: crate::model::IdentityProfile) -> Self { - self.identity = Some(input); - self - } - /// An identity profile. - pub fn set_identity( - mut self, - input: std::option::Option, - ) -> Self { - self.identity = input; - self - } - /// Consumes the builder and constructs a [`GlobalEventIdentityUpdate`](crate::model::GlobalEventIdentityUpdate) - pub fn build(self) -> crate::model::GlobalEventIdentityUpdate { - crate::model::GlobalEventIdentityUpdate { - identity: self.identity, - } - } - } -} -impl GlobalEventIdentityUpdate { - /// Creates a new builder-style object to manufacture [`GlobalEventIdentityUpdate`](crate::model::GlobalEventIdentityUpdate) - pub fn builder() -> crate::model::global_event_identity_update::Builder { - crate::model::global_event_identity_update::Builder::default() - } -} - -/// `rivet.api.identity.common#GlobalEventKind` variant for party updates. Received any time the identity joins a party, a party is updated, or when the identity leaves a party. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GlobalEventPartyUpdate { - /// If null, the identity left the party. - pub party: std::option::Option, -} -impl GlobalEventPartyUpdate { - /// If null, the identity left the party. - pub fn party(&self) -> std::option::Option<&crate::model::PartySummary> { - self.party.as_ref() - } -} -impl std::fmt::Debug for GlobalEventPartyUpdate { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GlobalEventPartyUpdate"); - formatter.field("party", &self.party); - formatter.finish() - } -} -/// See [`GlobalEventPartyUpdate`](crate::model::GlobalEventPartyUpdate) -pub mod global_event_party_update { - /// A builder for [`GlobalEventPartyUpdate`](crate::model::GlobalEventPartyUpdate) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) party: std::option::Option, - } - impl Builder { - /// If null, the identity left the party. - pub fn party(mut self, input: crate::model::PartySummary) -> Self { - self.party = Some(input); - self - } - /// If null, the identity left the party. - pub fn set_party(mut self, input: std::option::Option) -> Self { - self.party = input; - self - } - /// Consumes the builder and constructs a [`GlobalEventPartyUpdate`](crate::model::GlobalEventPartyUpdate) - pub fn build(self) -> crate::model::GlobalEventPartyUpdate { - crate::model::GlobalEventPartyUpdate { party: self.party } - } - } -} -impl GlobalEventPartyUpdate { - /// Creates a new builder-style object to manufacture [`GlobalEventPartyUpdate`](crate::model::GlobalEventPartyUpdate) - pub fn builder() -> crate::model::global_event_party_update::Builder { - crate::model::global_event_party_update::Builder::default() - } -} - -/// `rivet.api.identity.common#GlobalEventKind` variant for chat reads. Received any time the last read timestamp is set. Used to update the status of unread indicators on chats. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GlobalEventChatRead { - /// A universally unique identifier. - pub thread_id: std::option::Option, - /// RFC3339 timestamp. - pub read_ts: std::option::Option, -} -impl GlobalEventChatRead { - /// A universally unique identifier. - pub fn thread_id(&self) -> std::option::Option<&str> { - self.thread_id.as_deref() - } - /// RFC3339 timestamp. - pub fn read_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.read_ts.as_ref() - } -} -impl std::fmt::Debug for GlobalEventChatRead { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GlobalEventChatRead"); - formatter.field("thread_id", &self.thread_id); - formatter.field("read_ts", &self.read_ts); - formatter.finish() - } -} -/// See [`GlobalEventChatRead`](crate::model::GlobalEventChatRead) -pub mod global_event_chat_read { - /// A builder for [`GlobalEventChatRead`](crate::model::GlobalEventChatRead) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) thread_id: std::option::Option, - pub(crate) read_ts: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn thread_id(mut self, input: impl Into) -> Self { - self.thread_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_thread_id(mut self, input: std::option::Option) -> Self { - self.thread_id = input; - self - } - /// RFC3339 timestamp. - pub fn read_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.read_ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_read_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.read_ts = input; - self - } - /// Consumes the builder and constructs a [`GlobalEventChatRead`](crate::model::GlobalEventChatRead) - pub fn build(self) -> crate::model::GlobalEventChatRead { - crate::model::GlobalEventChatRead { - thread_id: self.thread_id, - read_ts: self.read_ts, - } - } - } -} -impl GlobalEventChatRead { - /// Creates a new builder-style object to manufacture [`GlobalEventChatRead`](crate::model::GlobalEventChatRead) - pub fn builder() -> crate::model::global_event_chat_read::Builder { - crate::model::global_event_chat_read::Builder::default() - } -} - -/// `rivet.api.identity.common#GlobalEventKind` variant for chat messages. Received any time a message is sent to a chat the identity is in. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GlobalEventChatMessage { - /// A chat thread. - pub thread: std::option::Option, -} -impl GlobalEventChatMessage { - /// A chat thread. - pub fn thread(&self) -> std::option::Option<&crate::model::ChatThread> { - self.thread.as_ref() - } -} -impl std::fmt::Debug for GlobalEventChatMessage { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GlobalEventChatMessage"); - formatter.field("thread", &self.thread); - formatter.finish() - } -} -/// See [`GlobalEventChatMessage`](crate::model::GlobalEventChatMessage) -pub mod global_event_chat_message { - /// A builder for [`GlobalEventChatMessage`](crate::model::GlobalEventChatMessage) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) thread: std::option::Option, - } - impl Builder { - /// A chat thread. - pub fn thread(mut self, input: crate::model::ChatThread) -> Self { - self.thread = Some(input); - self - } - /// A chat thread. - pub fn set_thread(mut self, input: std::option::Option) -> Self { - self.thread = input; - self - } - /// Consumes the builder and constructs a [`GlobalEventChatMessage`](crate::model::GlobalEventChatMessage) - pub fn build(self) -> crate::model::GlobalEventChatMessage { - crate::model::GlobalEventChatMessage { - thread: self.thread, - } - } - } -} -impl GlobalEventChatMessage { - /// Creates a new builder-style object to manufacture [`GlobalEventChatMessage`](crate::model::GlobalEventChatMessage) - pub fn builder() -> crate::model::global_event_chat_message::Builder { - crate::model::global_event_chat_message::Builder::default() - } -} - -/// A chat thread. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ChatThread { - /// A universally unique identifier. - pub thread_id: std::option::Option, - /// RFC3339 timestamp. - pub create_ts: std::option::Option, - /// Represents the topic of the given chat thread. - pub topic: std::option::Option, - /// A chat message. - pub tail_message: std::option::Option, - /// RFC3339 timestamp. - pub last_read_ts: std::option::Option, - /// Unsigned 64 bit integer. - pub unread_count: std::option::Option, - /// External links for a chat thread. - pub external: std::option::Option, -} -impl ChatThread { - /// A universally unique identifier. - pub fn thread_id(&self) -> std::option::Option<&str> { - self.thread_id.as_deref() - } - /// RFC3339 timestamp. - pub fn create_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.create_ts.as_ref() - } - /// Represents the topic of the given chat thread. - pub fn topic(&self) -> std::option::Option<&crate::model::ChatTopic> { - self.topic.as_ref() - } - /// A chat message. - pub fn tail_message(&self) -> std::option::Option<&crate::model::ChatMessage> { - self.tail_message.as_ref() - } - /// RFC3339 timestamp. - pub fn last_read_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.last_read_ts.as_ref() - } - /// Unsigned 64 bit integer. - pub fn unread_count(&self) -> std::option::Option { - self.unread_count - } - /// External links for a chat thread. - pub fn external(&self) -> std::option::Option<&crate::model::ChatThreadExternalLinks> { - self.external.as_ref() - } -} -impl std::fmt::Debug for ChatThread { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ChatThread"); - formatter.field("thread_id", &self.thread_id); - formatter.field("create_ts", &self.create_ts); - formatter.field("topic", &self.topic); - formatter.field("tail_message", &self.tail_message); - formatter.field("last_read_ts", &self.last_read_ts); - formatter.field("unread_count", &self.unread_count); - formatter.field("external", &self.external); - formatter.finish() - } -} -/// See [`ChatThread`](crate::model::ChatThread) -pub mod chat_thread { - /// A builder for [`ChatThread`](crate::model::ChatThread) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) thread_id: std::option::Option, - pub(crate) create_ts: std::option::Option, - pub(crate) topic: std::option::Option, - pub(crate) tail_message: std::option::Option, - pub(crate) last_read_ts: std::option::Option, - pub(crate) unread_count: std::option::Option, - pub(crate) external: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn thread_id(mut self, input: impl Into) -> Self { - self.thread_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_thread_id(mut self, input: std::option::Option) -> Self { - self.thread_id = input; - self - } - /// RFC3339 timestamp. - pub fn create_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.create_ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_create_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.create_ts = input; - self - } - /// Represents the topic of the given chat thread. - pub fn topic(mut self, input: crate::model::ChatTopic) -> Self { - self.topic = Some(input); - self - } - /// Represents the topic of the given chat thread. - pub fn set_topic(mut self, input: std::option::Option) -> Self { - self.topic = input; - self - } - /// A chat message. - pub fn tail_message(mut self, input: crate::model::ChatMessage) -> Self { - self.tail_message = Some(input); - self - } - /// A chat message. - pub fn set_tail_message( - mut self, - input: std::option::Option, - ) -> Self { - self.tail_message = input; - self - } - /// RFC3339 timestamp. - pub fn last_read_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.last_read_ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_last_read_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.last_read_ts = input; - self - } - /// Unsigned 64 bit integer. - pub fn unread_count(mut self, input: i64) -> Self { - self.unread_count = Some(input); - self - } - /// Unsigned 64 bit integer. - pub fn set_unread_count(mut self, input: std::option::Option) -> Self { - self.unread_count = input; - self - } - /// External links for a chat thread. - pub fn external(mut self, input: crate::model::ChatThreadExternalLinks) -> Self { - self.external = Some(input); - self - } - /// External links for a chat thread. - pub fn set_external( - mut self, - input: std::option::Option, - ) -> Self { - self.external = input; - self - } - /// Consumes the builder and constructs a [`ChatThread`](crate::model::ChatThread) - pub fn build(self) -> crate::model::ChatThread { - crate::model::ChatThread { - thread_id: self.thread_id, - create_ts: self.create_ts, - topic: self.topic, - tail_message: self.tail_message, - last_read_ts: self.last_read_ts, - unread_count: self.unread_count, - external: self.external, - } - } - } -} -impl ChatThread { - /// Creates a new builder-style object to manufacture [`ChatThread`](crate::model::ChatThread) - pub fn builder() -> crate::model::chat_thread::Builder { - crate::model::chat_thread::Builder::default() - } -} - -/// External links for a chat thread. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ChatThreadExternalLinks { - /// A link to opening the chat thread. - pub chat: std::option::Option, -} -impl ChatThreadExternalLinks { - /// A link to opening the chat thread. - pub fn chat(&self) -> std::option::Option<&str> { - self.chat.as_deref() - } -} -impl std::fmt::Debug for ChatThreadExternalLinks { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ChatThreadExternalLinks"); - formatter.field("chat", &self.chat); - formatter.finish() - } -} -/// See [`ChatThreadExternalLinks`](crate::model::ChatThreadExternalLinks) -pub mod chat_thread_external_links { - /// A builder for [`ChatThreadExternalLinks`](crate::model::ChatThreadExternalLinks) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) chat: std::option::Option, - } - impl Builder { - /// A link to opening the chat thread. - pub fn chat(mut self, input: impl Into) -> Self { - self.chat = Some(input.into()); - self - } - /// A link to opening the chat thread. - pub fn set_chat(mut self, input: std::option::Option) -> Self { - self.chat = input; - self - } - /// Consumes the builder and constructs a [`ChatThreadExternalLinks`](crate::model::ChatThreadExternalLinks) - pub fn build(self) -> crate::model::ChatThreadExternalLinks { - crate::model::ChatThreadExternalLinks { chat: self.chat } - } - } -} -impl ChatThreadExternalLinks { - /// Creates a new builder-style object to manufacture [`ChatThreadExternalLinks`](crate::model::ChatThreadExternalLinks) - pub fn builder() -> crate::model::chat_thread_external_links::Builder { - crate::model::chat_thread_external_links::Builder::default() - } -} - -/// A chat message. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ChatMessage { - /// A universally unique identifier. - pub chat_message_id: std::option::Option, - /// A universally unique identifier. - pub thread_id: std::option::Option, - /// RFC3339 timestamp. - pub send_ts: std::option::Option, - /// Represents types of chat message bodies. - pub body: std::option::Option, -} -impl ChatMessage { - /// A universally unique identifier. - pub fn chat_message_id(&self) -> std::option::Option<&str> { - self.chat_message_id.as_deref() - } - /// A universally unique identifier. - pub fn thread_id(&self) -> std::option::Option<&str> { - self.thread_id.as_deref() - } - /// RFC3339 timestamp. - pub fn send_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.send_ts.as_ref() - } - /// Represents types of chat message bodies. - pub fn body(&self) -> std::option::Option<&crate::model::ChatMessageBody> { - self.body.as_ref() - } -} -impl std::fmt::Debug for ChatMessage { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ChatMessage"); - formatter.field("chat_message_id", &self.chat_message_id); - formatter.field("thread_id", &self.thread_id); - formatter.field("send_ts", &self.send_ts); - formatter.field("body", &self.body); - formatter.finish() - } -} -/// See [`ChatMessage`](crate::model::ChatMessage) -pub mod chat_message { - /// A builder for [`ChatMessage`](crate::model::ChatMessage) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) chat_message_id: std::option::Option, - pub(crate) thread_id: std::option::Option, - pub(crate) send_ts: std::option::Option, - pub(crate) body: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn chat_message_id(mut self, input: impl Into) -> Self { - self.chat_message_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_chat_message_id( - mut self, - input: std::option::Option, - ) -> Self { - self.chat_message_id = input; - self - } - /// A universally unique identifier. - pub fn thread_id(mut self, input: impl Into) -> Self { - self.thread_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_thread_id(mut self, input: std::option::Option) -> Self { - self.thread_id = input; - self - } - /// RFC3339 timestamp. - pub fn send_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.send_ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_send_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.send_ts = input; - self - } - /// Represents types of chat message bodies. - pub fn body(mut self, input: crate::model::ChatMessageBody) -> Self { - self.body = Some(input); - self - } - /// Represents types of chat message bodies. - pub fn set_body( - mut self, - input: std::option::Option, - ) -> Self { - self.body = input; - self - } - /// Consumes the builder and constructs a [`ChatMessage`](crate::model::ChatMessage) - pub fn build(self) -> crate::model::ChatMessage { - crate::model::ChatMessage { - chat_message_id: self.chat_message_id, - thread_id: self.thread_id, - send_ts: self.send_ts, - body: self.body, - } - } - } -} -impl ChatMessage { - /// Creates a new builder-style object to manufacture [`ChatMessage`](crate::model::ChatMessage) - pub fn builder() -> crate::model::chat_message::Builder { - crate::model::chat_message::Builder::default() - } -} - -/// Represents types of chat message bodies. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] -pub enum ChatMessageBody { - /// `rivet.chat#ChatMessageBody` variant for indicating a new chat was created. - ChatCreate(crate::model::ChatMessageBodyChatCreate), - /// `rivet.chat#ChatMessageBody` variant for deleted messages. - Deleted(crate::model::ChatMessageBodyDeleted), - /// `rivet.chat#ChatMessageBody` variant for indicating an identity joined the group. - GroupJoin(crate::model::ChatMessageBodyGroupJoin), - /// `rivet.chat#ChatMessageBody` variant for indicating an identity left the group. - GroupLeave(crate::model::ChatMessageBodyGroupLeave), - /// `rivet.chat#ChatMessageBody` variant for indicating an identity has been kicked from the group. - GroupMemberKick(crate::model::ChatMessageBodyGroupMemberKick), - /// `rivet.chat#ChatMessageBody` variant for indicating an identity followed the identity. - IdentityFollow(crate::model::ChatMessageBodyIdentityFollow), - /// `rivet.chat#ChatMessageBody` variant for indicating a change in the party's current activity. - PartyActivityChange(crate::model::ChatMessageBodyPartyActivityChange), - /// `rivet.chat#ChatMessageBody` variant holding an a party invitation. - PartyInvite(crate::model::ChatMessageBodyPartyInvite), - /// `rivet.chat#ChatMessageBody` variant for indicating an identity joined the party. - PartyJoin(crate::model::ChatMessageBodyPartyJoin), - /// `rivet.chat#ChatMessageBody` variant for indicating an identity requesting to join your party. - PartyJoinRequest(crate::model::ChatMessageBodyPartyJoinRequest), - /// `rivet.chat#ChatMessageBody` variant for indicating an identity left the party. - PartyLeave(crate::model::ChatMessageBodyPartyLeave), - /// `rivet.chat#ChatMessageBody` variant for text messages. Sent by other identities using the chat interface. - Text(crate::model::ChatMessageBodyText), - /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version. - /// An unknown enum variant - /// - /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._ - /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized - /// by the client. This can happen when the server adds new functionality, but the client has not been updated. - /// To investigate this, consider turning on debug logging to print the raw HTTP response. - #[non_exhaustive] - Unknown, -} -impl ChatMessageBody { - /// Tries to convert the enum instance into [`ChatCreate`](crate::model::ChatMessageBody::ChatCreate), extracting the inner [`ChatMessageBodyChatCreate`](crate::model::ChatMessageBodyChatCreate). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_chat_create( - &self, - ) -> std::result::Result<&crate::model::ChatMessageBodyChatCreate, &Self> { - if let ChatMessageBody::ChatCreate(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`ChatCreate`](crate::model::ChatMessageBody::ChatCreate). - pub fn is_chat_create(&self) -> bool { - self.as_chat_create().is_ok() - } - /// Tries to convert the enum instance into [`Deleted`](crate::model::ChatMessageBody::Deleted), extracting the inner [`ChatMessageBodyDeleted`](crate::model::ChatMessageBodyDeleted). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_deleted(&self) -> std::result::Result<&crate::model::ChatMessageBodyDeleted, &Self> { - if let ChatMessageBody::Deleted(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`Deleted`](crate::model::ChatMessageBody::Deleted). - pub fn is_deleted(&self) -> bool { - self.as_deleted().is_ok() - } - /// Tries to convert the enum instance into [`GroupJoin`](crate::model::ChatMessageBody::GroupJoin), extracting the inner [`ChatMessageBodyGroupJoin`](crate::model::ChatMessageBodyGroupJoin). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_group_join( - &self, - ) -> std::result::Result<&crate::model::ChatMessageBodyGroupJoin, &Self> { - if let ChatMessageBody::GroupJoin(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`GroupJoin`](crate::model::ChatMessageBody::GroupJoin). - pub fn is_group_join(&self) -> bool { - self.as_group_join().is_ok() - } - /// Tries to convert the enum instance into [`GroupLeave`](crate::model::ChatMessageBody::GroupLeave), extracting the inner [`ChatMessageBodyGroupLeave`](crate::model::ChatMessageBodyGroupLeave). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_group_leave( - &self, - ) -> std::result::Result<&crate::model::ChatMessageBodyGroupLeave, &Self> { - if let ChatMessageBody::GroupLeave(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`GroupLeave`](crate::model::ChatMessageBody::GroupLeave). - pub fn is_group_leave(&self) -> bool { - self.as_group_leave().is_ok() - } - /// Tries to convert the enum instance into [`GroupMemberKick`](crate::model::ChatMessageBody::GroupMemberKick), extracting the inner [`ChatMessageBodyGroupMemberKick`](crate::model::ChatMessageBodyGroupMemberKick). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_group_member_kick( - &self, - ) -> std::result::Result<&crate::model::ChatMessageBodyGroupMemberKick, &Self> { - if let ChatMessageBody::GroupMemberKick(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`GroupMemberKick`](crate::model::ChatMessageBody::GroupMemberKick). - pub fn is_group_member_kick(&self) -> bool { - self.as_group_member_kick().is_ok() - } - /// Tries to convert the enum instance into [`IdentityFollow`](crate::model::ChatMessageBody::IdentityFollow), extracting the inner [`ChatMessageBodyIdentityFollow`](crate::model::ChatMessageBodyIdentityFollow). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_identity_follow( - &self, - ) -> std::result::Result<&crate::model::ChatMessageBodyIdentityFollow, &Self> { - if let ChatMessageBody::IdentityFollow(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`IdentityFollow`](crate::model::ChatMessageBody::IdentityFollow). - pub fn is_identity_follow(&self) -> bool { - self.as_identity_follow().is_ok() - } - /// Tries to convert the enum instance into [`PartyActivityChange`](crate::model::ChatMessageBody::PartyActivityChange), extracting the inner [`ChatMessageBodyPartyActivityChange`](crate::model::ChatMessageBodyPartyActivityChange). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_party_activity_change( - &self, - ) -> std::result::Result<&crate::model::ChatMessageBodyPartyActivityChange, &Self> { - if let ChatMessageBody::PartyActivityChange(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`PartyActivityChange`](crate::model::ChatMessageBody::PartyActivityChange). - pub fn is_party_activity_change(&self) -> bool { - self.as_party_activity_change().is_ok() - } - /// Tries to convert the enum instance into [`PartyInvite`](crate::model::ChatMessageBody::PartyInvite), extracting the inner [`ChatMessageBodyPartyInvite`](crate::model::ChatMessageBodyPartyInvite). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_party_invite( - &self, - ) -> std::result::Result<&crate::model::ChatMessageBodyPartyInvite, &Self> { - if let ChatMessageBody::PartyInvite(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`PartyInvite`](crate::model::ChatMessageBody::PartyInvite). - pub fn is_party_invite(&self) -> bool { - self.as_party_invite().is_ok() - } - /// Tries to convert the enum instance into [`PartyJoin`](crate::model::ChatMessageBody::PartyJoin), extracting the inner [`ChatMessageBodyPartyJoin`](crate::model::ChatMessageBodyPartyJoin). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_party_join( - &self, - ) -> std::result::Result<&crate::model::ChatMessageBodyPartyJoin, &Self> { - if let ChatMessageBody::PartyJoin(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`PartyJoin`](crate::model::ChatMessageBody::PartyJoin). - pub fn is_party_join(&self) -> bool { - self.as_party_join().is_ok() - } - /// Tries to convert the enum instance into [`PartyJoinRequest`](crate::model::ChatMessageBody::PartyJoinRequest), extracting the inner [`ChatMessageBodyPartyJoinRequest`](crate::model::ChatMessageBodyPartyJoinRequest). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_party_join_request( - &self, - ) -> std::result::Result<&crate::model::ChatMessageBodyPartyJoinRequest, &Self> { - if let ChatMessageBody::PartyJoinRequest(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`PartyJoinRequest`](crate::model::ChatMessageBody::PartyJoinRequest). - pub fn is_party_join_request(&self) -> bool { - self.as_party_join_request().is_ok() - } - /// Tries to convert the enum instance into [`PartyLeave`](crate::model::ChatMessageBody::PartyLeave), extracting the inner [`ChatMessageBodyPartyLeave`](crate::model::ChatMessageBodyPartyLeave). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_party_leave( - &self, - ) -> std::result::Result<&crate::model::ChatMessageBodyPartyLeave, &Self> { - if let ChatMessageBody::PartyLeave(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`PartyLeave`](crate::model::ChatMessageBody::PartyLeave). - pub fn is_party_leave(&self) -> bool { - self.as_party_leave().is_ok() - } - /// Tries to convert the enum instance into [`Text`](crate::model::ChatMessageBody::Text), extracting the inner [`ChatMessageBodyText`](crate::model::ChatMessageBodyText). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_text(&self) -> std::result::Result<&crate::model::ChatMessageBodyText, &Self> { - if let ChatMessageBody::Text(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`Text`](crate::model::ChatMessageBody::Text). - pub fn is_text(&self) -> bool { - self.as_text().is_ok() - } - /// Returns true if the enum instance is the `Unknown` variant. - pub fn is_unknown(&self) -> bool { - matches!(self, Self::Unknown) - } -} - -/// `rivet.chat#ChatMessageBody` variant for indicating a change in the party's current activity. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ChatMessageBodyPartyActivityChange { - /// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. - pub activity: std::option::Option, -} -impl ChatMessageBodyPartyActivityChange { - /// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. - pub fn activity(&self) -> std::option::Option<&crate::model::PartyActivity> { - self.activity.as_ref() - } -} -impl std::fmt::Debug for ChatMessageBodyPartyActivityChange { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ChatMessageBodyPartyActivityChange"); - formatter.field("activity", &self.activity); - formatter.finish() - } -} -/// See [`ChatMessageBodyPartyActivityChange`](crate::model::ChatMessageBodyPartyActivityChange) -pub mod chat_message_body_party_activity_change { - /// A builder for [`ChatMessageBodyPartyActivityChange`](crate::model::ChatMessageBodyPartyActivityChange) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) activity: std::option::Option, - } - impl Builder { - /// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. - pub fn activity(mut self, input: crate::model::PartyActivity) -> Self { - self.activity = Some(input); - self - } - /// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. - pub fn set_activity( - mut self, - input: std::option::Option, - ) -> Self { - self.activity = input; - self - } - /// Consumes the builder and constructs a [`ChatMessageBodyPartyActivityChange`](crate::model::ChatMessageBodyPartyActivityChange) - pub fn build(self) -> crate::model::ChatMessageBodyPartyActivityChange { - crate::model::ChatMessageBodyPartyActivityChange { - activity: self.activity, - } - } - } -} -impl ChatMessageBodyPartyActivityChange { - /// Creates a new builder-style object to manufacture [`ChatMessageBodyPartyActivityChange`](crate::model::ChatMessageBodyPartyActivityChange) - pub fn builder() -> crate::model::chat_message_body_party_activity_change::Builder { - crate::model::chat_message_body_party_activity_change::Builder::default() - } -} - -/// `rivet.chat#ChatMessageBody` variant for indicating an identity left the party. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ChatMessageBodyPartyLeave { - /// An identity handle. - pub identity: std::option::Option, -} -impl ChatMessageBodyPartyLeave { - /// An identity handle. - pub fn identity(&self) -> std::option::Option<&crate::model::IdentityHandle> { - self.identity.as_ref() - } -} -impl std::fmt::Debug for ChatMessageBodyPartyLeave { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ChatMessageBodyPartyLeave"); - formatter.field("identity", &self.identity); - formatter.finish() - } -} -/// See [`ChatMessageBodyPartyLeave`](crate::model::ChatMessageBodyPartyLeave) -pub mod chat_message_body_party_leave { - /// A builder for [`ChatMessageBodyPartyLeave`](crate::model::ChatMessageBodyPartyLeave) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity: std::option::Option, - } - impl Builder { - /// An identity handle. - pub fn identity(mut self, input: crate::model::IdentityHandle) -> Self { - self.identity = Some(input); - self - } - /// An identity handle. - pub fn set_identity( - mut self, - input: std::option::Option, - ) -> Self { - self.identity = input; - self - } - /// Consumes the builder and constructs a [`ChatMessageBodyPartyLeave`](crate::model::ChatMessageBodyPartyLeave) - pub fn build(self) -> crate::model::ChatMessageBodyPartyLeave { - crate::model::ChatMessageBodyPartyLeave { - identity: self.identity, - } - } - } -} -impl ChatMessageBodyPartyLeave { - /// Creates a new builder-style object to manufacture [`ChatMessageBodyPartyLeave`](crate::model::ChatMessageBodyPartyLeave) - pub fn builder() -> crate::model::chat_message_body_party_leave::Builder { - crate::model::chat_message_body_party_leave::Builder::default() - } -} - -/// `rivet.chat#ChatMessageBody` variant for indicating an identity joined the party. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ChatMessageBodyPartyJoin { - /// An identity handle. - pub identity: std::option::Option, -} -impl ChatMessageBodyPartyJoin { - /// An identity handle. - pub fn identity(&self) -> std::option::Option<&crate::model::IdentityHandle> { - self.identity.as_ref() - } -} -impl std::fmt::Debug for ChatMessageBodyPartyJoin { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ChatMessageBodyPartyJoin"); - formatter.field("identity", &self.identity); - formatter.finish() - } -} -/// See [`ChatMessageBodyPartyJoin`](crate::model::ChatMessageBodyPartyJoin) -pub mod chat_message_body_party_join { - /// A builder for [`ChatMessageBodyPartyJoin`](crate::model::ChatMessageBodyPartyJoin) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity: std::option::Option, - } - impl Builder { - /// An identity handle. - pub fn identity(mut self, input: crate::model::IdentityHandle) -> Self { - self.identity = Some(input); - self - } - /// An identity handle. - pub fn set_identity( - mut self, - input: std::option::Option, - ) -> Self { - self.identity = input; - self - } - /// Consumes the builder and constructs a [`ChatMessageBodyPartyJoin`](crate::model::ChatMessageBodyPartyJoin) - pub fn build(self) -> crate::model::ChatMessageBodyPartyJoin { - crate::model::ChatMessageBodyPartyJoin { - identity: self.identity, - } - } - } -} -impl ChatMessageBodyPartyJoin { - /// Creates a new builder-style object to manufacture [`ChatMessageBodyPartyJoin`](crate::model::ChatMessageBodyPartyJoin) - pub fn builder() -> crate::model::chat_message_body_party_join::Builder { - crate::model::chat_message_body_party_join::Builder::default() - } -} - -/// `rivet.chat#ChatMessageBody` variant for indicating an identity requesting to join your party. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ChatMessageBodyPartyJoinRequest { - /// An identity handle. - pub sender: std::option::Option, -} -impl ChatMessageBodyPartyJoinRequest { - /// An identity handle. - pub fn sender(&self) -> std::option::Option<&crate::model::IdentityHandle> { - self.sender.as_ref() - } -} -impl std::fmt::Debug for ChatMessageBodyPartyJoinRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ChatMessageBodyPartyJoinRequest"); - formatter.field("sender", &self.sender); - formatter.finish() - } -} -/// See [`ChatMessageBodyPartyJoinRequest`](crate::model::ChatMessageBodyPartyJoinRequest) -pub mod chat_message_body_party_join_request { - /// A builder for [`ChatMessageBodyPartyJoinRequest`](crate::model::ChatMessageBodyPartyJoinRequest) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) sender: std::option::Option, - } - impl Builder { - /// An identity handle. - pub fn sender(mut self, input: crate::model::IdentityHandle) -> Self { - self.sender = Some(input); - self - } - /// An identity handle. - pub fn set_sender( - mut self, - input: std::option::Option, - ) -> Self { - self.sender = input; - self - } - /// Consumes the builder and constructs a [`ChatMessageBodyPartyJoinRequest`](crate::model::ChatMessageBodyPartyJoinRequest) - pub fn build(self) -> crate::model::ChatMessageBodyPartyJoinRequest { - crate::model::ChatMessageBodyPartyJoinRequest { - sender: self.sender, - } - } - } -} -impl ChatMessageBodyPartyJoinRequest { - /// Creates a new builder-style object to manufacture [`ChatMessageBodyPartyJoinRequest`](crate::model::ChatMessageBodyPartyJoinRequest) - pub fn builder() -> crate::model::chat_message_body_party_join_request::Builder { - crate::model::chat_message_body_party_join_request::Builder::default() - } -} - -/// `rivet.chat#ChatMessageBody` variant holding an a party invitation. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ChatMessageBodyPartyInvite { - /// An identity handle. - pub sender: std::option::Option, - /// A party handle. - pub party: std::option::Option, - /// Pass to `rivet.api.party#GetPartyFromInvite$token` to view more information about the party. Pass to `rivet.api.party.common#JoinPartyInvite$token` to join the party. - pub invite_token: std::option::Option, -} -impl ChatMessageBodyPartyInvite { - /// An identity handle. - pub fn sender(&self) -> std::option::Option<&crate::model::IdentityHandle> { - self.sender.as_ref() - } - /// A party handle. - pub fn party(&self) -> std::option::Option<&crate::model::PartyHandle> { - self.party.as_ref() - } - /// Pass to `rivet.api.party#GetPartyFromInvite$token` to view more information about the party. Pass to `rivet.api.party.common#JoinPartyInvite$token` to join the party. - pub fn invite_token(&self) -> std::option::Option<&str> { - self.invite_token.as_deref() - } -} -impl std::fmt::Debug for ChatMessageBodyPartyInvite { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ChatMessageBodyPartyInvite"); - formatter.field("sender", &self.sender); - formatter.field("party", &self.party); - formatter.field("invite_token", &"*** Sensitive Data Redacted ***"); - formatter.finish() - } -} -/// See [`ChatMessageBodyPartyInvite`](crate::model::ChatMessageBodyPartyInvite) -pub mod chat_message_body_party_invite { - /// A builder for [`ChatMessageBodyPartyInvite`](crate::model::ChatMessageBodyPartyInvite) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) sender: std::option::Option, - pub(crate) party: std::option::Option, - pub(crate) invite_token: std::option::Option, - } - impl Builder { - /// An identity handle. - pub fn sender(mut self, input: crate::model::IdentityHandle) -> Self { - self.sender = Some(input); - self - } - /// An identity handle. - pub fn set_sender( - mut self, - input: std::option::Option, - ) -> Self { - self.sender = input; - self - } - /// A party handle. - pub fn party(mut self, input: crate::model::PartyHandle) -> Self { - self.party = Some(input); - self - } - /// A party handle. - pub fn set_party(mut self, input: std::option::Option) -> Self { - self.party = input; - self - } - /// Pass to `rivet.api.party#GetPartyFromInvite$token` to view more information about the party. Pass to `rivet.api.party.common#JoinPartyInvite$token` to join the party. - pub fn invite_token(mut self, input: impl Into) -> Self { - self.invite_token = Some(input.into()); - self - } - /// Pass to `rivet.api.party#GetPartyFromInvite$token` to view more information about the party. Pass to `rivet.api.party.common#JoinPartyInvite$token` to join the party. - pub fn set_invite_token(mut self, input: std::option::Option) -> Self { - self.invite_token = input; - self - } - /// Consumes the builder and constructs a [`ChatMessageBodyPartyInvite`](crate::model::ChatMessageBodyPartyInvite) - pub fn build(self) -> crate::model::ChatMessageBodyPartyInvite { - crate::model::ChatMessageBodyPartyInvite { - sender: self.sender, - party: self.party, - invite_token: self.invite_token, - } - } - } -} -impl ChatMessageBodyPartyInvite { - /// Creates a new builder-style object to manufacture [`ChatMessageBodyPartyInvite`](crate::model::ChatMessageBodyPartyInvite) - pub fn builder() -> crate::model::chat_message_body_party_invite::Builder { - crate::model::chat_message_body_party_invite::Builder::default() - } -} - -/// `rivet.chat#ChatMessageBody` variant for indicating an identity has been kicked from the group. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ChatMessageBodyGroupMemberKick { - /// An identity handle. - pub identity: std::option::Option, -} -impl ChatMessageBodyGroupMemberKick { - /// An identity handle. - pub fn identity(&self) -> std::option::Option<&crate::model::IdentityHandle> { - self.identity.as_ref() - } -} -impl std::fmt::Debug for ChatMessageBodyGroupMemberKick { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ChatMessageBodyGroupMemberKick"); - formatter.field("identity", &self.identity); - formatter.finish() - } -} -/// See [`ChatMessageBodyGroupMemberKick`](crate::model::ChatMessageBodyGroupMemberKick) -pub mod chat_message_body_group_member_kick { - /// A builder for [`ChatMessageBodyGroupMemberKick`](crate::model::ChatMessageBodyGroupMemberKick) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity: std::option::Option, - } - impl Builder { - /// An identity handle. - pub fn identity(mut self, input: crate::model::IdentityHandle) -> Self { - self.identity = Some(input); - self - } - /// An identity handle. - pub fn set_identity( - mut self, - input: std::option::Option, - ) -> Self { - self.identity = input; - self - } - /// Consumes the builder and constructs a [`ChatMessageBodyGroupMemberKick`](crate::model::ChatMessageBodyGroupMemberKick) - pub fn build(self) -> crate::model::ChatMessageBodyGroupMemberKick { - crate::model::ChatMessageBodyGroupMemberKick { - identity: self.identity, - } - } - } -} -impl ChatMessageBodyGroupMemberKick { - /// Creates a new builder-style object to manufacture [`ChatMessageBodyGroupMemberKick`](crate::model::ChatMessageBodyGroupMemberKick) - pub fn builder() -> crate::model::chat_message_body_group_member_kick::Builder { - crate::model::chat_message_body_group_member_kick::Builder::default() - } -} - -/// `rivet.chat#ChatMessageBody` variant for indicating an identity left the group. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ChatMessageBodyGroupLeave { - /// An identity handle. - pub identity: std::option::Option, -} -impl ChatMessageBodyGroupLeave { - /// An identity handle. - pub fn identity(&self) -> std::option::Option<&crate::model::IdentityHandle> { - self.identity.as_ref() - } -} -impl std::fmt::Debug for ChatMessageBodyGroupLeave { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ChatMessageBodyGroupLeave"); - formatter.field("identity", &self.identity); - formatter.finish() - } -} -/// See [`ChatMessageBodyGroupLeave`](crate::model::ChatMessageBodyGroupLeave) -pub mod chat_message_body_group_leave { - /// A builder for [`ChatMessageBodyGroupLeave`](crate::model::ChatMessageBodyGroupLeave) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity: std::option::Option, - } - impl Builder { - /// An identity handle. - pub fn identity(mut self, input: crate::model::IdentityHandle) -> Self { - self.identity = Some(input); - self - } - /// An identity handle. - pub fn set_identity( - mut self, - input: std::option::Option, - ) -> Self { - self.identity = input; - self - } - /// Consumes the builder and constructs a [`ChatMessageBodyGroupLeave`](crate::model::ChatMessageBodyGroupLeave) - pub fn build(self) -> crate::model::ChatMessageBodyGroupLeave { - crate::model::ChatMessageBodyGroupLeave { - identity: self.identity, - } - } - } -} -impl ChatMessageBodyGroupLeave { - /// Creates a new builder-style object to manufacture [`ChatMessageBodyGroupLeave`](crate::model::ChatMessageBodyGroupLeave) - pub fn builder() -> crate::model::chat_message_body_group_leave::Builder { - crate::model::chat_message_body_group_leave::Builder::default() - } -} - -/// `rivet.chat#ChatMessageBody` variant for indicating an identity joined the group. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ChatMessageBodyGroupJoin { - /// An identity handle. - pub identity: std::option::Option, -} -impl ChatMessageBodyGroupJoin { - /// An identity handle. - pub fn identity(&self) -> std::option::Option<&crate::model::IdentityHandle> { - self.identity.as_ref() - } -} -impl std::fmt::Debug for ChatMessageBodyGroupJoin { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ChatMessageBodyGroupJoin"); - formatter.field("identity", &self.identity); - formatter.finish() - } -} -/// See [`ChatMessageBodyGroupJoin`](crate::model::ChatMessageBodyGroupJoin) -pub mod chat_message_body_group_join { - /// A builder for [`ChatMessageBodyGroupJoin`](crate::model::ChatMessageBodyGroupJoin) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity: std::option::Option, - } - impl Builder { - /// An identity handle. - pub fn identity(mut self, input: crate::model::IdentityHandle) -> Self { - self.identity = Some(input); - self - } - /// An identity handle. - pub fn set_identity( - mut self, - input: std::option::Option, - ) -> Self { - self.identity = input; - self - } - /// Consumes the builder and constructs a [`ChatMessageBodyGroupJoin`](crate::model::ChatMessageBodyGroupJoin) - pub fn build(self) -> crate::model::ChatMessageBodyGroupJoin { - crate::model::ChatMessageBodyGroupJoin { - identity: self.identity, - } - } - } -} -impl ChatMessageBodyGroupJoin { - /// Creates a new builder-style object to manufacture [`ChatMessageBodyGroupJoin`](crate::model::ChatMessageBodyGroupJoin) - pub fn builder() -> crate::model::chat_message_body_group_join::Builder { - crate::model::chat_message_body_group_join::Builder::default() - } -} - -/// `rivet.chat#ChatMessageBody` variant for indicating an identity followed the identity. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ChatMessageBodyIdentityFollow {} -impl std::fmt::Debug for ChatMessageBodyIdentityFollow { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ChatMessageBodyIdentityFollow"); - formatter.finish() - } -} -/// See [`ChatMessageBodyIdentityFollow`](crate::model::ChatMessageBodyIdentityFollow) -pub mod chat_message_body_identity_follow { - /// A builder for [`ChatMessageBodyIdentityFollow`](crate::model::ChatMessageBodyIdentityFollow) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`ChatMessageBodyIdentityFollow`](crate::model::ChatMessageBodyIdentityFollow) - pub fn build(self) -> crate::model::ChatMessageBodyIdentityFollow { - crate::model::ChatMessageBodyIdentityFollow {} - } - } -} -impl ChatMessageBodyIdentityFollow { - /// Creates a new builder-style object to manufacture [`ChatMessageBodyIdentityFollow`](crate::model::ChatMessageBodyIdentityFollow) - pub fn builder() -> crate::model::chat_message_body_identity_follow::Builder { - crate::model::chat_message_body_identity_follow::Builder::default() - } -} - -/// `rivet.chat#ChatMessageBody` variant for deleted messages. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ChatMessageBodyDeleted { - /// An identity handle. - pub sender: std::option::Option, -} -impl ChatMessageBodyDeleted { - /// An identity handle. - pub fn sender(&self) -> std::option::Option<&crate::model::IdentityHandle> { - self.sender.as_ref() - } -} -impl std::fmt::Debug for ChatMessageBodyDeleted { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ChatMessageBodyDeleted"); - formatter.field("sender", &self.sender); - formatter.finish() - } -} -/// See [`ChatMessageBodyDeleted`](crate::model::ChatMessageBodyDeleted) -pub mod chat_message_body_deleted { - /// A builder for [`ChatMessageBodyDeleted`](crate::model::ChatMessageBodyDeleted) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) sender: std::option::Option, - } - impl Builder { - /// An identity handle. - pub fn sender(mut self, input: crate::model::IdentityHandle) -> Self { - self.sender = Some(input); - self - } - /// An identity handle. - pub fn set_sender( - mut self, - input: std::option::Option, - ) -> Self { - self.sender = input; - self - } - /// Consumes the builder and constructs a [`ChatMessageBodyDeleted`](crate::model::ChatMessageBodyDeleted) - pub fn build(self) -> crate::model::ChatMessageBodyDeleted { - crate::model::ChatMessageBodyDeleted { - sender: self.sender, - } - } - } -} -impl ChatMessageBodyDeleted { - /// Creates a new builder-style object to manufacture [`ChatMessageBodyDeleted`](crate::model::ChatMessageBodyDeleted) - pub fn builder() -> crate::model::chat_message_body_deleted::Builder { - crate::model::chat_message_body_deleted::Builder::default() - } -} - -/// `rivet.chat#ChatMessageBody` variant for indicating a new chat was created. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ChatMessageBodyChatCreate {} -impl std::fmt::Debug for ChatMessageBodyChatCreate { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ChatMessageBodyChatCreate"); - formatter.finish() - } -} -/// See [`ChatMessageBodyChatCreate`](crate::model::ChatMessageBodyChatCreate) -pub mod chat_message_body_chat_create { - /// A builder for [`ChatMessageBodyChatCreate`](crate::model::ChatMessageBodyChatCreate) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`ChatMessageBodyChatCreate`](crate::model::ChatMessageBodyChatCreate) - pub fn build(self) -> crate::model::ChatMessageBodyChatCreate { - crate::model::ChatMessageBodyChatCreate {} - } - } -} -impl ChatMessageBodyChatCreate { - /// Creates a new builder-style object to manufacture [`ChatMessageBodyChatCreate`](crate::model::ChatMessageBodyChatCreate) - pub fn builder() -> crate::model::chat_message_body_chat_create::Builder { - crate::model::chat_message_body_chat_create::Builder::default() - } -} - -/// `rivet.chat#ChatMessageBody` variant for text messages. Sent by other identities using the chat interface. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ChatMessageBodyText { - /// An identity handle. - pub sender: std::option::Option, - /// The text in the message. - pub body: std::option::Option, -} -impl ChatMessageBodyText { - /// An identity handle. - pub fn sender(&self) -> std::option::Option<&crate::model::IdentityHandle> { - self.sender.as_ref() - } - /// The text in the message. - pub fn body(&self) -> std::option::Option<&str> { - self.body.as_deref() - } -} -impl std::fmt::Debug for ChatMessageBodyText { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ChatMessageBodyText"); - formatter.field("sender", &self.sender); - formatter.field("body", &self.body); - formatter.finish() - } -} -/// See [`ChatMessageBodyText`](crate::model::ChatMessageBodyText) -pub mod chat_message_body_text { - /// A builder for [`ChatMessageBodyText`](crate::model::ChatMessageBodyText) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) sender: std::option::Option, - pub(crate) body: std::option::Option, - } - impl Builder { - /// An identity handle. - pub fn sender(mut self, input: crate::model::IdentityHandle) -> Self { - self.sender = Some(input); - self - } - /// An identity handle. - pub fn set_sender( - mut self, - input: std::option::Option, - ) -> Self { - self.sender = input; - self - } - /// The text in the message. - pub fn body(mut self, input: impl Into) -> Self { - self.body = Some(input.into()); - self - } - /// The text in the message. - pub fn set_body(mut self, input: std::option::Option) -> Self { - self.body = input; - self - } - /// Consumes the builder and constructs a [`ChatMessageBodyText`](crate::model::ChatMessageBodyText) - pub fn build(self) -> crate::model::ChatMessageBodyText { - crate::model::ChatMessageBodyText { - sender: self.sender, - body: self.body, - } - } - } -} -impl ChatMessageBodyText { - /// Creates a new builder-style object to manufacture [`ChatMessageBodyText`](crate::model::ChatMessageBodyText) - pub fn builder() -> crate::model::chat_message_body_text::Builder { - crate::model::chat_message_body_text::Builder::default() - } -} - -/// Represents the topic of the given chat thread. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] -pub enum ChatTopic { - /// `rivet.chat#ChatTopic` variant for direct (identity to identity) chats. - Direct(crate::model::ChatTopicDirect), - /// `rivet.chat#ChatTopic` variant for groups. - Group(crate::model::ChatTopicGroup), - /// `rivet.chat#ChatTopic` variant for parties. - Party(crate::model::ChatTopicParty), - /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version. - /// An unknown enum variant - /// - /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._ - /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized - /// by the client. This can happen when the server adds new functionality, but the client has not been updated. - /// To investigate this, consider turning on debug logging to print the raw HTTP response. - #[non_exhaustive] - Unknown, -} -impl ChatTopic { - /// Tries to convert the enum instance into [`Direct`](crate::model::ChatTopic::Direct), extracting the inner [`ChatTopicDirect`](crate::model::ChatTopicDirect). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_direct(&self) -> std::result::Result<&crate::model::ChatTopicDirect, &Self> { - if let ChatTopic::Direct(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`Direct`](crate::model::ChatTopic::Direct). - pub fn is_direct(&self) -> bool { - self.as_direct().is_ok() - } - /// Tries to convert the enum instance into [`Group`](crate::model::ChatTopic::Group), extracting the inner [`ChatTopicGroup`](crate::model::ChatTopicGroup). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_group(&self) -> std::result::Result<&crate::model::ChatTopicGroup, &Self> { - if let ChatTopic::Group(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`Group`](crate::model::ChatTopic::Group). - pub fn is_group(&self) -> bool { - self.as_group().is_ok() - } - /// Tries to convert the enum instance into [`Party`](crate::model::ChatTopic::Party), extracting the inner [`ChatTopicParty`](crate::model::ChatTopicParty). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_party(&self) -> std::result::Result<&crate::model::ChatTopicParty, &Self> { - if let ChatTopic::Party(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`Party`](crate::model::ChatTopic::Party). - pub fn is_party(&self) -> bool { - self.as_party().is_ok() - } - /// Returns true if the enum instance is the `Unknown` variant. - pub fn is_unknown(&self) -> bool { - matches!(self, Self::Unknown) - } -} - -/// `rivet.chat#ChatTopic` variant for direct (identity to identity) chats. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ChatTopicDirect { - /// An identity handle. - pub identity_a: std::option::Option, - /// An identity handle. - pub identity_b: std::option::Option, -} -impl ChatTopicDirect { - /// An identity handle. - pub fn identity_a(&self) -> std::option::Option<&crate::model::IdentityHandle> { - self.identity_a.as_ref() - } - /// An identity handle. - pub fn identity_b(&self) -> std::option::Option<&crate::model::IdentityHandle> { - self.identity_b.as_ref() - } -} -impl std::fmt::Debug for ChatTopicDirect { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ChatTopicDirect"); - formatter.field("identity_a", &self.identity_a); - formatter.field("identity_b", &self.identity_b); - formatter.finish() - } -} -/// See [`ChatTopicDirect`](crate::model::ChatTopicDirect) -pub mod chat_topic_direct { - /// A builder for [`ChatTopicDirect`](crate::model::ChatTopicDirect) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity_a: std::option::Option, - pub(crate) identity_b: std::option::Option, - } - impl Builder { - /// An identity handle. - pub fn identity_a(mut self, input: crate::model::IdentityHandle) -> Self { - self.identity_a = Some(input); - self - } - /// An identity handle. - pub fn set_identity_a( - mut self, - input: std::option::Option, - ) -> Self { - self.identity_a = input; - self - } - /// An identity handle. - pub fn identity_b(mut self, input: crate::model::IdentityHandle) -> Self { - self.identity_b = Some(input); - self - } - /// An identity handle. - pub fn set_identity_b( - mut self, - input: std::option::Option, - ) -> Self { - self.identity_b = input; - self - } - /// Consumes the builder and constructs a [`ChatTopicDirect`](crate::model::ChatTopicDirect) - pub fn build(self) -> crate::model::ChatTopicDirect { - crate::model::ChatTopicDirect { - identity_a: self.identity_a, - identity_b: self.identity_b, - } - } - } -} -impl ChatTopicDirect { - /// Creates a new builder-style object to manufacture [`ChatTopicDirect`](crate::model::ChatTopicDirect) - pub fn builder() -> crate::model::chat_topic_direct::Builder { - crate::model::chat_topic_direct::Builder::default() - } -} - -/// `rivet.chat#ChatTopic` variant for parties. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ChatTopicParty { - /// A party handle. - pub party: std::option::Option, -} -impl ChatTopicParty { - /// A party handle. - pub fn party(&self) -> std::option::Option<&crate::model::PartyHandle> { - self.party.as_ref() - } -} -impl std::fmt::Debug for ChatTopicParty { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ChatTopicParty"); - formatter.field("party", &self.party); - formatter.finish() - } -} -/// See [`ChatTopicParty`](crate::model::ChatTopicParty) -pub mod chat_topic_party { - /// A builder for [`ChatTopicParty`](crate::model::ChatTopicParty) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) party: std::option::Option, - } - impl Builder { - /// A party handle. - pub fn party(mut self, input: crate::model::PartyHandle) -> Self { - self.party = Some(input); - self - } - /// A party handle. - pub fn set_party(mut self, input: std::option::Option) -> Self { - self.party = input; - self - } - /// Consumes the builder and constructs a [`ChatTopicParty`](crate::model::ChatTopicParty) - pub fn build(self) -> crate::model::ChatTopicParty { - crate::model::ChatTopicParty { party: self.party } - } - } -} -impl ChatTopicParty { - /// Creates a new builder-style object to manufacture [`ChatTopicParty`](crate::model::ChatTopicParty) - pub fn builder() -> crate::model::chat_topic_party::Builder { - crate::model::chat_topic_party::Builder::default() - } -} - -/// `rivet.chat#ChatTopic` variant for groups. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ChatTopicGroup { - /// A group handle. - pub group: std::option::Option, -} -impl ChatTopicGroup { - /// A group handle. - pub fn group(&self) -> std::option::Option<&crate::model::GroupHandle> { - self.group.as_ref() - } -} -impl std::fmt::Debug for ChatTopicGroup { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ChatTopicGroup"); - formatter.field("group", &self.group); - formatter.finish() - } -} -/// See [`ChatTopicGroup`](crate::model::ChatTopicGroup) -pub mod chat_topic_group { - /// A builder for [`ChatTopicGroup`](crate::model::ChatTopicGroup) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) group: std::option::Option, - } - impl Builder { - /// A group handle. - pub fn group(mut self, input: crate::model::GroupHandle) -> Self { - self.group = Some(input); - self - } - /// A group handle. - pub fn set_group(mut self, input: std::option::Option) -> Self { - self.group = input; - self - } - /// Consumes the builder and constructs a [`ChatTopicGroup`](crate::model::ChatTopicGroup) - pub fn build(self) -> crate::model::ChatTopicGroup { - crate::model::ChatTopicGroup { group: self.group } - } - } -} -impl ChatTopicGroup { - /// Creates a new builder-style object to manufacture [`ChatTopicGroup`](crate::model::ChatTopicGroup) - pub fn builder() -> crate::model::chat_topic_group::Builder { - crate::model::chat_topic_group::Builder::default() - } -} - -/// An identity summary. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct IdentitySummary { - /// A universally unique identifier. - pub identity_id: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub account_number: std::option::Option, - /// The URL of this identity's avatar image. - pub avatar_url: std::option::Option, - /// Information about the identity's current status, party, and active game. - pub presence: std::option::Option, - /// A party handle. - pub party: std::option::Option, - /// Whether or not this identity is registered with a linked account. - pub is_registered: std::option::Option, - /// External links for an identity. - pub external: std::option::Option, - /// Whether or not the requestee's identity is following this identity. - pub following: std::option::Option, - /// Whether or not this identity following the requestee's identity. - pub is_following_me: std::option::Option, - /// Whether or not this identity is both following and is followed by the requestee's identity. - pub is_mutual_following: std::option::Option, -} -impl IdentitySummary { - /// A universally unique identifier. - pub fn identity_id(&self) -> std::option::Option<&str> { - self.identity_id.as_deref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub fn account_number(&self) -> std::option::Option { - self.account_number - } - /// The URL of this identity's avatar image. - pub fn avatar_url(&self) -> std::option::Option<&str> { - self.avatar_url.as_deref() - } - /// Information about the identity's current status, party, and active game. - pub fn presence(&self) -> std::option::Option<&crate::model::IdentityPresence> { - self.presence.as_ref() - } - /// A party handle. - pub fn party(&self) -> std::option::Option<&crate::model::PartyHandle> { - self.party.as_ref() - } - /// Whether or not this identity is registered with a linked account. - pub fn is_registered(&self) -> std::option::Option { - self.is_registered - } - /// External links for an identity. - pub fn external(&self) -> std::option::Option<&crate::model::IdentityExternalLinks> { - self.external.as_ref() - } - /// Whether or not the requestee's identity is following this identity. - pub fn following(&self) -> std::option::Option { - self.following - } - /// Whether or not this identity following the requestee's identity. - pub fn is_following_me(&self) -> std::option::Option { - self.is_following_me - } - /// Whether or not this identity is both following and is followed by the requestee's identity. - pub fn is_mutual_following(&self) -> std::option::Option { - self.is_mutual_following - } -} -impl std::fmt::Debug for IdentitySummary { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("IdentitySummary"); - formatter.field("identity_id", &self.identity_id); - formatter.field("display_name", &self.display_name); - formatter.field("account_number", &self.account_number); - formatter.field("avatar_url", &self.avatar_url); - formatter.field("presence", &self.presence); - formatter.field("party", &self.party); - formatter.field("is_registered", &self.is_registered); - formatter.field("external", &self.external); - formatter.field("following", &self.following); - formatter.field("is_following_me", &self.is_following_me); - formatter.field("is_mutual_following", &self.is_mutual_following); - formatter.finish() - } -} -/// See [`IdentitySummary`](crate::model::IdentitySummary) -pub mod identity_summary { - /// A builder for [`IdentitySummary`](crate::model::IdentitySummary) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity_id: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) account_number: std::option::Option, - pub(crate) avatar_url: std::option::Option, - pub(crate) presence: std::option::Option, - pub(crate) party: std::option::Option, - pub(crate) is_registered: std::option::Option, - pub(crate) external: std::option::Option, - pub(crate) following: std::option::Option, - pub(crate) is_following_me: std::option::Option, - pub(crate) is_mutual_following: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.identity_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.identity_id = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub fn account_number(mut self, input: i32) -> Self { - self.account_number = Some(input); - self - } - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub fn set_account_number(mut self, input: std::option::Option) -> Self { - self.account_number = input; - self - } - /// The URL of this identity's avatar image. - pub fn avatar_url(mut self, input: impl Into) -> Self { - self.avatar_url = Some(input.into()); - self - } - /// The URL of this identity's avatar image. - pub fn set_avatar_url(mut self, input: std::option::Option) -> Self { - self.avatar_url = input; - self - } - /// Information about the identity's current status, party, and active game. - pub fn presence(mut self, input: crate::model::IdentityPresence) -> Self { - self.presence = Some(input); - self - } - /// Information about the identity's current status, party, and active game. - pub fn set_presence( - mut self, - input: std::option::Option, - ) -> Self { - self.presence = input; - self - } - /// A party handle. - pub fn party(mut self, input: crate::model::PartyHandle) -> Self { - self.party = Some(input); - self - } - /// A party handle. - pub fn set_party(mut self, input: std::option::Option) -> Self { - self.party = input; - self - } - /// Whether or not this identity is registered with a linked account. - pub fn is_registered(mut self, input: bool) -> Self { - self.is_registered = Some(input); - self - } - /// Whether or not this identity is registered with a linked account. - pub fn set_is_registered(mut self, input: std::option::Option) -> Self { - self.is_registered = input; - self - } - /// External links for an identity. - pub fn external(mut self, input: crate::model::IdentityExternalLinks) -> Self { - self.external = Some(input); - self - } - /// External links for an identity. - pub fn set_external( - mut self, - input: std::option::Option, - ) -> Self { - self.external = input; - self - } - /// Whether or not the requestee's identity is following this identity. - pub fn following(mut self, input: bool) -> Self { - self.following = Some(input); - self - } - /// Whether or not the requestee's identity is following this identity. - pub fn set_following(mut self, input: std::option::Option) -> Self { - self.following = input; - self - } - /// Whether or not this identity following the requestee's identity. - pub fn is_following_me(mut self, input: bool) -> Self { - self.is_following_me = Some(input); - self - } - /// Whether or not this identity following the requestee's identity. - pub fn set_is_following_me(mut self, input: std::option::Option) -> Self { - self.is_following_me = input; - self - } - /// Whether or not this identity is both following and is followed by the requestee's identity. - pub fn is_mutual_following(mut self, input: bool) -> Self { - self.is_mutual_following = Some(input); - self - } - /// Whether or not this identity is both following and is followed by the requestee's identity. - pub fn set_is_mutual_following(mut self, input: std::option::Option) -> Self { - self.is_mutual_following = input; - self - } - /// Consumes the builder and constructs a [`IdentitySummary`](crate::model::IdentitySummary) - pub fn build(self) -> crate::model::IdentitySummary { - crate::model::IdentitySummary { - identity_id: self.identity_id, - display_name: self.display_name, - account_number: self.account_number, - avatar_url: self.avatar_url, - presence: self.presence, - party: self.party, - is_registered: self.is_registered, - external: self.external, - following: self.following, - is_following_me: self.is_following_me, - is_mutual_following: self.is_mutual_following, - } - } - } -} -impl IdentitySummary { - /// Creates a new builder-style object to manufacture [`IdentitySummary`](crate::model::IdentitySummary) - pub fn builder() -> crate::model::identity_summary::Builder { - crate::model::identity_summary::Builder::default() - } -} - -/// A presigned request used to upload files. Upload your file to the given URL via a PUT request. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UploadPresignedRequest { - /// The name of the file to upload. This is the same as the one given in the upload prepare file. - pub path: std::option::Option, - /// The URL of the presigned request for which to upload your file to. - pub url: std::option::Option, -} -impl UploadPresignedRequest { - /// The name of the file to upload. This is the same as the one given in the upload prepare file. - pub fn path(&self) -> std::option::Option<&str> { - self.path.as_deref() - } - /// The URL of the presigned request for which to upload your file to. - pub fn url(&self) -> std::option::Option<&str> { - self.url.as_deref() - } -} -impl std::fmt::Debug for UploadPresignedRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UploadPresignedRequest"); - formatter.field("path", &self.path); - formatter.field("url", &self.url); - formatter.finish() - } -} -/// See [`UploadPresignedRequest`](crate::model::UploadPresignedRequest) -pub mod upload_presigned_request { - /// A builder for [`UploadPresignedRequest`](crate::model::UploadPresignedRequest) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) path: std::option::Option, - pub(crate) url: std::option::Option, - } - impl Builder { - /// The name of the file to upload. This is the same as the one given in the upload prepare file. - pub fn path(mut self, input: impl Into) -> Self { - self.path = Some(input.into()); - self - } - /// The name of the file to upload. This is the same as the one given in the upload prepare file. - pub fn set_path(mut self, input: std::option::Option) -> Self { - self.path = input; - self - } - /// The URL of the presigned request for which to upload your file to. - pub fn url(mut self, input: impl Into) -> Self { - self.url = Some(input.into()); - self - } - /// The URL of the presigned request for which to upload your file to. - pub fn set_url(mut self, input: std::option::Option) -> Self { - self.url = input; - self - } - /// Consumes the builder and constructs a [`UploadPresignedRequest`](crate::model::UploadPresignedRequest) - pub fn build(self) -> crate::model::UploadPresignedRequest { - crate::model::UploadPresignedRequest { - path: self.path, - url: self.url, - } - } - } -} -impl UploadPresignedRequest { - /// Creates a new builder-style object to manufacture [`UploadPresignedRequest`](crate::model::UploadPresignedRequest) - pub fn builder() -> crate::model::upload_presigned_request::Builder { - crate::model::upload_presigned_request::Builder::default() - } -} - -/// Information about the identity's current game. This is information that all other identities can see about what the current identity is doing. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UpdateIdentityGameActivity { - /// A short message about the current game activity. - pub message: std::option::Option, - /// JSON data seen by anyone. - pub public_metadata: std::option::Option, - /// JSON data seen only by the given identity and their mutual followers. - pub mutual_metadata: std::option::Option, -} -impl UpdateIdentityGameActivity { - /// A short message about the current game activity. - pub fn message(&self) -> std::option::Option<&str> { - self.message.as_deref() - } - /// JSON data seen by anyone. - pub fn public_metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.public_metadata.as_ref() - } - /// JSON data seen only by the given identity and their mutual followers. - pub fn mutual_metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.mutual_metadata.as_ref() - } -} -impl std::fmt::Debug for UpdateIdentityGameActivity { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UpdateIdentityGameActivity"); - formatter.field("message", &self.message); - formatter.field("public_metadata", &self.public_metadata); - formatter.field("mutual_metadata", &self.mutual_metadata); - formatter.finish() - } -} -/// See [`UpdateIdentityGameActivity`](crate::model::UpdateIdentityGameActivity) -pub mod update_identity_game_activity { - /// A builder for [`UpdateIdentityGameActivity`](crate::model::UpdateIdentityGameActivity) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) message: std::option::Option, - pub(crate) public_metadata: std::option::Option, - pub(crate) mutual_metadata: std::option::Option, - } - impl Builder { - /// A short message about the current game activity. - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - /// A short message about the current game activity. - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - /// JSON data seen by anyone. - pub fn public_metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.public_metadata = Some(input); - self - } - /// JSON data seen by anyone. - pub fn set_public_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.public_metadata = input; - self - } - /// JSON data seen only by the given identity and their mutual followers. - pub fn mutual_metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.mutual_metadata = Some(input); - self - } - /// JSON data seen only by the given identity and their mutual followers. - pub fn set_mutual_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.mutual_metadata = input; - self - } - /// Consumes the builder and constructs a [`UpdateIdentityGameActivity`](crate::model::UpdateIdentityGameActivity) - pub fn build(self) -> crate::model::UpdateIdentityGameActivity { - crate::model::UpdateIdentityGameActivity { - message: self.message, - public_metadata: self.public_metadata, - mutual_metadata: self.mutual_metadata, - } - } - } -} -impl UpdateIdentityGameActivity { - /// Creates a new builder-style object to manufacture [`UpdateIdentityGameActivity`](crate::model::UpdateIdentityGameActivity) - pub fn builder() -> crate::model::update_identity_game_activity::Builder { - crate::model::update_identity_game_activity::Builder::default() - } -} - -/// An error given by failed content validation. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ValidationError { - /// A list of strings denoting the origin of a validation error. - pub path: std::option::Option>, -} -impl ValidationError { - /// A list of strings denoting the origin of a validation error. - pub fn path(&self) -> std::option::Option<&[std::string::String]> { - self.path.as_deref() - } -} -impl std::fmt::Debug for ValidationError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ValidationError"); - formatter.field("path", &self.path); - formatter.finish() - } -} -/// See [`ValidationError`](crate::model::ValidationError) -pub mod validation_error { - /// A builder for [`ValidationError`](crate::model::ValidationError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) path: std::option::Option>, - } - impl Builder { - /// Appends an item to `path`. - /// - /// To override the contents of this collection use [`set_path`](Self::set_path). - /// - /// A list of strings denoting the origin of a validation error. - pub fn path(mut self, input: impl Into) -> Self { - let mut v = self.path.unwrap_or_default(); - v.push(input.into()); - self.path = Some(v); - self - } - /// A list of strings denoting the origin of a validation error. - pub fn set_path( - mut self, - input: std::option::Option>, - ) -> Self { - self.path = input; - self - } - /// Consumes the builder and constructs a [`ValidationError`](crate::model::ValidationError) - pub fn build(self) -> crate::model::ValidationError { - crate::model::ValidationError { path: self.path } - } - } -} -impl ValidationError { - /// Creates a new builder-style object to manufacture [`ValidationError`](crate::model::ValidationError) - pub fn builder() -> crate::model::validation_error::Builder { - crate::model::validation_error::Builder::default() - } -} diff --git a/lib/smithy-output/api-identity/rust/rust/src/operation.rs b/lib/smithy-output/api-identity/rust/rust/src/operation.rs deleted file mode 100644 index 95b0c7c39..000000000 --- a/lib/smithy-output/api-identity/rust/rust/src/operation.rs +++ /dev/null @@ -1,1028 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Operation shape for `CancelGameLink`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`cancel_game_link`](crate::client::Client::cancel_game_link). -/// -/// See [`crate::client::fluent_builders::CancelGameLink`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct CancelGameLink { - _private: (), -} -impl CancelGameLink { - /// Creates a new builder-style object to manufacture [`CancelGameLinkInput`](crate::input::CancelGameLinkInput) - pub fn builder() -> crate::input::cancel_game_link_input::Builder { - crate::input::cancel_game_link_input::Builder::default() - } - /// Creates a new `CancelGameLink` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for CancelGameLink { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_cancel_game_link_error(response) - } else { - crate::operation_deser::parse_cancel_game_link_response(response) - } - } -} - -/// Operation shape for `CompleteGameLink`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`complete_game_link`](crate::client::Client::complete_game_link). -/// -/// See [`crate::client::fluent_builders::CompleteGameLink`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct CompleteGameLink { - _private: (), -} -impl CompleteGameLink { - /// Creates a new builder-style object to manufacture [`CompleteGameLinkInput`](crate::input::CompleteGameLinkInput) - pub fn builder() -> crate::input::complete_game_link_input::Builder { - crate::input::complete_game_link_input::Builder::default() - } - /// Creates a new `CompleteGameLink` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for CompleteGameLink { - type Output = std::result::Result< - crate::output::CompleteGameLinkOutput, - crate::error::CompleteGameLinkError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_complete_game_link_error(response) - } else { - crate::operation_deser::parse_complete_game_link_response(response) - } - } -} - -/// Operation shape for `CompleteIdentityAvatarUpload`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`complete_identity_avatar_upload`](crate::client::Client::complete_identity_avatar_upload). -/// -/// See [`crate::client::fluent_builders::CompleteIdentityAvatarUpload`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct CompleteIdentityAvatarUpload { - _private: (), -} -impl CompleteIdentityAvatarUpload { - /// Creates a new builder-style object to manufacture [`CompleteIdentityAvatarUploadInput`](crate::input::CompleteIdentityAvatarUploadInput) - pub fn builder() -> crate::input::complete_identity_avatar_upload_input::Builder { - crate::input::complete_identity_avatar_upload_input::Builder::default() - } - /// Creates a new `CompleteIdentityAvatarUpload` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for CompleteIdentityAvatarUpload { - type Output = std::result::Result< - crate::output::CompleteIdentityAvatarUploadOutput, - crate::error::CompleteIdentityAvatarUploadError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_complete_identity_avatar_upload_error(response) - } else { - crate::operation_deser::parse_complete_identity_avatar_upload_response(response) - } - } -} - -/// Operation shape for `FollowIdentity`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`follow_identity`](crate::client::Client::follow_identity). -/// -/// See [`crate::client::fluent_builders::FollowIdentity`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct FollowIdentity { - _private: (), -} -impl FollowIdentity { - /// Creates a new builder-style object to manufacture [`FollowIdentityInput`](crate::input::FollowIdentityInput) - pub fn builder() -> crate::input::follow_identity_input::Builder { - crate::input::follow_identity_input::Builder::default() - } - /// Creates a new `FollowIdentity` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for FollowIdentity { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_follow_identity_error(response) - } else { - crate::operation_deser::parse_follow_identity_response(response) - } - } -} - -/// Operation shape for `GetGameLink`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`get_game_link`](crate::client::Client::get_game_link). -/// -/// See [`crate::client::fluent_builders::GetGameLink`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GetGameLink { - _private: (), -} -impl GetGameLink { - /// Creates a new builder-style object to manufacture [`GetGameLinkInput`](crate::input::GetGameLinkInput) - pub fn builder() -> crate::input::get_game_link_input::Builder { - crate::input::get_game_link_input::Builder::default() - } - /// Creates a new `GetGameLink` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GetGameLink { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_get_game_link_error(response) - } else { - crate::operation_deser::parse_get_game_link_response(response) - } - } -} - -/// Operation shape for `GetIdentityHandles`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`get_identity_handles`](crate::client::Client::get_identity_handles). -/// -/// See [`crate::client::fluent_builders::GetIdentityHandles`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GetIdentityHandles { - _private: (), -} -impl GetIdentityHandles { - /// Creates a new builder-style object to manufacture [`GetIdentityHandlesInput`](crate::input::GetIdentityHandlesInput) - pub fn builder() -> crate::input::get_identity_handles_input::Builder { - crate::input::get_identity_handles_input::Builder::default() - } - /// Creates a new `GetIdentityHandles` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GetIdentityHandles { - type Output = std::result::Result< - crate::output::GetIdentityHandlesOutput, - crate::error::GetIdentityHandlesError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_get_identity_handles_error(response) - } else { - crate::operation_deser::parse_get_identity_handles_response(response) - } - } -} - -/// Operation shape for `GetIdentityProfile`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`get_identity_profile`](crate::client::Client::get_identity_profile). -/// -/// See [`crate::client::fluent_builders::GetIdentityProfile`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GetIdentityProfile { - _private: (), -} -impl GetIdentityProfile { - /// Creates a new builder-style object to manufacture [`GetIdentityProfileInput`](crate::input::GetIdentityProfileInput) - pub fn builder() -> crate::input::get_identity_profile_input::Builder { - crate::input::get_identity_profile_input::Builder::default() - } - /// Creates a new `GetIdentityProfile` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GetIdentityProfile { - type Output = std::result::Result< - crate::output::GetIdentityProfileOutput, - crate::error::GetIdentityProfileError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_get_identity_profile_error(response) - } else { - crate::operation_deser::parse_get_identity_profile_response(response) - } - } -} - -/// Operation shape for `GetIdentitySelfProfile`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`get_identity_self_profile`](crate::client::Client::get_identity_self_profile). -/// -/// See [`crate::client::fluent_builders::GetIdentitySelfProfile`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GetIdentitySelfProfile { - _private: (), -} -impl GetIdentitySelfProfile { - /// Creates a new builder-style object to manufacture [`GetIdentitySelfProfileInput`](crate::input::GetIdentitySelfProfileInput) - pub fn builder() -> crate::input::get_identity_self_profile_input::Builder { - crate::input::get_identity_self_profile_input::Builder::default() - } - /// Creates a new `GetIdentitySelfProfile` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GetIdentitySelfProfile { - type Output = std::result::Result< - crate::output::GetIdentitySelfProfileOutput, - crate::error::GetIdentitySelfProfileError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_get_identity_self_profile_error(response) - } else { - crate::operation_deser::parse_get_identity_self_profile_response(response) - } - } -} - -/// Operation shape for `GetIdentitySummaries`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`get_identity_summaries`](crate::client::Client::get_identity_summaries). -/// -/// See [`crate::client::fluent_builders::GetIdentitySummaries`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GetIdentitySummaries { - _private: (), -} -impl GetIdentitySummaries { - /// Creates a new builder-style object to manufacture [`GetIdentitySummariesInput`](crate::input::GetIdentitySummariesInput) - pub fn builder() -> crate::input::get_identity_summaries_input::Builder { - crate::input::get_identity_summaries_input::Builder::default() - } - /// Creates a new `GetIdentitySummaries` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GetIdentitySummaries { - type Output = std::result::Result< - crate::output::GetIdentitySummariesOutput, - crate::error::GetIdentitySummariesError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_get_identity_summaries_error(response) - } else { - crate::operation_deser::parse_get_identity_summaries_response(response) - } - } -} - -/// Operation shape for `ListActivities`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`list_activities`](crate::client::Client::list_activities). -/// -/// See [`crate::client::fluent_builders::ListActivities`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct ListActivities { - _private: (), -} -impl ListActivities { - /// Creates a new builder-style object to manufacture [`ListActivitiesInput`](crate::input::ListActivitiesInput) - pub fn builder() -> crate::input::list_activities_input::Builder { - crate::input::list_activities_input::Builder::default() - } - /// Creates a new `ListActivities` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for ListActivities { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_list_activities_error(response) - } else { - crate::operation_deser::parse_list_activities_response(response) - } - } -} - -/// Operation shape for `ListFollowers`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`list_followers`](crate::client::Client::list_followers). -/// -/// See [`crate::client::fluent_builders::ListFollowers`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct ListFollowers { - _private: (), -} -impl ListFollowers { - /// Creates a new builder-style object to manufacture [`ListFollowersInput`](crate::input::ListFollowersInput) - pub fn builder() -> crate::input::list_followers_input::Builder { - crate::input::list_followers_input::Builder::default() - } - /// Creates a new `ListFollowers` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for ListFollowers { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_list_followers_error(response) - } else { - crate::operation_deser::parse_list_followers_response(response) - } - } -} - -/// Operation shape for `ListFollowing`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`list_following`](crate::client::Client::list_following). -/// -/// See [`crate::client::fluent_builders::ListFollowing`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct ListFollowing { - _private: (), -} -impl ListFollowing { - /// Creates a new builder-style object to manufacture [`ListFollowingInput`](crate::input::ListFollowingInput) - pub fn builder() -> crate::input::list_following_input::Builder { - crate::input::list_following_input::Builder::default() - } - /// Creates a new `ListFollowing` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for ListFollowing { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_list_following_error(response) - } else { - crate::operation_deser::parse_list_following_response(response) - } - } -} - -/// Operation shape for `ListFriends`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`list_friends`](crate::client::Client::list_friends). -/// -/// See [`crate::client::fluent_builders::ListFriends`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct ListFriends { - _private: (), -} -impl ListFriends { - /// Creates a new builder-style object to manufacture [`ListFriendsInput`](crate::input::ListFriendsInput) - pub fn builder() -> crate::input::list_friends_input::Builder { - crate::input::list_friends_input::Builder::default() - } - /// Creates a new `ListFriends` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for ListFriends { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_list_friends_error(response) - } else { - crate::operation_deser::parse_list_friends_response(response) - } - } -} - -/// Operation shape for `ListMutualFriends`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`list_mutual_friends`](crate::client::Client::list_mutual_friends). -/// -/// See [`crate::client::fluent_builders::ListMutualFriends`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct ListMutualFriends { - _private: (), -} -impl ListMutualFriends { - /// Creates a new builder-style object to manufacture [`ListMutualFriendsInput`](crate::input::ListMutualFriendsInput) - pub fn builder() -> crate::input::list_mutual_friends_input::Builder { - crate::input::list_mutual_friends_input::Builder::default() - } - /// Creates a new `ListMutualFriends` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for ListMutualFriends { - type Output = std::result::Result< - crate::output::ListMutualFriendsOutput, - crate::error::ListMutualFriendsError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_list_mutual_friends_error(response) - } else { - crate::operation_deser::parse_list_mutual_friends_response(response) - } - } -} - -/// Operation shape for `ListRecentFollowers`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`list_recent_followers`](crate::client::Client::list_recent_followers). -/// -/// See [`crate::client::fluent_builders::ListRecentFollowers`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct ListRecentFollowers { - _private: (), -} -impl ListRecentFollowers { - /// Creates a new builder-style object to manufacture [`ListRecentFollowersInput`](crate::input::ListRecentFollowersInput) - pub fn builder() -> crate::input::list_recent_followers_input::Builder { - crate::input::list_recent_followers_input::Builder::default() - } - /// Creates a new `ListRecentFollowers` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for ListRecentFollowers { - type Output = std::result::Result< - crate::output::ListRecentFollowersOutput, - crate::error::ListRecentFollowersError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_list_recent_followers_error(response) - } else { - crate::operation_deser::parse_list_recent_followers_response(response) - } - } -} - -/// Operation shape for `MarkDeletion`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`mark_deletion`](crate::client::Client::mark_deletion). -/// -/// See [`crate::client::fluent_builders::MarkDeletion`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct MarkDeletion { - _private: (), -} -impl MarkDeletion { - /// Creates a new builder-style object to manufacture [`MarkDeletionInput`](crate::input::MarkDeletionInput) - pub fn builder() -> crate::input::mark_deletion_input::Builder { - crate::input::mark_deletion_input::Builder::default() - } - /// Creates a new `MarkDeletion` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for MarkDeletion { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_mark_deletion_error(response) - } else { - crate::operation_deser::parse_mark_deletion_response(response) - } - } -} - -/// Operation shape for `PrepareGameLink`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`prepare_game_link`](crate::client::Client::prepare_game_link). -/// -/// See [`crate::client::fluent_builders::PrepareGameLink`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct PrepareGameLink { - _private: (), -} -impl PrepareGameLink { - /// Creates a new builder-style object to manufacture [`PrepareGameLinkInput`](crate::input::PrepareGameLinkInput) - pub fn builder() -> crate::input::prepare_game_link_input::Builder { - crate::input::prepare_game_link_input::Builder::default() - } - /// Creates a new `PrepareGameLink` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for PrepareGameLink { - type Output = std::result::Result< - crate::output::PrepareGameLinkOutput, - crate::error::PrepareGameLinkError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_prepare_game_link_error(response) - } else { - crate::operation_deser::parse_prepare_game_link_response(response) - } - } -} - -/// Operation shape for `PrepareIdentityAvatarUpload`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`prepare_identity_avatar_upload`](crate::client::Client::prepare_identity_avatar_upload). -/// -/// See [`crate::client::fluent_builders::PrepareIdentityAvatarUpload`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct PrepareIdentityAvatarUpload { - _private: (), -} -impl PrepareIdentityAvatarUpload { - /// Creates a new builder-style object to manufacture [`PrepareIdentityAvatarUploadInput`](crate::input::PrepareIdentityAvatarUploadInput) - pub fn builder() -> crate::input::prepare_identity_avatar_upload_input::Builder { - crate::input::prepare_identity_avatar_upload_input::Builder::default() - } - /// Creates a new `PrepareIdentityAvatarUpload` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for PrepareIdentityAvatarUpload { - type Output = std::result::Result< - crate::output::PrepareIdentityAvatarUploadOutput, - crate::error::PrepareIdentityAvatarUploadError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_prepare_identity_avatar_upload_error(response) - } else { - crate::operation_deser::parse_prepare_identity_avatar_upload_response(response) - } - } -} - -/// Operation shape for `RecentFollowerIgnore`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`recent_follower_ignore`](crate::client::Client::recent_follower_ignore). -/// -/// See [`crate::client::fluent_builders::RecentFollowerIgnore`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct RecentFollowerIgnore { - _private: (), -} -impl RecentFollowerIgnore { - /// Creates a new builder-style object to manufacture [`RecentFollowerIgnoreInput`](crate::input::RecentFollowerIgnoreInput) - pub fn builder() -> crate::input::recent_follower_ignore_input::Builder { - crate::input::recent_follower_ignore_input::Builder::default() - } - /// Creates a new `RecentFollowerIgnore` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for RecentFollowerIgnore { - type Output = std::result::Result< - crate::output::RecentFollowerIgnoreOutput, - crate::error::RecentFollowerIgnoreError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_recent_follower_ignore_error(response) - } else { - crate::operation_deser::parse_recent_follower_ignore_response(response) - } - } -} - -/// Operation shape for `RemoveIdentityGameActivity`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`remove_identity_game_activity`](crate::client::Client::remove_identity_game_activity). -/// -/// See [`crate::client::fluent_builders::RemoveIdentityGameActivity`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct RemoveIdentityGameActivity { - _private: (), -} -impl RemoveIdentityGameActivity { - /// Creates a new builder-style object to manufacture [`RemoveIdentityGameActivityInput`](crate::input::RemoveIdentityGameActivityInput) - pub fn builder() -> crate::input::remove_identity_game_activity_input::Builder { - crate::input::remove_identity_game_activity_input::Builder::default() - } - /// Creates a new `RemoveIdentityGameActivity` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for RemoveIdentityGameActivity { - type Output = std::result::Result< - crate::output::RemoveIdentityGameActivityOutput, - crate::error::RemoveIdentityGameActivityError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_remove_identity_game_activity_error(response) - } else { - crate::operation_deser::parse_remove_identity_game_activity_response(response) - } - } -} - -/// Operation shape for `ReportIdentity`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`report_identity`](crate::client::Client::report_identity). -/// -/// See [`crate::client::fluent_builders::ReportIdentity`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct ReportIdentity { - _private: (), -} -impl ReportIdentity { - /// Creates a new builder-style object to manufacture [`ReportIdentityInput`](crate::input::ReportIdentityInput) - pub fn builder() -> crate::input::report_identity_input::Builder { - crate::input::report_identity_input::Builder::default() - } - /// Creates a new `ReportIdentity` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for ReportIdentity { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_report_identity_error(response) - } else { - crate::operation_deser::parse_report_identity_response(response) - } - } -} - -/// Operation shape for `SearchIdentities`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`search_identities`](crate::client::Client::search_identities). -/// -/// See [`crate::client::fluent_builders::SearchIdentities`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct SearchIdentities { - _private: (), -} -impl SearchIdentities { - /// Creates a new builder-style object to manufacture [`SearchIdentitiesInput`](crate::input::SearchIdentitiesInput) - pub fn builder() -> crate::input::search_identities_input::Builder { - crate::input::search_identities_input::Builder::default() - } - /// Creates a new `SearchIdentities` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for SearchIdentities { - type Output = std::result::Result< - crate::output::SearchIdentitiesOutput, - crate::error::SearchIdentitiesError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_search_identities_error(response) - } else { - crate::operation_deser::parse_search_identities_response(response) - } - } -} - -/// Operation shape for `SetIdentityGameActivity`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`set_identity_game_activity`](crate::client::Client::set_identity_game_activity). -/// -/// See [`crate::client::fluent_builders::SetIdentityGameActivity`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct SetIdentityGameActivity { - _private: (), -} -impl SetIdentityGameActivity { - /// Creates a new builder-style object to manufacture [`SetIdentityGameActivityInput`](crate::input::SetIdentityGameActivityInput) - pub fn builder() -> crate::input::set_identity_game_activity_input::Builder { - crate::input::set_identity_game_activity_input::Builder::default() - } - /// Creates a new `SetIdentityGameActivity` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for SetIdentityGameActivity { - type Output = std::result::Result< - crate::output::SetIdentityGameActivityOutput, - crate::error::SetIdentityGameActivityError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_set_identity_game_activity_error(response) - } else { - crate::operation_deser::parse_set_identity_game_activity_response(response) - } - } -} - -/// Operation shape for `SetupIdentity`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`setup_identity`](crate::client::Client::setup_identity). -/// -/// See [`crate::client::fluent_builders::SetupIdentity`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct SetupIdentity { - _private: (), -} -impl SetupIdentity { - /// Creates a new builder-style object to manufacture [`SetupIdentityInput`](crate::input::SetupIdentityInput) - pub fn builder() -> crate::input::setup_identity_input::Builder { - crate::input::setup_identity_input::Builder::default() - } - /// Creates a new `SetupIdentity` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for SetupIdentity { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_setup_identity_error(response) - } else { - crate::operation_deser::parse_setup_identity_response(response) - } - } -} - -/// Operation shape for `SignupForBeta`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`signup_for_beta`](crate::client::Client::signup_for_beta). -/// -/// See [`crate::client::fluent_builders::SignupForBeta`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct SignupForBeta { - _private: (), -} -impl SignupForBeta { - /// Creates a new builder-style object to manufacture [`SignupForBetaInput`](crate::input::SignupForBetaInput) - pub fn builder() -> crate::input::signup_for_beta_input::Builder { - crate::input::signup_for_beta_input::Builder::default() - } - /// Creates a new `SignupForBeta` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for SignupForBeta { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_signup_for_beta_error(response) - } else { - crate::operation_deser::parse_signup_for_beta_response(response) - } - } -} - -/// Operation shape for `UnfollowIdentity`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`unfollow_identity`](crate::client::Client::unfollow_identity). -/// -/// See [`crate::client::fluent_builders::UnfollowIdentity`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct UnfollowIdentity { - _private: (), -} -impl UnfollowIdentity { - /// Creates a new builder-style object to manufacture [`UnfollowIdentityInput`](crate::input::UnfollowIdentityInput) - pub fn builder() -> crate::input::unfollow_identity_input::Builder { - crate::input::unfollow_identity_input::Builder::default() - } - /// Creates a new `UnfollowIdentity` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for UnfollowIdentity { - type Output = std::result::Result< - crate::output::UnfollowIdentityOutput, - crate::error::UnfollowIdentityError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_unfollow_identity_error(response) - } else { - crate::operation_deser::parse_unfollow_identity_response(response) - } - } -} - -/// Operation shape for `UnmarkDeletion`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`unmark_deletion`](crate::client::Client::unmark_deletion). -/// -/// See [`crate::client::fluent_builders::UnmarkDeletion`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct UnmarkDeletion { - _private: (), -} -impl UnmarkDeletion { - /// Creates a new builder-style object to manufacture [`UnmarkDeletionInput`](crate::input::UnmarkDeletionInput) - pub fn builder() -> crate::input::unmark_deletion_input::Builder { - crate::input::unmark_deletion_input::Builder::default() - } - /// Creates a new `UnmarkDeletion` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for UnmarkDeletion { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_unmark_deletion_error(response) - } else { - crate::operation_deser::parse_unmark_deletion_response(response) - } - } -} - -/// Operation shape for `UpdateIdentityProfile`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`update_identity_profile`](crate::client::Client::update_identity_profile). -/// -/// See [`crate::client::fluent_builders::UpdateIdentityProfile`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct UpdateIdentityProfile { - _private: (), -} -impl UpdateIdentityProfile { - /// Creates a new builder-style object to manufacture [`UpdateIdentityProfileInput`](crate::input::UpdateIdentityProfileInput) - pub fn builder() -> crate::input::update_identity_profile_input::Builder { - crate::input::update_identity_profile_input::Builder::default() - } - /// Creates a new `UpdateIdentityProfile` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for UpdateIdentityProfile { - type Output = std::result::Result< - crate::output::UpdateIdentityProfileOutput, - crate::error::UpdateIdentityProfileError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_update_identity_profile_error(response) - } else { - crate::operation_deser::parse_update_identity_profile_response(response) - } - } -} - -/// Operation shape for `UpdateIdentityStatus`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`update_identity_status`](crate::client::Client::update_identity_status). -/// -/// See [`crate::client::fluent_builders::UpdateIdentityStatus`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct UpdateIdentityStatus { - _private: (), -} -impl UpdateIdentityStatus { - /// Creates a new builder-style object to manufacture [`UpdateIdentityStatusInput`](crate::input::UpdateIdentityStatusInput) - pub fn builder() -> crate::input::update_identity_status_input::Builder { - crate::input::update_identity_status_input::Builder::default() - } - /// Creates a new `UpdateIdentityStatus` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for UpdateIdentityStatus { - type Output = std::result::Result< - crate::output::UpdateIdentityStatusOutput, - crate::error::UpdateIdentityStatusError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_update_identity_status_error(response) - } else { - crate::operation_deser::parse_update_identity_status_response(response) - } - } -} - -/// Operation shape for `ValidateIdentityProfile`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`validate_identity_profile`](crate::client::Client::validate_identity_profile). -/// -/// See [`crate::client::fluent_builders::ValidateIdentityProfile`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct ValidateIdentityProfile { - _private: (), -} -impl ValidateIdentityProfile { - /// Creates a new builder-style object to manufacture [`ValidateIdentityProfileInput`](crate::input::ValidateIdentityProfileInput) - pub fn builder() -> crate::input::validate_identity_profile_input::Builder { - crate::input::validate_identity_profile_input::Builder::default() - } - /// Creates a new `ValidateIdentityProfile` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for ValidateIdentityProfile { - type Output = std::result::Result< - crate::output::ValidateIdentityProfileOutput, - crate::error::ValidateIdentityProfileError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_validate_identity_profile_error(response) - } else { - crate::operation_deser::parse_validate_identity_profile_response(response) - } - } -} - -/// Operation shape for `WatchEvents`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`watch_events`](crate::client::Client::watch_events). -/// -/// See [`crate::client::fluent_builders::WatchEvents`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct WatchEvents { - _private: (), -} -impl WatchEvents { - /// Creates a new builder-style object to manufacture [`WatchEventsInput`](crate::input::WatchEventsInput) - pub fn builder() -> crate::input::watch_events_input::Builder { - crate::input::watch_events_input::Builder::default() - } - /// Creates a new `WatchEvents` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for WatchEvents { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_watch_events_error(response) - } else { - crate::operation_deser::parse_watch_events_response(response) - } - } -} diff --git a/lib/smithy-output/api-identity/rust/rust/src/operation_deser.rs b/lib/smithy-output/api-identity/rust/rust/src/operation_deser.rs deleted file mode 100644 index 78814a8a8..000000000 --- a/lib/smithy-output/api-identity/rust/rust/src/operation_deser.rs +++ /dev/null @@ -1,4721 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[allow(clippy::unnecessary_wraps)] -pub fn parse_cancel_game_link_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::CancelGameLinkError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::CancelGameLinkError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::CancelGameLinkError { - meta: generic, - kind: crate::error::CancelGameLinkErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::CancelGameLinkError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::CancelGameLinkError { - meta: generic, - kind: crate::error::CancelGameLinkErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::CancelGameLinkError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::CancelGameLinkError { - meta: generic, - kind: crate::error::CancelGameLinkErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::CancelGameLinkError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::CancelGameLinkError { - meta: generic, - kind: crate::error::CancelGameLinkErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::CancelGameLinkError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::CancelGameLinkError { - meta: generic, - kind: crate::error::CancelGameLinkErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::CancelGameLinkError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::CancelGameLinkError { - meta: generic, - kind: crate::error::CancelGameLinkErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::CancelGameLinkError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::CancelGameLinkError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_cancel_game_link_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::cancel_game_link_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_complete_game_link_error( - response: &http::Response, -) -> std::result::Result -{ - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::CompleteGameLinkError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::CompleteGameLinkError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::CompleteGameLinkError { - meta: generic, - kind: crate::error::CompleteGameLinkErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::CompleteGameLinkError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::CompleteGameLinkError { - meta: generic, - kind: crate::error::CompleteGameLinkErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::CompleteGameLinkError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::CompleteGameLinkError { - meta: generic, - kind: crate::error::CompleteGameLinkErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::CompleteGameLinkError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::CompleteGameLinkError { - meta: generic, - kind: crate::error::CompleteGameLinkErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::CompleteGameLinkError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::CompleteGameLinkError { - meta: generic, - kind: crate::error::CompleteGameLinkErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::CompleteGameLinkError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::CompleteGameLinkError { - meta: generic, - kind: crate::error::CompleteGameLinkErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::CompleteGameLinkError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::CompleteGameLinkError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_complete_game_link_response( - response: &http::Response, -) -> std::result::Result -{ - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::complete_game_link_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_complete_identity_avatar_upload_error( - response: &http::Response, -) -> std::result::Result< - crate::output::CompleteIdentityAvatarUploadOutput, - crate::error::CompleteIdentityAvatarUploadError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::CompleteIdentityAvatarUploadError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => { - return Err(crate::error::CompleteIdentityAvatarUploadError::unhandled( - generic, - )) - } - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::CompleteIdentityAvatarUploadError { - meta: generic, - kind: crate::error::CompleteIdentityAvatarUploadErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::CompleteIdentityAvatarUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::CompleteIdentityAvatarUploadError { - meta: generic, - kind: crate::error::CompleteIdentityAvatarUploadErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::CompleteIdentityAvatarUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::CompleteIdentityAvatarUploadError { - meta: generic, - kind: crate::error::CompleteIdentityAvatarUploadErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::CompleteIdentityAvatarUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::CompleteIdentityAvatarUploadError { - meta: generic, - kind: crate::error::CompleteIdentityAvatarUploadErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::CompleteIdentityAvatarUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::CompleteIdentityAvatarUploadError { - meta: generic, - kind: crate::error::CompleteIdentityAvatarUploadErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::CompleteIdentityAvatarUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::CompleteIdentityAvatarUploadError { - meta: generic, - kind: crate::error::CompleteIdentityAvatarUploadErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::CompleteIdentityAvatarUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::CompleteIdentityAvatarUploadError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_complete_identity_avatar_upload_response( - response: &http::Response, -) -> std::result::Result< - crate::output::CompleteIdentityAvatarUploadOutput, - crate::error::CompleteIdentityAvatarUploadError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::complete_identity_avatar_upload_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_follow_identity_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::FollowIdentityError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::FollowIdentityError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::FollowIdentityError { - meta: generic, - kind: crate::error::FollowIdentityErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::FollowIdentityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::FollowIdentityError { - meta: generic, - kind: crate::error::FollowIdentityErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::FollowIdentityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::FollowIdentityError { - meta: generic, - kind: crate::error::FollowIdentityErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::FollowIdentityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::FollowIdentityError { - meta: generic, - kind: crate::error::FollowIdentityErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::FollowIdentityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::FollowIdentityError { - meta: generic, - kind: crate::error::FollowIdentityErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::FollowIdentityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::FollowIdentityError { - meta: generic, - kind: crate::error::FollowIdentityErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::FollowIdentityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::FollowIdentityError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_follow_identity_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::follow_identity_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_game_link_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GetGameLinkError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::GetGameLinkError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GetGameLinkError { - meta: generic, - kind: crate::error::GetGameLinkErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetGameLinkError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GetGameLinkError { - meta: generic, - kind: crate::error::GetGameLinkErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameLinkError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GetGameLinkError { - meta: generic, - kind: crate::error::GetGameLinkErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameLinkError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GetGameLinkError { - meta: generic, - kind: crate::error::GetGameLinkErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameLinkError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GetGameLinkError { - meta: generic, - kind: crate::error::GetGameLinkErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameLinkError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GetGameLinkError { - meta: generic, - kind: crate::error::GetGameLinkErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameLinkError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GetGameLinkError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_game_link_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::get_game_link_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_get_game_link( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetGameLinkError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_identity_handles_error( - response: &http::Response, -) -> std::result::Result< - crate::output::GetIdentityHandlesOutput, - crate::error::GetIdentityHandlesError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GetIdentityHandlesError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::GetIdentityHandlesError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GetIdentityHandlesError { - meta: generic, - kind: crate::error::GetIdentityHandlesErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetIdentityHandlesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GetIdentityHandlesError { - meta: generic, - kind: crate::error::GetIdentityHandlesErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetIdentityHandlesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GetIdentityHandlesError { - meta: generic, - kind: crate::error::GetIdentityHandlesErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetIdentityHandlesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GetIdentityHandlesError { - meta: generic, - kind: crate::error::GetIdentityHandlesErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetIdentityHandlesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GetIdentityHandlesError { - meta: generic, - kind: crate::error::GetIdentityHandlesErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetIdentityHandlesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GetIdentityHandlesError { - meta: generic, - kind: crate::error::GetIdentityHandlesErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetIdentityHandlesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GetIdentityHandlesError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_identity_handles_response( - response: &http::Response, -) -> std::result::Result< - crate::output::GetIdentityHandlesOutput, - crate::error::GetIdentityHandlesError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::get_identity_handles_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_get_identity_handles( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetIdentityHandlesError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_identity_profile_error( - response: &http::Response, -) -> std::result::Result< - crate::output::GetIdentityProfileOutput, - crate::error::GetIdentityProfileError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GetIdentityProfileError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::GetIdentityProfileError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GetIdentityProfileError { - meta: generic, - kind: crate::error::GetIdentityProfileErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetIdentityProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GetIdentityProfileError { - meta: generic, - kind: crate::error::GetIdentityProfileErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetIdentityProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GetIdentityProfileError { - meta: generic, - kind: crate::error::GetIdentityProfileErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetIdentityProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GetIdentityProfileError { - meta: generic, - kind: crate::error::GetIdentityProfileErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetIdentityProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GetIdentityProfileError { - meta: generic, - kind: crate::error::GetIdentityProfileErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetIdentityProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GetIdentityProfileError { - meta: generic, - kind: crate::error::GetIdentityProfileErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetIdentityProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GetIdentityProfileError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_identity_profile_response( - response: &http::Response, -) -> std::result::Result< - crate::output::GetIdentityProfileOutput, - crate::error::GetIdentityProfileError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::get_identity_profile_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_get_identity_profile( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetIdentityProfileError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_identity_self_profile_error( - response: &http::Response, -) -> std::result::Result< - crate::output::GetIdentitySelfProfileOutput, - crate::error::GetIdentitySelfProfileError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GetIdentitySelfProfileError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => { - return Err(crate::error::GetIdentitySelfProfileError::unhandled( - generic, - )) - } - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GetIdentitySelfProfileError { - meta: generic, - kind: crate::error::GetIdentitySelfProfileErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetIdentitySelfProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GetIdentitySelfProfileError { - meta: generic, - kind: crate::error::GetIdentitySelfProfileErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetIdentitySelfProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GetIdentitySelfProfileError { - meta: generic, - kind: crate::error::GetIdentitySelfProfileErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetIdentitySelfProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GetIdentitySelfProfileError { - meta: generic, - kind: crate::error::GetIdentitySelfProfileErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetIdentitySelfProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GetIdentitySelfProfileError { - meta: generic, - kind: crate::error::GetIdentitySelfProfileErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetIdentitySelfProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GetIdentitySelfProfileError { - meta: generic, - kind: crate::error::GetIdentitySelfProfileErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetIdentitySelfProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GetIdentitySelfProfileError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_identity_self_profile_response( - response: &http::Response, -) -> std::result::Result< - crate::output::GetIdentitySelfProfileOutput, - crate::error::GetIdentitySelfProfileError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::get_identity_self_profile_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_get_identity_self_profile( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetIdentitySelfProfileError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_identity_summaries_error( - response: &http::Response, -) -> std::result::Result< - crate::output::GetIdentitySummariesOutput, - crate::error::GetIdentitySummariesError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GetIdentitySummariesError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::GetIdentitySummariesError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GetIdentitySummariesError { - meta: generic, - kind: crate::error::GetIdentitySummariesErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetIdentitySummariesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GetIdentitySummariesError { - meta: generic, - kind: crate::error::GetIdentitySummariesErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetIdentitySummariesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GetIdentitySummariesError { - meta: generic, - kind: crate::error::GetIdentitySummariesErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetIdentitySummariesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GetIdentitySummariesError { - meta: generic, - kind: crate::error::GetIdentitySummariesErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetIdentitySummariesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GetIdentitySummariesError { - meta: generic, - kind: crate::error::GetIdentitySummariesErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetIdentitySummariesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GetIdentitySummariesError { - meta: generic, - kind: crate::error::GetIdentitySummariesErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetIdentitySummariesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GetIdentitySummariesError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_identity_summaries_response( - response: &http::Response, -) -> std::result::Result< - crate::output::GetIdentitySummariesOutput, - crate::error::GetIdentitySummariesError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::get_identity_summaries_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_get_identity_summaries( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetIdentitySummariesError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_list_activities_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::ListActivitiesError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::ListActivitiesError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::ListActivitiesError { - meta: generic, - kind: crate::error::ListActivitiesErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ListActivitiesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::ListActivitiesError { - meta: generic, - kind: crate::error::ListActivitiesErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListActivitiesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::ListActivitiesError { - meta: generic, - kind: crate::error::ListActivitiesErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListActivitiesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::ListActivitiesError { - meta: generic, - kind: crate::error::ListActivitiesErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListActivitiesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::ListActivitiesError { - meta: generic, - kind: crate::error::ListActivitiesErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListActivitiesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::ListActivitiesError { - meta: generic, - kind: crate::error::ListActivitiesErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListActivitiesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::ListActivitiesError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_list_activities_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::list_activities_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_list_activities( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ListActivitiesError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_list_followers_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::ListFollowersError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::ListFollowersError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::ListFollowersError { - meta: generic, - kind: crate::error::ListFollowersErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ListFollowersError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::ListFollowersError { - meta: generic, - kind: crate::error::ListFollowersErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListFollowersError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::ListFollowersError { - meta: generic, - kind: crate::error::ListFollowersErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListFollowersError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::ListFollowersError { - meta: generic, - kind: crate::error::ListFollowersErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListFollowersError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::ListFollowersError { - meta: generic, - kind: crate::error::ListFollowersErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListFollowersError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::ListFollowersError { - meta: generic, - kind: crate::error::ListFollowersErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListFollowersError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::ListFollowersError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_list_followers_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::list_followers_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_list_followers( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ListFollowersError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_list_following_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::ListFollowingError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::ListFollowingError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::ListFollowingError { - meta: generic, - kind: crate::error::ListFollowingErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ListFollowingError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::ListFollowingError { - meta: generic, - kind: crate::error::ListFollowingErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListFollowingError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::ListFollowingError { - meta: generic, - kind: crate::error::ListFollowingErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListFollowingError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::ListFollowingError { - meta: generic, - kind: crate::error::ListFollowingErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListFollowingError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::ListFollowingError { - meta: generic, - kind: crate::error::ListFollowingErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListFollowingError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::ListFollowingError { - meta: generic, - kind: crate::error::ListFollowingErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListFollowingError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::ListFollowingError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_list_following_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::list_following_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_list_following( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ListFollowingError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_list_friends_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::ListFriendsError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::ListFriendsError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::ListFriendsError { - meta: generic, - kind: crate::error::ListFriendsErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ListFriendsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::ListFriendsError { - meta: generic, - kind: crate::error::ListFriendsErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListFriendsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::ListFriendsError { - meta: generic, - kind: crate::error::ListFriendsErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListFriendsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::ListFriendsError { - meta: generic, - kind: crate::error::ListFriendsErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListFriendsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::ListFriendsError { - meta: generic, - kind: crate::error::ListFriendsErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListFriendsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::ListFriendsError { - meta: generic, - kind: crate::error::ListFriendsErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListFriendsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::ListFriendsError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_list_friends_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::list_friends_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_list_friends( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ListFriendsError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_list_mutual_friends_error( - response: &http::Response, -) -> std::result::Result -{ - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::ListMutualFriendsError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::ListMutualFriendsError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::ListMutualFriendsError { - meta: generic, - kind: crate::error::ListMutualFriendsErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ListMutualFriendsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::ListMutualFriendsError { - meta: generic, - kind: crate::error::ListMutualFriendsErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListMutualFriendsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::ListMutualFriendsError { - meta: generic, - kind: crate::error::ListMutualFriendsErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListMutualFriendsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::ListMutualFriendsError { - meta: generic, - kind: crate::error::ListMutualFriendsErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListMutualFriendsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::ListMutualFriendsError { - meta: generic, - kind: crate::error::ListMutualFriendsErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListMutualFriendsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::ListMutualFriendsError { - meta: generic, - kind: crate::error::ListMutualFriendsErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListMutualFriendsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::ListMutualFriendsError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_list_mutual_friends_response( - response: &http::Response, -) -> std::result::Result -{ - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::list_mutual_friends_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_list_mutual_friends( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ListMutualFriendsError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_list_recent_followers_error( - response: &http::Response, -) -> std::result::Result< - crate::output::ListRecentFollowersOutput, - crate::error::ListRecentFollowersError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::ListRecentFollowersError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::ListRecentFollowersError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::ListRecentFollowersError { - meta: generic, - kind: crate::error::ListRecentFollowersErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ListRecentFollowersError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::ListRecentFollowersError { - meta: generic, - kind: crate::error::ListRecentFollowersErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListRecentFollowersError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::ListRecentFollowersError { - meta: generic, - kind: crate::error::ListRecentFollowersErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListRecentFollowersError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::ListRecentFollowersError { - meta: generic, - kind: crate::error::ListRecentFollowersErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListRecentFollowersError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::ListRecentFollowersError { - meta: generic, - kind: crate::error::ListRecentFollowersErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListRecentFollowersError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::ListRecentFollowersError { - meta: generic, - kind: crate::error::ListRecentFollowersErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListRecentFollowersError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::ListRecentFollowersError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_list_recent_followers_response( - response: &http::Response, -) -> std::result::Result< - crate::output::ListRecentFollowersOutput, - crate::error::ListRecentFollowersError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::list_recent_followers_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_list_recent_followers( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ListRecentFollowersError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_mark_deletion_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::MarkDeletionError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::MarkDeletionError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::MarkDeletionError { - meta: generic, - kind: crate::error::MarkDeletionErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::MarkDeletionError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::MarkDeletionError { - meta: generic, - kind: crate::error::MarkDeletionErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::MarkDeletionError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::MarkDeletionError { - meta: generic, - kind: crate::error::MarkDeletionErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::MarkDeletionError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::MarkDeletionError { - meta: generic, - kind: crate::error::MarkDeletionErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::MarkDeletionError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::MarkDeletionError { - meta: generic, - kind: crate::error::MarkDeletionErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::MarkDeletionError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::MarkDeletionError { - meta: generic, - kind: crate::error::MarkDeletionErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::MarkDeletionError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::MarkDeletionError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_mark_deletion_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::mark_deletion_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_prepare_game_link_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::PrepareGameLinkError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::PrepareGameLinkError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::PrepareGameLinkError { - meta: generic, - kind: crate::error::PrepareGameLinkErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::PrepareGameLinkError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::PrepareGameLinkError { - meta: generic, - kind: crate::error::PrepareGameLinkErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::PrepareGameLinkError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::PrepareGameLinkError { - meta: generic, - kind: crate::error::PrepareGameLinkErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::PrepareGameLinkError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::PrepareGameLinkError { - meta: generic, - kind: crate::error::PrepareGameLinkErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::PrepareGameLinkError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::PrepareGameLinkError { - meta: generic, - kind: crate::error::PrepareGameLinkErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::PrepareGameLinkError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::PrepareGameLinkError { - meta: generic, - kind: crate::error::PrepareGameLinkErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::PrepareGameLinkError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::PrepareGameLinkError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_prepare_game_link_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::prepare_game_link_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_prepare_game_link( - response.body().as_ref(), - output, - ) - .map_err(crate::error::PrepareGameLinkError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_prepare_identity_avatar_upload_error( - response: &http::Response, -) -> std::result::Result< - crate::output::PrepareIdentityAvatarUploadOutput, - crate::error::PrepareIdentityAvatarUploadError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::PrepareIdentityAvatarUploadError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => { - return Err(crate::error::PrepareIdentityAvatarUploadError::unhandled( - generic, - )) - } - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::PrepareIdentityAvatarUploadError { - meta: generic, - kind: crate::error::PrepareIdentityAvatarUploadErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::PrepareIdentityAvatarUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::PrepareIdentityAvatarUploadError { - meta: generic, - kind: crate::error::PrepareIdentityAvatarUploadErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::PrepareIdentityAvatarUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::PrepareIdentityAvatarUploadError { - meta: generic, - kind: crate::error::PrepareIdentityAvatarUploadErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::PrepareIdentityAvatarUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::PrepareIdentityAvatarUploadError { - meta: generic, - kind: crate::error::PrepareIdentityAvatarUploadErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::PrepareIdentityAvatarUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::PrepareIdentityAvatarUploadError { - meta: generic, - kind: crate::error::PrepareIdentityAvatarUploadErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::PrepareIdentityAvatarUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::PrepareIdentityAvatarUploadError { - meta: generic, - kind: crate::error::PrepareIdentityAvatarUploadErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::PrepareIdentityAvatarUploadError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::PrepareIdentityAvatarUploadError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_prepare_identity_avatar_upload_response( - response: &http::Response, -) -> std::result::Result< - crate::output::PrepareIdentityAvatarUploadOutput, - crate::error::PrepareIdentityAvatarUploadError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::prepare_identity_avatar_upload_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_prepare_identity_avatar_upload( - response.body().as_ref(), - output, - ) - .map_err(crate::error::PrepareIdentityAvatarUploadError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_recent_follower_ignore_error( - response: &http::Response, -) -> std::result::Result< - crate::output::RecentFollowerIgnoreOutput, - crate::error::RecentFollowerIgnoreError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::RecentFollowerIgnoreError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::RecentFollowerIgnoreError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::RecentFollowerIgnoreError { - meta: generic, - kind: crate::error::RecentFollowerIgnoreErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::RecentFollowerIgnoreError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::RecentFollowerIgnoreError { - meta: generic, - kind: crate::error::RecentFollowerIgnoreErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::RecentFollowerIgnoreError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::RecentFollowerIgnoreError { - meta: generic, - kind: crate::error::RecentFollowerIgnoreErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::RecentFollowerIgnoreError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::RecentFollowerIgnoreError { - meta: generic, - kind: crate::error::RecentFollowerIgnoreErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::RecentFollowerIgnoreError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::RecentFollowerIgnoreError { - meta: generic, - kind: crate::error::RecentFollowerIgnoreErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::RecentFollowerIgnoreError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::RecentFollowerIgnoreError { - meta: generic, - kind: crate::error::RecentFollowerIgnoreErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::RecentFollowerIgnoreError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::RecentFollowerIgnoreError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_recent_follower_ignore_response( - response: &http::Response, -) -> std::result::Result< - crate::output::RecentFollowerIgnoreOutput, - crate::error::RecentFollowerIgnoreError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::recent_follower_ignore_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_remove_identity_game_activity_error( - response: &http::Response, -) -> std::result::Result< - crate::output::RemoveIdentityGameActivityOutput, - crate::error::RemoveIdentityGameActivityError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::RemoveIdentityGameActivityError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => { - return Err(crate::error::RemoveIdentityGameActivityError::unhandled( - generic, - )) - } - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::RemoveIdentityGameActivityError { - meta: generic, - kind: crate::error::RemoveIdentityGameActivityErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::RemoveIdentityGameActivityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::RemoveIdentityGameActivityError { - meta: generic, - kind: crate::error::RemoveIdentityGameActivityErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::RemoveIdentityGameActivityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::RemoveIdentityGameActivityError { - meta: generic, - kind: crate::error::RemoveIdentityGameActivityErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::RemoveIdentityGameActivityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::RemoveIdentityGameActivityError { - meta: generic, - kind: crate::error::RemoveIdentityGameActivityErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::RemoveIdentityGameActivityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::RemoveIdentityGameActivityError { - meta: generic, - kind: crate::error::RemoveIdentityGameActivityErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::RemoveIdentityGameActivityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::RemoveIdentityGameActivityError { - meta: generic, - kind: crate::error::RemoveIdentityGameActivityErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::RemoveIdentityGameActivityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::RemoveIdentityGameActivityError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_remove_identity_game_activity_response( - response: &http::Response, -) -> std::result::Result< - crate::output::RemoveIdentityGameActivityOutput, - crate::error::RemoveIdentityGameActivityError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::remove_identity_game_activity_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_report_identity_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::ReportIdentityError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::ReportIdentityError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::ReportIdentityError { - meta: generic, - kind: crate::error::ReportIdentityErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ReportIdentityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::ReportIdentityError { - meta: generic, - kind: crate::error::ReportIdentityErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::ReportIdentityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::ReportIdentityError { - meta: generic, - kind: crate::error::ReportIdentityErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::ReportIdentityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::ReportIdentityError { - meta: generic, - kind: crate::error::ReportIdentityErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::ReportIdentityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::ReportIdentityError { - meta: generic, - kind: crate::error::ReportIdentityErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::ReportIdentityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::ReportIdentityError { - meta: generic, - kind: crate::error::ReportIdentityErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::ReportIdentityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::ReportIdentityError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_report_identity_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::report_identity_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_search_identities_error( - response: &http::Response, -) -> std::result::Result -{ - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::SearchIdentitiesError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::SearchIdentitiesError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::SearchIdentitiesError { - meta: generic, - kind: crate::error::SearchIdentitiesErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::SearchIdentitiesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::SearchIdentitiesError { - meta: generic, - kind: crate::error::SearchIdentitiesErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::SearchIdentitiesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::SearchIdentitiesError { - meta: generic, - kind: crate::error::SearchIdentitiesErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::SearchIdentitiesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::SearchIdentitiesError { - meta: generic, - kind: crate::error::SearchIdentitiesErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::SearchIdentitiesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::SearchIdentitiesError { - meta: generic, - kind: crate::error::SearchIdentitiesErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::SearchIdentitiesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::SearchIdentitiesError { - meta: generic, - kind: crate::error::SearchIdentitiesErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::SearchIdentitiesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::SearchIdentitiesError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_search_identities_response( - response: &http::Response, -) -> std::result::Result -{ - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::search_identities_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_search_identities( - response.body().as_ref(), - output, - ) - .map_err(crate::error::SearchIdentitiesError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_set_identity_game_activity_error( - response: &http::Response, -) -> std::result::Result< - crate::output::SetIdentityGameActivityOutput, - crate::error::SetIdentityGameActivityError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::SetIdentityGameActivityError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => { - return Err(crate::error::SetIdentityGameActivityError::unhandled( - generic, - )) - } - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::SetIdentityGameActivityError { - meta: generic, - kind: crate::error::SetIdentityGameActivityErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::SetIdentityGameActivityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::SetIdentityGameActivityError { - meta: generic, - kind: crate::error::SetIdentityGameActivityErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetIdentityGameActivityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::SetIdentityGameActivityError { - meta: generic, - kind: crate::error::SetIdentityGameActivityErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetIdentityGameActivityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::SetIdentityGameActivityError { - meta: generic, - kind: crate::error::SetIdentityGameActivityErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetIdentityGameActivityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::SetIdentityGameActivityError { - meta: generic, - kind: crate::error::SetIdentityGameActivityErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetIdentityGameActivityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::SetIdentityGameActivityError { - meta: generic, - kind: crate::error::SetIdentityGameActivityErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetIdentityGameActivityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::SetIdentityGameActivityError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_set_identity_game_activity_response( - response: &http::Response, -) -> std::result::Result< - crate::output::SetIdentityGameActivityOutput, - crate::error::SetIdentityGameActivityError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::set_identity_game_activity_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_setup_identity_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::SetupIdentityError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::SetupIdentityError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::SetupIdentityError { - meta: generic, - kind: crate::error::SetupIdentityErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::SetupIdentityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::SetupIdentityError { - meta: generic, - kind: crate::error::SetupIdentityErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetupIdentityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::SetupIdentityError { - meta: generic, - kind: crate::error::SetupIdentityErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetupIdentityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::SetupIdentityError { - meta: generic, - kind: crate::error::SetupIdentityErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetupIdentityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::SetupIdentityError { - meta: generic, - kind: crate::error::SetupIdentityErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetupIdentityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::SetupIdentityError { - meta: generic, - kind: crate::error::SetupIdentityErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetupIdentityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::SetupIdentityError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_setup_identity_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::setup_identity_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_setup_identity( - response.body().as_ref(), - output, - ) - .map_err(crate::error::SetupIdentityError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_signup_for_beta_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::SignupForBetaError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::SignupForBetaError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::SignupForBetaError { - meta: generic, - kind: crate::error::SignupForBetaErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::SignupForBetaError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::SignupForBetaError { - meta: generic, - kind: crate::error::SignupForBetaErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::SignupForBetaError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::SignupForBetaError { - meta: generic, - kind: crate::error::SignupForBetaErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::SignupForBetaError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::SignupForBetaError { - meta: generic, - kind: crate::error::SignupForBetaErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::SignupForBetaError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::SignupForBetaError { - meta: generic, - kind: crate::error::SignupForBetaErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::SignupForBetaError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::SignupForBetaError { - meta: generic, - kind: crate::error::SignupForBetaErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::SignupForBetaError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::SignupForBetaError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_signup_for_beta_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::signup_for_beta_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_unfollow_identity_error( - response: &http::Response, -) -> std::result::Result -{ - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::UnfollowIdentityError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::UnfollowIdentityError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::UnfollowIdentityError { - meta: generic, - kind: crate::error::UnfollowIdentityErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::UnfollowIdentityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::UnfollowIdentityError { - meta: generic, - kind: crate::error::UnfollowIdentityErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::UnfollowIdentityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::UnfollowIdentityError { - meta: generic, - kind: crate::error::UnfollowIdentityErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::UnfollowIdentityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::UnfollowIdentityError { - meta: generic, - kind: crate::error::UnfollowIdentityErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::UnfollowIdentityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::UnfollowIdentityError { - meta: generic, - kind: crate::error::UnfollowIdentityErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::UnfollowIdentityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::UnfollowIdentityError { - meta: generic, - kind: crate::error::UnfollowIdentityErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::UnfollowIdentityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::UnfollowIdentityError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_unfollow_identity_response( - response: &http::Response, -) -> std::result::Result -{ - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::unfollow_identity_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_unmark_deletion_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::UnmarkDeletionError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::UnmarkDeletionError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::UnmarkDeletionError { - meta: generic, - kind: crate::error::UnmarkDeletionErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::UnmarkDeletionError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::UnmarkDeletionError { - meta: generic, - kind: crate::error::UnmarkDeletionErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::UnmarkDeletionError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::UnmarkDeletionError { - meta: generic, - kind: crate::error::UnmarkDeletionErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::UnmarkDeletionError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::UnmarkDeletionError { - meta: generic, - kind: crate::error::UnmarkDeletionErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::UnmarkDeletionError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::UnmarkDeletionError { - meta: generic, - kind: crate::error::UnmarkDeletionErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::UnmarkDeletionError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::UnmarkDeletionError { - meta: generic, - kind: crate::error::UnmarkDeletionErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::UnmarkDeletionError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::UnmarkDeletionError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_unmark_deletion_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::unmark_deletion_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_update_identity_profile_error( - response: &http::Response, -) -> std::result::Result< - crate::output::UpdateIdentityProfileOutput, - crate::error::UpdateIdentityProfileError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::UpdateIdentityProfileError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::UpdateIdentityProfileError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::UpdateIdentityProfileError { - meta: generic, - kind: crate::error::UpdateIdentityProfileErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::UpdateIdentityProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::UpdateIdentityProfileError { - meta: generic, - kind: crate::error::UpdateIdentityProfileErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateIdentityProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::UpdateIdentityProfileError { - meta: generic, - kind: crate::error::UpdateIdentityProfileErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateIdentityProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::UpdateIdentityProfileError { - meta: generic, - kind: crate::error::UpdateIdentityProfileErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateIdentityProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::UpdateIdentityProfileError { - meta: generic, - kind: crate::error::UpdateIdentityProfileErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateIdentityProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::UpdateIdentityProfileError { - meta: generic, - kind: crate::error::UpdateIdentityProfileErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateIdentityProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::UpdateIdentityProfileError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_update_identity_profile_response( - response: &http::Response, -) -> std::result::Result< - crate::output::UpdateIdentityProfileOutput, - crate::error::UpdateIdentityProfileError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::update_identity_profile_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_update_identity_status_error( - response: &http::Response, -) -> std::result::Result< - crate::output::UpdateIdentityStatusOutput, - crate::error::UpdateIdentityStatusError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::UpdateIdentityStatusError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::UpdateIdentityStatusError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::UpdateIdentityStatusError { - meta: generic, - kind: crate::error::UpdateIdentityStatusErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::UpdateIdentityStatusError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::UpdateIdentityStatusError { - meta: generic, - kind: crate::error::UpdateIdentityStatusErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateIdentityStatusError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::UpdateIdentityStatusError { - meta: generic, - kind: crate::error::UpdateIdentityStatusErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateIdentityStatusError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::UpdateIdentityStatusError { - meta: generic, - kind: crate::error::UpdateIdentityStatusErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateIdentityStatusError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::UpdateIdentityStatusError { - meta: generic, - kind: crate::error::UpdateIdentityStatusErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateIdentityStatusError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::UpdateIdentityStatusError { - meta: generic, - kind: crate::error::UpdateIdentityStatusErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateIdentityStatusError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::UpdateIdentityStatusError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_update_identity_status_response( - response: &http::Response, -) -> std::result::Result< - crate::output::UpdateIdentityStatusOutput, - crate::error::UpdateIdentityStatusError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::update_identity_status_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_validate_identity_profile_error( - response: &http::Response, -) -> std::result::Result< - crate::output::ValidateIdentityProfileOutput, - crate::error::ValidateIdentityProfileError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::ValidateIdentityProfileError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => { - return Err(crate::error::ValidateIdentityProfileError::unhandled( - generic, - )) - } - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::ValidateIdentityProfileError { - meta: generic, - kind: crate::error::ValidateIdentityProfileErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ValidateIdentityProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::ValidateIdentityProfileError { - meta: generic, - kind: crate::error::ValidateIdentityProfileErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateIdentityProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::ValidateIdentityProfileError { - meta: generic, - kind: crate::error::ValidateIdentityProfileErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateIdentityProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::ValidateIdentityProfileError { - meta: generic, - kind: crate::error::ValidateIdentityProfileErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateIdentityProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::ValidateIdentityProfileError { - meta: generic, - kind: crate::error::ValidateIdentityProfileErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateIdentityProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::ValidateIdentityProfileError { - meta: generic, - kind: crate::error::ValidateIdentityProfileErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateIdentityProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::ValidateIdentityProfileError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_validate_identity_profile_response( - response: &http::Response, -) -> std::result::Result< - crate::output::ValidateIdentityProfileOutput, - crate::error::ValidateIdentityProfileError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::validate_identity_profile_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_validate_identity_profile( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ValidateIdentityProfileError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_watch_events_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::WatchEventsError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::WatchEventsError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::WatchEventsError { - meta: generic, - kind: crate::error::WatchEventsErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::WatchEventsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::WatchEventsError { - meta: generic, - kind: crate::error::WatchEventsErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::WatchEventsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::WatchEventsError { - meta: generic, - kind: crate::error::WatchEventsErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::WatchEventsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::WatchEventsError { - meta: generic, - kind: crate::error::WatchEventsErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::WatchEventsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::WatchEventsError { - meta: generic, - kind: crate::error::WatchEventsErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::WatchEventsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::WatchEventsError { - meta: generic, - kind: crate::error::WatchEventsErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::WatchEventsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::WatchEventsError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_watch_events_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::watch_events_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_watch_events( - response.body().as_ref(), - output, - ) - .map_err(crate::error::WatchEventsError::unhandled)?; - output.build() - }) -} diff --git a/lib/smithy-output/api-identity/rust/rust/src/operation_ser.rs b/lib/smithy-output/api-identity/rust/rust/src/operation_ser.rs deleted file mode 100644 index 92dc5c22a..000000000 --- a/lib/smithy-output/api-identity/rust/rust/src/operation_ser.rs +++ /dev/null @@ -1,115 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub fn serialize_operation_crate_operation_cancel_game_link( - input: &crate::input::CancelGameLinkInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_cancel_game_link_input(&mut object, input)?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_complete_game_link( - input: &crate::input::CompleteGameLinkInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_complete_game_link_input(&mut object, input)?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_prepare_identity_avatar_upload( - input: &crate::input::PrepareIdentityAvatarUploadInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_prepare_identity_avatar_upload_input( - &mut object, - input, - )?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_report_identity( - input: &crate::input::ReportIdentityInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_report_identity_input(&mut object, input)?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_set_identity_game_activity( - input: &crate::input::SetIdentityGameActivityInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_set_identity_game_activity_input( - &mut object, - input, - )?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_setup_identity( - input: &crate::input::SetupIdentityInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_setup_identity_input(&mut object, input)?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_signup_for_beta( - input: &crate::input::SignupForBetaInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_signup_for_beta_input(&mut object, input)?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_update_identity_profile( - input: &crate::input::UpdateIdentityProfileInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_update_identity_profile_input( - &mut object, - input, - )?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_update_identity_status( - input: &crate::input::UpdateIdentityStatusInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_update_identity_status_input( - &mut object, - input, - )?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_validate_identity_profile( - input: &crate::input::ValidateIdentityProfileInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_validate_identity_profile_input( - &mut object, - input, - )?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} diff --git a/lib/smithy-output/api-identity/rust/rust/src/output.rs b/lib/smithy-output/api-identity/rust/rust/src/output.rs deleted file mode 100644 index c04b5c583..000000000 --- a/lib/smithy-output/api-identity/rust/rust/src/output.rs +++ /dev/null @@ -1,2069 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ListActivitiesOutput { - /// A list of identity handles. - pub identities: std::option::Option>, - /// A list of game summaries. - pub games: std::option::Option>, - /// A list of party summaries. - pub parties: std::option::Option>, - /// A list of group summaries. - pub suggested_groups: std::option::Option>, - /// A list of identity handles. - pub suggested_players: std::option::Option>, - /// Provided by watchable endpoints used in blocking loops. - pub watch: std::option::Option, -} -impl ListActivitiesOutput { - /// A list of identity handles. - pub fn identities(&self) -> std::option::Option<&[crate::model::IdentityHandle]> { - self.identities.as_deref() - } - /// A list of game summaries. - pub fn games(&self) -> std::option::Option<&[crate::model::GameSummary]> { - self.games.as_deref() - } - /// A list of party summaries. - pub fn parties(&self) -> std::option::Option<&[crate::model::PartySummary]> { - self.parties.as_deref() - } - /// A list of group summaries. - pub fn suggested_groups(&self) -> std::option::Option<&[crate::model::GroupSummary]> { - self.suggested_groups.as_deref() - } - /// A list of identity handles. - pub fn suggested_players(&self) -> std::option::Option<&[crate::model::IdentityHandle]> { - self.suggested_players.as_deref() - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(&self) -> std::option::Option<&crate::model::WatchResponse> { - self.watch.as_ref() - } -} -impl std::fmt::Debug for ListActivitiesOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ListActivitiesOutput"); - formatter.field("identities", &self.identities); - formatter.field("games", &self.games); - formatter.field("parties", &self.parties); - formatter.field("suggested_groups", &self.suggested_groups); - formatter.field("suggested_players", &self.suggested_players); - formatter.field("watch", &self.watch); - formatter.finish() - } -} -/// See [`ListActivitiesOutput`](crate::output::ListActivitiesOutput) -pub mod list_activities_output { - /// A builder for [`ListActivitiesOutput`](crate::output::ListActivitiesOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identities: std::option::Option>, - pub(crate) games: std::option::Option>, - pub(crate) parties: std::option::Option>, - pub(crate) suggested_groups: std::option::Option>, - pub(crate) suggested_players: - std::option::Option>, - pub(crate) watch: std::option::Option, - } - impl Builder { - /// Appends an item to `identities`. - /// - /// To override the contents of this collection use [`set_identities`](Self::set_identities). - /// - /// A list of identity handles. - pub fn identities(mut self, input: crate::model::IdentityHandle) -> Self { - let mut v = self.identities.unwrap_or_default(); - v.push(input); - self.identities = Some(v); - self - } - /// A list of identity handles. - pub fn set_identities( - mut self, - input: std::option::Option>, - ) -> Self { - self.identities = input; - self - } - /// Appends an item to `games`. - /// - /// To override the contents of this collection use [`set_games`](Self::set_games). - /// - /// A list of game summaries. - pub fn games(mut self, input: crate::model::GameSummary) -> Self { - let mut v = self.games.unwrap_or_default(); - v.push(input); - self.games = Some(v); - self - } - /// A list of game summaries. - pub fn set_games( - mut self, - input: std::option::Option>, - ) -> Self { - self.games = input; - self - } - /// Appends an item to `parties`. - /// - /// To override the contents of this collection use [`set_parties`](Self::set_parties). - /// - /// A list of party summaries. - pub fn parties(mut self, input: crate::model::PartySummary) -> Self { - let mut v = self.parties.unwrap_or_default(); - v.push(input); - self.parties = Some(v); - self - } - /// A list of party summaries. - pub fn set_parties( - mut self, - input: std::option::Option>, - ) -> Self { - self.parties = input; - self - } - /// Appends an item to `suggested_groups`. - /// - /// To override the contents of this collection use [`set_suggested_groups`](Self::set_suggested_groups). - /// - /// A list of group summaries. - pub fn suggested_groups(mut self, input: crate::model::GroupSummary) -> Self { - let mut v = self.suggested_groups.unwrap_or_default(); - v.push(input); - self.suggested_groups = Some(v); - self - } - /// A list of group summaries. - pub fn set_suggested_groups( - mut self, - input: std::option::Option>, - ) -> Self { - self.suggested_groups = input; - self - } - /// Appends an item to `suggested_players`. - /// - /// To override the contents of this collection use [`set_suggested_players`](Self::set_suggested_players). - /// - /// A list of identity handles. - pub fn suggested_players(mut self, input: crate::model::IdentityHandle) -> Self { - let mut v = self.suggested_players.unwrap_or_default(); - v.push(input); - self.suggested_players = Some(v); - self - } - /// A list of identity handles. - pub fn set_suggested_players( - mut self, - input: std::option::Option>, - ) -> Self { - self.suggested_players = input; - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(mut self, input: crate::model::WatchResponse) -> Self { - self.watch = Some(input); - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn set_watch( - mut self, - input: std::option::Option, - ) -> Self { - self.watch = input; - self - } - /// Consumes the builder and constructs a [`ListActivitiesOutput`](crate::output::ListActivitiesOutput) - pub fn build(self) -> crate::output::ListActivitiesOutput { - crate::output::ListActivitiesOutput { - identities: self.identities, - games: self.games, - parties: self.parties, - suggested_groups: self.suggested_groups, - suggested_players: self.suggested_players, - watch: self.watch, - } - } - } -} -impl ListActivitiesOutput { - /// Creates a new builder-style object to manufacture [`ListActivitiesOutput`](crate::output::ListActivitiesOutput) - pub fn builder() -> crate::output::list_activities_output::Builder { - crate::output::list_activities_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CancelGameLinkOutput {} -impl std::fmt::Debug for CancelGameLinkOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CancelGameLinkOutput"); - formatter.finish() - } -} -/// See [`CancelGameLinkOutput`](crate::output::CancelGameLinkOutput) -pub mod cancel_game_link_output { - /// A builder for [`CancelGameLinkOutput`](crate::output::CancelGameLinkOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`CancelGameLinkOutput`](crate::output::CancelGameLinkOutput) - pub fn build(self) -> crate::output::CancelGameLinkOutput { - crate::output::CancelGameLinkOutput {} - } - } -} -impl CancelGameLinkOutput { - /// Creates a new builder-style object to manufacture [`CancelGameLinkOutput`](crate::output::CancelGameLinkOutput) - pub fn builder() -> crate::output::cancel_game_link_output::Builder { - crate::output::cancel_game_link_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CompleteGameLinkOutput {} -impl std::fmt::Debug for CompleteGameLinkOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CompleteGameLinkOutput"); - formatter.finish() - } -} -/// See [`CompleteGameLinkOutput`](crate::output::CompleteGameLinkOutput) -pub mod complete_game_link_output { - /// A builder for [`CompleteGameLinkOutput`](crate::output::CompleteGameLinkOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`CompleteGameLinkOutput`](crate::output::CompleteGameLinkOutput) - pub fn build(self) -> crate::output::CompleteGameLinkOutput { - crate::output::CompleteGameLinkOutput {} - } - } -} -impl CompleteGameLinkOutput { - /// Creates a new builder-style object to manufacture [`CompleteGameLinkOutput`](crate::output::CompleteGameLinkOutput) - pub fn builder() -> crate::output::complete_game_link_output::Builder { - crate::output::complete_game_link_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetGameLinkOutput { - /// The link status between an identity and a game user. - pub status: std::option::Option, - /// A game handle. - pub game: std::option::Option, - /// The current game user identity which created this game link. - pub current_identity: std::option::Option, - /// If `status` is `GameLinkStatus$COMPLETE`, this will return the new identity and identity token to use for all future requests. - pub new_identity: std::option::Option, - /// Provided by watchable endpoints used in blocking loops. - pub watch: std::option::Option, -} -impl GetGameLinkOutput { - /// The link status between an identity and a game user. - pub fn status(&self) -> std::option::Option<&crate::model::GameLinkStatus> { - self.status.as_ref() - } - /// A game handle. - pub fn game(&self) -> std::option::Option<&crate::model::GameHandle> { - self.game.as_ref() - } - /// The current game user identity which created this game link. - pub fn current_identity(&self) -> std::option::Option<&crate::model::IdentityHandle> { - self.current_identity.as_ref() - } - /// If `status` is `GameLinkStatus$COMPLETE`, this will return the new identity and identity token to use for all future requests. - pub fn new_identity(&self) -> std::option::Option<&crate::model::GetGameLinkNewIdentity> { - self.new_identity.as_ref() - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(&self) -> std::option::Option<&crate::model::WatchResponse> { - self.watch.as_ref() - } -} -impl std::fmt::Debug for GetGameLinkOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetGameLinkOutput"); - formatter.field("status", &self.status); - formatter.field("game", &self.game); - formatter.field("current_identity", &self.current_identity); - formatter.field("new_identity", &self.new_identity); - formatter.field("watch", &self.watch); - formatter.finish() - } -} -/// See [`GetGameLinkOutput`](crate::output::GetGameLinkOutput) -pub mod get_game_link_output { - /// A builder for [`GetGameLinkOutput`](crate::output::GetGameLinkOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) status: std::option::Option, - pub(crate) game: std::option::Option, - pub(crate) current_identity: std::option::Option, - pub(crate) new_identity: std::option::Option, - pub(crate) watch: std::option::Option, - } - impl Builder { - /// The link status between an identity and a game user. - pub fn status(mut self, input: crate::model::GameLinkStatus) -> Self { - self.status = Some(input); - self - } - /// The link status between an identity and a game user. - pub fn set_status( - mut self, - input: std::option::Option, - ) -> Self { - self.status = input; - self - } - /// A game handle. - pub fn game(mut self, input: crate::model::GameHandle) -> Self { - self.game = Some(input); - self - } - /// A game handle. - pub fn set_game(mut self, input: std::option::Option) -> Self { - self.game = input; - self - } - /// The current game user identity which created this game link. - pub fn current_identity(mut self, input: crate::model::IdentityHandle) -> Self { - self.current_identity = Some(input); - self - } - /// The current game user identity which created this game link. - pub fn set_current_identity( - mut self, - input: std::option::Option, - ) -> Self { - self.current_identity = input; - self - } - /// If `status` is `GameLinkStatus$COMPLETE`, this will return the new identity and identity token to use for all future requests. - pub fn new_identity(mut self, input: crate::model::GetGameLinkNewIdentity) -> Self { - self.new_identity = Some(input); - self - } - /// If `status` is `GameLinkStatus$COMPLETE`, this will return the new identity and identity token to use for all future requests. - pub fn set_new_identity( - mut self, - input: std::option::Option, - ) -> Self { - self.new_identity = input; - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(mut self, input: crate::model::WatchResponse) -> Self { - self.watch = Some(input); - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn set_watch( - mut self, - input: std::option::Option, - ) -> Self { - self.watch = input; - self - } - /// Consumes the builder and constructs a [`GetGameLinkOutput`](crate::output::GetGameLinkOutput) - pub fn build(self) -> crate::output::GetGameLinkOutput { - crate::output::GetGameLinkOutput { - status: self.status, - game: self.game, - current_identity: self.current_identity, - new_identity: self.new_identity, - watch: self.watch, - } - } - } -} -impl GetGameLinkOutput { - /// Creates a new builder-style object to manufacture [`GetGameLinkOutput`](crate::output::GetGameLinkOutput) - pub fn builder() -> crate::output::get_game_link_output::Builder { - crate::output::get_game_link_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PrepareGameLinkOutput { - /// Pass this to `rivet.api.identity#GetGameLink` to get the linking status. Valid for 15 minutes. - pub identity_link_token: std::option::Option, - /// The URL that the user should visit to link their Rivet account. - pub identity_link_url: std::option::Option, - /// Timestamp (in milliseconds) at which the link will expire. - pub expire_ts: std::option::Option, -} -impl PrepareGameLinkOutput { - /// Pass this to `rivet.api.identity#GetGameLink` to get the linking status. Valid for 15 minutes. - pub fn identity_link_token(&self) -> std::option::Option<&str> { - self.identity_link_token.as_deref() - } - /// The URL that the user should visit to link their Rivet account. - pub fn identity_link_url(&self) -> std::option::Option<&str> { - self.identity_link_url.as_deref() - } - /// Timestamp (in milliseconds) at which the link will expire. - pub fn expire_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.expire_ts.as_ref() - } -} -impl std::fmt::Debug for PrepareGameLinkOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PrepareGameLinkOutput"); - formatter.field("identity_link_token", &self.identity_link_token); - formatter.field("identity_link_url", &self.identity_link_url); - formatter.field("expire_ts", &self.expire_ts); - formatter.finish() - } -} -/// See [`PrepareGameLinkOutput`](crate::output::PrepareGameLinkOutput) -pub mod prepare_game_link_output { - /// A builder for [`PrepareGameLinkOutput`](crate::output::PrepareGameLinkOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity_link_token: std::option::Option, - pub(crate) identity_link_url: std::option::Option, - pub(crate) expire_ts: std::option::Option, - } - impl Builder { - /// Pass this to `rivet.api.identity#GetGameLink` to get the linking status. Valid for 15 minutes. - pub fn identity_link_token(mut self, input: impl Into) -> Self { - self.identity_link_token = Some(input.into()); - self - } - /// Pass this to `rivet.api.identity#GetGameLink` to get the linking status. Valid for 15 minutes. - pub fn set_identity_link_token( - mut self, - input: std::option::Option, - ) -> Self { - self.identity_link_token = input; - self - } - /// The URL that the user should visit to link their Rivet account. - pub fn identity_link_url(mut self, input: impl Into) -> Self { - self.identity_link_url = Some(input.into()); - self - } - /// The URL that the user should visit to link their Rivet account. - pub fn set_identity_link_url( - mut self, - input: std::option::Option, - ) -> Self { - self.identity_link_url = input; - self - } - /// Timestamp (in milliseconds) at which the link will expire. - pub fn expire_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.expire_ts = Some(input); - self - } - /// Timestamp (in milliseconds) at which the link will expire. - pub fn set_expire_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.expire_ts = input; - self - } - /// Consumes the builder and constructs a [`PrepareGameLinkOutput`](crate::output::PrepareGameLinkOutput) - pub fn build(self) -> crate::output::PrepareGameLinkOutput { - crate::output::PrepareGameLinkOutput { - identity_link_token: self.identity_link_token, - identity_link_url: self.identity_link_url, - expire_ts: self.expire_ts, - } - } - } -} -impl PrepareGameLinkOutput { - /// Creates a new builder-style object to manufacture [`PrepareGameLinkOutput`](crate::output::PrepareGameLinkOutput) - pub fn builder() -> crate::output::prepare_game_link_output::Builder { - crate::output::prepare_game_link_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct WatchEventsOutput { - /// A list of global events. Ordered old to new. - pub events: std::option::Option>, - /// Provided by watchable endpoints used in blocking loops. - pub watch: std::option::Option, -} -impl WatchEventsOutput { - /// A list of global events. Ordered old to new. - pub fn events(&self) -> std::option::Option<&[crate::model::GlobalEvent]> { - self.events.as_deref() - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(&self) -> std::option::Option<&crate::model::WatchResponse> { - self.watch.as_ref() - } -} -impl std::fmt::Debug for WatchEventsOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("WatchEventsOutput"); - formatter.field("events", &self.events); - formatter.field("watch", &self.watch); - formatter.finish() - } -} -/// See [`WatchEventsOutput`](crate::output::WatchEventsOutput) -pub mod watch_events_output { - /// A builder for [`WatchEventsOutput`](crate::output::WatchEventsOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) events: std::option::Option>, - pub(crate) watch: std::option::Option, - } - impl Builder { - /// Appends an item to `events`. - /// - /// To override the contents of this collection use [`set_events`](Self::set_events). - /// - /// A list of global events. Ordered old to new. - pub fn events(mut self, input: crate::model::GlobalEvent) -> Self { - let mut v = self.events.unwrap_or_default(); - v.push(input); - self.events = Some(v); - self - } - /// A list of global events. Ordered old to new. - pub fn set_events( - mut self, - input: std::option::Option>, - ) -> Self { - self.events = input; - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(mut self, input: crate::model::WatchResponse) -> Self { - self.watch = Some(input); - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn set_watch( - mut self, - input: std::option::Option, - ) -> Self { - self.watch = input; - self - } - /// Consumes the builder and constructs a [`WatchEventsOutput`](crate::output::WatchEventsOutput) - pub fn build(self) -> crate::output::WatchEventsOutput { - crate::output::WatchEventsOutput { - events: self.events, - watch: self.watch, - } - } - } -} -impl WatchEventsOutput { - /// Creates a new builder-style object to manufacture [`WatchEventsOutput`](crate::output::WatchEventsOutput) - pub fn builder() -> crate::output::watch_events_output::Builder { - crate::output::watch_events_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UnmarkDeletionOutput {} -impl std::fmt::Debug for UnmarkDeletionOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UnmarkDeletionOutput"); - formatter.finish() - } -} -/// See [`UnmarkDeletionOutput`](crate::output::UnmarkDeletionOutput) -pub mod unmark_deletion_output { - /// A builder for [`UnmarkDeletionOutput`](crate::output::UnmarkDeletionOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`UnmarkDeletionOutput`](crate::output::UnmarkDeletionOutput) - pub fn build(self) -> crate::output::UnmarkDeletionOutput { - crate::output::UnmarkDeletionOutput {} - } - } -} -impl UnmarkDeletionOutput { - /// Creates a new builder-style object to manufacture [`UnmarkDeletionOutput`](crate::output::UnmarkDeletionOutput) - pub fn builder() -> crate::output::unmark_deletion_output::Builder { - crate::output::unmark_deletion_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct MarkDeletionOutput {} -impl std::fmt::Debug for MarkDeletionOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("MarkDeletionOutput"); - formatter.finish() - } -} -/// See [`MarkDeletionOutput`](crate::output::MarkDeletionOutput) -pub mod mark_deletion_output { - /// A builder for [`MarkDeletionOutput`](crate::output::MarkDeletionOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`MarkDeletionOutput`](crate::output::MarkDeletionOutput) - pub fn build(self) -> crate::output::MarkDeletionOutput { - crate::output::MarkDeletionOutput {} - } - } -} -impl MarkDeletionOutput { - /// Creates a new builder-style object to manufacture [`MarkDeletionOutput`](crate::output::MarkDeletionOutput) - pub fn builder() -> crate::output::mark_deletion_output::Builder { - crate::output::mark_deletion_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ListMutualFriendsOutput { - /// A list of identity handles. - pub identities: std::option::Option>, - #[allow(missing_docs)] // documentation missing in model - pub anchor: std::option::Option, -} -impl ListMutualFriendsOutput { - /// A list of identity handles. - pub fn identities(&self) -> std::option::Option<&[crate::model::IdentityHandle]> { - self.identities.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn anchor(&self) -> std::option::Option<&str> { - self.anchor.as_deref() - } -} -impl std::fmt::Debug for ListMutualFriendsOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ListMutualFriendsOutput"); - formatter.field("identities", &self.identities); - formatter.field("anchor", &self.anchor); - formatter.finish() - } -} -/// See [`ListMutualFriendsOutput`](crate::output::ListMutualFriendsOutput) -pub mod list_mutual_friends_output { - /// A builder for [`ListMutualFriendsOutput`](crate::output::ListMutualFriendsOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identities: std::option::Option>, - pub(crate) anchor: std::option::Option, - } - impl Builder { - /// Appends an item to `identities`. - /// - /// To override the contents of this collection use [`set_identities`](Self::set_identities). - /// - /// A list of identity handles. - pub fn identities(mut self, input: crate::model::IdentityHandle) -> Self { - let mut v = self.identities.unwrap_or_default(); - v.push(input); - self.identities = Some(v); - self - } - /// A list of identity handles. - pub fn set_identities( - mut self, - input: std::option::Option>, - ) -> Self { - self.identities = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn anchor(mut self, input: impl Into) -> Self { - self.anchor = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_anchor(mut self, input: std::option::Option) -> Self { - self.anchor = input; - self - } - /// Consumes the builder and constructs a [`ListMutualFriendsOutput`](crate::output::ListMutualFriendsOutput) - pub fn build(self) -> crate::output::ListMutualFriendsOutput { - crate::output::ListMutualFriendsOutput { - identities: self.identities, - anchor: self.anchor, - } - } - } -} -impl ListMutualFriendsOutput { - /// Creates a new builder-style object to manufacture [`ListMutualFriendsOutput`](crate::output::ListMutualFriendsOutput) - pub fn builder() -> crate::output::list_mutual_friends_output::Builder { - crate::output::list_mutual_friends_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct RecentFollowerIgnoreOutput {} -impl std::fmt::Debug for RecentFollowerIgnoreOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("RecentFollowerIgnoreOutput"); - formatter.finish() - } -} -/// See [`RecentFollowerIgnoreOutput`](crate::output::RecentFollowerIgnoreOutput) -pub mod recent_follower_ignore_output { - /// A builder for [`RecentFollowerIgnoreOutput`](crate::output::RecentFollowerIgnoreOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`RecentFollowerIgnoreOutput`](crate::output::RecentFollowerIgnoreOutput) - pub fn build(self) -> crate::output::RecentFollowerIgnoreOutput { - crate::output::RecentFollowerIgnoreOutput {} - } - } -} -impl RecentFollowerIgnoreOutput { - /// Creates a new builder-style object to manufacture [`RecentFollowerIgnoreOutput`](crate::output::RecentFollowerIgnoreOutput) - pub fn builder() -> crate::output::recent_follower_ignore_output::Builder { - crate::output::recent_follower_ignore_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ListRecentFollowersOutput { - /// A list of identity handles. - pub identities: std::option::Option>, - #[allow(missing_docs)] // documentation missing in model - pub anchor: std::option::Option, - /// Provided by watchable endpoints used in blocking loops. - pub watch: std::option::Option, -} -impl ListRecentFollowersOutput { - /// A list of identity handles. - pub fn identities(&self) -> std::option::Option<&[crate::model::IdentityHandle]> { - self.identities.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn anchor(&self) -> std::option::Option<&str> { - self.anchor.as_deref() - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(&self) -> std::option::Option<&crate::model::WatchResponse> { - self.watch.as_ref() - } -} -impl std::fmt::Debug for ListRecentFollowersOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ListRecentFollowersOutput"); - formatter.field("identities", &self.identities); - formatter.field("anchor", &self.anchor); - formatter.field("watch", &self.watch); - formatter.finish() - } -} -/// See [`ListRecentFollowersOutput`](crate::output::ListRecentFollowersOutput) -pub mod list_recent_followers_output { - /// A builder for [`ListRecentFollowersOutput`](crate::output::ListRecentFollowersOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identities: std::option::Option>, - pub(crate) anchor: std::option::Option, - pub(crate) watch: std::option::Option, - } - impl Builder { - /// Appends an item to `identities`. - /// - /// To override the contents of this collection use [`set_identities`](Self::set_identities). - /// - /// A list of identity handles. - pub fn identities(mut self, input: crate::model::IdentityHandle) -> Self { - let mut v = self.identities.unwrap_or_default(); - v.push(input); - self.identities = Some(v); - self - } - /// A list of identity handles. - pub fn set_identities( - mut self, - input: std::option::Option>, - ) -> Self { - self.identities = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn anchor(mut self, input: impl Into) -> Self { - self.anchor = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_anchor(mut self, input: std::option::Option) -> Self { - self.anchor = input; - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(mut self, input: crate::model::WatchResponse) -> Self { - self.watch = Some(input); - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn set_watch( - mut self, - input: std::option::Option, - ) -> Self { - self.watch = input; - self - } - /// Consumes the builder and constructs a [`ListRecentFollowersOutput`](crate::output::ListRecentFollowersOutput) - pub fn build(self) -> crate::output::ListRecentFollowersOutput { - crate::output::ListRecentFollowersOutput { - identities: self.identities, - anchor: self.anchor, - watch: self.watch, - } - } - } -} -impl ListRecentFollowersOutput { - /// Creates a new builder-style object to manufacture [`ListRecentFollowersOutput`](crate::output::ListRecentFollowersOutput) - pub fn builder() -> crate::output::list_recent_followers_output::Builder { - crate::output::list_recent_followers_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetIdentitySummariesOutput { - /// A list of identity summaries. - pub identities: std::option::Option>, -} -impl GetIdentitySummariesOutput { - /// A list of identity summaries. - pub fn identities(&self) -> std::option::Option<&[crate::model::IdentitySummary]> { - self.identities.as_deref() - } -} -impl std::fmt::Debug for GetIdentitySummariesOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetIdentitySummariesOutput"); - formatter.field("identities", &self.identities); - formatter.finish() - } -} -/// See [`GetIdentitySummariesOutput`](crate::output::GetIdentitySummariesOutput) -pub mod get_identity_summaries_output { - /// A builder for [`GetIdentitySummariesOutput`](crate::output::GetIdentitySummariesOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identities: std::option::Option>, - } - impl Builder { - /// Appends an item to `identities`. - /// - /// To override the contents of this collection use [`set_identities`](Self::set_identities). - /// - /// A list of identity summaries. - pub fn identities(mut self, input: crate::model::IdentitySummary) -> Self { - let mut v = self.identities.unwrap_or_default(); - v.push(input); - self.identities = Some(v); - self - } - /// A list of identity summaries. - pub fn set_identities( - mut self, - input: std::option::Option>, - ) -> Self { - self.identities = input; - self - } - /// Consumes the builder and constructs a [`GetIdentitySummariesOutput`](crate::output::GetIdentitySummariesOutput) - pub fn build(self) -> crate::output::GetIdentitySummariesOutput { - crate::output::GetIdentitySummariesOutput { - identities: self.identities, - } - } - } -} -impl GetIdentitySummariesOutput { - /// Creates a new builder-style object to manufacture [`GetIdentitySummariesOutput`](crate::output::GetIdentitySummariesOutput) - pub fn builder() -> crate::output::get_identity_summaries_output::Builder { - crate::output::get_identity_summaries_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetIdentityHandlesOutput { - /// A list of identity handles. - pub identities: std::option::Option>, -} -impl GetIdentityHandlesOutput { - /// A list of identity handles. - pub fn identities(&self) -> std::option::Option<&[crate::model::IdentityHandle]> { - self.identities.as_deref() - } -} -impl std::fmt::Debug for GetIdentityHandlesOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetIdentityHandlesOutput"); - formatter.field("identities", &self.identities); - formatter.finish() - } -} -/// See [`GetIdentityHandlesOutput`](crate::output::GetIdentityHandlesOutput) -pub mod get_identity_handles_output { - /// A builder for [`GetIdentityHandlesOutput`](crate::output::GetIdentityHandlesOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identities: std::option::Option>, - } - impl Builder { - /// Appends an item to `identities`. - /// - /// To override the contents of this collection use [`set_identities`](Self::set_identities). - /// - /// A list of identity handles. - pub fn identities(mut self, input: crate::model::IdentityHandle) -> Self { - let mut v = self.identities.unwrap_or_default(); - v.push(input); - self.identities = Some(v); - self - } - /// A list of identity handles. - pub fn set_identities( - mut self, - input: std::option::Option>, - ) -> Self { - self.identities = input; - self - } - /// Consumes the builder and constructs a [`GetIdentityHandlesOutput`](crate::output::GetIdentityHandlesOutput) - pub fn build(self) -> crate::output::GetIdentityHandlesOutput { - crate::output::GetIdentityHandlesOutput { - identities: self.identities, - } - } - } -} -impl GetIdentityHandlesOutput { - /// Creates a new builder-style object to manufacture [`GetIdentityHandlesOutput`](crate::output::GetIdentityHandlesOutput) - pub fn builder() -> crate::output::get_identity_handles_output::Builder { - crate::output::get_identity_handles_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ReportIdentityOutput {} -impl std::fmt::Debug for ReportIdentityOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ReportIdentityOutput"); - formatter.finish() - } -} -/// See [`ReportIdentityOutput`](crate::output::ReportIdentityOutput) -pub mod report_identity_output { - /// A builder for [`ReportIdentityOutput`](crate::output::ReportIdentityOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`ReportIdentityOutput`](crate::output::ReportIdentityOutput) - pub fn build(self) -> crate::output::ReportIdentityOutput { - crate::output::ReportIdentityOutput {} - } - } -} -impl ReportIdentityOutput { - /// Creates a new builder-style object to manufacture [`ReportIdentityOutput`](crate::output::ReportIdentityOutput) - pub fn builder() -> crate::output::report_identity_output::Builder { - crate::output::report_identity_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ListFriendsOutput { - /// A list of identity handles. - pub identities: std::option::Option>, - #[allow(missing_docs)] // documentation missing in model - pub anchor: std::option::Option, - /// Provided by watchable endpoints used in blocking loops. - pub watch: std::option::Option, -} -impl ListFriendsOutput { - /// A list of identity handles. - pub fn identities(&self) -> std::option::Option<&[crate::model::IdentityHandle]> { - self.identities.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn anchor(&self) -> std::option::Option<&str> { - self.anchor.as_deref() - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(&self) -> std::option::Option<&crate::model::WatchResponse> { - self.watch.as_ref() - } -} -impl std::fmt::Debug for ListFriendsOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ListFriendsOutput"); - formatter.field("identities", &self.identities); - formatter.field("anchor", &self.anchor); - formatter.field("watch", &self.watch); - formatter.finish() - } -} -/// See [`ListFriendsOutput`](crate::output::ListFriendsOutput) -pub mod list_friends_output { - /// A builder for [`ListFriendsOutput`](crate::output::ListFriendsOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identities: std::option::Option>, - pub(crate) anchor: std::option::Option, - pub(crate) watch: std::option::Option, - } - impl Builder { - /// Appends an item to `identities`. - /// - /// To override the contents of this collection use [`set_identities`](Self::set_identities). - /// - /// A list of identity handles. - pub fn identities(mut self, input: crate::model::IdentityHandle) -> Self { - let mut v = self.identities.unwrap_or_default(); - v.push(input); - self.identities = Some(v); - self - } - /// A list of identity handles. - pub fn set_identities( - mut self, - input: std::option::Option>, - ) -> Self { - self.identities = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn anchor(mut self, input: impl Into) -> Self { - self.anchor = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_anchor(mut self, input: std::option::Option) -> Self { - self.anchor = input; - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(mut self, input: crate::model::WatchResponse) -> Self { - self.watch = Some(input); - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn set_watch( - mut self, - input: std::option::Option, - ) -> Self { - self.watch = input; - self - } - /// Consumes the builder and constructs a [`ListFriendsOutput`](crate::output::ListFriendsOutput) - pub fn build(self) -> crate::output::ListFriendsOutput { - crate::output::ListFriendsOutput { - identities: self.identities, - anchor: self.anchor, - watch: self.watch, - } - } - } -} -impl ListFriendsOutput { - /// Creates a new builder-style object to manufacture [`ListFriendsOutput`](crate::output::ListFriendsOutput) - pub fn builder() -> crate::output::list_friends_output::Builder { - crate::output::list_friends_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ListFollowingOutput { - /// A list of identity handles. - pub identities: std::option::Option>, - #[allow(missing_docs)] // documentation missing in model - pub anchor: std::option::Option, - /// Provided by watchable endpoints used in blocking loops. - pub watch: std::option::Option, -} -impl ListFollowingOutput { - /// A list of identity handles. - pub fn identities(&self) -> std::option::Option<&[crate::model::IdentityHandle]> { - self.identities.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn anchor(&self) -> std::option::Option<&str> { - self.anchor.as_deref() - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(&self) -> std::option::Option<&crate::model::WatchResponse> { - self.watch.as_ref() - } -} -impl std::fmt::Debug for ListFollowingOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ListFollowingOutput"); - formatter.field("identities", &self.identities); - formatter.field("anchor", &self.anchor); - formatter.field("watch", &self.watch); - formatter.finish() - } -} -/// See [`ListFollowingOutput`](crate::output::ListFollowingOutput) -pub mod list_following_output { - /// A builder for [`ListFollowingOutput`](crate::output::ListFollowingOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identities: std::option::Option>, - pub(crate) anchor: std::option::Option, - pub(crate) watch: std::option::Option, - } - impl Builder { - /// Appends an item to `identities`. - /// - /// To override the contents of this collection use [`set_identities`](Self::set_identities). - /// - /// A list of identity handles. - pub fn identities(mut self, input: crate::model::IdentityHandle) -> Self { - let mut v = self.identities.unwrap_or_default(); - v.push(input); - self.identities = Some(v); - self - } - /// A list of identity handles. - pub fn set_identities( - mut self, - input: std::option::Option>, - ) -> Self { - self.identities = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn anchor(mut self, input: impl Into) -> Self { - self.anchor = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_anchor(mut self, input: std::option::Option) -> Self { - self.anchor = input; - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(mut self, input: crate::model::WatchResponse) -> Self { - self.watch = Some(input); - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn set_watch( - mut self, - input: std::option::Option, - ) -> Self { - self.watch = input; - self - } - /// Consumes the builder and constructs a [`ListFollowingOutput`](crate::output::ListFollowingOutput) - pub fn build(self) -> crate::output::ListFollowingOutput { - crate::output::ListFollowingOutput { - identities: self.identities, - anchor: self.anchor, - watch: self.watch, - } - } - } -} -impl ListFollowingOutput { - /// Creates a new builder-style object to manufacture [`ListFollowingOutput`](crate::output::ListFollowingOutput) - pub fn builder() -> crate::output::list_following_output::Builder { - crate::output::list_following_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ListFollowersOutput { - /// A list of identity handles. - pub identities: std::option::Option>, - #[allow(missing_docs)] // documentation missing in model - pub anchor: std::option::Option, - /// Provided by watchable endpoints used in blocking loops. - pub watch: std::option::Option, -} -impl ListFollowersOutput { - /// A list of identity handles. - pub fn identities(&self) -> std::option::Option<&[crate::model::IdentityHandle]> { - self.identities.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn anchor(&self) -> std::option::Option<&str> { - self.anchor.as_deref() - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(&self) -> std::option::Option<&crate::model::WatchResponse> { - self.watch.as_ref() - } -} -impl std::fmt::Debug for ListFollowersOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ListFollowersOutput"); - formatter.field("identities", &self.identities); - formatter.field("anchor", &self.anchor); - formatter.field("watch", &self.watch); - formatter.finish() - } -} -/// See [`ListFollowersOutput`](crate::output::ListFollowersOutput) -pub mod list_followers_output { - /// A builder for [`ListFollowersOutput`](crate::output::ListFollowersOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identities: std::option::Option>, - pub(crate) anchor: std::option::Option, - pub(crate) watch: std::option::Option, - } - impl Builder { - /// Appends an item to `identities`. - /// - /// To override the contents of this collection use [`set_identities`](Self::set_identities). - /// - /// A list of identity handles. - pub fn identities(mut self, input: crate::model::IdentityHandle) -> Self { - let mut v = self.identities.unwrap_or_default(); - v.push(input); - self.identities = Some(v); - self - } - /// A list of identity handles. - pub fn set_identities( - mut self, - input: std::option::Option>, - ) -> Self { - self.identities = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn anchor(mut self, input: impl Into) -> Self { - self.anchor = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_anchor(mut self, input: std::option::Option) -> Self { - self.anchor = input; - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(mut self, input: crate::model::WatchResponse) -> Self { - self.watch = Some(input); - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn set_watch( - mut self, - input: std::option::Option, - ) -> Self { - self.watch = input; - self - } - /// Consumes the builder and constructs a [`ListFollowersOutput`](crate::output::ListFollowersOutput) - pub fn build(self) -> crate::output::ListFollowersOutput { - crate::output::ListFollowersOutput { - identities: self.identities, - anchor: self.anchor, - watch: self.watch, - } - } - } -} -impl ListFollowersOutput { - /// Creates a new builder-style object to manufacture [`ListFollowersOutput`](crate::output::ListFollowersOutput) - pub fn builder() -> crate::output::list_followers_output::Builder { - crate::output::list_followers_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct SignupForBetaOutput {} -impl std::fmt::Debug for SignupForBetaOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("SignupForBetaOutput"); - formatter.finish() - } -} -/// See [`SignupForBetaOutput`](crate::output::SignupForBetaOutput) -pub mod signup_for_beta_output { - /// A builder for [`SignupForBetaOutput`](crate::output::SignupForBetaOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`SignupForBetaOutput`](crate::output::SignupForBetaOutput) - pub fn build(self) -> crate::output::SignupForBetaOutput { - crate::output::SignupForBetaOutput {} - } - } -} -impl SignupForBetaOutput { - /// Creates a new builder-style object to manufacture [`SignupForBetaOutput`](crate::output::SignupForBetaOutput) - pub fn builder() -> crate::output::signup_for_beta_output::Builder { - crate::output::signup_for_beta_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CompleteIdentityAvatarUploadOutput {} -impl std::fmt::Debug for CompleteIdentityAvatarUploadOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CompleteIdentityAvatarUploadOutput"); - formatter.finish() - } -} -/// See [`CompleteIdentityAvatarUploadOutput`](crate::output::CompleteIdentityAvatarUploadOutput) -pub mod complete_identity_avatar_upload_output { - /// A builder for [`CompleteIdentityAvatarUploadOutput`](crate::output::CompleteIdentityAvatarUploadOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`CompleteIdentityAvatarUploadOutput`](crate::output::CompleteIdentityAvatarUploadOutput) - pub fn build(self) -> crate::output::CompleteIdentityAvatarUploadOutput { - crate::output::CompleteIdentityAvatarUploadOutput {} - } - } -} -impl CompleteIdentityAvatarUploadOutput { - /// Creates a new builder-style object to manufacture [`CompleteIdentityAvatarUploadOutput`](crate::output::CompleteIdentityAvatarUploadOutput) - pub fn builder() -> crate::output::complete_identity_avatar_upload_output::Builder { - crate::output::complete_identity_avatar_upload_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PrepareIdentityAvatarUploadOutput { - /// A universally unique identifier. - pub upload_id: std::option::Option, - /// A presigned request used to upload files. Upload your file to the given URL via a PUT request. - pub presigned_request: std::option::Option, -} -impl PrepareIdentityAvatarUploadOutput { - /// A universally unique identifier. - pub fn upload_id(&self) -> std::option::Option<&str> { - self.upload_id.as_deref() - } - /// A presigned request used to upload files. Upload your file to the given URL via a PUT request. - pub fn presigned_request(&self) -> std::option::Option<&crate::model::UploadPresignedRequest> { - self.presigned_request.as_ref() - } -} -impl std::fmt::Debug for PrepareIdentityAvatarUploadOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PrepareIdentityAvatarUploadOutput"); - formatter.field("upload_id", &self.upload_id); - formatter.field("presigned_request", &self.presigned_request); - formatter.finish() - } -} -/// See [`PrepareIdentityAvatarUploadOutput`](crate::output::PrepareIdentityAvatarUploadOutput) -pub mod prepare_identity_avatar_upload_output { - /// A builder for [`PrepareIdentityAvatarUploadOutput`](crate::output::PrepareIdentityAvatarUploadOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) upload_id: std::option::Option, - pub(crate) presigned_request: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn upload_id(mut self, input: impl Into) -> Self { - self.upload_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_upload_id(mut self, input: std::option::Option) -> Self { - self.upload_id = input; - self - } - /// A presigned request used to upload files. Upload your file to the given URL via a PUT request. - pub fn presigned_request(mut self, input: crate::model::UploadPresignedRequest) -> Self { - self.presigned_request = Some(input); - self - } - /// A presigned request used to upload files. Upload your file to the given URL via a PUT request. - pub fn set_presigned_request( - mut self, - input: std::option::Option, - ) -> Self { - self.presigned_request = input; - self - } - /// Consumes the builder and constructs a [`PrepareIdentityAvatarUploadOutput`](crate::output::PrepareIdentityAvatarUploadOutput) - pub fn build(self) -> crate::output::PrepareIdentityAvatarUploadOutput { - crate::output::PrepareIdentityAvatarUploadOutput { - upload_id: self.upload_id, - presigned_request: self.presigned_request, - } - } - } -} -impl PrepareIdentityAvatarUploadOutput { - /// Creates a new builder-style object to manufacture [`PrepareIdentityAvatarUploadOutput`](crate::output::PrepareIdentityAvatarUploadOutput) - pub fn builder() -> crate::output::prepare_identity_avatar_upload_output::Builder { - crate::output::prepare_identity_avatar_upload_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UnfollowIdentityOutput {} -impl std::fmt::Debug for UnfollowIdentityOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UnfollowIdentityOutput"); - formatter.finish() - } -} -/// See [`UnfollowIdentityOutput`](crate::output::UnfollowIdentityOutput) -pub mod unfollow_identity_output { - /// A builder for [`UnfollowIdentityOutput`](crate::output::UnfollowIdentityOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`UnfollowIdentityOutput`](crate::output::UnfollowIdentityOutput) - pub fn build(self) -> crate::output::UnfollowIdentityOutput { - crate::output::UnfollowIdentityOutput {} - } - } -} -impl UnfollowIdentityOutput { - /// Creates a new builder-style object to manufacture [`UnfollowIdentityOutput`](crate::output::UnfollowIdentityOutput) - pub fn builder() -> crate::output::unfollow_identity_output::Builder { - crate::output::unfollow_identity_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct FollowIdentityOutput {} -impl std::fmt::Debug for FollowIdentityOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("FollowIdentityOutput"); - formatter.finish() - } -} -/// See [`FollowIdentityOutput`](crate::output::FollowIdentityOutput) -pub mod follow_identity_output { - /// A builder for [`FollowIdentityOutput`](crate::output::FollowIdentityOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`FollowIdentityOutput`](crate::output::FollowIdentityOutput) - pub fn build(self) -> crate::output::FollowIdentityOutput { - crate::output::FollowIdentityOutput {} - } - } -} -impl FollowIdentityOutput { - /// Creates a new builder-style object to manufacture [`FollowIdentityOutput`](crate::output::FollowIdentityOutput) - pub fn builder() -> crate::output::follow_identity_output::Builder { - crate::output::follow_identity_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UpdateIdentityStatusOutput {} -impl std::fmt::Debug for UpdateIdentityStatusOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UpdateIdentityStatusOutput"); - formatter.finish() - } -} -/// See [`UpdateIdentityStatusOutput`](crate::output::UpdateIdentityStatusOutput) -pub mod update_identity_status_output { - /// A builder for [`UpdateIdentityStatusOutput`](crate::output::UpdateIdentityStatusOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`UpdateIdentityStatusOutput`](crate::output::UpdateIdentityStatusOutput) - pub fn build(self) -> crate::output::UpdateIdentityStatusOutput { - crate::output::UpdateIdentityStatusOutput {} - } - } -} -impl UpdateIdentityStatusOutput { - /// Creates a new builder-style object to manufacture [`UpdateIdentityStatusOutput`](crate::output::UpdateIdentityStatusOutput) - pub fn builder() -> crate::output::update_identity_status_output::Builder { - crate::output::update_identity_status_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct RemoveIdentityGameActivityOutput {} -impl std::fmt::Debug for RemoveIdentityGameActivityOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("RemoveIdentityGameActivityOutput"); - formatter.finish() - } -} -/// See [`RemoveIdentityGameActivityOutput`](crate::output::RemoveIdentityGameActivityOutput) -pub mod remove_identity_game_activity_output { - /// A builder for [`RemoveIdentityGameActivityOutput`](crate::output::RemoveIdentityGameActivityOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`RemoveIdentityGameActivityOutput`](crate::output::RemoveIdentityGameActivityOutput) - pub fn build(self) -> crate::output::RemoveIdentityGameActivityOutput { - crate::output::RemoveIdentityGameActivityOutput {} - } - } -} -impl RemoveIdentityGameActivityOutput { - /// Creates a new builder-style object to manufacture [`RemoveIdentityGameActivityOutput`](crate::output::RemoveIdentityGameActivityOutput) - pub fn builder() -> crate::output::remove_identity_game_activity_output::Builder { - crate::output::remove_identity_game_activity_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct SetIdentityGameActivityOutput {} -impl std::fmt::Debug for SetIdentityGameActivityOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("SetIdentityGameActivityOutput"); - formatter.finish() - } -} -/// See [`SetIdentityGameActivityOutput`](crate::output::SetIdentityGameActivityOutput) -pub mod set_identity_game_activity_output { - /// A builder for [`SetIdentityGameActivityOutput`](crate::output::SetIdentityGameActivityOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`SetIdentityGameActivityOutput`](crate::output::SetIdentityGameActivityOutput) - pub fn build(self) -> crate::output::SetIdentityGameActivityOutput { - crate::output::SetIdentityGameActivityOutput {} - } - } -} -impl SetIdentityGameActivityOutput { - /// Creates a new builder-style object to manufacture [`SetIdentityGameActivityOutput`](crate::output::SetIdentityGameActivityOutput) - pub fn builder() -> crate::output::set_identity_game_activity_output::Builder { - crate::output::set_identity_game_activity_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct SearchIdentitiesOutput { - /// A list of identity handles. - pub identities: std::option::Option>, - #[allow(missing_docs)] // documentation missing in model - pub anchor: std::option::Option, -} -impl SearchIdentitiesOutput { - /// A list of identity handles. - pub fn identities(&self) -> std::option::Option<&[crate::model::IdentityHandle]> { - self.identities.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn anchor(&self) -> std::option::Option<&str> { - self.anchor.as_deref() - } -} -impl std::fmt::Debug for SearchIdentitiesOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("SearchIdentitiesOutput"); - formatter.field("identities", &self.identities); - formatter.field("anchor", &self.anchor); - formatter.finish() - } -} -/// See [`SearchIdentitiesOutput`](crate::output::SearchIdentitiesOutput) -pub mod search_identities_output { - /// A builder for [`SearchIdentitiesOutput`](crate::output::SearchIdentitiesOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identities: std::option::Option>, - pub(crate) anchor: std::option::Option, - } - impl Builder { - /// Appends an item to `identities`. - /// - /// To override the contents of this collection use [`set_identities`](Self::set_identities). - /// - /// A list of identity handles. - pub fn identities(mut self, input: crate::model::IdentityHandle) -> Self { - let mut v = self.identities.unwrap_or_default(); - v.push(input); - self.identities = Some(v); - self - } - /// A list of identity handles. - pub fn set_identities( - mut self, - input: std::option::Option>, - ) -> Self { - self.identities = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn anchor(mut self, input: impl Into) -> Self { - self.anchor = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_anchor(mut self, input: std::option::Option) -> Self { - self.anchor = input; - self - } - /// Consumes the builder and constructs a [`SearchIdentitiesOutput`](crate::output::SearchIdentitiesOutput) - pub fn build(self) -> crate::output::SearchIdentitiesOutput { - crate::output::SearchIdentitiesOutput { - identities: self.identities, - anchor: self.anchor, - } - } - } -} -impl SearchIdentitiesOutput { - /// Creates a new builder-style object to manufacture [`SearchIdentitiesOutput`](crate::output::SearchIdentitiesOutput) - pub fn builder() -> crate::output::search_identities_output::Builder { - crate::output::search_identities_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ValidateIdentityProfileOutput { - /// A list of validation errors. - pub errors: std::option::Option>, -} -impl ValidateIdentityProfileOutput { - /// A list of validation errors. - pub fn errors(&self) -> std::option::Option<&[crate::model::ValidationError]> { - self.errors.as_deref() - } -} -impl std::fmt::Debug for ValidateIdentityProfileOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ValidateIdentityProfileOutput"); - formatter.field("errors", &self.errors); - formatter.finish() - } -} -/// See [`ValidateIdentityProfileOutput`](crate::output::ValidateIdentityProfileOutput) -pub mod validate_identity_profile_output { - /// A builder for [`ValidateIdentityProfileOutput`](crate::output::ValidateIdentityProfileOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) errors: std::option::Option>, - } - impl Builder { - /// Appends an item to `errors`. - /// - /// To override the contents of this collection use [`set_errors`](Self::set_errors). - /// - /// A list of validation errors. - pub fn errors(mut self, input: crate::model::ValidationError) -> Self { - let mut v = self.errors.unwrap_or_default(); - v.push(input); - self.errors = Some(v); - self - } - /// A list of validation errors. - pub fn set_errors( - mut self, - input: std::option::Option>, - ) -> Self { - self.errors = input; - self - } - /// Consumes the builder and constructs a [`ValidateIdentityProfileOutput`](crate::output::ValidateIdentityProfileOutput) - pub fn build(self) -> crate::output::ValidateIdentityProfileOutput { - crate::output::ValidateIdentityProfileOutput { - errors: self.errors, - } - } - } -} -impl ValidateIdentityProfileOutput { - /// Creates a new builder-style object to manufacture [`ValidateIdentityProfileOutput`](crate::output::ValidateIdentityProfileOutput) - pub fn builder() -> crate::output::validate_identity_profile_output::Builder { - crate::output::validate_identity_profile_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UpdateIdentityProfileOutput {} -impl std::fmt::Debug for UpdateIdentityProfileOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UpdateIdentityProfileOutput"); - formatter.finish() - } -} -/// See [`UpdateIdentityProfileOutput`](crate::output::UpdateIdentityProfileOutput) -pub mod update_identity_profile_output { - /// A builder for [`UpdateIdentityProfileOutput`](crate::output::UpdateIdentityProfileOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`UpdateIdentityProfileOutput`](crate::output::UpdateIdentityProfileOutput) - pub fn build(self) -> crate::output::UpdateIdentityProfileOutput { - crate::output::UpdateIdentityProfileOutput {} - } - } -} -impl UpdateIdentityProfileOutput { - /// Creates a new builder-style object to manufacture [`UpdateIdentityProfileOutput`](crate::output::UpdateIdentityProfileOutput) - pub fn builder() -> crate::output::update_identity_profile_output::Builder { - crate::output::update_identity_profile_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetIdentitySelfProfileOutput { - /// An identity profile. - pub identity: std::option::Option, - /// Provided by watchable endpoints used in blocking loops. - pub watch: std::option::Option, -} -impl GetIdentitySelfProfileOutput { - /// An identity profile. - pub fn identity(&self) -> std::option::Option<&crate::model::IdentityProfile> { - self.identity.as_ref() - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(&self) -> std::option::Option<&crate::model::WatchResponse> { - self.watch.as_ref() - } -} -impl std::fmt::Debug for GetIdentitySelfProfileOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetIdentitySelfProfileOutput"); - formatter.field("identity", &self.identity); - formatter.field("watch", &self.watch); - formatter.finish() - } -} -/// See [`GetIdentitySelfProfileOutput`](crate::output::GetIdentitySelfProfileOutput) -pub mod get_identity_self_profile_output { - /// A builder for [`GetIdentitySelfProfileOutput`](crate::output::GetIdentitySelfProfileOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity: std::option::Option, - pub(crate) watch: std::option::Option, - } - impl Builder { - /// An identity profile. - pub fn identity(mut self, input: crate::model::IdentityProfile) -> Self { - self.identity = Some(input); - self - } - /// An identity profile. - pub fn set_identity( - mut self, - input: std::option::Option, - ) -> Self { - self.identity = input; - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(mut self, input: crate::model::WatchResponse) -> Self { - self.watch = Some(input); - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn set_watch( - mut self, - input: std::option::Option, - ) -> Self { - self.watch = input; - self - } - /// Consumes the builder and constructs a [`GetIdentitySelfProfileOutput`](crate::output::GetIdentitySelfProfileOutput) - pub fn build(self) -> crate::output::GetIdentitySelfProfileOutput { - crate::output::GetIdentitySelfProfileOutput { - identity: self.identity, - watch: self.watch, - } - } - } -} -impl GetIdentitySelfProfileOutput { - /// Creates a new builder-style object to manufacture [`GetIdentitySelfProfileOutput`](crate::output::GetIdentitySelfProfileOutput) - pub fn builder() -> crate::output::get_identity_self_profile_output::Builder { - crate::output::get_identity_self_profile_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetIdentityProfileOutput { - /// An identity profile. - pub identity: std::option::Option, - /// Provided by watchable endpoints used in blocking loops. - pub watch: std::option::Option, -} -impl GetIdentityProfileOutput { - /// An identity profile. - pub fn identity(&self) -> std::option::Option<&crate::model::IdentityProfile> { - self.identity.as_ref() - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(&self) -> std::option::Option<&crate::model::WatchResponse> { - self.watch.as_ref() - } -} -impl std::fmt::Debug for GetIdentityProfileOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetIdentityProfileOutput"); - formatter.field("identity", &self.identity); - formatter.field("watch", &self.watch); - formatter.finish() - } -} -/// See [`GetIdentityProfileOutput`](crate::output::GetIdentityProfileOutput) -pub mod get_identity_profile_output { - /// A builder for [`GetIdentityProfileOutput`](crate::output::GetIdentityProfileOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity: std::option::Option, - pub(crate) watch: std::option::Option, - } - impl Builder { - /// An identity profile. - pub fn identity(mut self, input: crate::model::IdentityProfile) -> Self { - self.identity = Some(input); - self - } - /// An identity profile. - pub fn set_identity( - mut self, - input: std::option::Option, - ) -> Self { - self.identity = input; - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(mut self, input: crate::model::WatchResponse) -> Self { - self.watch = Some(input); - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn set_watch( - mut self, - input: std::option::Option, - ) -> Self { - self.watch = input; - self - } - /// Consumes the builder and constructs a [`GetIdentityProfileOutput`](crate::output::GetIdentityProfileOutput) - pub fn build(self) -> crate::output::GetIdentityProfileOutput { - crate::output::GetIdentityProfileOutput { - identity: self.identity, - watch: self.watch, - } - } - } -} -impl GetIdentityProfileOutput { - /// Creates a new builder-style object to manufacture [`GetIdentityProfileOutput`](crate::output::GetIdentityProfileOutput) - pub fn builder() -> crate::output::get_identity_profile_output::Builder { - crate::output::get_identity_profile_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct SetupIdentityOutput { - /// Token used to authenticate the identity. Should be stored somewhere permanent. Pass this to `rivet.api.identity#SetupIdentity$existing_identity_token` next time `rivet.api.identity#SetupIdentity` is called. Token has a 90 day TTL. This means that if `rivet.api.identity#SetupIdentity` is not called again within 90 days, the token will no longer be valid. If this happens, the user can recover their account through the linking process (see `rivet.api.identity#PrepareGameLink`). This token should be stored locally and never sent to a server or another device. If this token is compromised, anyone with access to this token has control of the identity. - pub identity_token: std::option::Option, - /// Timestamp (in milliseconds) at which the token expires. - pub identity_token_expire_ts: std::option::Option, - /// Information about the identity that was just authenticated. - pub identity: std::option::Option, - /// A universally unique identifier. - pub game_id: std::option::Option, -} -impl SetupIdentityOutput { - /// Token used to authenticate the identity. Should be stored somewhere permanent. Pass this to `rivet.api.identity#SetupIdentity$existing_identity_token` next time `rivet.api.identity#SetupIdentity` is called. Token has a 90 day TTL. This means that if `rivet.api.identity#SetupIdentity` is not called again within 90 days, the token will no longer be valid. If this happens, the user can recover their account through the linking process (see `rivet.api.identity#PrepareGameLink`). This token should be stored locally and never sent to a server or another device. If this token is compromised, anyone with access to this token has control of the identity. - pub fn identity_token(&self) -> std::option::Option<&str> { - self.identity_token.as_deref() - } - /// Timestamp (in milliseconds) at which the token expires. - pub fn identity_token_expire_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.identity_token_expire_ts.as_ref() - } - /// Information about the identity that was just authenticated. - pub fn identity(&self) -> std::option::Option<&crate::model::IdentityProfile> { - self.identity.as_ref() - } - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } -} -impl std::fmt::Debug for SetupIdentityOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("SetupIdentityOutput"); - formatter.field("identity_token", &"*** Sensitive Data Redacted ***"); - formatter.field("identity_token_expire_ts", &self.identity_token_expire_ts); - formatter.field("identity", &self.identity); - formatter.field("game_id", &self.game_id); - formatter.finish() - } -} -/// See [`SetupIdentityOutput`](crate::output::SetupIdentityOutput) -pub mod setup_identity_output { - /// A builder for [`SetupIdentityOutput`](crate::output::SetupIdentityOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity_token: std::option::Option, - pub(crate) identity_token_expire_ts: std::option::Option, - pub(crate) identity: std::option::Option, - pub(crate) game_id: std::option::Option, - } - impl Builder { - /// Token used to authenticate the identity. Should be stored somewhere permanent. Pass this to `rivet.api.identity#SetupIdentity$existing_identity_token` next time `rivet.api.identity#SetupIdentity` is called. Token has a 90 day TTL. This means that if `rivet.api.identity#SetupIdentity` is not called again within 90 days, the token will no longer be valid. If this happens, the user can recover their account through the linking process (see `rivet.api.identity#PrepareGameLink`). This token should be stored locally and never sent to a server or another device. If this token is compromised, anyone with access to this token has control of the identity. - pub fn identity_token(mut self, input: impl Into) -> Self { - self.identity_token = Some(input.into()); - self - } - /// Token used to authenticate the identity. Should be stored somewhere permanent. Pass this to `rivet.api.identity#SetupIdentity$existing_identity_token` next time `rivet.api.identity#SetupIdentity` is called. Token has a 90 day TTL. This means that if `rivet.api.identity#SetupIdentity` is not called again within 90 days, the token will no longer be valid. If this happens, the user can recover their account through the linking process (see `rivet.api.identity#PrepareGameLink`). This token should be stored locally and never sent to a server or another device. If this token is compromised, anyone with access to this token has control of the identity. - pub fn set_identity_token( - mut self, - input: std::option::Option, - ) -> Self { - self.identity_token = input; - self - } - /// Timestamp (in milliseconds) at which the token expires. - pub fn identity_token_expire_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.identity_token_expire_ts = Some(input); - self - } - /// Timestamp (in milliseconds) at which the token expires. - pub fn set_identity_token_expire_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.identity_token_expire_ts = input; - self - } - /// Information about the identity that was just authenticated. - pub fn identity(mut self, input: crate::model::IdentityProfile) -> Self { - self.identity = Some(input); - self - } - /// Information about the identity that was just authenticated. - pub fn set_identity( - mut self, - input: std::option::Option, - ) -> Self { - self.identity = input; - self - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// Consumes the builder and constructs a [`SetupIdentityOutput`](crate::output::SetupIdentityOutput) - pub fn build(self) -> crate::output::SetupIdentityOutput { - crate::output::SetupIdentityOutput { - identity_token: self.identity_token, - identity_token_expire_ts: self.identity_token_expire_ts, - identity: self.identity, - game_id: self.game_id, - } - } - } -} -impl SetupIdentityOutput { - /// Creates a new builder-style object to manufacture [`SetupIdentityOutput`](crate::output::SetupIdentityOutput) - pub fn builder() -> crate::output::setup_identity_output::Builder { - crate::output::setup_identity_output::Builder::default() - } -} diff --git a/lib/smithy-output/api-job/rust-server/rust-server/Cargo.toml b/lib/smithy-output/api-job/rust-server/rust-server/Cargo.toml deleted file mode 100644 index 4ff0f4b81..000000000 --- a/lib/smithy-output/api-job/rust-server/rust-server/Cargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -[package] -name = "rivet-job-server" -version = "0.0.1" -authors = ["Rivet "] -edition = "2021" -license = "Apache-2.0" - -[package.metadata.docs.rs] -all-features = true -targets = ["x86_64-unknown-linux-gnu"] - -[dependencies] -serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" -chrono = { version = "0.4", features = ["serde"] } diff --git a/lib/smithy-output/api-job/rust-server/rust-server/src/lib.rs b/lib/smithy-output/api-job/rust-server/rust-server/src/lib.rs deleted file mode 100644 index ff9294697..000000000 --- a/lib/smithy-output/api-job/rust-server/rust-server/src/lib.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod models; \ No newline at end of file diff --git a/lib/smithy-output/api-job/rust-server/rust-server/src/models.rs b/lib/smithy-output/api-job/rust-server/rust-server/src/models.rs deleted file mode 100644 index 25422e59d..000000000 --- a/lib/smithy-output/api-job/rust-server/rust-server/src/models.rs +++ /dev/null @@ -1,13 +0,0 @@ -#[allow(unused_imports)] -use chrono; -#[allow(unused_imports)] -use serde::{Deserialize, Serialize}; - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CleanupRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CleanupResponse {} - diff --git a/lib/smithy-output/api-job/rust/rust/Cargo.toml b/lib/smithy-output/api-job/rust/rust/Cargo.toml deleted file mode 100644 index 14d235694..000000000 --- a/lib/smithy-output/api-job/rust/rust/Cargo.toml +++ /dev/null @@ -1,33 +0,0 @@ -# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -[package] -name = "rivet-job" -version = "0.0.1" -authors = ["Rivet Gaming, LLC "] -description = "" -edition = "2021" -license = "Apache-2.0" - -[package.metadata.docs.rs] -all-features = true -targets = ["x86_64-unknown-linux-gnu"] -[dependencies.aws-smithy-client] -version = "^0.41.0" -[dependencies.aws-smithy-http] -version = "^0.41.0" -[dependencies.aws-smithy-json] -version = "^0.41.0" -[dependencies.aws-smithy-types] -version = "^0.41.0" -[dependencies.bytes] -version = "1" -[dependencies.http] -version = "0.2" -[dependencies.tower] -version = "0.4" -[features] -rt-tokio = ["aws-smithy-http/rt-tokio"] -rustls = ["aws-smithy-client/rustls"] -native-tls = ["aws-smithy-client/native-tls"] -default = ["rt-tokio", "rustls"] - - diff --git a/lib/smithy-output/api-job/rust/rust/src/client.rs b/lib/smithy-output/api-job/rust/rust/src/client.rs deleted file mode 100644 index 0bf824fcc..000000000 --- a/lib/smithy-output/api-job/rust/rust/src/client.rs +++ /dev/null @@ -1,282 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[derive(Debug)] -pub(crate) struct Handle { - pub(crate) client: aws_smithy_client::Client, - pub(crate) conf: crate::Config, -} - -/// An ergonomic service client for `JobService`. -/// -/// This client allows ergonomic access to a `JobService`-shaped service. -/// Each method corresponds to an endpoint defined in the service's Smithy model, -/// and the request and response shapes are auto-generated from that same model. -/// -/// # Constructing a Client -/// -/// To construct a client, you need a few different things: -/// -/// - A [`Config`](crate::Config) that specifies additional configuration -/// required by the service. -/// - A connector (`C`) that specifies how HTTP requests are translated -/// into HTTP responses. This will typically be an HTTP client (like -/// `hyper`), though you can also substitute in your own, like a mock -/// mock connector for testing. -/// - A "middleware" (`M`) that modifies requests prior to them being -/// sent to the request. Most commonly, middleware will decide what -/// endpoint the requests should be sent to, as well as perform -/// authentication and authorization of requests (such as SigV4). -/// You can also have middleware that performs request/response -/// tracing, throttling, or other middleware-like tasks. -/// - A retry policy (`R`) that dictates the behavior for requests that -/// fail and should (potentially) be retried. The default type is -/// generally what you want, as it implements a well-vetted retry -/// policy implemented in [`RetryMode::Standard`](aws_smithy_types::retry::RetryMode::Standard). -/// -/// To construct a client, you will generally want to call -/// [`Client::with_config`], which takes a [`aws_smithy_client::Client`] (a -/// Smithy client that isn't specialized to a particular service), -/// and a [`Config`](crate::Config). Both of these are constructed using -/// the [builder pattern] where you first construct a `Builder` type, -/// then configure it with the necessary parameters, and then call -/// `build` to construct the finalized output type. The -/// [`aws_smithy_client::Client`] builder is re-exported in this crate as -/// [`Builder`] for convenience. -/// -/// In _most_ circumstances, you will want to use the following pattern -/// to construct a client: -/// -/// ``` -/// use rivet_job::{Builder, Client, Config}; -/// let raw_client = -/// Builder::dyn_https() -/// # /* -/// .middleware(/* discussed below */) -/// # */ -/// # .middleware_fn(|r| r) -/// .build(); -/// let config = Config::builder().build(); -/// let client = Client::with_config(raw_client, config); -/// ``` -/// -/// For the middleware, you'll want to use whatever matches the -/// routing, authentication and authorization required by the target -/// service. For example, for the standard AWS SDK which uses -/// [SigV4-signed requests], the middleware looks like this: -/// -// Ignored as otherwise we'd need to pull in all these dev-dependencies. -/// ```rust,ignore -/// use aws_endpoint::AwsEndpointStage; -/// use aws_http::auth::CredentialsStage; -/// use aws_http::recursion_detection::RecursionDetectionStage; -/// use aws_http::user_agent::UserAgentStage; -/// use aws_sig_auth::middleware::SigV4SigningStage; -/// use aws_sig_auth::signer::SigV4Signer; -/// use aws_smithy_client::retry::Config as RetryConfig; -/// use aws_smithy_http_tower::map_request::{AsyncMapRequestLayer, MapRequestLayer}; -/// use std::fmt::Debug; -/// use tower::layer::util::{Identity, Stack}; -/// use tower::ServiceBuilder; -/// -/// type AwsMiddlewareStack = Stack< -/// MapRequestLayer, -/// Stack< -/// MapRequestLayer, -/// Stack< -/// AsyncMapRequestLayer, -/// Stack< -/// MapRequestLayer, -/// Stack, Identity>, -/// >, -/// >, -/// >, -/// >; -/// -/// /// AWS Middleware Stack -/// /// -/// /// This implements the middleware stack for this service. It will: -/// /// 1. Load credentials asynchronously into the property bag -/// /// 2. Sign the request with SigV4 -/// /// 3. Resolve an Endpoint for the request -/// /// 4. Add a user agent to the request -/// #[derive(Debug, Default, Clone)] -/// #[non_exhaustive] -/// pub struct AwsMiddleware; -/// -/// impl AwsMiddleware { -/// /// Create a new `AwsMiddleware` stack -/// /// -/// /// Note: `AwsMiddleware` holds no state. -/// pub fn new() -> Self { -/// AwsMiddleware::default() -/// } -/// } -/// -/// // define the middleware stack in a non-generic location to reduce code bloat. -/// fn base() -> ServiceBuilder { -/// let credential_provider = AsyncMapRequestLayer::for_mapper(CredentialsStage::new()); -/// let signer = MapRequestLayer::for_mapper(SigV4SigningStage::new(SigV4Signer::new())); -/// let endpoint_resolver = MapRequestLayer::for_mapper(AwsEndpointStage); -/// let user_agent = MapRequestLayer::for_mapper(UserAgentStage::new()); -/// let recursion_detection = MapRequestLayer::for_mapper(RecursionDetectionStage::new()); -/// // These layers can be considered as occurring in order, that is: -/// // 1. Resolve an endpoint -/// // 2. Add a user agent -/// // 3. Acquire credentials -/// // 4. Sign with credentials -/// // (5. Dispatch over the wire) -/// ServiceBuilder::new() -/// .layer(endpoint_resolver) -/// .layer(user_agent) -/// .layer(credential_provider) -/// .layer(signer) -/// .layer(recursion_detection) -/// } -/// -/// impl tower::Layer for AwsMiddleware { -/// type Service = >::Service; -/// -/// fn layer(&self, inner: S) -> Self::Service { -/// base().service(inner) -/// } -/// } -/// ``` -/// -/// # Using a Client -/// -/// Once you have a client set up, you can access the service's endpoints -/// by calling the appropriate method on [`Client`]. Each such method -/// returns a request builder for that endpoint, with methods for setting -/// the various fields of the request. Once your request is complete, use -/// the `send` method to send the request. `send` returns a future, which -/// you then have to `.await` to get the service's response. -/// -/// [builder pattern]: https://rust-lang.github.io/api-guidelines/type-safety.html#c-builder -/// [SigV4-signed requests]: https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html -#[derive(std::fmt::Debug)] -pub struct Client { - handle: std::sync::Arc>, -} - -impl std::clone::Clone for Client { - fn clone(&self) -> Self { - Self { - handle: self.handle.clone(), - } - } -} - -#[doc(inline)] -pub use aws_smithy_client::Builder; - -impl From> for Client { - fn from(client: aws_smithy_client::Client) -> Self { - Self::with_config(client, crate::Config::builder().build()) - } -} - -impl Client { - /// Creates a client with the given service configuration. - pub fn with_config(client: aws_smithy_client::Client, conf: crate::Config) -> Self { - Self { - handle: std::sync::Arc::new(Handle { client, conf }), - } - } - - /// Returns the client's configuration. - pub fn conf(&self) -> &crate::Config { - &self.handle.conf - } -} -impl Client -where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, -{ - /// Constructs a fluent builder for the [`Cleanup`](crate::client::fluent_builders::Cleanup) operation. - /// - /// - The fluent builder takes no input, just [`send`](crate::client::fluent_builders::Cleanup::send) it. - - /// - On success, responds with [`CleanupOutput`](crate::output::CleanupOutput) - - /// - On failure, responds with [`SdkError`](crate::error::CleanupError) - pub fn cleanup(&self) -> fluent_builders::Cleanup { - fluent_builders::Cleanup::new(self.handle.clone()) - } -} -pub mod fluent_builders { - //! - //! Utilities to ergonomically construct a request to the service. - //! - //! Fluent builders are created through the [`Client`](crate::client::Client) by calling - //! one if its operation methods. After parameters are set using the builder methods, - //! the `send` method can be called to initiate the request. - //! - /// Fluent builder constructing a request to `Cleanup`. - /// - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct Cleanup { - handle: std::sync::Arc>, - inner: crate::input::cleanup_input::Builder, - } - impl Cleanup - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `Cleanup`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::CleanupOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::CleanupInputOperationOutputAlias, - crate::output::CleanupOutput, - crate::error::CleanupError, - crate::input::CleanupInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - } -} -/// A wrapper around [`Client`]. Helps reduce external imports. -pub struct ClientWrapper { - pub(crate) client: Client, -} - -impl std::ops::Deref for ClientWrapper { - type Target = Client; - - fn deref(&self) -> &Self::Target { - &self.client - } -} diff --git a/lib/smithy-output/api-job/rust/rust/src/config.rs b/lib/smithy-output/api-job/rust/rust/src/config.rs deleted file mode 100644 index abe505a01..000000000 --- a/lib/smithy-output/api-job/rust/rust/src/config.rs +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Service config. -/// -pub struct Config { - pub(crate) auth: Option, - pub(crate) uri: String, -} -impl std::fmt::Debug for Config { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut config = f.debug_struct("Config"); - config.finish() - } -} -impl Config { - /// Constructs a config builder. - pub fn builder() -> Builder { - Builder::default() - } -} -/// Builder for creating a `Config`. -#[derive(Default)] -pub struct Builder { - pub(crate) auth: Option, - pub(crate) uri: Option, -} -impl Builder { - /// Constructs a config builder. - pub fn new() -> Self { - Self::default() - } - /// Sets the bearer token to be used with the Smithy client. - pub fn set_bearer_token(mut self, bearer_token: impl std::fmt::Display) -> Self { - self.auth = Some(format!("Bearer {}", bearer_token)); - self - } - /// Sets the base URI to be used with the Smithy client. - pub fn set_uri(mut self, uri: impl ToString) -> Self { - self.uri = Some(uri.to_string()); - self - } - /// Builds a [`Config`]. - pub fn build(self) -> Config { - Config { - auth: self - .auth - .or_else(|| std::env::var("RIVET_LOBBY_TOKEN").ok()) - .or_else(|| std::env::var("RIVET_CLIENT_TOKEN").ok()), - uri: self - .uri - .or_else(|| std::env::var("RIVET_JOB_API_URL").ok()) - .unwrap_or_else(|| "https://job.api.rivet.gg/v1".to_string()), - } - } - /// Builds a default [`Client`] from the given config. - pub fn build_client(self) -> crate::client::ClientWrapper { - let raw_client = aws_smithy_client::Builder::dyn_https() - .middleware(tower::layer::util::Identity::new()) - .sleep_impl(None) - .build(); - crate::client::ClientWrapper { - client: crate::Client::with_config(raw_client, self.build()), - } - } -} diff --git a/lib/smithy-output/api-job/rust/rust/src/error.rs b/lib/smithy-output/api-job/rust/rust/src/error.rs deleted file mode 100644 index b17dcc2e2..000000000 --- a/lib/smithy-output/api-job/rust/rust/src/error.rs +++ /dev/null @@ -1,916 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Error type for the `Cleanup` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct CleanupError { - /// Kind of error that occurred. - pub kind: CleanupErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `Cleanup` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum CleanupErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for CleanupError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - CleanupErrorKind::InternalError(_inner) => _inner.fmt(f), - CleanupErrorKind::RateLimitError(_inner) => _inner.fmt(f), - CleanupErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - CleanupErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - CleanupErrorKind::NotFoundError(_inner) => _inner.fmt(f), - CleanupErrorKind::BadRequestError(_inner) => _inner.fmt(f), - CleanupErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for CleanupError { - fn code(&self) -> Option<&str> { - CleanupError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - CleanupErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - CleanupErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl CleanupError { - /// Creates a new `CleanupError`. - pub fn new(kind: CleanupErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `CleanupError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: CleanupErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `CleanupError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: CleanupErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `CleanupErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, CleanupErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `CleanupErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, CleanupErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `CleanupErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, CleanupErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `CleanupErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, CleanupErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `CleanupErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, CleanupErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `CleanupErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, CleanupErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for CleanupError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - CleanupErrorKind::InternalError(_inner) => Some(_inner), - CleanupErrorKind::RateLimitError(_inner) => Some(_inner), - CleanupErrorKind::ForbiddenError(_inner) => Some(_inner), - CleanupErrorKind::UnauthorizedError(_inner) => Some(_inner), - CleanupErrorKind::NotFoundError(_inner) => Some(_inner), - CleanupErrorKind::BadRequestError(_inner) => Some(_inner), - CleanupErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// An error thrown when the requestee has sent an invalid or malformed request. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct BadRequestError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl BadRequestError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for BadRequestError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("BadRequestError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl BadRequestError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for BadRequestError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "BadRequestError")?; - if let Some(inner_1) = &self.message { - write!(f, ": {}", inner_1)?; - } - Ok(()) - } -} -impl std::error::Error for BadRequestError {} -/// See [`BadRequestError`](crate::error::BadRequestError) -pub mod bad_request_error { - /// A builder for [`BadRequestError`](crate::error::BadRequestError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`BadRequestError`](crate::error::BadRequestError) - pub fn build(self) -> crate::error::BadRequestError { - crate::error::BadRequestError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl BadRequestError { - /// Creates a new builder-style object to manufacture [`BadRequestError`](crate::error::BadRequestError) - pub fn builder() -> crate::error::bad_request_error::Builder { - crate::error::bad_request_error::Builder::default() - } -} - -/// An error thrown when the requestee requests a non existent resource. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct NotFoundError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl NotFoundError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for NotFoundError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("NotFoundError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl NotFoundError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for NotFoundError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "NotFoundError")?; - if let Some(inner_2) = &self.message { - write!(f, ": {}", inner_2)?; - } - Ok(()) - } -} -impl std::error::Error for NotFoundError {} -/// See [`NotFoundError`](crate::error::NotFoundError) -pub mod not_found_error { - /// A builder for [`NotFoundError`](crate::error::NotFoundError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`NotFoundError`](crate::error::NotFoundError) - pub fn build(self) -> crate::error::NotFoundError { - crate::error::NotFoundError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl NotFoundError { - /// Creates a new builder-style object to manufacture [`NotFoundError`](crate::error::NotFoundError) - pub fn builder() -> crate::error::not_found_error::Builder { - crate::error::not_found_error::Builder::default() - } -} - -/// An error thrown when the requestee is not authenticated. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UnauthorizedError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl UnauthorizedError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for UnauthorizedError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UnauthorizedError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl UnauthorizedError { - /// Returns `Some(ErrorKind)` if the error is retryable. Otherwise, returns `None`. - pub fn retryable_error_kind(&self) -> aws_smithy_types::retry::ErrorKind { - aws_smithy_types::retry::ErrorKind::ClientError - } - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for UnauthorizedError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "UnauthorizedError")?; - if let Some(inner_3) = &self.message { - write!(f, ": {}", inner_3)?; - } - Ok(()) - } -} -impl std::error::Error for UnauthorizedError {} -/// See [`UnauthorizedError`](crate::error::UnauthorizedError) -pub mod unauthorized_error { - /// A builder for [`UnauthorizedError`](crate::error::UnauthorizedError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`UnauthorizedError`](crate::error::UnauthorizedError) - pub fn build(self) -> crate::error::UnauthorizedError { - crate::error::UnauthorizedError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl UnauthorizedError { - /// Creates a new builder-style object to manufacture [`UnauthorizedError`](crate::error::UnauthorizedError) - pub fn builder() -> crate::error::unauthorized_error::Builder { - crate::error::unauthorized_error::Builder::default() - } -} - -/// An error thrown when the requestee requests a resource they do not have access to. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ForbiddenError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl ForbiddenError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for ForbiddenError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ForbiddenError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl ForbiddenError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for ForbiddenError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "ForbiddenError")?; - if let Some(inner_4) = &self.message { - write!(f, ": {}", inner_4)?; - } - Ok(()) - } -} -impl std::error::Error for ForbiddenError {} -/// See [`ForbiddenError`](crate::error::ForbiddenError) -pub mod forbidden_error { - /// A builder for [`ForbiddenError`](crate::error::ForbiddenError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`ForbiddenError`](crate::error::ForbiddenError) - pub fn build(self) -> crate::error::ForbiddenError { - crate::error::ForbiddenError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl ForbiddenError { - /// Creates a new builder-style object to manufacture [`ForbiddenError`](crate::error::ForbiddenError) - pub fn builder() -> crate::error::forbidden_error::Builder { - crate::error::forbidden_error::Builder::default() - } -} - -/// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct RateLimitError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl RateLimitError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for RateLimitError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("RateLimitError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl RateLimitError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for RateLimitError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "RateLimitError")?; - if let Some(inner_5) = &self.message { - write!(f, ": {}", inner_5)?; - } - Ok(()) - } -} -impl std::error::Error for RateLimitError {} -/// See [`RateLimitError`](crate::error::RateLimitError) -pub mod rate_limit_error { - /// A builder for [`RateLimitError`](crate::error::RateLimitError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`RateLimitError`](crate::error::RateLimitError) - pub fn build(self) -> crate::error::RateLimitError { - crate::error::RateLimitError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl RateLimitError { - /// Creates a new builder-style object to manufacture [`RateLimitError`](crate::error::RateLimitError) - pub fn builder() -> crate::error::rate_limit_error::Builder { - crate::error::rate_limit_error::Builder::default() - } -} - -/// An error caused by internal server problems. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct InternalError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl InternalError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for InternalError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("InternalError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl InternalError { - /// Returns `Some(ErrorKind)` if the error is retryable. Otherwise, returns `None`. - pub fn retryable_error_kind(&self) -> aws_smithy_types::retry::ErrorKind { - aws_smithy_types::retry::ErrorKind::ServerError - } - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for InternalError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "InternalError")?; - if let Some(inner_6) = &self.message { - write!(f, ": {}", inner_6)?; - } - Ok(()) - } -} -impl std::error::Error for InternalError {} -/// See [`InternalError`](crate::error::InternalError) -pub mod internal_error { - /// A builder for [`InternalError`](crate::error::InternalError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`InternalError`](crate::error::InternalError) - pub fn build(self) -> crate::error::InternalError { - crate::error::InternalError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl InternalError { - /// Creates a new builder-style object to manufacture [`InternalError`](crate::error::InternalError) - pub fn builder() -> crate::error::internal_error::Builder { - crate::error::internal_error::Builder::default() - } -} diff --git a/lib/smithy-output/api-job/rust/rust/src/error_meta.rs b/lib/smithy-output/api-job/rust/rust/src/error_meta.rs deleted file mode 100644 index 953b3fbc1..000000000 --- a/lib/smithy-output/api-job/rust/rust/src/error_meta.rs +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// All possible error types for this service. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum Error { - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An unhandled error occurred. - Unhandled(Box), -} -impl std::fmt::Display for Error { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Error::BadRequestError(inner) => inner.fmt(f), - Error::ForbiddenError(inner) => inner.fmt(f), - Error::InternalError(inner) => inner.fmt(f), - Error::NotFoundError(inner) => inner.fmt(f), - Error::RateLimitError(inner) => inner.fmt(f), - Error::UnauthorizedError(inner) => inner.fmt(f), - Error::Unhandled(inner) => inner.fmt(f), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::CleanupErrorKind::InternalError(inner) => Error::InternalError(inner), - crate::error::CleanupErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::CleanupErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::CleanupErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::CleanupErrorKind::NotFoundError(inner) => Error::NotFoundError(inner), - crate::error::CleanupErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::CleanupErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl std::error::Error for Error {} diff --git a/lib/smithy-output/api-job/rust/rust/src/input.rs b/lib/smithy-output/api-job/rust/rust/src/input.rs deleted file mode 100644 index 77e6f2d1b..000000000 --- a/lib/smithy-output/api-job/rust/rust/src/input.rs +++ /dev/null @@ -1,94 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -use std::fmt::Write; -/// See [`CleanupInput`](crate::input::CleanupInput) -pub mod cleanup_input { - /// A builder for [`CleanupInput`](crate::input::CleanupInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`CleanupInput`](crate::input::CleanupInput) - pub fn build( - self, - ) -> std::result::Result - { - Ok(crate::input::CleanupInput {}) - } - } -} -#[doc(hidden)] -pub type CleanupInputOperationOutputAlias = crate::operation::Cleanup; -#[doc(hidden)] -pub type CleanupInputOperationRetryAlias = (); -impl CleanupInput { - /// Consumes the builder and constructs an Operation<[`Cleanup`](crate::operation::Cleanup)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::CleanupInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/runs/cleanup").expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::CleanupInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from("{}"); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = - aws_smithy_http::operation::Operation::new(request, crate::operation::Cleanup::new()) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "Cleanup", - "JobService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`CleanupInput`](crate::input::CleanupInput) - pub fn builder() -> crate::input::cleanup_input::Builder { - crate::input::cleanup_input::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CleanupInput {} -impl std::fmt::Debug for CleanupInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CleanupInput"); - formatter.finish() - } -} diff --git a/lib/smithy-output/api-job/rust/rust/src/json_deser.rs b/lib/smithy-output/api-job/rust/rust/src/json_deser.rs deleted file mode 100644 index 570bfab5f..000000000 --- a/lib/smithy-output/api-job/rust/rust/src/json_deser.rs +++ /dev/null @@ -1,404 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub fn parse_http_generic_error( - response: &http::Response, -) -> Result { - crate::json_errors::parse_generic_error(response.body(), response.headers()) -} - -pub fn deser_structure_crate_error_internal_error_json_err( - value: &[u8], - mut builder: crate::error::internal_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_rate_limit_error_json_err( - value: &[u8], - mut builder: crate::error::rate_limit_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_forbidden_error_json_err( - value: &[u8], - mut builder: crate::error::forbidden_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_unauthorized_error_json_err( - value: &[u8], - mut builder: crate::error::unauthorized_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_not_found_error_json_err( - value: &[u8], - mut builder: crate::error::not_found_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_bad_request_error_json_err( - value: &[u8], - mut builder: crate::error::bad_request_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn or_empty_doc(data: &[u8]) -> &[u8] { - if data.is_empty() { - b"{}" - } else { - data - } -} diff --git a/lib/smithy-output/api-job/rust/rust/src/json_errors.rs b/lib/smithy-output/api-job/rust/rust/src/json_errors.rs deleted file mode 100644 index 7b7574319..000000000 --- a/lib/smithy-output/api-job/rust/rust/src/json_errors.rs +++ /dev/null @@ -1,220 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -use aws_smithy_json::deserialize::token::skip_value; -use aws_smithy_json::deserialize::{json_token_iter, Error as DeserializeError, Token}; -use aws_smithy_types::Error as SmithyError; -use bytes::Bytes; -use http::header::ToStrError; -use http::{HeaderMap, HeaderValue}; -use std::borrow::Cow; - -// currently only used by AwsJson -#[allow(unused)] -pub fn is_error(response: &http::Response) -> bool { - !response.status().is_success() -} - -fn sanitize_error_code(error_code: &str) -> &str { - // Trim a trailing URL from the error code, beginning with a `:` - let error_code = match error_code.find(':') { - Some(idx) => &error_code[..idx], - None => error_code, - }; - - // Trim a prefixing namespace from the error code, beginning with a `#` - match error_code.find('#') { - Some(idx) => &error_code[idx + 1..], - None => error_code, - } -} - -struct ErrorBody<'a> { - code: Option>, - message: Option>, -} - -fn parse_error_body(bytes: &[u8]) -> Result { - let mut tokens = json_token_iter(bytes).peekable(); - let (mut typ, mut code, mut message) = (None, None, None); - if let Some(Token::StartObject { .. }) = tokens.next().transpose()? { - loop { - match tokens.next().transpose()? { - Some(Token::EndObject { .. }) => break, - Some(Token::ObjectKey { key, .. }) => { - if let Some(Ok(Token::ValueString { value, .. })) = tokens.peek() { - match key.as_escaped_str() { - "code" => code = Some(value.to_unescaped()?), - "__type" => typ = Some(value.to_unescaped()?), - "message" | "Message" | "errorMessage" => { - message = Some(value.to_unescaped()?) - } - _ => {} - } - } - skip_value(&mut tokens)?; - } - _ => { - return Err(DeserializeError::custom( - "expected object key or end object", - )) - } - } - } - if tokens.next().is_some() { - return Err(DeserializeError::custom( - "found more JSON tokens after completing parsing", - )); - } - } - Ok(ErrorBody { - code: code.or(typ), - message, - }) -} - -fn error_type_from_header(headers: &HeaderMap) -> Result, ToStrError> { - headers - .get("X-Amzn-Errortype") - .map(|v| v.to_str()) - .transpose() -} - -fn request_id(headers: &HeaderMap) -> Option<&str> { - headers - .get("X-Amzn-Requestid") - .and_then(|v| v.to_str().ok()) -} - -pub fn parse_generic_error( - payload: &Bytes, - headers: &HeaderMap, -) -> Result { - let ErrorBody { code, message } = parse_error_body(payload.as_ref())?; - - let mut err_builder = SmithyError::builder(); - if let Some(code) = error_type_from_header(headers) - .map_err(|_| DeserializeError::custom("X-Amzn-Errortype header was not valid UTF-8"))? - .or_else(|| code.as_deref()) - .map(sanitize_error_code) - { - err_builder.code(code); - } - if let Some(message) = message { - err_builder.message(message); - } - if let Some(request_id) = request_id(headers) { - err_builder.request_id(request_id); - } - Ok(err_builder.build()) -} - -#[cfg(test)] -mod test { - use crate::json_errors::{parse_error_body, parse_generic_error, sanitize_error_code}; - use aws_smithy_types::Error; - use bytes::Bytes; - use std::borrow::Cow; - - #[test] - fn generic_error() { - let response = http::Response::builder() - .header("X-Amzn-Requestid", "1234") - .body(Bytes::from_static( - br#"{ "__type": "FooError", "message": "Go to foo" }"#, - )) - .unwrap(); - assert_eq!( - parse_generic_error(response.body(), response.headers()).unwrap(), - Error::builder() - .code("FooError") - .message("Go to foo") - .request_id("1234") - .build() - ) - } - - #[test] - fn error_type() { - assert_eq!( - Some(Cow::Borrowed("FooError")), - parse_error_body(br#"{ "__type": "FooError" }"#) - .unwrap() - .code - ); - } - - #[test] - fn code_takes_priority() { - assert_eq!( - Some(Cow::Borrowed("BarError")), - parse_error_body(br#"{ "code": "BarError", "__type": "FooError" }"#) - .unwrap() - .code - ); - } - - #[test] - fn ignore_unrecognized_fields() { - assert_eq!( - Some(Cow::Borrowed("FooError")), - parse_error_body(br#"{ "__type": "FooError", "asdf": 5, "fdsa": {}, "foo": "1" }"#) - .unwrap() - .code - ); - } - - #[test] - fn sanitize_namespace_and_url() { - assert_eq!( - sanitize_error_code("aws.protocoltests.restjson#FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/"), - "FooError"); - } - - #[test] - fn sanitize_noop() { - assert_eq!(sanitize_error_code("FooError"), "FooError"); - } - - #[test] - fn sanitize_url() { - assert_eq!( - sanitize_error_code( - "FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/" - ), - "FooError" - ); - } - - #[test] - fn sanitize_namespace() { - assert_eq!( - sanitize_error_code("aws.protocoltests.restjson#FooError"), - "FooError" - ); - } - - // services like lambda use an alternate `Message` instead of `message` - #[test] - fn alternative_error_message_names() { - let response = http::Response::builder() - .header("x-amzn-errortype", "ResourceNotFoundException") - .body(Bytes::from_static( - br#"{ - "Type": "User", - "Message": "Functions from 'us-west-2' are not reachable from us-east-1" - }"#, - )) - .unwrap(); - assert_eq!( - parse_generic_error(response.body(), response.headers()).unwrap(), - Error::builder() - .code("ResourceNotFoundException") - .message("Functions from 'us-west-2' are not reachable from us-east-1") - .build() - ); - } -} diff --git a/lib/smithy-output/api-job/rust/rust/src/lib.rs b/lib/smithy-output/api-job/rust/rust/src/lib.rs deleted file mode 100644 index 989b0e602..000000000 --- a/lib/smithy-output/api-job/rust/rust/src/lib.rs +++ /dev/null @@ -1,53 +0,0 @@ -#![allow(clippy::module_inception)] -#![allow(clippy::upper_case_acronyms)] -#![allow(clippy::large_enum_variant)] -#![allow(clippy::wrong_self_convention)] -#![allow(clippy::should_implement_trait)] -#![allow(clippy::blacklisted_name)] -#![allow(clippy::vec_init_then_push)] -#![allow(rustdoc::bare_urls)] -#![warn(missing_docs)] -//! rivet-job -//! -//! # Crate Organization -//! -//! The entry point for most customers will be [`Client`]. [`Client`] exposes one method for each API offered -//! by the service. -//! -//! Some APIs require complex or nested arguments. These exist in [`model`](crate::model). -//! -//! Lastly, errors that can be returned by the service are contained within [`error`]. [`Error`] defines a meta -//! error encompassing all possible errors that can be returned by the service. -//! -//! The other modules within this crate are not required for normal usage. - -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use error_meta::Error; - -#[doc(inline)] -pub use config::Config; - -/// Client and fluent builders for calling the service. -pub mod client; -/// Configuration for the service. -pub mod config; -/// Errors that can occur when calling the service. -pub mod error; -mod error_meta; -/// Input structures for operations. -pub mod input; -mod json_deser; -mod json_errors; -/// All operations that this crate can perform. -pub mod operation; -mod operation_deser; -/// Output structures for operations. -pub mod output; -pub use client::{Builder, Client, ClientWrapper}; -/// Crate version number. -pub static PKG_VERSION: &str = env!("CARGO_PKG_VERSION"); -/// Re-exported types from supporting crates. -pub mod types { - pub use aws_smithy_http::result::SdkError; - pub use aws_smithy_types::DateTime; -} diff --git a/lib/smithy-output/api-job/rust/rust/src/operation.rs b/lib/smithy-output/api-job/rust/rust/src/operation.rs deleted file mode 100644 index e581ec251..000000000 --- a/lib/smithy-output/api-job/rust/rust/src/operation.rs +++ /dev/null @@ -1,31 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Operation shape for `Cleanup`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`cleanup`](crate::client::Client::cleanup). -/// -/// See [`crate::client::fluent_builders::Cleanup`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct Cleanup { - _private: (), -} -impl Cleanup { - /// Creates a new builder-style object to manufacture [`CleanupInput`](crate::input::CleanupInput) - pub fn builder() -> crate::input::cleanup_input::Builder { - crate::input::cleanup_input::Builder::default() - } - /// Creates a new `Cleanup` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for Cleanup { - type Output = std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_cleanup_error(response) - } else { - crate::operation_deser::parse_cleanup_response(response) - } - } -} diff --git a/lib/smithy-output/api-job/rust/rust/src/operation_deser.rs b/lib/smithy-output/api-job/rust/rust/src/operation_deser.rs deleted file mode 100644 index 656661ccb..000000000 --- a/lib/smithy-output/api-job/rust/rust/src/operation_deser.rs +++ /dev/null @@ -1,146 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[allow(clippy::unnecessary_wraps)] -pub fn parse_cleanup_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::CleanupError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::CleanupError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::CleanupError { - meta: generic, - kind: crate::error::CleanupErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::CleanupError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::CleanupError { - meta: generic, - kind: crate::error::CleanupErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::CleanupError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::CleanupError { - meta: generic, - kind: crate::error::CleanupErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::CleanupError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::CleanupError { - meta: generic, - kind: crate::error::CleanupErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::CleanupError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::CleanupError { - meta: generic, - kind: crate::error::CleanupErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::CleanupError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::CleanupError { - meta: generic, - kind: crate::error::CleanupErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::CleanupError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::CleanupError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_cleanup_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::cleanup_output::Builder::default(); - let _ = response; - output.build() - }) -} diff --git a/lib/smithy-output/api-job/rust/rust/src/output.rs b/lib/smithy-output/api-job/rust/rust/src/output.rs deleted file mode 100644 index 24703ed01..000000000 --- a/lib/smithy-output/api-job/rust/rust/src/output.rs +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CleanupOutput {} -impl std::fmt::Debug for CleanupOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CleanupOutput"); - formatter.finish() - } -} -/// See [`CleanupOutput`](crate::output::CleanupOutput) -pub mod cleanup_output { - /// A builder for [`CleanupOutput`](crate::output::CleanupOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`CleanupOutput`](crate::output::CleanupOutput) - pub fn build(self) -> crate::output::CleanupOutput { - crate::output::CleanupOutput {} - } - } -} -impl CleanupOutput { - /// Creates a new builder-style object to manufacture [`CleanupOutput`](crate::output::CleanupOutput) - pub fn builder() -> crate::output::cleanup_output::Builder { - crate::output::cleanup_output::Builder::default() - } -} diff --git a/lib/smithy-output/api-kv/rust-server/rust-server/Cargo.toml b/lib/smithy-output/api-kv/rust-server/rust-server/Cargo.toml deleted file mode 100644 index 652e9b1b7..000000000 --- a/lib/smithy-output/api-kv/rust-server/rust-server/Cargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -[package] -name = "rivet-kv-server" -version = "0.0.8" -authors = ["Rivet "] -edition = "2021" -license = "Apache-2.0" - -[package.metadata.docs.rs] -all-features = true -targets = ["x86_64-unknown-linux-gnu"] - -[dependencies] -serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" -chrono = { version = "0.4", features = ["serde"] } diff --git a/lib/smithy-output/api-kv/rust-server/rust-server/src/lib.rs b/lib/smithy-output/api-kv/rust-server/rust-server/src/lib.rs deleted file mode 100644 index ff9294697..000000000 --- a/lib/smithy-output/api-kv/rust-server/rust-server/src/lib.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod models; \ No newline at end of file diff --git a/lib/smithy-output/api-kv/rust-server/rust-server/src/models.rs b/lib/smithy-output/api-kv/rust-server/rust-server/src/models.rs deleted file mode 100644 index bf3dd9823..000000000 --- a/lib/smithy-output/api-kv/rust-server/rust-server/src/models.rs +++ /dev/null @@ -1,104 +0,0 @@ -#[allow(unused_imports)] -use chrono; -#[allow(unused_imports)] -use serde::{Deserialize, Serialize}; - -/// A new entry to insert into the key-value database. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PutEntry { - /// A string reprenting a key in the key-value database. Key path components are split by a slash (e.g. `a/b/c` has the path components `["a", "b", "c"]`). Slashes can be escaped by using a forward slash (e.g. `a/b\/c/d` has the path components `["a", "b/c", "d"]`). See `rivet.api.kv.common#KeyComponents` for the structure of a `rivet.api.kv.common#Key` split by `/`. - pub key: std::string::String, - #[allow(missing_docs)] // documentation missing in model - pub value: serde_json::Value, -} - -/// Provided by watchable endpoints used in blocking loops. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct WatchResponse { - /// Index indicating the version of the data responded. Pas this to `rivet.common#WatchQuery` to block and wait for the next response. - pub index: std::string::String, -} - -/// A key-value entry. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct KvEntry { - /// A key separated into components. - pub key: std::vec::Vec, - #[allow(missing_docs)] // documentation missing in model - pub value: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub deleted: std::option::Option, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PutBatchRequest { - /// A universally unique identifier. - pub namespace_id: std::option::Option, - /// A list of entries to insert. - pub entries: std::vec::Vec, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct DeleteBatchRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetBatchRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PutRequest { - /// A universally unique identifier. - pub namespace_id: std::option::Option, - /// Any JSON value to set the key to. - pub key: std::string::String, - #[allow(missing_docs)] // documentation missing in model - pub value: serde_json::Value, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct DeleteRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PutBatchResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct DeleteBatchResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetBatchResponse { - /// A list of key-value entries. - pub entries: std::vec::Vec, - /// Provided by watchable endpoints used in blocking loops. - pub watch: WatchResponse, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PutResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct DeleteResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetResponse { - /// The key's JSON value. - pub value: std::option::Option, - /// Whether or not the entry has been deleted. Only set when watching this endpoint. - pub deleted: std::option::Option, - /// Provided by watchable endpoints used in blocking loops. - pub watch: WatchResponse, -} - diff --git a/lib/smithy-output/api-kv/rust/rust/Cargo.toml b/lib/smithy-output/api-kv/rust/rust/Cargo.toml deleted file mode 100644 index 74bd59f95..000000000 --- a/lib/smithy-output/api-kv/rust/rust/Cargo.toml +++ /dev/null @@ -1,33 +0,0 @@ -# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -[package] -name = "rivet-kv" -version = "0.0.8" -authors = ["Rivet Gaming, LLC "] -description = "Rivet service for interacting with the key-value database" -edition = "2021" -license = "Apache-2.0" - -[package.metadata.docs.rs] -all-features = true -targets = ["x86_64-unknown-linux-gnu"] -[dependencies.aws-smithy-client] -version = "^0.41.0" -[dependencies.aws-smithy-http] -version = "^0.41.0" -[dependencies.aws-smithy-json] -version = "^0.41.0" -[dependencies.aws-smithy-types] -version = "^0.41.0" -[dependencies.bytes] -version = "1" -[dependencies.http] -version = "0.2" -[dependencies.tower] -version = "0.4" -[features] -rt-tokio = ["aws-smithy-http/rt-tokio"] -rustls = ["aws-smithy-client/rustls"] -native-tls = ["aws-smithy-client/native-tls"] -default = ["rt-tokio", "rustls"] - - diff --git a/lib/smithy-output/api-kv/rust/rust/src/client.rs b/lib/smithy-output/api-kv/rust/rust/src/client.rs deleted file mode 100644 index 3df0aa590..000000000 --- a/lib/smithy-output/api-kv/rust/rust/src/client.rs +++ /dev/null @@ -1,796 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[derive(Debug)] -pub(crate) struct Handle { - pub(crate) client: aws_smithy_client::Client, - pub(crate) conf: crate::Config, -} - -/// An ergonomic service client for `KvService`. -/// -/// This client allows ergonomic access to a `KvService`-shaped service. -/// Each method corresponds to an endpoint defined in the service's Smithy model, -/// and the request and response shapes are auto-generated from that same model. -/// -/// # Constructing a Client -/// -/// To construct a client, you need a few different things: -/// -/// - A [`Config`](crate::Config) that specifies additional configuration -/// required by the service. -/// - A connector (`C`) that specifies how HTTP requests are translated -/// into HTTP responses. This will typically be an HTTP client (like -/// `hyper`), though you can also substitute in your own, like a mock -/// mock connector for testing. -/// - A "middleware" (`M`) that modifies requests prior to them being -/// sent to the request. Most commonly, middleware will decide what -/// endpoint the requests should be sent to, as well as perform -/// authentication and authorization of requests (such as SigV4). -/// You can also have middleware that performs request/response -/// tracing, throttling, or other middleware-like tasks. -/// - A retry policy (`R`) that dictates the behavior for requests that -/// fail and should (potentially) be retried. The default type is -/// generally what you want, as it implements a well-vetted retry -/// policy implemented in [`RetryMode::Standard`](aws_smithy_types::retry::RetryMode::Standard). -/// -/// To construct a client, you will generally want to call -/// [`Client::with_config`], which takes a [`aws_smithy_client::Client`] (a -/// Smithy client that isn't specialized to a particular service), -/// and a [`Config`](crate::Config). Both of these are constructed using -/// the [builder pattern] where you first construct a `Builder` type, -/// then configure it with the necessary parameters, and then call -/// `build` to construct the finalized output type. The -/// [`aws_smithy_client::Client`] builder is re-exported in this crate as -/// [`Builder`] for convenience. -/// -/// In _most_ circumstances, you will want to use the following pattern -/// to construct a client: -/// -/// ``` -/// use rivet_kv::{Builder, Client, Config}; -/// let raw_client = -/// Builder::dyn_https() -/// # /* -/// .middleware(/* discussed below */) -/// # */ -/// # .middleware_fn(|r| r) -/// .build(); -/// let config = Config::builder().build(); -/// let client = Client::with_config(raw_client, config); -/// ``` -/// -/// For the middleware, you'll want to use whatever matches the -/// routing, authentication and authorization required by the target -/// service. For example, for the standard AWS SDK which uses -/// [SigV4-signed requests], the middleware looks like this: -/// -// Ignored as otherwise we'd need to pull in all these dev-dependencies. -/// ```rust,ignore -/// use aws_endpoint::AwsEndpointStage; -/// use aws_http::auth::CredentialsStage; -/// use aws_http::recursion_detection::RecursionDetectionStage; -/// use aws_http::user_agent::UserAgentStage; -/// use aws_sig_auth::middleware::SigV4SigningStage; -/// use aws_sig_auth::signer::SigV4Signer; -/// use aws_smithy_client::retry::Config as RetryConfig; -/// use aws_smithy_http_tower::map_request::{AsyncMapRequestLayer, MapRequestLayer}; -/// use std::fmt::Debug; -/// use tower::layer::util::{Identity, Stack}; -/// use tower::ServiceBuilder; -/// -/// type AwsMiddlewareStack = Stack< -/// MapRequestLayer, -/// Stack< -/// MapRequestLayer, -/// Stack< -/// AsyncMapRequestLayer, -/// Stack< -/// MapRequestLayer, -/// Stack, Identity>, -/// >, -/// >, -/// >, -/// >; -/// -/// /// AWS Middleware Stack -/// /// -/// /// This implements the middleware stack for this service. It will: -/// /// 1. Load credentials asynchronously into the property bag -/// /// 2. Sign the request with SigV4 -/// /// 3. Resolve an Endpoint for the request -/// /// 4. Add a user agent to the request -/// #[derive(Debug, Default, Clone)] -/// #[non_exhaustive] -/// pub struct AwsMiddleware; -/// -/// impl AwsMiddleware { -/// /// Create a new `AwsMiddleware` stack -/// /// -/// /// Note: `AwsMiddleware` holds no state. -/// pub fn new() -> Self { -/// AwsMiddleware::default() -/// } -/// } -/// -/// // define the middleware stack in a non-generic location to reduce code bloat. -/// fn base() -> ServiceBuilder { -/// let credential_provider = AsyncMapRequestLayer::for_mapper(CredentialsStage::new()); -/// let signer = MapRequestLayer::for_mapper(SigV4SigningStage::new(SigV4Signer::new())); -/// let endpoint_resolver = MapRequestLayer::for_mapper(AwsEndpointStage); -/// let user_agent = MapRequestLayer::for_mapper(UserAgentStage::new()); -/// let recursion_detection = MapRequestLayer::for_mapper(RecursionDetectionStage::new()); -/// // These layers can be considered as occurring in order, that is: -/// // 1. Resolve an endpoint -/// // 2. Add a user agent -/// // 3. Acquire credentials -/// // 4. Sign with credentials -/// // (5. Dispatch over the wire) -/// ServiceBuilder::new() -/// .layer(endpoint_resolver) -/// .layer(user_agent) -/// .layer(credential_provider) -/// .layer(signer) -/// .layer(recursion_detection) -/// } -/// -/// impl tower::Layer for AwsMiddleware { -/// type Service = >::Service; -/// -/// fn layer(&self, inner: S) -> Self::Service { -/// base().service(inner) -/// } -/// } -/// ``` -/// -/// # Using a Client -/// -/// Once you have a client set up, you can access the service's endpoints -/// by calling the appropriate method on [`Client`]. Each such method -/// returns a request builder for that endpoint, with methods for setting -/// the various fields of the request. Once your request is complete, use -/// the `send` method to send the request. `send` returns a future, which -/// you then have to `.await` to get the service's response. -/// -/// [builder pattern]: https://rust-lang.github.io/api-guidelines/type-safety.html#c-builder -/// [SigV4-signed requests]: https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html -#[derive(std::fmt::Debug)] -pub struct Client { - handle: std::sync::Arc>, -} - -impl std::clone::Clone for Client { - fn clone(&self) -> Self { - Self { - handle: self.handle.clone(), - } - } -} - -#[doc(inline)] -pub use aws_smithy_client::Builder; - -impl From> for Client { - fn from(client: aws_smithy_client::Client) -> Self { - Self::with_config(client, crate::Config::builder().build()) - } -} - -impl Client { - /// Creates a client with the given service configuration. - pub fn with_config(client: aws_smithy_client::Client, conf: crate::Config) -> Self { - Self { - handle: std::sync::Arc::new(Handle { client, conf }), - } - } - - /// Returns the client's configuration. - pub fn conf(&self) -> &crate::Config { - &self.handle.conf - } -} -impl Client -where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, -{ - /// Constructs a fluent builder for the [`Delete`](crate::client::fluent_builders::Delete) operation. - /// - /// - The fluent builder is configurable: - /// - [`key(impl Into)`](crate::client::fluent_builders::Delete::key) / [`set_key(Option)`](crate::client::fluent_builders::Delete::set_key): A string reprenting a key in the key-value database. Key path components are split by a slash (e.g. `a/b/c` has the path components `["a", "b", "c"]`). Slashes can be escaped by using a forward slash (e.g. `a/b\/c/d` has the path components `["a", "b/c", "d"]`). See `rivet.api.kv.common#KeyComponents` for the structure of a `rivet.api.kv.common#Key` split by `/`. - /// - [`namespace_id(impl Into)`](crate::client::fluent_builders::Delete::namespace_id) / [`set_namespace_id(Option)`](crate::client::fluent_builders::Delete::set_namespace_id): A universally unique identifier. - /// - On success, responds with [`DeleteOutput`](crate::output::DeleteOutput) - - /// - On failure, responds with [`SdkError`](crate::error::DeleteError) - pub fn delete(&self) -> fluent_builders::Delete { - fluent_builders::Delete::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`DeleteBatch`](crate::client::fluent_builders::DeleteBatch) operation. - /// - /// - The fluent builder is configurable: - /// - [`keys(Vec)`](crate::client::fluent_builders::DeleteBatch::keys) / [`set_keys(Option>)`](crate::client::fluent_builders::DeleteBatch::set_keys): A list of keys. - /// - [`namespace_id(impl Into)`](crate::client::fluent_builders::DeleteBatch::namespace_id) / [`set_namespace_id(Option)`](crate::client::fluent_builders::DeleteBatch::set_namespace_id): A universally unique identifier. - /// - On success, responds with [`DeleteBatchOutput`](crate::output::DeleteBatchOutput) - - /// - On failure, responds with [`SdkError`](crate::error::DeleteBatchError) - pub fn delete_batch(&self) -> fluent_builders::DeleteBatch { - fluent_builders::DeleteBatch::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`Get`](crate::client::fluent_builders::Get) operation. - /// - /// - The fluent builder is configurable: - /// - [`key(impl Into)`](crate::client::fluent_builders::Get::key) / [`set_key(Option)`](crate::client::fluent_builders::Get::set_key): A string reprenting a key in the key-value database. Key path components are split by a slash (e.g. `a/b/c` has the path components `["a", "b", "c"]`). Slashes can be escaped by using a forward slash (e.g. `a/b\/c/d` has the path components `["a", "b/c", "d"]`). See `rivet.api.kv.common#KeyComponents` for the structure of a `rivet.api.kv.common#Key` split by `/`. - /// - [`watch_index(impl Into)`](crate::client::fluent_builders::Get::watch_index) / [`set_watch_index(Option)`](crate::client::fluent_builders::Get::set_watch_index): A query parameter denoting the requests watch index. - /// - [`namespace_id(impl Into)`](crate::client::fluent_builders::Get::namespace_id) / [`set_namespace_id(Option)`](crate::client::fluent_builders::Get::set_namespace_id): A universally unique identifier. - /// - On success, responds with [`GetOutput`](crate::output::GetOutput) with field(s): - /// - [`value(Option)`](crate::output::GetOutput::value): The key's JSON value. - /// - [`deleted(Option)`](crate::output::GetOutput::deleted): Whether or not the entry has been deleted. Only set when watching this endpoint. - /// - [`watch(Option)`](crate::output::GetOutput::watch): Provided by watchable endpoints used in blocking loops. - /// - On failure, responds with [`SdkError`](crate::error::GetError) - pub fn get(&self) -> fluent_builders::Get { - fluent_builders::Get::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GetBatch`](crate::client::fluent_builders::GetBatch) operation. - /// - /// - The fluent builder is configurable: - /// - [`keys(Vec)`](crate::client::fluent_builders::GetBatch::keys) / [`set_keys(Option>)`](crate::client::fluent_builders::GetBatch::set_keys): A list of keys. - /// - [`watch_index(impl Into)`](crate::client::fluent_builders::GetBatch::watch_index) / [`set_watch_index(Option)`](crate::client::fluent_builders::GetBatch::set_watch_index): A query parameter denoting the requests watch index. - /// - [`namespace_id(impl Into)`](crate::client::fluent_builders::GetBatch::namespace_id) / [`set_namespace_id(Option)`](crate::client::fluent_builders::GetBatch::set_namespace_id): A universally unique identifier. - /// - On success, responds with [`GetBatchOutput`](crate::output::GetBatchOutput) with field(s): - /// - [`entries(Option>)`](crate::output::GetBatchOutput::entries): A list of key-value entries. - /// - [`watch(Option)`](crate::output::GetBatchOutput::watch): Provided by watchable endpoints used in blocking loops. - /// - On failure, responds with [`SdkError`](crate::error::GetBatchError) - pub fn get_batch(&self) -> fluent_builders::GetBatch { - fluent_builders::GetBatch::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`Put`](crate::client::fluent_builders::Put) operation. - /// - /// - The fluent builder is configurable: - /// - [`namespace_id(impl Into)`](crate::client::fluent_builders::Put::namespace_id) / [`set_namespace_id(Option)`](crate::client::fluent_builders::Put::set_namespace_id): A universally unique identifier. - /// - [`key(impl Into)`](crate::client::fluent_builders::Put::key) / [`set_key(Option)`](crate::client::fluent_builders::Put::set_key): Any JSON value to set the key to. - /// - [`value(Document)`](crate::client::fluent_builders::Put::value) / [`set_value(Option)`](crate::client::fluent_builders::Put::set_value): (undocumented) - /// - On success, responds with [`PutOutput`](crate::output::PutOutput) - - /// - On failure, responds with [`SdkError`](crate::error::PutError) - pub fn put(&self) -> fluent_builders::Put { - fluent_builders::Put::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`PutBatch`](crate::client::fluent_builders::PutBatch) operation. - /// - /// - The fluent builder is configurable: - /// - [`namespace_id(impl Into)`](crate::client::fluent_builders::PutBatch::namespace_id) / [`set_namespace_id(Option)`](crate::client::fluent_builders::PutBatch::set_namespace_id): A universally unique identifier. - /// - [`entries(Vec)`](crate::client::fluent_builders::PutBatch::entries) / [`set_entries(Option>)`](crate::client::fluent_builders::PutBatch::set_entries): A list of entries to insert. - /// - On success, responds with [`PutBatchOutput`](crate::output::PutBatchOutput) - - /// - On failure, responds with [`SdkError`](crate::error::PutBatchError) - pub fn put_batch(&self) -> fluent_builders::PutBatch { - fluent_builders::PutBatch::new(self.handle.clone()) - } -} -pub mod fluent_builders { - //! - //! Utilities to ergonomically construct a request to the service. - //! - //! Fluent builders are created through the [`Client`](crate::client::Client) by calling - //! one if its operation methods. After parameters are set using the builder methods, - //! the `send` method can be called to initiate the request. - //! - /// Fluent builder constructing a request to `Delete`. - /// - /// Deletes a key-value entry by key. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct Delete { - handle: std::sync::Arc>, - inner: crate::input::delete_input::Builder, - } - impl Delete - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `Delete`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::DeleteOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::DeleteInputOperationOutputAlias, - crate::output::DeleteOutput, - crate::error::DeleteError, - crate::input::DeleteInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A string reprenting a key in the key-value database. Key path components are split by a slash (e.g. `a/b/c` has the path components `["a", "b", "c"]`). Slashes can be escaped by using a forward slash (e.g. `a/b\/c/d` has the path components `["a", "b/c", "d"]`). See `rivet.api.kv.common#KeyComponents` for the structure of a `rivet.api.kv.common#Key` split by `/`. - pub fn key(mut self, input: impl Into) -> Self { - self.inner = self.inner.key(input.into()); - self - } - /// A string reprenting a key in the key-value database. Key path components are split by a slash (e.g. `a/b/c` has the path components `["a", "b", "c"]`). Slashes can be escaped by using a forward slash (e.g. `a/b\/c/d` has the path components `["a", "b/c", "d"]`). See `rivet.api.kv.common#KeyComponents` for the structure of a `rivet.api.kv.common#Key` split by `/`. - pub fn set_key(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_key(input); - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.namespace_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_namespace_id(input); - self - } - } - /// Fluent builder constructing a request to `DeleteBatch`. - /// - /// Deletes multiple key-value entries by key(s). - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct DeleteBatch { - handle: std::sync::Arc>, - inner: crate::input::delete_batch_input::Builder, - } - impl DeleteBatch - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `DeleteBatch`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::DeleteBatchOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::DeleteBatchInputOperationOutputAlias, - crate::output::DeleteBatchOutput, - crate::error::DeleteBatchError, - crate::input::DeleteBatchInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// Appends an item to `keys`. - /// - /// To override the contents of this collection use [`set_keys`](Self::set_keys). - /// - /// A list of keys. - pub fn keys(mut self, input: impl Into) -> Self { - self.inner = self.inner.keys(input.into()); - self - } - /// A list of keys. - pub fn set_keys( - mut self, - input: std::option::Option>, - ) -> Self { - self.inner = self.inner.set_keys(input); - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.namespace_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_namespace_id(input); - self - } - } - /// Fluent builder constructing a request to `Get`. - /// - /// Returns a specific key-value entry by key. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct Get { - handle: std::sync::Arc>, - inner: crate::input::get_input::Builder, - } - impl Get - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `Get`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GetOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GetInputOperationOutputAlias, - crate::output::GetOutput, - crate::error::GetError, - crate::input::GetInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A string reprenting a key in the key-value database. Key path components are split by a slash (e.g. `a/b/c` has the path components `["a", "b", "c"]`). Slashes can be escaped by using a forward slash (e.g. `a/b\/c/d` has the path components `["a", "b/c", "d"]`). See `rivet.api.kv.common#KeyComponents` for the structure of a `rivet.api.kv.common#Key` split by `/`. - pub fn key(mut self, input: impl Into) -> Self { - self.inner = self.inner.key(input.into()); - self - } - /// A string reprenting a key in the key-value database. Key path components are split by a slash (e.g. `a/b/c` has the path components `["a", "b", "c"]`). Slashes can be escaped by using a forward slash (e.g. `a/b\/c/d` has the path components `["a", "b/c", "d"]`). See `rivet.api.kv.common#KeyComponents` for the structure of a `rivet.api.kv.common#Key` split by `/`. - pub fn set_key(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_key(input); - self - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.inner = self.inner.watch_index(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_watch_index(input); - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.namespace_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_namespace_id(input); - self - } - } - /// Fluent builder constructing a request to `GetBatch`. - /// - /// Gets multiple key-value entries by key(s). - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GetBatch { - handle: std::sync::Arc>, - inner: crate::input::get_batch_input::Builder, - } - impl GetBatch - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GetBatch`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GetBatchOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GetBatchInputOperationOutputAlias, - crate::output::GetBatchOutput, - crate::error::GetBatchError, - crate::input::GetBatchInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// Appends an item to `keys`. - /// - /// To override the contents of this collection use [`set_keys`](Self::set_keys). - /// - /// A list of keys. - pub fn keys(mut self, input: impl Into) -> Self { - self.inner = self.inner.keys(input.into()); - self - } - /// A list of keys. - pub fn set_keys( - mut self, - input: std::option::Option>, - ) -> Self { - self.inner = self.inner.set_keys(input); - self - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.inner = self.inner.watch_index(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_watch_index(input); - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.namespace_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_namespace_id(input); - self - } - } - /// Fluent builder constructing a request to `Put`. - /// - /// Puts (sets or overwrites) a key-value entry by key. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct Put { - handle: std::sync::Arc>, - inner: crate::input::put_input::Builder, - } - impl Put - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `Put`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::PutOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::PutInputOperationOutputAlias, - crate::output::PutOutput, - crate::error::PutError, - crate::input::PutInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.namespace_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_namespace_id(input); - self - } - /// Any JSON value to set the key to. - pub fn key(mut self, input: impl Into) -> Self { - self.inner = self.inner.key(input.into()); - self - } - /// Any JSON value to set the key to. - pub fn set_key(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_key(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn value(mut self, input: aws_smithy_types::Document) -> Self { - self.inner = self.inner.value(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_value(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_value(input); - self - } - } - /// Fluent builder constructing a request to `PutBatch`. - /// - /// Puts (sets or overwrites) multiple key-value entries by key(s). - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct PutBatch { - handle: std::sync::Arc>, - inner: crate::input::put_batch_input::Builder, - } - impl PutBatch - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `PutBatch`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::PutBatchOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::PutBatchInputOperationOutputAlias, - crate::output::PutBatchOutput, - crate::error::PutBatchError, - crate::input::PutBatchInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.namespace_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_namespace_id(input); - self - } - /// Appends an item to `entries`. - /// - /// To override the contents of this collection use [`set_entries`](Self::set_entries). - /// - /// A list of entries to insert. - pub fn entries(mut self, input: crate::model::PutEntry) -> Self { - self.inner = self.inner.entries(input); - self - } - /// A list of entries to insert. - pub fn set_entries( - mut self, - input: std::option::Option>, - ) -> Self { - self.inner = self.inner.set_entries(input); - self - } - } -} -/// A wrapper around [`Client`]. Helps reduce external imports. -pub struct ClientWrapper { - pub(crate) client: Client, -} - -impl std::ops::Deref for ClientWrapper { - type Target = Client; - - fn deref(&self) -> &Self::Target { - &self.client - } -} diff --git a/lib/smithy-output/api-kv/rust/rust/src/config.rs b/lib/smithy-output/api-kv/rust/rust/src/config.rs deleted file mode 100644 index 92e9e5073..000000000 --- a/lib/smithy-output/api-kv/rust/rust/src/config.rs +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Service config. -/// -pub struct Config { - pub(crate) auth: Option, - pub(crate) uri: String, -} -impl std::fmt::Debug for Config { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut config = f.debug_struct("Config"); - config.finish() - } -} -impl Config { - /// Constructs a config builder. - pub fn builder() -> Builder { - Builder::default() - } -} -/// Builder for creating a `Config`. -#[derive(Default)] -pub struct Builder { - pub(crate) auth: Option, - pub(crate) uri: Option, -} -impl Builder { - /// Constructs a config builder. - pub fn new() -> Self { - Self::default() - } - /// Sets the bearer token to be used with the Smithy client. - pub fn set_bearer_token(mut self, bearer_token: impl std::fmt::Display) -> Self { - self.auth = Some(format!("Bearer {}", bearer_token)); - self - } - /// Sets the base URI to be used with the Smithy client. - pub fn set_uri(mut self, uri: impl ToString) -> Self { - self.uri = Some(uri.to_string()); - self - } - /// Builds a [`Config`]. - pub fn build(self) -> Config { - Config { - auth: self - .auth - .or_else(|| std::env::var("RIVET_LOBBY_TOKEN").ok()) - .or_else(|| std::env::var("RIVET_CLIENT_TOKEN").ok()), - uri: self - .uri - .or_else(|| std::env::var("RIVET_KV_API_URL").ok()) - .unwrap_or_else(|| "https://kv.api.rivet.gg/v1".to_string()), - } - } - /// Builds a default [`Client`] from the given config. - pub fn build_client(self) -> crate::client::ClientWrapper { - let raw_client = aws_smithy_client::Builder::dyn_https() - .middleware(tower::layer::util::Identity::new()) - .sleep_impl(None) - .build(); - crate::client::ClientWrapper { - client: crate::Client::with_config(raw_client, self.build()), - } - } -} diff --git a/lib/smithy-output/api-kv/rust/rust/src/error.rs b/lib/smithy-output/api-kv/rust/rust/src/error.rs deleted file mode 100644 index bda38b263..000000000 --- a/lib/smithy-output/api-kv/rust/rust/src/error.rs +++ /dev/null @@ -1,1586 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Error type for the `Delete` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct DeleteError { - /// Kind of error that occurred. - pub kind: DeleteErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `Delete` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum DeleteErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for DeleteError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - DeleteErrorKind::InternalError(_inner) => _inner.fmt(f), - DeleteErrorKind::RateLimitError(_inner) => _inner.fmt(f), - DeleteErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - DeleteErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - DeleteErrorKind::NotFoundError(_inner) => _inner.fmt(f), - DeleteErrorKind::BadRequestError(_inner) => _inner.fmt(f), - DeleteErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for DeleteError { - fn code(&self) -> Option<&str> { - DeleteError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - DeleteErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - DeleteErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl DeleteError { - /// Creates a new `DeleteError`. - pub fn new(kind: DeleteErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `DeleteError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: DeleteErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `DeleteError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: DeleteErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `DeleteErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, DeleteErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `DeleteErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, DeleteErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `DeleteErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, DeleteErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `DeleteErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, DeleteErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `DeleteErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, DeleteErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `DeleteErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, DeleteErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for DeleteError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - DeleteErrorKind::InternalError(_inner) => Some(_inner), - DeleteErrorKind::RateLimitError(_inner) => Some(_inner), - DeleteErrorKind::ForbiddenError(_inner) => Some(_inner), - DeleteErrorKind::UnauthorizedError(_inner) => Some(_inner), - DeleteErrorKind::NotFoundError(_inner) => Some(_inner), - DeleteErrorKind::BadRequestError(_inner) => Some(_inner), - DeleteErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `DeleteBatch` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct DeleteBatchError { - /// Kind of error that occurred. - pub kind: DeleteBatchErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `DeleteBatch` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum DeleteBatchErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for DeleteBatchError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - DeleteBatchErrorKind::InternalError(_inner) => _inner.fmt(f), - DeleteBatchErrorKind::RateLimitError(_inner) => _inner.fmt(f), - DeleteBatchErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - DeleteBatchErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - DeleteBatchErrorKind::NotFoundError(_inner) => _inner.fmt(f), - DeleteBatchErrorKind::BadRequestError(_inner) => _inner.fmt(f), - DeleteBatchErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for DeleteBatchError { - fn code(&self) -> Option<&str> { - DeleteBatchError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - DeleteBatchErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - DeleteBatchErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl DeleteBatchError { - /// Creates a new `DeleteBatchError`. - pub fn new(kind: DeleteBatchErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `DeleteBatchError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: DeleteBatchErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `DeleteBatchError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: DeleteBatchErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `DeleteBatchErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, DeleteBatchErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `DeleteBatchErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, DeleteBatchErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `DeleteBatchErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, DeleteBatchErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `DeleteBatchErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, DeleteBatchErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `DeleteBatchErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, DeleteBatchErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `DeleteBatchErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, DeleteBatchErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for DeleteBatchError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - DeleteBatchErrorKind::InternalError(_inner) => Some(_inner), - DeleteBatchErrorKind::RateLimitError(_inner) => Some(_inner), - DeleteBatchErrorKind::ForbiddenError(_inner) => Some(_inner), - DeleteBatchErrorKind::UnauthorizedError(_inner) => Some(_inner), - DeleteBatchErrorKind::NotFoundError(_inner) => Some(_inner), - DeleteBatchErrorKind::BadRequestError(_inner) => Some(_inner), - DeleteBatchErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `Get` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GetError { - /// Kind of error that occurred. - pub kind: GetErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `Get` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GetErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GetError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GetErrorKind::InternalError(_inner) => _inner.fmt(f), - GetErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GetErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GetErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GetErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GetErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GetErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GetError { - fn code(&self) -> Option<&str> { - GetError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GetErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - GetErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl GetError { - /// Creates a new `GetError`. - pub fn new(kind: GetErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GetError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GetErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GetError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GetErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GetErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, GetErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `GetErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, GetErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `GetErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, GetErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `GetErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, GetErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `GetErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, GetErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `GetErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, GetErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for GetError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GetErrorKind::InternalError(_inner) => Some(_inner), - GetErrorKind::RateLimitError(_inner) => Some(_inner), - GetErrorKind::ForbiddenError(_inner) => Some(_inner), - GetErrorKind::UnauthorizedError(_inner) => Some(_inner), - GetErrorKind::NotFoundError(_inner) => Some(_inner), - GetErrorKind::BadRequestError(_inner) => Some(_inner), - GetErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `GetBatch` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GetBatchError { - /// Kind of error that occurred. - pub kind: GetBatchErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GetBatch` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GetBatchErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GetBatchError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GetBatchErrorKind::InternalError(_inner) => _inner.fmt(f), - GetBatchErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GetBatchErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GetBatchErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GetBatchErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GetBatchErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GetBatchErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GetBatchError { - fn code(&self) -> Option<&str> { - GetBatchError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GetBatchErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - GetBatchErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl GetBatchError { - /// Creates a new `GetBatchError`. - pub fn new(kind: GetBatchErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GetBatchError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GetBatchErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GetBatchError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GetBatchErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GetBatchErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, GetBatchErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `GetBatchErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, GetBatchErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `GetBatchErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, GetBatchErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `GetBatchErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, GetBatchErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `GetBatchErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, GetBatchErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `GetBatchErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, GetBatchErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for GetBatchError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GetBatchErrorKind::InternalError(_inner) => Some(_inner), - GetBatchErrorKind::RateLimitError(_inner) => Some(_inner), - GetBatchErrorKind::ForbiddenError(_inner) => Some(_inner), - GetBatchErrorKind::UnauthorizedError(_inner) => Some(_inner), - GetBatchErrorKind::NotFoundError(_inner) => Some(_inner), - GetBatchErrorKind::BadRequestError(_inner) => Some(_inner), - GetBatchErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `Put` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct PutError { - /// Kind of error that occurred. - pub kind: PutErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `Put` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum PutErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for PutError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - PutErrorKind::InternalError(_inner) => _inner.fmt(f), - PutErrorKind::RateLimitError(_inner) => _inner.fmt(f), - PutErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - PutErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - PutErrorKind::NotFoundError(_inner) => _inner.fmt(f), - PutErrorKind::BadRequestError(_inner) => _inner.fmt(f), - PutErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for PutError { - fn code(&self) -> Option<&str> { - PutError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - PutErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - PutErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl PutError { - /// Creates a new `PutError`. - pub fn new(kind: PutErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `PutError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: PutErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `PutError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: PutErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `PutErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, PutErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `PutErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, PutErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `PutErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, PutErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `PutErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, PutErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `PutErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, PutErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `PutErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, PutErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for PutError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - PutErrorKind::InternalError(_inner) => Some(_inner), - PutErrorKind::RateLimitError(_inner) => Some(_inner), - PutErrorKind::ForbiddenError(_inner) => Some(_inner), - PutErrorKind::UnauthorizedError(_inner) => Some(_inner), - PutErrorKind::NotFoundError(_inner) => Some(_inner), - PutErrorKind::BadRequestError(_inner) => Some(_inner), - PutErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `PutBatch` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct PutBatchError { - /// Kind of error that occurred. - pub kind: PutBatchErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `PutBatch` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum PutBatchErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for PutBatchError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - PutBatchErrorKind::InternalError(_inner) => _inner.fmt(f), - PutBatchErrorKind::RateLimitError(_inner) => _inner.fmt(f), - PutBatchErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - PutBatchErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - PutBatchErrorKind::NotFoundError(_inner) => _inner.fmt(f), - PutBatchErrorKind::BadRequestError(_inner) => _inner.fmt(f), - PutBatchErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for PutBatchError { - fn code(&self) -> Option<&str> { - PutBatchError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - PutBatchErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - PutBatchErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl PutBatchError { - /// Creates a new `PutBatchError`. - pub fn new(kind: PutBatchErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `PutBatchError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: PutBatchErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `PutBatchError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: PutBatchErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `PutBatchErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, PutBatchErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `PutBatchErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, PutBatchErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `PutBatchErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, PutBatchErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `PutBatchErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, PutBatchErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `PutBatchErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, PutBatchErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `PutBatchErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, PutBatchErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for PutBatchError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - PutBatchErrorKind::InternalError(_inner) => Some(_inner), - PutBatchErrorKind::RateLimitError(_inner) => Some(_inner), - PutBatchErrorKind::ForbiddenError(_inner) => Some(_inner), - PutBatchErrorKind::UnauthorizedError(_inner) => Some(_inner), - PutBatchErrorKind::NotFoundError(_inner) => Some(_inner), - PutBatchErrorKind::BadRequestError(_inner) => Some(_inner), - PutBatchErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// An error thrown when the requestee has sent an invalid or malformed request. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct BadRequestError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl BadRequestError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for BadRequestError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("BadRequestError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl BadRequestError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for BadRequestError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "BadRequestError")?; - if let Some(inner_1) = &self.message { - write!(f, ": {}", inner_1)?; - } - Ok(()) - } -} -impl std::error::Error for BadRequestError {} -/// See [`BadRequestError`](crate::error::BadRequestError) -pub mod bad_request_error { - /// A builder for [`BadRequestError`](crate::error::BadRequestError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`BadRequestError`](crate::error::BadRequestError) - pub fn build(self) -> crate::error::BadRequestError { - crate::error::BadRequestError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl BadRequestError { - /// Creates a new builder-style object to manufacture [`BadRequestError`](crate::error::BadRequestError) - pub fn builder() -> crate::error::bad_request_error::Builder { - crate::error::bad_request_error::Builder::default() - } -} - -/// An error thrown when the requestee requests a non existent resource. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct NotFoundError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl NotFoundError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for NotFoundError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("NotFoundError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl NotFoundError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for NotFoundError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "NotFoundError")?; - if let Some(inner_2) = &self.message { - write!(f, ": {}", inner_2)?; - } - Ok(()) - } -} -impl std::error::Error for NotFoundError {} -/// See [`NotFoundError`](crate::error::NotFoundError) -pub mod not_found_error { - /// A builder for [`NotFoundError`](crate::error::NotFoundError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`NotFoundError`](crate::error::NotFoundError) - pub fn build(self) -> crate::error::NotFoundError { - crate::error::NotFoundError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl NotFoundError { - /// Creates a new builder-style object to manufacture [`NotFoundError`](crate::error::NotFoundError) - pub fn builder() -> crate::error::not_found_error::Builder { - crate::error::not_found_error::Builder::default() - } -} - -/// An error thrown when the requestee is not authenticated. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UnauthorizedError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl UnauthorizedError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for UnauthorizedError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UnauthorizedError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl UnauthorizedError { - /// Returns `Some(ErrorKind)` if the error is retryable. Otherwise, returns `None`. - pub fn retryable_error_kind(&self) -> aws_smithy_types::retry::ErrorKind { - aws_smithy_types::retry::ErrorKind::ClientError - } - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for UnauthorizedError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "UnauthorizedError")?; - if let Some(inner_3) = &self.message { - write!(f, ": {}", inner_3)?; - } - Ok(()) - } -} -impl std::error::Error for UnauthorizedError {} -/// See [`UnauthorizedError`](crate::error::UnauthorizedError) -pub mod unauthorized_error { - /// A builder for [`UnauthorizedError`](crate::error::UnauthorizedError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`UnauthorizedError`](crate::error::UnauthorizedError) - pub fn build(self) -> crate::error::UnauthorizedError { - crate::error::UnauthorizedError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl UnauthorizedError { - /// Creates a new builder-style object to manufacture [`UnauthorizedError`](crate::error::UnauthorizedError) - pub fn builder() -> crate::error::unauthorized_error::Builder { - crate::error::unauthorized_error::Builder::default() - } -} - -/// An error thrown when the requestee requests a resource they do not have access to. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ForbiddenError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl ForbiddenError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for ForbiddenError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ForbiddenError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl ForbiddenError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for ForbiddenError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "ForbiddenError")?; - if let Some(inner_4) = &self.message { - write!(f, ": {}", inner_4)?; - } - Ok(()) - } -} -impl std::error::Error for ForbiddenError {} -/// See [`ForbiddenError`](crate::error::ForbiddenError) -pub mod forbidden_error { - /// A builder for [`ForbiddenError`](crate::error::ForbiddenError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`ForbiddenError`](crate::error::ForbiddenError) - pub fn build(self) -> crate::error::ForbiddenError { - crate::error::ForbiddenError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl ForbiddenError { - /// Creates a new builder-style object to manufacture [`ForbiddenError`](crate::error::ForbiddenError) - pub fn builder() -> crate::error::forbidden_error::Builder { - crate::error::forbidden_error::Builder::default() - } -} - -/// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct RateLimitError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl RateLimitError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for RateLimitError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("RateLimitError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl RateLimitError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for RateLimitError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "RateLimitError")?; - if let Some(inner_5) = &self.message { - write!(f, ": {}", inner_5)?; - } - Ok(()) - } -} -impl std::error::Error for RateLimitError {} -/// See [`RateLimitError`](crate::error::RateLimitError) -pub mod rate_limit_error { - /// A builder for [`RateLimitError`](crate::error::RateLimitError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`RateLimitError`](crate::error::RateLimitError) - pub fn build(self) -> crate::error::RateLimitError { - crate::error::RateLimitError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl RateLimitError { - /// Creates a new builder-style object to manufacture [`RateLimitError`](crate::error::RateLimitError) - pub fn builder() -> crate::error::rate_limit_error::Builder { - crate::error::rate_limit_error::Builder::default() - } -} - -/// An error caused by internal server problems. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct InternalError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl InternalError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for InternalError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("InternalError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl InternalError { - /// Returns `Some(ErrorKind)` if the error is retryable. Otherwise, returns `None`. - pub fn retryable_error_kind(&self) -> aws_smithy_types::retry::ErrorKind { - aws_smithy_types::retry::ErrorKind::ServerError - } - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for InternalError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "InternalError")?; - if let Some(inner_6) = &self.message { - write!(f, ": {}", inner_6)?; - } - Ok(()) - } -} -impl std::error::Error for InternalError {} -/// See [`InternalError`](crate::error::InternalError) -pub mod internal_error { - /// A builder for [`InternalError`](crate::error::InternalError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`InternalError`](crate::error::InternalError) - pub fn build(self) -> crate::error::InternalError { - crate::error::InternalError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl InternalError { - /// Creates a new builder-style object to manufacture [`InternalError`](crate::error::InternalError) - pub fn builder() -> crate::error::internal_error::Builder { - crate::error::internal_error::Builder::default() - } -} diff --git a/lib/smithy-output/api-kv/rust/rust/src/error_meta.rs b/lib/smithy-output/api-kv/rust/rust/src/error_meta.rs deleted file mode 100644 index d22d50049..000000000 --- a/lib/smithy-output/api-kv/rust/rust/src/error_meta.rs +++ /dev/null @@ -1,196 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// All possible error types for this service. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum Error { - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An unhandled error occurred. - Unhandled(Box), -} -impl std::fmt::Display for Error { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Error::BadRequestError(inner) => inner.fmt(f), - Error::ForbiddenError(inner) => inner.fmt(f), - Error::InternalError(inner) => inner.fmt(f), - Error::NotFoundError(inner) => inner.fmt(f), - Error::RateLimitError(inner) => inner.fmt(f), - Error::UnauthorizedError(inner) => inner.fmt(f), - Error::Unhandled(inner) => inner.fmt(f), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::DeleteErrorKind::InternalError(inner) => Error::InternalError(inner), - crate::error::DeleteErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::DeleteErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::DeleteErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::DeleteErrorKind::NotFoundError(inner) => Error::NotFoundError(inner), - crate::error::DeleteErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::DeleteErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::DeleteBatchErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::DeleteBatchErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::DeleteBatchErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::DeleteBatchErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::DeleteBatchErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::DeleteBatchErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::DeleteBatchErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GetErrorKind::InternalError(inner) => Error::InternalError(inner), - crate::error::GetErrorKind::RateLimitError(inner) => Error::RateLimitError(inner), - crate::error::GetErrorKind::ForbiddenError(inner) => Error::ForbiddenError(inner), - crate::error::GetErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GetErrorKind::NotFoundError(inner) => Error::NotFoundError(inner), - crate::error::GetErrorKind::BadRequestError(inner) => Error::BadRequestError(inner), - crate::error::GetErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GetBatchErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GetBatchErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GetBatchErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GetBatchErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GetBatchErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GetBatchErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GetBatchErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::PutErrorKind::InternalError(inner) => Error::InternalError(inner), - crate::error::PutErrorKind::RateLimitError(inner) => Error::RateLimitError(inner), - crate::error::PutErrorKind::ForbiddenError(inner) => Error::ForbiddenError(inner), - crate::error::PutErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::PutErrorKind::NotFoundError(inner) => Error::NotFoundError(inner), - crate::error::PutErrorKind::BadRequestError(inner) => Error::BadRequestError(inner), - crate::error::PutErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::PutBatchErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::PutBatchErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::PutBatchErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::PutBatchErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::PutBatchErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::PutBatchErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::PutBatchErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl std::error::Error for Error {} diff --git a/lib/smithy-output/api-kv/rust/rust/src/input.rs b/lib/smithy-output/api-kv/rust/rust/src/input.rs deleted file mode 100644 index 47d2aa07f..000000000 --- a/lib/smithy-output/api-kv/rust/rust/src/input.rs +++ /dev/null @@ -1,1010 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -use std::fmt::Write; -/// See [`DeleteInput`](crate::input::DeleteInput) -pub mod delete_input { - /// A builder for [`DeleteInput`](crate::input::DeleteInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) key: std::option::Option, - pub(crate) namespace_id: std::option::Option, - } - impl Builder { - /// A string reprenting a key in the key-value database. Key path components are split by a slash (e.g. `a/b/c` has the path components `["a", "b", "c"]`). Slashes can be escaped by using a forward slash (e.g. `a/b\/c/d` has the path components `["a", "b/c", "d"]`). See `rivet.api.kv.common#KeyComponents` for the structure of a `rivet.api.kv.common#Key` split by `/`. - pub fn key(mut self, input: impl Into) -> Self { - self.key = Some(input.into()); - self - } - /// A string reprenting a key in the key-value database. Key path components are split by a slash (e.g. `a/b/c` has the path components `["a", "b", "c"]`). Slashes can be escaped by using a forward slash (e.g. `a/b\/c/d` has the path components `["a", "b/c", "d"]`). See `rivet.api.kv.common#KeyComponents` for the structure of a `rivet.api.kv.common#Key` split by `/`. - pub fn set_key(mut self, input: std::option::Option) -> Self { - self.key = input; - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.namespace_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.namespace_id = input; - self - } - /// Consumes the builder and constructs a [`DeleteInput`](crate::input::DeleteInput) - pub fn build( - self, - ) -> std::result::Result - { - Ok(crate::input::DeleteInput { - key: self.key, - namespace_id: self.namespace_id, - }) - } - } -} -#[doc(hidden)] -pub type DeleteInputOperationOutputAlias = crate::operation::Delete; -#[doc(hidden)] -pub type DeleteInputOperationRetryAlias = (); -impl DeleteInput { - /// Consumes the builder and constructs an Operation<[`Delete`](crate::operation::Delete)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::DeleteInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/entries").expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::DeleteInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_1) = &_input.key { - query.push_kv("key", &aws_smithy_http::query::fmt_string(&inner_1)); - } - if let Some(inner_2) = &_input.namespace_id { - query.push_kv( - "namespace_id", - &aws_smithy_http::query::fmt_string(&inner_2), - ); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::DeleteInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("DELETE").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = - aws_smithy_http::operation::Operation::new(request, crate::operation::Delete::new()) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "Delete", - "KvService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`DeleteInput`](crate::input::DeleteInput) - pub fn builder() -> crate::input::delete_input::Builder { - crate::input::delete_input::Builder::default() - } -} - -/// See [`DeleteBatchInput`](crate::input::DeleteBatchInput) -pub mod delete_batch_input { - /// A builder for [`DeleteBatchInput`](crate::input::DeleteBatchInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) keys: std::option::Option>, - pub(crate) namespace_id: std::option::Option, - } - impl Builder { - /// Appends an item to `keys`. - /// - /// To override the contents of this collection use [`set_keys`](Self::set_keys). - /// - /// A list of keys. - pub fn keys(mut self, input: impl Into) -> Self { - let mut v = self.keys.unwrap_or_default(); - v.push(input.into()); - self.keys = Some(v); - self - } - /// A list of keys. - pub fn set_keys( - mut self, - input: std::option::Option>, - ) -> Self { - self.keys = input; - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.namespace_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.namespace_id = input; - self - } - /// Consumes the builder and constructs a [`DeleteBatchInput`](crate::input::DeleteBatchInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::DeleteBatchInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::DeleteBatchInput { - keys: self.keys, - namespace_id: self.namespace_id, - }) - } - } -} -#[doc(hidden)] -pub type DeleteBatchInputOperationOutputAlias = crate::operation::DeleteBatch; -#[doc(hidden)] -pub type DeleteBatchInputOperationRetryAlias = (); -impl DeleteBatchInput { - /// Consumes the builder and constructs an Operation<[`DeleteBatch`](crate::operation::DeleteBatch)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::DeleteBatchInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/entries/batch").expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::DeleteBatchInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_3) = &_input.keys { - for inner_4 in inner_3 { - query.push_kv("keys", &aws_smithy_http::query::fmt_string(&inner_4)); - } - } - if let Some(inner_5) = &_input.namespace_id { - query.push_kv( - "namespace_id", - &aws_smithy_http::query::fmt_string(&inner_5), - ); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::DeleteBatchInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("DELETE").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::DeleteBatch::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "DeleteBatch", - "KvService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`DeleteBatchInput`](crate::input::DeleteBatchInput) - pub fn builder() -> crate::input::delete_batch_input::Builder { - crate::input::delete_batch_input::Builder::default() - } -} - -/// See [`GetInput`](crate::input::GetInput) -pub mod get_input { - /// A builder for [`GetInput`](crate::input::GetInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) key: std::option::Option, - pub(crate) watch_index: std::option::Option, - pub(crate) namespace_id: std::option::Option, - } - impl Builder { - /// A string reprenting a key in the key-value database. Key path components are split by a slash (e.g. `a/b/c` has the path components `["a", "b", "c"]`). Slashes can be escaped by using a forward slash (e.g. `a/b\/c/d` has the path components `["a", "b/c", "d"]`). See `rivet.api.kv.common#KeyComponents` for the structure of a `rivet.api.kv.common#Key` split by `/`. - pub fn key(mut self, input: impl Into) -> Self { - self.key = Some(input.into()); - self - } - /// A string reprenting a key in the key-value database. Key path components are split by a slash (e.g. `a/b/c` has the path components `["a", "b", "c"]`). Slashes can be escaped by using a forward slash (e.g. `a/b\/c/d` has the path components `["a", "b/c", "d"]`). See `rivet.api.kv.common#KeyComponents` for the structure of a `rivet.api.kv.common#Key` split by `/`. - pub fn set_key(mut self, input: std::option::Option) -> Self { - self.key = input; - self - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.watch_index = Some(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.watch_index = input; - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.namespace_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.namespace_id = input; - self - } - /// Consumes the builder and constructs a [`GetInput`](crate::input::GetInput) - pub fn build( - self, - ) -> std::result::Result { - Ok(crate::input::GetInput { - key: self.key, - watch_index: self.watch_index, - namespace_id: self.namespace_id, - }) - } - } -} -#[doc(hidden)] -pub type GetInputOperationOutputAlias = crate::operation::Get; -#[doc(hidden)] -pub type GetInputOperationRetryAlias = (); -impl GetInput { - /// Consumes the builder and constructs an Operation<[`Get`](crate::operation::Get)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GetInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/entries").expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::GetInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_6) = &_input.key { - query.push_kv("key", &aws_smithy_http::query::fmt_string(&inner_6)); - } - if let Some(inner_7) = &_input.watch_index { - query.push_kv("watch_index", &aws_smithy_http::query::fmt_string(&inner_7)); - } - if let Some(inner_8) = &_input.namespace_id { - query.push_kv( - "namespace_id", - &aws_smithy_http::query::fmt_string(&inner_8), - ); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GetInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new(request, crate::operation::Get::new()) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "Get", - "KvService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GetInput`](crate::input::GetInput) - pub fn builder() -> crate::input::get_input::Builder { - crate::input::get_input::Builder::default() - } -} - -/// See [`GetBatchInput`](crate::input::GetBatchInput) -pub mod get_batch_input { - /// A builder for [`GetBatchInput`](crate::input::GetBatchInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) keys: std::option::Option>, - pub(crate) watch_index: std::option::Option, - pub(crate) namespace_id: std::option::Option, - } - impl Builder { - /// Appends an item to `keys`. - /// - /// To override the contents of this collection use [`set_keys`](Self::set_keys). - /// - /// A list of keys. - pub fn keys(mut self, input: impl Into) -> Self { - let mut v = self.keys.unwrap_or_default(); - v.push(input.into()); - self.keys = Some(v); - self - } - /// A list of keys. - pub fn set_keys( - mut self, - input: std::option::Option>, - ) -> Self { - self.keys = input; - self - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.watch_index = Some(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.watch_index = input; - self - } - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.namespace_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.namespace_id = input; - self - } - /// Consumes the builder and constructs a [`GetBatchInput`](crate::input::GetBatchInput) - pub fn build( - self, - ) -> std::result::Result - { - Ok(crate::input::GetBatchInput { - keys: self.keys, - watch_index: self.watch_index, - namespace_id: self.namespace_id, - }) - } - } -} -#[doc(hidden)] -pub type GetBatchInputOperationOutputAlias = crate::operation::GetBatch; -#[doc(hidden)] -pub type GetBatchInputOperationRetryAlias = (); -impl GetBatchInput { - /// Consumes the builder and constructs an Operation<[`GetBatch`](crate::operation::GetBatch)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GetBatchInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/entries/batch").expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::GetBatchInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_9) = &_input.keys { - for inner_10 in inner_9 { - query.push_kv("keys", &aws_smithy_http::query::fmt_string(&inner_10)); - } - } - if let Some(inner_11) = &_input.watch_index { - query.push_kv( - "watch_index", - &aws_smithy_http::query::fmt_string(&inner_11), - ); - } - if let Some(inner_12) = &_input.namespace_id { - query.push_kv( - "namespace_id", - &aws_smithy_http::query::fmt_string(&inner_12), - ); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GetBatchInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = - aws_smithy_http::operation::Operation::new(request, crate::operation::GetBatch::new()) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GetBatch", - "KvService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GetBatchInput`](crate::input::GetBatchInput) - pub fn builder() -> crate::input::get_batch_input::Builder { - crate::input::get_batch_input::Builder::default() - } -} - -/// See [`PutInput`](crate::input::PutInput) -pub mod put_input { - /// A builder for [`PutInput`](crate::input::PutInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) namespace_id: std::option::Option, - pub(crate) key: std::option::Option, - pub(crate) value: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.namespace_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.namespace_id = input; - self - } - /// Any JSON value to set the key to. - pub fn key(mut self, input: impl Into) -> Self { - self.key = Some(input.into()); - self - } - /// Any JSON value to set the key to. - pub fn set_key(mut self, input: std::option::Option) -> Self { - self.key = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn value(mut self, input: aws_smithy_types::Document) -> Self { - self.value = Some(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_value(mut self, input: std::option::Option) -> Self { - self.value = input; - self - } - /// Consumes the builder and constructs a [`PutInput`](crate::input::PutInput) - pub fn build( - self, - ) -> std::result::Result { - Ok(crate::input::PutInput { - namespace_id: self.namespace_id, - key: self.key, - value: self.value, - }) - } - } -} -#[doc(hidden)] -pub type PutInputOperationOutputAlias = crate::operation::Put; -#[doc(hidden)] -pub type PutInputOperationRetryAlias = (); -impl PutInput { - /// Consumes the builder and constructs an Operation<[`Put`](crate::operation::Put)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::PutInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/entries").expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::PutInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("PUT").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_put(&self)?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new(request, crate::operation::Put::new()) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "Put", - "KvService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`PutInput`](crate::input::PutInput) - pub fn builder() -> crate::input::put_input::Builder { - crate::input::put_input::Builder::default() - } -} - -/// See [`PutBatchInput`](crate::input::PutBatchInput) -pub mod put_batch_input { - /// A builder for [`PutBatchInput`](crate::input::PutBatchInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) namespace_id: std::option::Option, - pub(crate) entries: std::option::Option>, - } - impl Builder { - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.namespace_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.namespace_id = input; - self - } - /// Appends an item to `entries`. - /// - /// To override the contents of this collection use [`set_entries`](Self::set_entries). - /// - /// A list of entries to insert. - pub fn entries(mut self, input: crate::model::PutEntry) -> Self { - let mut v = self.entries.unwrap_or_default(); - v.push(input); - self.entries = Some(v); - self - } - /// A list of entries to insert. - pub fn set_entries( - mut self, - input: std::option::Option>, - ) -> Self { - self.entries = input; - self - } - /// Consumes the builder and constructs a [`PutBatchInput`](crate::input::PutBatchInput) - pub fn build( - self, - ) -> std::result::Result - { - Ok(crate::input::PutBatchInput { - namespace_id: self.namespace_id, - entries: self.entries, - }) - } - } -} -#[doc(hidden)] -pub type PutBatchInputOperationOutputAlias = crate::operation::PutBatch; -#[doc(hidden)] -pub type PutBatchInputOperationRetryAlias = (); -impl PutBatchInput { - /// Consumes the builder and constructs an Operation<[`PutBatch`](crate::operation::PutBatch)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::PutBatchInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/entries/batch").expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::PutBatchInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("PUT").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_put_batch(&self)?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = - aws_smithy_http::operation::Operation::new(request, crate::operation::PutBatch::new()) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "PutBatch", - "KvService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`PutBatchInput`](crate::input::PutBatchInput) - pub fn builder() -> crate::input::put_batch_input::Builder { - crate::input::put_batch_input::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PutBatchInput { - /// A universally unique identifier. - pub namespace_id: std::option::Option, - /// A list of entries to insert. - pub entries: std::option::Option>, -} -impl PutBatchInput { - /// A universally unique identifier. - pub fn namespace_id(&self) -> std::option::Option<&str> { - self.namespace_id.as_deref() - } - /// A list of entries to insert. - pub fn entries(&self) -> std::option::Option<&[crate::model::PutEntry]> { - self.entries.as_deref() - } -} -impl std::fmt::Debug for PutBatchInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PutBatchInput"); - formatter.field("namespace_id", &self.namespace_id); - formatter.field("entries", &self.entries); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct DeleteBatchInput { - /// A list of keys. - pub keys: std::option::Option>, - /// A universally unique identifier. - pub namespace_id: std::option::Option, -} -impl DeleteBatchInput { - /// A list of keys. - pub fn keys(&self) -> std::option::Option<&[std::string::String]> { - self.keys.as_deref() - } - /// A universally unique identifier. - pub fn namespace_id(&self) -> std::option::Option<&str> { - self.namespace_id.as_deref() - } -} -impl std::fmt::Debug for DeleteBatchInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("DeleteBatchInput"); - formatter.field("keys", &self.keys); - formatter.field("namespace_id", &self.namespace_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetBatchInput { - /// A list of keys. - pub keys: std::option::Option>, - /// A query parameter denoting the requests watch index. - pub watch_index: std::option::Option, - /// A universally unique identifier. - pub namespace_id: std::option::Option, -} -impl GetBatchInput { - /// A list of keys. - pub fn keys(&self) -> std::option::Option<&[std::string::String]> { - self.keys.as_deref() - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(&self) -> std::option::Option<&str> { - self.watch_index.as_deref() - } - /// A universally unique identifier. - pub fn namespace_id(&self) -> std::option::Option<&str> { - self.namespace_id.as_deref() - } -} -impl std::fmt::Debug for GetBatchInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetBatchInput"); - formatter.field("keys", &self.keys); - formatter.field("watch_index", &self.watch_index); - formatter.field("namespace_id", &self.namespace_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PutInput { - /// A universally unique identifier. - pub namespace_id: std::option::Option, - /// Any JSON value to set the key to. - pub key: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub value: std::option::Option, -} -impl PutInput { - /// A universally unique identifier. - pub fn namespace_id(&self) -> std::option::Option<&str> { - self.namespace_id.as_deref() - } - /// Any JSON value to set the key to. - pub fn key(&self) -> std::option::Option<&str> { - self.key.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn value(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.value.as_ref() - } -} -impl std::fmt::Debug for PutInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PutInput"); - formatter.field("namespace_id", &self.namespace_id); - formatter.field("key", &self.key); - formatter.field("value", &self.value); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct DeleteInput { - /// A string reprenting a key in the key-value database. Key path components are split by a slash (e.g. `a/b/c` has the path components `["a", "b", "c"]`). Slashes can be escaped by using a forward slash (e.g. `a/b\/c/d` has the path components `["a", "b/c", "d"]`). See `rivet.api.kv.common#KeyComponents` for the structure of a `rivet.api.kv.common#Key` split by `/`. - pub key: std::option::Option, - /// A universally unique identifier. - pub namespace_id: std::option::Option, -} -impl DeleteInput { - /// A string reprenting a key in the key-value database. Key path components are split by a slash (e.g. `a/b/c` has the path components `["a", "b", "c"]`). Slashes can be escaped by using a forward slash (e.g. `a/b\/c/d` has the path components `["a", "b/c", "d"]`). See `rivet.api.kv.common#KeyComponents` for the structure of a `rivet.api.kv.common#Key` split by `/`. - pub fn key(&self) -> std::option::Option<&str> { - self.key.as_deref() - } - /// A universally unique identifier. - pub fn namespace_id(&self) -> std::option::Option<&str> { - self.namespace_id.as_deref() - } -} -impl std::fmt::Debug for DeleteInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("DeleteInput"); - formatter.field("key", &self.key); - formatter.field("namespace_id", &self.namespace_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetInput { - /// A string reprenting a key in the key-value database. Key path components are split by a slash (e.g. `a/b/c` has the path components `["a", "b", "c"]`). Slashes can be escaped by using a forward slash (e.g. `a/b\/c/d` has the path components `["a", "b/c", "d"]`). See `rivet.api.kv.common#KeyComponents` for the structure of a `rivet.api.kv.common#Key` split by `/`. - pub key: std::option::Option, - /// A query parameter denoting the requests watch index. - pub watch_index: std::option::Option, - /// A universally unique identifier. - pub namespace_id: std::option::Option, -} -impl GetInput { - /// A string reprenting a key in the key-value database. Key path components are split by a slash (e.g. `a/b/c` has the path components `["a", "b", "c"]`). Slashes can be escaped by using a forward slash (e.g. `a/b\/c/d` has the path components `["a", "b/c", "d"]`). See `rivet.api.kv.common#KeyComponents` for the structure of a `rivet.api.kv.common#Key` split by `/`. - pub fn key(&self) -> std::option::Option<&str> { - self.key.as_deref() - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(&self) -> std::option::Option<&str> { - self.watch_index.as_deref() - } - /// A universally unique identifier. - pub fn namespace_id(&self) -> std::option::Option<&str> { - self.namespace_id.as_deref() - } -} -impl std::fmt::Debug for GetInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetInput"); - formatter.field("key", &self.key); - formatter.field("watch_index", &self.watch_index); - formatter.field("namespace_id", &self.namespace_id); - formatter.finish() - } -} diff --git a/lib/smithy-output/api-kv/rust/rust/src/json_deser.rs b/lib/smithy-output/api-kv/rust/rust/src/json_deser.rs deleted file mode 100644 index 4d9fbe3cc..000000000 --- a/lib/smithy-output/api-kv/rust/rust/src/json_deser.rs +++ /dev/null @@ -1,672 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub fn parse_http_generic_error( - response: &http::Response, -) -> Result { - crate::json_errors::parse_generic_error(response.body(), response.headers()) -} - -pub fn deser_structure_crate_error_internal_error_json_err( - value: &[u8], - mut builder: crate::error::internal_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_rate_limit_error_json_err( - value: &[u8], - mut builder: crate::error::rate_limit_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_forbidden_error_json_err( - value: &[u8], - mut builder: crate::error::forbidden_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_unauthorized_error_json_err( - value: &[u8], - mut builder: crate::error::unauthorized_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_not_found_error_json_err( - value: &[u8], - mut builder: crate::error::not_found_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_bad_request_error_json_err( - value: &[u8], - mut builder: crate::error::bad_request_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_get( - value: &[u8], - mut builder: crate::output::get_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "deleted" => { - builder = builder.set_deleted( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - "value" => { - builder = builder.set_value(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - "watch" => { - builder = builder.set_watch( - crate::json_deser::deser_structure_crate_model_watch_response(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_get_batch( - value: &[u8], - mut builder: crate::output::get_batch_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "entries" => { - builder = builder.set_entries( - crate::json_deser::deser_list_rivet_api_kv_common_kv_entries(tokens)?, - ); - } - "watch" => { - builder = builder.set_watch( - crate::json_deser::deser_structure_crate_model_watch_response(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn or_empty_doc(data: &[u8]) -> &[u8] { - if data.is_empty() { - b"{}" - } else { - data - } -} - -pub fn deser_structure_crate_model_watch_response<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::WatchResponse::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "index" => { - builder = builder.set_index( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_api_kv_common_kv_entries<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_kv_entry(tokens)?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_structure_crate_model_kv_entry<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::KvEntry::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "key" => { - builder = builder.set_key( - crate::json_deser::deser_list_rivet_api_kv_common_key_components(tokens)? - ); - } - "value" => { - builder = builder.set_value(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - "deleted" => { - builder = builder.set_deleted( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_api_kv_common_key_components<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} diff --git a/lib/smithy-output/api-kv/rust/rust/src/json_errors.rs b/lib/smithy-output/api-kv/rust/rust/src/json_errors.rs deleted file mode 100644 index 7b7574319..000000000 --- a/lib/smithy-output/api-kv/rust/rust/src/json_errors.rs +++ /dev/null @@ -1,220 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -use aws_smithy_json::deserialize::token::skip_value; -use aws_smithy_json::deserialize::{json_token_iter, Error as DeserializeError, Token}; -use aws_smithy_types::Error as SmithyError; -use bytes::Bytes; -use http::header::ToStrError; -use http::{HeaderMap, HeaderValue}; -use std::borrow::Cow; - -// currently only used by AwsJson -#[allow(unused)] -pub fn is_error(response: &http::Response) -> bool { - !response.status().is_success() -} - -fn sanitize_error_code(error_code: &str) -> &str { - // Trim a trailing URL from the error code, beginning with a `:` - let error_code = match error_code.find(':') { - Some(idx) => &error_code[..idx], - None => error_code, - }; - - // Trim a prefixing namespace from the error code, beginning with a `#` - match error_code.find('#') { - Some(idx) => &error_code[idx + 1..], - None => error_code, - } -} - -struct ErrorBody<'a> { - code: Option>, - message: Option>, -} - -fn parse_error_body(bytes: &[u8]) -> Result { - let mut tokens = json_token_iter(bytes).peekable(); - let (mut typ, mut code, mut message) = (None, None, None); - if let Some(Token::StartObject { .. }) = tokens.next().transpose()? { - loop { - match tokens.next().transpose()? { - Some(Token::EndObject { .. }) => break, - Some(Token::ObjectKey { key, .. }) => { - if let Some(Ok(Token::ValueString { value, .. })) = tokens.peek() { - match key.as_escaped_str() { - "code" => code = Some(value.to_unescaped()?), - "__type" => typ = Some(value.to_unescaped()?), - "message" | "Message" | "errorMessage" => { - message = Some(value.to_unescaped()?) - } - _ => {} - } - } - skip_value(&mut tokens)?; - } - _ => { - return Err(DeserializeError::custom( - "expected object key or end object", - )) - } - } - } - if tokens.next().is_some() { - return Err(DeserializeError::custom( - "found more JSON tokens after completing parsing", - )); - } - } - Ok(ErrorBody { - code: code.or(typ), - message, - }) -} - -fn error_type_from_header(headers: &HeaderMap) -> Result, ToStrError> { - headers - .get("X-Amzn-Errortype") - .map(|v| v.to_str()) - .transpose() -} - -fn request_id(headers: &HeaderMap) -> Option<&str> { - headers - .get("X-Amzn-Requestid") - .and_then(|v| v.to_str().ok()) -} - -pub fn parse_generic_error( - payload: &Bytes, - headers: &HeaderMap, -) -> Result { - let ErrorBody { code, message } = parse_error_body(payload.as_ref())?; - - let mut err_builder = SmithyError::builder(); - if let Some(code) = error_type_from_header(headers) - .map_err(|_| DeserializeError::custom("X-Amzn-Errortype header was not valid UTF-8"))? - .or_else(|| code.as_deref()) - .map(sanitize_error_code) - { - err_builder.code(code); - } - if let Some(message) = message { - err_builder.message(message); - } - if let Some(request_id) = request_id(headers) { - err_builder.request_id(request_id); - } - Ok(err_builder.build()) -} - -#[cfg(test)] -mod test { - use crate::json_errors::{parse_error_body, parse_generic_error, sanitize_error_code}; - use aws_smithy_types::Error; - use bytes::Bytes; - use std::borrow::Cow; - - #[test] - fn generic_error() { - let response = http::Response::builder() - .header("X-Amzn-Requestid", "1234") - .body(Bytes::from_static( - br#"{ "__type": "FooError", "message": "Go to foo" }"#, - )) - .unwrap(); - assert_eq!( - parse_generic_error(response.body(), response.headers()).unwrap(), - Error::builder() - .code("FooError") - .message("Go to foo") - .request_id("1234") - .build() - ) - } - - #[test] - fn error_type() { - assert_eq!( - Some(Cow::Borrowed("FooError")), - parse_error_body(br#"{ "__type": "FooError" }"#) - .unwrap() - .code - ); - } - - #[test] - fn code_takes_priority() { - assert_eq!( - Some(Cow::Borrowed("BarError")), - parse_error_body(br#"{ "code": "BarError", "__type": "FooError" }"#) - .unwrap() - .code - ); - } - - #[test] - fn ignore_unrecognized_fields() { - assert_eq!( - Some(Cow::Borrowed("FooError")), - parse_error_body(br#"{ "__type": "FooError", "asdf": 5, "fdsa": {}, "foo": "1" }"#) - .unwrap() - .code - ); - } - - #[test] - fn sanitize_namespace_and_url() { - assert_eq!( - sanitize_error_code("aws.protocoltests.restjson#FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/"), - "FooError"); - } - - #[test] - fn sanitize_noop() { - assert_eq!(sanitize_error_code("FooError"), "FooError"); - } - - #[test] - fn sanitize_url() { - assert_eq!( - sanitize_error_code( - "FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/" - ), - "FooError" - ); - } - - #[test] - fn sanitize_namespace() { - assert_eq!( - sanitize_error_code("aws.protocoltests.restjson#FooError"), - "FooError" - ); - } - - // services like lambda use an alternate `Message` instead of `message` - #[test] - fn alternative_error_message_names() { - let response = http::Response::builder() - .header("x-amzn-errortype", "ResourceNotFoundException") - .body(Bytes::from_static( - br#"{ - "Type": "User", - "Message": "Functions from 'us-west-2' are not reachable from us-east-1" - }"#, - )) - .unwrap(); - assert_eq!( - parse_generic_error(response.body(), response.headers()).unwrap(), - Error::builder() - .code("ResourceNotFoundException") - .message("Functions from 'us-west-2' are not reachable from us-east-1") - .build() - ); - } -} diff --git a/lib/smithy-output/api-kv/rust/rust/src/json_ser.rs b/lib/smithy-output/api-kv/rust/rust/src/json_ser.rs deleted file mode 100644 index a30171b66..000000000 --- a/lib/smithy-output/api-kv/rust/rust/src/json_ser.rs +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub fn serialize_structure_crate_input_put_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::PutInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_1) = &input.key { - object.key("key").string(var_1.as_str()); - } - if let Some(var_2) = &input.namespace_id { - object.key("namespace_id").string(var_2.as_str()); - } - if let Some(var_3) = &input.value { - object.key("value").document(var_3); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_put_batch_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::PutBatchInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_4) = &input.entries { - let mut array_5 = object.key("entries").start_array(); - for item_6 in var_4 { - { - let mut object_7 = array_5.value().start_object(); - crate::json_ser::serialize_structure_crate_model_put_entry(&mut object_7, item_6)?; - object_7.finish(); - } - } - array_5.finish(); - } - if let Some(var_8) = &input.namespace_id { - object.key("namespace_id").string(var_8.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_model_put_entry( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::PutEntry, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_9) = &input.key { - object.key("key").string(var_9.as_str()); - } - if let Some(var_10) = &input.value { - object.key("value").document(var_10); - } - Ok(()) -} diff --git a/lib/smithy-output/api-kv/rust/rust/src/lib.rs b/lib/smithy-output/api-kv/rust/rust/src/lib.rs deleted file mode 100644 index e175fe0f6..000000000 --- a/lib/smithy-output/api-kv/rust/rust/src/lib.rs +++ /dev/null @@ -1,57 +0,0 @@ -#![allow(clippy::module_inception)] -#![allow(clippy::upper_case_acronyms)] -#![allow(clippy::large_enum_variant)] -#![allow(clippy::wrong_self_convention)] -#![allow(clippy::should_implement_trait)] -#![allow(clippy::blacklisted_name)] -#![allow(clippy::vec_init_then_push)] -#![allow(rustdoc::bare_urls)] -#![warn(missing_docs)] -//! rivet-kv -//! -//! # Crate Organization -//! -//! The entry point for most customers will be [`Client`]. [`Client`] exposes one method for each API offered -//! by the service. -//! -//! Some APIs require complex or nested arguments. These exist in [`model`](crate::model). -//! -//! Lastly, errors that can be returned by the service are contained within [`error`]. [`Error`] defines a meta -//! error encompassing all possible errors that can be returned by the service. -//! -//! The other modules within this crate are not required for normal usage. - -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use error_meta::Error; - -#[doc(inline)] -pub use config::Config; - -/// Client and fluent builders for calling the service. -pub mod client; -/// Configuration for the service. -pub mod config; -/// Errors that can occur when calling the service. -pub mod error; -mod error_meta; -/// Input structures for operations. -pub mod input; -mod json_deser; -mod json_errors; -mod json_ser; -/// Data structures used by operation inputs/outputs. -pub mod model; -/// All operations that this crate can perform. -pub mod operation; -mod operation_deser; -mod operation_ser; -/// Output structures for operations. -pub mod output; -pub use client::{Builder, Client, ClientWrapper}; -/// Crate version number. -pub static PKG_VERSION: &str = env!("CARGO_PKG_VERSION"); -/// Re-exported types from supporting crates. -pub mod types { - pub use aws_smithy_http::result::SdkError; - pub use aws_smithy_types::DateTime; -} diff --git a/lib/smithy-output/api-kv/rust/rust/src/model.rs b/lib/smithy-output/api-kv/rust/rust/src/model.rs deleted file mode 100644 index 5732e4931..000000000 --- a/lib/smithy-output/api-kv/rust/rust/src/model.rs +++ /dev/null @@ -1,226 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// A new entry to insert into the key-value database. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PutEntry { - /// A string reprenting a key in the key-value database. Key path components are split by a slash (e.g. `a/b/c` has the path components `["a", "b", "c"]`). Slashes can be escaped by using a forward slash (e.g. `a/b\/c/d` has the path components `["a", "b/c", "d"]`). See `rivet.api.kv.common#KeyComponents` for the structure of a `rivet.api.kv.common#Key` split by `/`. - pub key: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub value: std::option::Option, -} -impl PutEntry { - /// A string reprenting a key in the key-value database. Key path components are split by a slash (e.g. `a/b/c` has the path components `["a", "b", "c"]`). Slashes can be escaped by using a forward slash (e.g. `a/b\/c/d` has the path components `["a", "b/c", "d"]`). See `rivet.api.kv.common#KeyComponents` for the structure of a `rivet.api.kv.common#Key` split by `/`. - pub fn key(&self) -> std::option::Option<&str> { - self.key.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn value(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.value.as_ref() - } -} -impl std::fmt::Debug for PutEntry { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PutEntry"); - formatter.field("key", &self.key); - formatter.field("value", &self.value); - formatter.finish() - } -} -/// See [`PutEntry`](crate::model::PutEntry) -pub mod put_entry { - /// A builder for [`PutEntry`](crate::model::PutEntry) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) key: std::option::Option, - pub(crate) value: std::option::Option, - } - impl Builder { - /// A string reprenting a key in the key-value database. Key path components are split by a slash (e.g. `a/b/c` has the path components `["a", "b", "c"]`). Slashes can be escaped by using a forward slash (e.g. `a/b\/c/d` has the path components `["a", "b/c", "d"]`). See `rivet.api.kv.common#KeyComponents` for the structure of a `rivet.api.kv.common#Key` split by `/`. - pub fn key(mut self, input: impl Into) -> Self { - self.key = Some(input.into()); - self - } - /// A string reprenting a key in the key-value database. Key path components are split by a slash (e.g. `a/b/c` has the path components `["a", "b", "c"]`). Slashes can be escaped by using a forward slash (e.g. `a/b\/c/d` has the path components `["a", "b/c", "d"]`). See `rivet.api.kv.common#KeyComponents` for the structure of a `rivet.api.kv.common#Key` split by `/`. - pub fn set_key(mut self, input: std::option::Option) -> Self { - self.key = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn value(mut self, input: aws_smithy_types::Document) -> Self { - self.value = Some(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_value(mut self, input: std::option::Option) -> Self { - self.value = input; - self - } - /// Consumes the builder and constructs a [`PutEntry`](crate::model::PutEntry) - pub fn build(self) -> crate::model::PutEntry { - crate::model::PutEntry { - key: self.key, - value: self.value, - } - } - } -} -impl PutEntry { - /// Creates a new builder-style object to manufacture [`PutEntry`](crate::model::PutEntry) - pub fn builder() -> crate::model::put_entry::Builder { - crate::model::put_entry::Builder::default() - } -} - -/// Provided by watchable endpoints used in blocking loops. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct WatchResponse { - /// Index indicating the version of the data responded. Pas this to `rivet.common#WatchQuery` to block and wait for the next response. - pub index: std::option::Option, -} -impl WatchResponse { - /// Index indicating the version of the data responded. Pas this to `rivet.common#WatchQuery` to block and wait for the next response. - pub fn index(&self) -> std::option::Option<&str> { - self.index.as_deref() - } -} -impl std::fmt::Debug for WatchResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("WatchResponse"); - formatter.field("index", &self.index); - formatter.finish() - } -} -/// See [`WatchResponse`](crate::model::WatchResponse) -pub mod watch_response { - /// A builder for [`WatchResponse`](crate::model::WatchResponse) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) index: std::option::Option, - } - impl Builder { - /// Index indicating the version of the data responded. Pas this to `rivet.common#WatchQuery` to block and wait for the next response. - pub fn index(mut self, input: impl Into) -> Self { - self.index = Some(input.into()); - self - } - /// Index indicating the version of the data responded. Pas this to `rivet.common#WatchQuery` to block and wait for the next response. - pub fn set_index(mut self, input: std::option::Option) -> Self { - self.index = input; - self - } - /// Consumes the builder and constructs a [`WatchResponse`](crate::model::WatchResponse) - pub fn build(self) -> crate::model::WatchResponse { - crate::model::WatchResponse { index: self.index } - } - } -} -impl WatchResponse { - /// Creates a new builder-style object to manufacture [`WatchResponse`](crate::model::WatchResponse) - pub fn builder() -> crate::model::watch_response::Builder { - crate::model::watch_response::Builder::default() - } -} - -/// A key-value entry. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct KvEntry { - /// A key separated into components. - pub key: std::option::Option>, - #[allow(missing_docs)] // documentation missing in model - pub value: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub deleted: std::option::Option, -} -impl KvEntry { - /// A key separated into components. - pub fn key(&self) -> std::option::Option<&[std::string::String]> { - self.key.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn value(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.value.as_ref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn deleted(&self) -> std::option::Option { - self.deleted - } -} -impl std::fmt::Debug for KvEntry { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("KvEntry"); - formatter.field("key", &self.key); - formatter.field("value", &self.value); - formatter.field("deleted", &self.deleted); - formatter.finish() - } -} -/// See [`KvEntry`](crate::model::KvEntry) -pub mod kv_entry { - /// A builder for [`KvEntry`](crate::model::KvEntry) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) key: std::option::Option>, - pub(crate) value: std::option::Option, - pub(crate) deleted: std::option::Option, - } - impl Builder { - /// Appends an item to `key`. - /// - /// To override the contents of this collection use [`set_key`](Self::set_key). - /// - /// A key separated into components. - pub fn key(mut self, input: impl Into) -> Self { - let mut v = self.key.unwrap_or_default(); - v.push(input.into()); - self.key = Some(v); - self - } - /// A key separated into components. - pub fn set_key( - mut self, - input: std::option::Option>, - ) -> Self { - self.key = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn value(mut self, input: aws_smithy_types::Document) -> Self { - self.value = Some(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_value(mut self, input: std::option::Option) -> Self { - self.value = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn deleted(mut self, input: bool) -> Self { - self.deleted = Some(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_deleted(mut self, input: std::option::Option) -> Self { - self.deleted = input; - self - } - /// Consumes the builder and constructs a [`KvEntry`](crate::model::KvEntry) - pub fn build(self) -> crate::model::KvEntry { - crate::model::KvEntry { - key: self.key, - value: self.value, - deleted: self.deleted, - } - } - } -} -impl KvEntry { - /// Creates a new builder-style object to manufacture [`KvEntry`](crate::model::KvEntry) - pub fn builder() -> crate::model::kv_entry::Builder { - crate::model::kv_entry::Builder::default() - } -} diff --git a/lib/smithy-output/api-kv/rust/rust/src/operation.rs b/lib/smithy-output/api-kv/rust/rust/src/operation.rs deleted file mode 100644 index 9dc6e5a6e..000000000 --- a/lib/smithy-output/api-kv/rust/rust/src/operation.rs +++ /dev/null @@ -1,187 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Operation shape for `Delete`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`delete`](crate::client::Client::delete). -/// -/// See [`crate::client::fluent_builders::Delete`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct Delete { - _private: (), -} -impl Delete { - /// Creates a new builder-style object to manufacture [`DeleteInput`](crate::input::DeleteInput) - pub fn builder() -> crate::input::delete_input::Builder { - crate::input::delete_input::Builder::default() - } - /// Creates a new `Delete` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for Delete { - type Output = std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_delete_error(response) - } else { - crate::operation_deser::parse_delete_response(response) - } - } -} - -/// Operation shape for `DeleteBatch`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`delete_batch`](crate::client::Client::delete_batch). -/// -/// See [`crate::client::fluent_builders::DeleteBatch`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct DeleteBatch { - _private: (), -} -impl DeleteBatch { - /// Creates a new builder-style object to manufacture [`DeleteBatchInput`](crate::input::DeleteBatchInput) - pub fn builder() -> crate::input::delete_batch_input::Builder { - crate::input::delete_batch_input::Builder::default() - } - /// Creates a new `DeleteBatch` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for DeleteBatch { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_delete_batch_error(response) - } else { - crate::operation_deser::parse_delete_batch_response(response) - } - } -} - -/// Operation shape for `Get`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`get`](crate::client::Client::get). -/// -/// See [`crate::client::fluent_builders::Get`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct Get { - _private: (), -} -impl Get { - /// Creates a new builder-style object to manufacture [`GetInput`](crate::input::GetInput) - pub fn builder() -> crate::input::get_input::Builder { - crate::input::get_input::Builder::default() - } - /// Creates a new `Get` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for Get { - type Output = std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_get_error(response) - } else { - crate::operation_deser::parse_get_response(response) - } - } -} - -/// Operation shape for `GetBatch`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`get_batch`](crate::client::Client::get_batch). -/// -/// See [`crate::client::fluent_builders::GetBatch`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GetBatch { - _private: (), -} -impl GetBatch { - /// Creates a new builder-style object to manufacture [`GetBatchInput`](crate::input::GetBatchInput) - pub fn builder() -> crate::input::get_batch_input::Builder { - crate::input::get_batch_input::Builder::default() - } - /// Creates a new `GetBatch` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GetBatch { - type Output = std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_get_batch_error(response) - } else { - crate::operation_deser::parse_get_batch_response(response) - } - } -} - -/// Operation shape for `Put`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`put`](crate::client::Client::put). -/// -/// See [`crate::client::fluent_builders::Put`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct Put { - _private: (), -} -impl Put { - /// Creates a new builder-style object to manufacture [`PutInput`](crate::input::PutInput) - pub fn builder() -> crate::input::put_input::Builder { - crate::input::put_input::Builder::default() - } - /// Creates a new `Put` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for Put { - type Output = std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_put_error(response) - } else { - crate::operation_deser::parse_put_response(response) - } - } -} - -/// Operation shape for `PutBatch`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`put_batch`](crate::client::Client::put_batch). -/// -/// See [`crate::client::fluent_builders::PutBatch`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct PutBatch { - _private: (), -} -impl PutBatch { - /// Creates a new builder-style object to manufacture [`PutBatchInput`](crate::input::PutBatchInput) - pub fn builder() -> crate::input::put_batch_input::Builder { - crate::input::put_batch_input::Builder::default() - } - /// Creates a new `PutBatch` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for PutBatch { - type Output = std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_put_batch_error(response) - } else { - crate::operation_deser::parse_put_batch_response(response) - } - } -} diff --git a/lib/smithy-output/api-kv/rust/rust/src/operation_deser.rs b/lib/smithy-output/api-kv/rust/rust/src/operation_deser.rs deleted file mode 100644 index 9dea9957d..000000000 --- a/lib/smithy-output/api-kv/rust/rust/src/operation_deser.rs +++ /dev/null @@ -1,886 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[allow(clippy::unnecessary_wraps)] -pub fn parse_delete_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::DeleteError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::DeleteError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::DeleteError { - meta: generic, - kind: crate::error::DeleteErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::DeleteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::DeleteError { - meta: generic, - kind: crate::error::DeleteErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::DeleteError { - meta: generic, - kind: crate::error::DeleteErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::DeleteError { - meta: generic, - kind: crate::error::DeleteErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::DeleteError { - meta: generic, - kind: crate::error::DeleteErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::DeleteError { - meta: generic, - kind: crate::error::DeleteErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::DeleteError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_delete_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::delete_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_delete_batch_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::DeleteBatchError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::DeleteBatchError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::DeleteBatchError { - meta: generic, - kind: crate::error::DeleteBatchErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::DeleteBatchError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::DeleteBatchError { - meta: generic, - kind: crate::error::DeleteBatchErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteBatchError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::DeleteBatchError { - meta: generic, - kind: crate::error::DeleteBatchErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteBatchError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::DeleteBatchError { - meta: generic, - kind: crate::error::DeleteBatchErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteBatchError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::DeleteBatchError { - meta: generic, - kind: crate::error::DeleteBatchErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteBatchError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::DeleteBatchError { - meta: generic, - kind: crate::error::DeleteBatchErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteBatchError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::DeleteBatchError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_delete_batch_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::delete_batch_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GetError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::GetError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GetError { - meta: generic, - kind: crate::error::GetErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GetError { - meta: generic, - kind: crate::error::GetErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GetError { - meta: generic, - kind: crate::error::GetErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GetError { - meta: generic, - kind: crate::error::GetErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GetError { - meta: generic, - kind: crate::error::GetErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GetError { - meta: generic, - kind: crate::error::GetErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GetError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::get_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_get( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_batch_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GetBatchError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::GetBatchError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GetBatchError { - meta: generic, - kind: crate::error::GetBatchErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetBatchError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GetBatchError { - meta: generic, - kind: crate::error::GetBatchErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetBatchError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GetBatchError { - meta: generic, - kind: crate::error::GetBatchErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetBatchError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GetBatchError { - meta: generic, - kind: crate::error::GetBatchErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetBatchError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GetBatchError { - meta: generic, - kind: crate::error::GetBatchErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetBatchError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GetBatchError { - meta: generic, - kind: crate::error::GetBatchErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetBatchError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GetBatchError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_batch_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::get_batch_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_get_batch( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetBatchError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_put_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::PutError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::PutError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::PutError { - meta: generic, - kind: crate::error::PutErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::PutError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::PutError { - meta: generic, - kind: crate::error::PutErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::PutError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::PutError { - meta: generic, - kind: crate::error::PutErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::PutError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::PutError { - meta: generic, - kind: crate::error::PutErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::PutError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::PutError { - meta: generic, - kind: crate::error::PutErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::PutError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::PutError { - meta: generic, - kind: crate::error::PutErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::PutError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::PutError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_put_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::put_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_put_batch_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::PutBatchError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::PutBatchError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::PutBatchError { - meta: generic, - kind: crate::error::PutBatchErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::PutBatchError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::PutBatchError { - meta: generic, - kind: crate::error::PutBatchErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::PutBatchError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::PutBatchError { - meta: generic, - kind: crate::error::PutBatchErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::PutBatchError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::PutBatchError { - meta: generic, - kind: crate::error::PutBatchErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::PutBatchError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::PutBatchError { - meta: generic, - kind: crate::error::PutBatchErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::PutBatchError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::PutBatchError { - meta: generic, - kind: crate::error::PutBatchErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::PutBatchError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::PutBatchError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_put_batch_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::put_batch_output::Builder::default(); - let _ = response; - output.build() - }) -} diff --git a/lib/smithy-output/api-kv/rust/rust/src/operation_ser.rs b/lib/smithy-output/api-kv/rust/rust/src/operation_ser.rs deleted file mode 100644 index 1148e91d7..000000000 --- a/lib/smithy-output/api-kv/rust/rust/src/operation_ser.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub fn serialize_operation_crate_operation_put( - input: &crate::input::PutInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_put_input(&mut object, input)?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_put_batch( - input: &crate::input::PutBatchInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_put_batch_input(&mut object, input)?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} diff --git a/lib/smithy-output/api-kv/rust/rust/src/output.rs b/lib/smithy-output/api-kv/rust/rust/src/output.rs deleted file mode 100644 index aa98dc198..000000000 --- a/lib/smithy-output/api-kv/rust/rust/src/output.rs +++ /dev/null @@ -1,300 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PutBatchOutput {} -impl std::fmt::Debug for PutBatchOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PutBatchOutput"); - formatter.finish() - } -} -/// See [`PutBatchOutput`](crate::output::PutBatchOutput) -pub mod put_batch_output { - /// A builder for [`PutBatchOutput`](crate::output::PutBatchOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`PutBatchOutput`](crate::output::PutBatchOutput) - pub fn build(self) -> crate::output::PutBatchOutput { - crate::output::PutBatchOutput {} - } - } -} -impl PutBatchOutput { - /// Creates a new builder-style object to manufacture [`PutBatchOutput`](crate::output::PutBatchOutput) - pub fn builder() -> crate::output::put_batch_output::Builder { - crate::output::put_batch_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct DeleteBatchOutput {} -impl std::fmt::Debug for DeleteBatchOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("DeleteBatchOutput"); - formatter.finish() - } -} -/// See [`DeleteBatchOutput`](crate::output::DeleteBatchOutput) -pub mod delete_batch_output { - /// A builder for [`DeleteBatchOutput`](crate::output::DeleteBatchOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`DeleteBatchOutput`](crate::output::DeleteBatchOutput) - pub fn build(self) -> crate::output::DeleteBatchOutput { - crate::output::DeleteBatchOutput {} - } - } -} -impl DeleteBatchOutput { - /// Creates a new builder-style object to manufacture [`DeleteBatchOutput`](crate::output::DeleteBatchOutput) - pub fn builder() -> crate::output::delete_batch_output::Builder { - crate::output::delete_batch_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetBatchOutput { - /// A list of key-value entries. - pub entries: std::option::Option>, - /// Provided by watchable endpoints used in blocking loops. - pub watch: std::option::Option, -} -impl GetBatchOutput { - /// A list of key-value entries. - pub fn entries(&self) -> std::option::Option<&[crate::model::KvEntry]> { - self.entries.as_deref() - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(&self) -> std::option::Option<&crate::model::WatchResponse> { - self.watch.as_ref() - } -} -impl std::fmt::Debug for GetBatchOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetBatchOutput"); - formatter.field("entries", &self.entries); - formatter.field("watch", &self.watch); - formatter.finish() - } -} -/// See [`GetBatchOutput`](crate::output::GetBatchOutput) -pub mod get_batch_output { - /// A builder for [`GetBatchOutput`](crate::output::GetBatchOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) entries: std::option::Option>, - pub(crate) watch: std::option::Option, - } - impl Builder { - /// Appends an item to `entries`. - /// - /// To override the contents of this collection use [`set_entries`](Self::set_entries). - /// - /// A list of key-value entries. - pub fn entries(mut self, input: crate::model::KvEntry) -> Self { - let mut v = self.entries.unwrap_or_default(); - v.push(input); - self.entries = Some(v); - self - } - /// A list of key-value entries. - pub fn set_entries( - mut self, - input: std::option::Option>, - ) -> Self { - self.entries = input; - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(mut self, input: crate::model::WatchResponse) -> Self { - self.watch = Some(input); - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn set_watch( - mut self, - input: std::option::Option, - ) -> Self { - self.watch = input; - self - } - /// Consumes the builder and constructs a [`GetBatchOutput`](crate::output::GetBatchOutput) - pub fn build(self) -> crate::output::GetBatchOutput { - crate::output::GetBatchOutput { - entries: self.entries, - watch: self.watch, - } - } - } -} -impl GetBatchOutput { - /// Creates a new builder-style object to manufacture [`GetBatchOutput`](crate::output::GetBatchOutput) - pub fn builder() -> crate::output::get_batch_output::Builder { - crate::output::get_batch_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PutOutput {} -impl std::fmt::Debug for PutOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PutOutput"); - formatter.finish() - } -} -/// See [`PutOutput`](crate::output::PutOutput) -pub mod put_output { - /// A builder for [`PutOutput`](crate::output::PutOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`PutOutput`](crate::output::PutOutput) - pub fn build(self) -> crate::output::PutOutput { - crate::output::PutOutput {} - } - } -} -impl PutOutput { - /// Creates a new builder-style object to manufacture [`PutOutput`](crate::output::PutOutput) - pub fn builder() -> crate::output::put_output::Builder { - crate::output::put_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct DeleteOutput {} -impl std::fmt::Debug for DeleteOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("DeleteOutput"); - formatter.finish() - } -} -/// See [`DeleteOutput`](crate::output::DeleteOutput) -pub mod delete_output { - /// A builder for [`DeleteOutput`](crate::output::DeleteOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`DeleteOutput`](crate::output::DeleteOutput) - pub fn build(self) -> crate::output::DeleteOutput { - crate::output::DeleteOutput {} - } - } -} -impl DeleteOutput { - /// Creates a new builder-style object to manufacture [`DeleteOutput`](crate::output::DeleteOutput) - pub fn builder() -> crate::output::delete_output::Builder { - crate::output::delete_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetOutput { - /// The key's JSON value. - pub value: std::option::Option, - /// Whether or not the entry has been deleted. Only set when watching this endpoint. - pub deleted: std::option::Option, - /// Provided by watchable endpoints used in blocking loops. - pub watch: std::option::Option, -} -impl GetOutput { - /// The key's JSON value. - pub fn value(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.value.as_ref() - } - /// Whether or not the entry has been deleted. Only set when watching this endpoint. - pub fn deleted(&self) -> std::option::Option { - self.deleted - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(&self) -> std::option::Option<&crate::model::WatchResponse> { - self.watch.as_ref() - } -} -impl std::fmt::Debug for GetOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetOutput"); - formatter.field("value", &self.value); - formatter.field("deleted", &self.deleted); - formatter.field("watch", &self.watch); - formatter.finish() - } -} -/// See [`GetOutput`](crate::output::GetOutput) -pub mod get_output { - /// A builder for [`GetOutput`](crate::output::GetOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) value: std::option::Option, - pub(crate) deleted: std::option::Option, - pub(crate) watch: std::option::Option, - } - impl Builder { - /// The key's JSON value. - pub fn value(mut self, input: aws_smithy_types::Document) -> Self { - self.value = Some(input); - self - } - /// The key's JSON value. - pub fn set_value(mut self, input: std::option::Option) -> Self { - self.value = input; - self - } - /// Whether or not the entry has been deleted. Only set when watching this endpoint. - pub fn deleted(mut self, input: bool) -> Self { - self.deleted = Some(input); - self - } - /// Whether or not the entry has been deleted. Only set when watching this endpoint. - pub fn set_deleted(mut self, input: std::option::Option) -> Self { - self.deleted = input; - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(mut self, input: crate::model::WatchResponse) -> Self { - self.watch = Some(input); - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn set_watch( - mut self, - input: std::option::Option, - ) -> Self { - self.watch = input; - self - } - /// Consumes the builder and constructs a [`GetOutput`](crate::output::GetOutput) - pub fn build(self) -> crate::output::GetOutput { - crate::output::GetOutput { - value: self.value, - deleted: self.deleted, - watch: self.watch, - } - } - } -} -impl GetOutput { - /// Creates a new builder-style object to manufacture [`GetOutput`](crate::output::GetOutput) - pub fn builder() -> crate::output::get_output::Builder { - crate::output::get_output::Builder::default() - } -} diff --git a/lib/smithy-output/api-matchmaker/rust-server/rust-server/Cargo.toml b/lib/smithy-output/api-matchmaker/rust-server/rust-server/Cargo.toml deleted file mode 100644 index 1c855bcbe..000000000 --- a/lib/smithy-output/api-matchmaker/rust-server/rust-server/Cargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -[package] -name = "rivet-matchmaker-server" -version = "0.0.8" -authors = ["Rivet "] -edition = "2021" -license = "Apache-2.0" - -[package.metadata.docs.rs] -all-features = true -targets = ["x86_64-unknown-linux-gnu"] - -[dependencies] -serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" -chrono = { version = "0.4", features = ["serde"] } diff --git a/lib/smithy-output/api-matchmaker/rust-server/rust-server/src/lib.rs b/lib/smithy-output/api-matchmaker/rust-server/rust-server/src/lib.rs deleted file mode 100644 index ff9294697..000000000 --- a/lib/smithy-output/api-matchmaker/rust-server/rust-server/src/lib.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod models; \ No newline at end of file diff --git a/lib/smithy-output/api-matchmaker/rust-server/rust-server/src/models.rs b/lib/smithy-output/api-matchmaker/rust-server/rust-server/src/models.rs deleted file mode 100644 index 6c1d671ef..000000000 --- a/lib/smithy-output/api-matchmaker/rust-server/rust-server/src/models.rs +++ /dev/null @@ -1,288 +0,0 @@ -#[allow(unused_imports)] -use chrono; -#[allow(unused_imports)] -use serde::{Deserialize, Serialize}; - -/// Game region statistics. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct RegionStatistics { - /// Unsigned 64 bit integer. - pub player_count: i64, - #[allow(missing_docs)] // documentation missing in model - pub game_modes: - std::collections::HashMap, -} - -/// Game mode statistics -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GameModeStatistics { - /// Unsigned 64 bit integer. - pub player_count: i64, -} - -/// Game namespace statistics. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct NamespaceStatistics { - /// Unsigned 64 bit integer. - pub player_count: i64, - #[allow(missing_docs)] // documentation missing in model - pub game_modes: - std::collections::HashMap, -} - -/// A region that the player can connect to. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct RegionInfo { - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub region_id: std::string::String, - /// A universally unique identifier. - pub provider_display_name: std::string::String, - /// A universally unique identifier. - pub region_display_name: std::string::String, - /// Geographical coordinates for a location on Planet Earth. - pub datacenter_coord: Coord, - /// Distance available in multiple units. - pub datacenter_distance_from_client: Distance, -} - -/// Distance available in multiple units. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct Distance { - #[allow(missing_docs)] // documentation missing in model - pub kilometers: f64, - #[allow(missing_docs)] // documentation missing in model - pub miles: f64, -} - -/// Geographical coordinates for a location on Planet Earth. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct Coord { - #[allow(missing_docs)] // documentation missing in model - pub latitude: f64, - #[allow(missing_docs)] // documentation missing in model - pub longitude: f64, -} - -/// A public lobby in the lobby list. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct LobbyInfo { - #[allow(missing_docs)] // documentation missing in model - pub region_id: std::string::String, - #[allow(missing_docs)] // documentation missing in model - pub game_mode_id: std::string::String, - /// A universally unique identifier. - pub lobby_id: std::string::String, - /// Unsigned 32 bit integer. - pub max_players_normal: i32, - /// Unsigned 32 bit integer. - pub max_players_direct: i32, - /// Unsigned 32 bit integer. - pub max_players_party: i32, - /// Unsigned 32 bit integer. - pub total_player_count: i32, -} - -/// A game mode that the player can join. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GameModeInfo { - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub game_mode_id: std::string::String, -} - -/// A matchmaker lobby. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct MatchmakerLobbyJoinInfo { - /// A universally unique identifier. - pub lobby_id: std::string::String, - /// A matchmaker lobby region. - pub region: MatchmakerLobbyJoinInfoRegion, - /// A list of lobby ports. - pub ports: - std::collections::HashMap, - /// A matchmaker lobby player. - pub player: MatchmakerLobbyJoinInfoPlayer, -} - -/// A matchmaker lobby player. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct MatchmakerLobbyJoinInfoPlayer { - /// Pass this token through the socket to the lobby server. The lobby server will validate this token with `rivet.api.matchmaker#PlayerConnected$player_token`. - pub token: std::string::String, -} - -/// A matchmaker lobby port. Configured by `rivet.cloud#LobbyGroupRuntimeDockerPort$label`. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct MatchmakerLobbyJoinInfoPort { - /// The host for the given port. Will be null if using a port range. - pub host: std::option::Option, - /// The hostname for the given port. - pub hostname: std::string::String, - /// The port number for this lobby. Will be null if using a port range. - pub port: std::option::Option, - /// The port range for this lobby. - pub port_range: std::option::Option, - /// Wether or not this lobby port uses TLS. You cannot mix a non-TLS and TLS ports. - pub is_tls: bool, -} - -/// Inclusive range of ports that can be connected to. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct MatchmakerLobbyJoinInfoPortRange { - /// Minimum port that can be connected to. Inclusive range. - pub min: i32, - /// Maximum port that can be connected to. Inclusive range. - pub max: i32, -} - -/// A matchmaker lobby region. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct MatchmakerLobbyJoinInfoRegion { - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub region_id: std::string::String, - /// Represent a resource's readable display name. - pub display_name: std::string::String, -} - -/// Methods to verify a captcha. -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum CaptchaConfig { - /// hCaptcha configuration. - Hcaptcha(CaptchaConfigHcaptcha), - /// Cloudflare Turnstile configuration. - Turnstile(CaptchaConfigTurnstile), -} - -/// Cloudflare Turnstile configuration. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CaptchaConfigTurnstile { - #[allow(missing_docs)] // documentation missing in model - pub client_response: std::string::String, -} - -/// hCaptcha configuration. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CaptchaConfigHcaptcha { - #[allow(missing_docs)] // documentation missing in model - pub client_response: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetGameStatisticsRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ListRegionsRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PlayerDisconnectedRequest { - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub player_token: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PlayerConnectedRequest { - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub player_token: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct SetLobbyClosedRequest { - #[allow(missing_docs)] // documentation missing in model - pub is_closed: bool, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ListLobbiesRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct FindLobbyRequest { - /// Game modes to match lobbies against. - pub game_modes: std::vec::Vec, - /// Regions to match lobbies against. If not specified, the optimal region will be determined and will attempt to find lobbies in that region. - pub regions: std::option::Option>, - /// Prevents a new lobby from being created when finding a lobby. If no lobby is found, a `MATCHMAKER_LOBBY_NOT_FOUND` error will be thrown. - pub prevent_auto_create_lobby: std::option::Option, - /// Methods to verify a captcha. - pub captcha: std::option::Option, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct JoinLobbyRequest { - /// A universally unique identifier. - pub lobby_id: std::string::String, - /// Methods to verify a captcha. - pub captcha: std::option::Option, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct LobbyReadyRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetGameStatisticsResponse { - /// Unsigned 64 bit integer. - pub player_count: i64, - #[allow(missing_docs)] // documentation missing in model - pub namespaces: - std::collections::HashMap, - #[allow(missing_docs)] // documentation missing in model - pub regions: std::collections::HashMap, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ListRegionsResponse { - #[allow(missing_docs)] // documentation missing in model - pub regions: std::vec::Vec, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PlayerDisconnectedResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PlayerConnectedResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct SetLobbyClosedResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ListLobbiesResponse { - #[allow(missing_docs)] // documentation missing in model - pub game_modes: std::vec::Vec, - #[allow(missing_docs)] // documentation missing in model - pub regions: std::vec::Vec, - #[allow(missing_docs)] // documentation missing in model - pub lobbies: std::vec::Vec, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct FindLobbyResponse { - /// A matchmaker lobby. - pub lobby: MatchmakerLobbyJoinInfo, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct JoinLobbyResponse { - /// A matchmaker lobby. - pub lobby: MatchmakerLobbyJoinInfo, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct LobbyReadyResponse {} - diff --git a/lib/smithy-output/api-matchmaker/rust/rust/Cargo.toml b/lib/smithy-output/api-matchmaker/rust/rust/Cargo.toml deleted file mode 100644 index f4cdcd47a..000000000 --- a/lib/smithy-output/api-matchmaker/rust/rust/Cargo.toml +++ /dev/null @@ -1,33 +0,0 @@ -# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -[package] -name = "rivet-matchmaker" -version = "0.0.8" -authors = ["Rivet Gaming, LLC "] -description = "Rivet service for matchmaking players and managing lobbies" -edition = "2021" -license = "Apache-2.0" - -[package.metadata.docs.rs] -all-features = true -targets = ["x86_64-unknown-linux-gnu"] -[dependencies.aws-smithy-client] -version = "^0.41.0" -[dependencies.aws-smithy-http] -version = "^0.41.0" -[dependencies.aws-smithy-json] -version = "^0.41.0" -[dependencies.aws-smithy-types] -version = "^0.41.0" -[dependencies.bytes] -version = "1" -[dependencies.http] -version = "0.2" -[dependencies.tower] -version = "0.4" -[features] -rt-tokio = ["aws-smithy-http/rt-tokio"] -rustls = ["aws-smithy-client/rustls"] -native-tls = ["aws-smithy-client/native-tls"] -default = ["rt-tokio", "rustls"] - - diff --git a/lib/smithy-output/api-matchmaker/rust/rust/src/client.rs b/lib/smithy-output/api-matchmaker/rust/rust/src/client.rs deleted file mode 100644 index fb4d61cae..000000000 --- a/lib/smithy-output/api-matchmaker/rust/rust/src/client.rs +++ /dev/null @@ -1,961 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[derive(Debug)] -pub(crate) struct Handle { - pub(crate) client: aws_smithy_client::Client, - pub(crate) conf: crate::Config, -} - -/// An ergonomic service client for `MatchmakerService`. -/// -/// This client allows ergonomic access to a `MatchmakerService`-shaped service. -/// Each method corresponds to an endpoint defined in the service's Smithy model, -/// and the request and response shapes are auto-generated from that same model. -/// -/// # Constructing a Client -/// -/// To construct a client, you need a few different things: -/// -/// - A [`Config`](crate::Config) that specifies additional configuration -/// required by the service. -/// - A connector (`C`) that specifies how HTTP requests are translated -/// into HTTP responses. This will typically be an HTTP client (like -/// `hyper`), though you can also substitute in your own, like a mock -/// mock connector for testing. -/// - A "middleware" (`M`) that modifies requests prior to them being -/// sent to the request. Most commonly, middleware will decide what -/// endpoint the requests should be sent to, as well as perform -/// authentication and authorization of requests (such as SigV4). -/// You can also have middleware that performs request/response -/// tracing, throttling, or other middleware-like tasks. -/// - A retry policy (`R`) that dictates the behavior for requests that -/// fail and should (potentially) be retried. The default type is -/// generally what you want, as it implements a well-vetted retry -/// policy implemented in [`RetryMode::Standard`](aws_smithy_types::retry::RetryMode::Standard). -/// -/// To construct a client, you will generally want to call -/// [`Client::with_config`], which takes a [`aws_smithy_client::Client`] (a -/// Smithy client that isn't specialized to a particular service), -/// and a [`Config`](crate::Config). Both of these are constructed using -/// the [builder pattern] where you first construct a `Builder` type, -/// then configure it with the necessary parameters, and then call -/// `build` to construct the finalized output type. The -/// [`aws_smithy_client::Client`] builder is re-exported in this crate as -/// [`Builder`] for convenience. -/// -/// In _most_ circumstances, you will want to use the following pattern -/// to construct a client: -/// -/// ``` -/// use rivet_matchmaker::{Builder, Client, Config}; -/// let raw_client = -/// Builder::dyn_https() -/// # /* -/// .middleware(/* discussed below */) -/// # */ -/// # .middleware_fn(|r| r) -/// .build(); -/// let config = Config::builder().build(); -/// let client = Client::with_config(raw_client, config); -/// ``` -/// -/// For the middleware, you'll want to use whatever matches the -/// routing, authentication and authorization required by the target -/// service. For example, for the standard AWS SDK which uses -/// [SigV4-signed requests], the middleware looks like this: -/// -// Ignored as otherwise we'd need to pull in all these dev-dependencies. -/// ```rust,ignore -/// use aws_endpoint::AwsEndpointStage; -/// use aws_http::auth::CredentialsStage; -/// use aws_http::recursion_detection::RecursionDetectionStage; -/// use aws_http::user_agent::UserAgentStage; -/// use aws_sig_auth::middleware::SigV4SigningStage; -/// use aws_sig_auth::signer::SigV4Signer; -/// use aws_smithy_client::retry::Config as RetryConfig; -/// use aws_smithy_http_tower::map_request::{AsyncMapRequestLayer, MapRequestLayer}; -/// use std::fmt::Debug; -/// use tower::layer::util::{Identity, Stack}; -/// use tower::ServiceBuilder; -/// -/// type AwsMiddlewareStack = Stack< -/// MapRequestLayer, -/// Stack< -/// MapRequestLayer, -/// Stack< -/// AsyncMapRequestLayer, -/// Stack< -/// MapRequestLayer, -/// Stack, Identity>, -/// >, -/// >, -/// >, -/// >; -/// -/// /// AWS Middleware Stack -/// /// -/// /// This implements the middleware stack for this service. It will: -/// /// 1. Load credentials asynchronously into the property bag -/// /// 2. Sign the request with SigV4 -/// /// 3. Resolve an Endpoint for the request -/// /// 4. Add a user agent to the request -/// #[derive(Debug, Default, Clone)] -/// #[non_exhaustive] -/// pub struct AwsMiddleware; -/// -/// impl AwsMiddleware { -/// /// Create a new `AwsMiddleware` stack -/// /// -/// /// Note: `AwsMiddleware` holds no state. -/// pub fn new() -> Self { -/// AwsMiddleware::default() -/// } -/// } -/// -/// // define the middleware stack in a non-generic location to reduce code bloat. -/// fn base() -> ServiceBuilder { -/// let credential_provider = AsyncMapRequestLayer::for_mapper(CredentialsStage::new()); -/// let signer = MapRequestLayer::for_mapper(SigV4SigningStage::new(SigV4Signer::new())); -/// let endpoint_resolver = MapRequestLayer::for_mapper(AwsEndpointStage); -/// let user_agent = MapRequestLayer::for_mapper(UserAgentStage::new()); -/// let recursion_detection = MapRequestLayer::for_mapper(RecursionDetectionStage::new()); -/// // These layers can be considered as occurring in order, that is: -/// // 1. Resolve an endpoint -/// // 2. Add a user agent -/// // 3. Acquire credentials -/// // 4. Sign with credentials -/// // (5. Dispatch over the wire) -/// ServiceBuilder::new() -/// .layer(endpoint_resolver) -/// .layer(user_agent) -/// .layer(credential_provider) -/// .layer(signer) -/// .layer(recursion_detection) -/// } -/// -/// impl tower::Layer for AwsMiddleware { -/// type Service = >::Service; -/// -/// fn layer(&self, inner: S) -> Self::Service { -/// base().service(inner) -/// } -/// } -/// ``` -/// -/// # Using a Client -/// -/// Once you have a client set up, you can access the service's endpoints -/// by calling the appropriate method on [`Client`]. Each such method -/// returns a request builder for that endpoint, with methods for setting -/// the various fields of the request. Once your request is complete, use -/// the `send` method to send the request. `send` returns a future, which -/// you then have to `.await` to get the service's response. -/// -/// [builder pattern]: https://rust-lang.github.io/api-guidelines/type-safety.html#c-builder -/// [SigV4-signed requests]: https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html -#[derive(std::fmt::Debug)] -pub struct Client { - handle: std::sync::Arc>, -} - -impl std::clone::Clone for Client { - fn clone(&self) -> Self { - Self { - handle: self.handle.clone(), - } - } -} - -#[doc(inline)] -pub use aws_smithy_client::Builder; - -impl From> for Client { - fn from(client: aws_smithy_client::Client) -> Self { - Self::with_config(client, crate::Config::builder().build()) - } -} - -impl Client { - /// Creates a client with the given service configuration. - pub fn with_config(client: aws_smithy_client::Client, conf: crate::Config) -> Self { - Self { - handle: std::sync::Arc::new(Handle { client, conf }), - } - } - - /// Returns the client's configuration. - pub fn conf(&self) -> &crate::Config { - &self.handle.conf - } -} -impl Client -where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, -{ - /// Constructs a fluent builder for the [`FindLobby`](crate::client::fluent_builders::FindLobby) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_modes(Vec)`](crate::client::fluent_builders::FindLobby::game_modes) / [`set_game_modes(Option>)`](crate::client::fluent_builders::FindLobby::set_game_modes): Game modes to match lobbies against. - /// - [`regions(Vec)`](crate::client::fluent_builders::FindLobby::regions) / [`set_regions(Option>)`](crate::client::fluent_builders::FindLobby::set_regions): Regions to match lobbies against. If not specified, the optimal region will be determined and will attempt to find lobbies in that region. - /// - [`prevent_auto_create_lobby(bool)`](crate::client::fluent_builders::FindLobby::prevent_auto_create_lobby) / [`set_prevent_auto_create_lobby(Option)`](crate::client::fluent_builders::FindLobby::set_prevent_auto_create_lobby): Prevents a new lobby from being created when finding a lobby. If no lobby is found, a `MATCHMAKER_LOBBY_NOT_FOUND` error will be thrown. - /// - [`captcha(CaptchaConfig)`](crate::client::fluent_builders::FindLobby::captcha) / [`set_captcha(Option)`](crate::client::fluent_builders::FindLobby::set_captcha): Methods to verify a captcha. - /// - [`origin(impl Into)`](crate::client::fluent_builders::FindLobby::origin) / [`set_origin(Option)`](crate::client::fluent_builders::FindLobby::set_origin): (undocumented) - /// - [`bypass_token(impl Into)`](crate::client::fluent_builders::FindLobby::bypass_token) / [`set_bypass_token(Option)`](crate::client::fluent_builders::FindLobby::set_bypass_token): A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - /// - On success, responds with [`FindLobbyOutput`](crate::output::FindLobbyOutput) with field(s): - /// - [`lobby(Option)`](crate::output::FindLobbyOutput::lobby): A matchmaker lobby. - /// - On failure, responds with [`SdkError`](crate::error::FindLobbyError) - pub fn find_lobby(&self) -> fluent_builders::FindLobby { - fluent_builders::FindLobby::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GetGameStatistics`](crate::client::fluent_builders::GetGameStatistics) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_id(impl Into)`](crate::client::fluent_builders::GetGameStatistics::game_id) / [`set_game_id(Option)`](crate::client::fluent_builders::GetGameStatistics::set_game_id): A universally unique identifier. - /// - On success, responds with [`GetGameStatisticsOutput`](crate::output::GetGameStatisticsOutput) with field(s): - /// - [`player_count(Option)`](crate::output::GetGameStatisticsOutput::player_count): Unsigned 64 bit integer. - /// - [`namespaces(Option>)`](crate::output::GetGameStatisticsOutput::namespaces): (undocumented) - /// - [`regions(Option>)`](crate::output::GetGameStatisticsOutput::regions): (undocumented) - /// - On failure, responds with [`SdkError`](crate::error::GetGameStatisticsError) - pub fn get_game_statistics(&self) -> fluent_builders::GetGameStatistics { - fluent_builders::GetGameStatistics::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`JoinLobby`](crate::client::fluent_builders::JoinLobby) operation. - /// - /// - The fluent builder is configurable: - /// - [`lobby_id(impl Into)`](crate::client::fluent_builders::JoinLobby::lobby_id) / [`set_lobby_id(Option)`](crate::client::fluent_builders::JoinLobby::set_lobby_id): A universally unique identifier. - /// - [`captcha(CaptchaConfig)`](crate::client::fluent_builders::JoinLobby::captcha) / [`set_captcha(Option)`](crate::client::fluent_builders::JoinLobby::set_captcha): Methods to verify a captcha. - /// - On success, responds with [`JoinLobbyOutput`](crate::output::JoinLobbyOutput) with field(s): - /// - [`lobby(Option)`](crate::output::JoinLobbyOutput::lobby): A matchmaker lobby. - /// - On failure, responds with [`SdkError`](crate::error::JoinLobbyError) - pub fn join_lobby(&self) -> fluent_builders::JoinLobby { - fluent_builders::JoinLobby::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`ListLobbies`](crate::client::fluent_builders::ListLobbies) operation. - /// - /// - The fluent builder takes no input, just [`send`](crate::client::fluent_builders::ListLobbies::send) it. - - /// - On success, responds with [`ListLobbiesOutput`](crate::output::ListLobbiesOutput) with field(s): - /// - [`game_modes(Option>)`](crate::output::ListLobbiesOutput::game_modes): (undocumented) - /// - [`regions(Option>)`](crate::output::ListLobbiesOutput::regions): (undocumented) - /// - [`lobbies(Option>)`](crate::output::ListLobbiesOutput::lobbies): (undocumented) - /// - On failure, responds with [`SdkError`](crate::error::ListLobbiesError) - pub fn list_lobbies(&self) -> fluent_builders::ListLobbies { - fluent_builders::ListLobbies::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`ListRegions`](crate::client::fluent_builders::ListRegions) operation. - /// - /// - The fluent builder takes no input, just [`send`](crate::client::fluent_builders::ListRegions::send) it. - - /// - On success, responds with [`ListRegionsOutput`](crate::output::ListRegionsOutput) with field(s): - /// - [`regions(Option>)`](crate::output::ListRegionsOutput::regions): (undocumented) - /// - On failure, responds with [`SdkError`](crate::error::ListRegionsError) - pub fn list_regions(&self) -> fluent_builders::ListRegions { - fluent_builders::ListRegions::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`LobbyReady`](crate::client::fluent_builders::LobbyReady) operation. - /// - /// - The fluent builder takes no input, just [`send`](crate::client::fluent_builders::LobbyReady::send) it. - - /// - On success, responds with [`LobbyReadyOutput`](crate::output::LobbyReadyOutput) - - /// - On failure, responds with [`SdkError`](crate::error::LobbyReadyError) - pub fn lobby_ready(&self) -> fluent_builders::LobbyReady { - fluent_builders::LobbyReady::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`PlayerConnected`](crate::client::fluent_builders::PlayerConnected) operation. - /// - /// - The fluent builder is configurable: - /// - [`player_token(impl Into)`](crate::client::fluent_builders::PlayerConnected::player_token) / [`set_player_token(Option)`](crate::client::fluent_builders::PlayerConnected::set_player_token): A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - /// - On success, responds with [`PlayerConnectedOutput`](crate::output::PlayerConnectedOutput) - - /// - On failure, responds with [`SdkError`](crate::error::PlayerConnectedError) - pub fn player_connected(&self) -> fluent_builders::PlayerConnected { - fluent_builders::PlayerConnected::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`PlayerDisconnected`](crate::client::fluent_builders::PlayerDisconnected) operation. - /// - /// - The fluent builder is configurable: - /// - [`player_token(impl Into)`](crate::client::fluent_builders::PlayerDisconnected::player_token) / [`set_player_token(Option)`](crate::client::fluent_builders::PlayerDisconnected::set_player_token): A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - /// - On success, responds with [`PlayerDisconnectedOutput`](crate::output::PlayerDisconnectedOutput) - - /// - On failure, responds with [`SdkError`](crate::error::PlayerDisconnectedError) - pub fn player_disconnected(&self) -> fluent_builders::PlayerDisconnected { - fluent_builders::PlayerDisconnected::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`SetLobbyClosed`](crate::client::fluent_builders::SetLobbyClosed) operation. - /// - /// - The fluent builder is configurable: - /// - [`is_closed(bool)`](crate::client::fluent_builders::SetLobbyClosed::is_closed) / [`set_is_closed(Option)`](crate::client::fluent_builders::SetLobbyClosed::set_is_closed): (undocumented) - /// - On success, responds with [`SetLobbyClosedOutput`](crate::output::SetLobbyClosedOutput) - - /// - On failure, responds with [`SdkError`](crate::error::SetLobbyClosedError) - pub fn set_lobby_closed(&self) -> fluent_builders::SetLobbyClosed { - fluent_builders::SetLobbyClosed::new(self.handle.clone()) - } -} -pub mod fluent_builders { - //! - //! Utilities to ergonomically construct a request to the service. - //! - //! Fluent builders are created through the [`Client`](crate::client::Client) by calling - //! one if its operation methods. After parameters are set using the builder methods, - //! the `send` method can be called to initiate the request. - //! - /// Fluent builder constructing a request to `FindLobby`. - /// - /// Finds a lobby based on the given criteria. If a lobby is not found and `prevent_auto_create_lobby` is `true`, a new lobby will be created. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct FindLobby { - handle: std::sync::Arc>, - inner: crate::input::find_lobby_input::Builder, - } - impl FindLobby - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `FindLobby`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::FindLobbyOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::FindLobbyInputOperationOutputAlias, - crate::output::FindLobbyOutput, - crate::error::FindLobbyError, - crate::input::FindLobbyInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// Appends an item to `game_modes`. - /// - /// To override the contents of this collection use [`set_game_modes`](Self::set_game_modes). - /// - /// Game modes to match lobbies against. - pub fn game_modes(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_modes(input.into()); - self - } - /// Game modes to match lobbies against. - pub fn set_game_modes( - mut self, - input: std::option::Option>, - ) -> Self { - self.inner = self.inner.set_game_modes(input); - self - } - /// Appends an item to `regions`. - /// - /// To override the contents of this collection use [`set_regions`](Self::set_regions). - /// - /// Regions to match lobbies against. If not specified, the optimal region will be determined and will attempt to find lobbies in that region. - pub fn regions(mut self, input: impl Into) -> Self { - self.inner = self.inner.regions(input.into()); - self - } - /// Regions to match lobbies against. If not specified, the optimal region will be determined and will attempt to find lobbies in that region. - pub fn set_regions( - mut self, - input: std::option::Option>, - ) -> Self { - self.inner = self.inner.set_regions(input); - self - } - /// Prevents a new lobby from being created when finding a lobby. If no lobby is found, a `MATCHMAKER_LOBBY_NOT_FOUND` error will be thrown. - pub fn prevent_auto_create_lobby(mut self, input: bool) -> Self { - self.inner = self.inner.prevent_auto_create_lobby(input); - self - } - /// Prevents a new lobby from being created when finding a lobby. If no lobby is found, a `MATCHMAKER_LOBBY_NOT_FOUND` error will be thrown. - pub fn set_prevent_auto_create_lobby(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_prevent_auto_create_lobby(input); - self - } - /// Methods to verify a captcha. - pub fn captcha(mut self, input: crate::model::CaptchaConfig) -> Self { - self.inner = self.inner.captcha(input); - self - } - /// Methods to verify a captcha. - pub fn set_captcha( - mut self, - input: std::option::Option, - ) -> Self { - self.inner = self.inner.set_captcha(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn origin(mut self, input: impl Into) -> Self { - self.inner = self.inner.origin(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_origin(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_origin(input); - self - } - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn bypass_token(mut self, input: impl Into) -> Self { - self.inner = self.inner.bypass_token(input.into()); - self - } - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn set_bypass_token(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_bypass_token(input); - self - } - } - /// Fluent builder constructing a request to `GetGameStatistics`. - /// - /// Gives matchmaker statistics about the given game. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GetGameStatistics { - handle: std::sync::Arc>, - inner: crate::input::get_game_statistics_input::Builder, - } - impl GetGameStatistics - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GetGameStatistics`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GetGameStatisticsOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GetGameStatisticsInputOperationOutputAlias, - crate::output::GetGameStatisticsOutput, - crate::error::GetGameStatisticsError, - crate::input::GetGameStatisticsInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_id(input); - self - } - } - /// Fluent builder constructing a request to `JoinLobby`. - /// - /// Joins a specific lobby. This request will use the direct player count configured for the lobby group. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct JoinLobby { - handle: std::sync::Arc>, - inner: crate::input::join_lobby_input::Builder, - } - impl JoinLobby - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `JoinLobby`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::JoinLobbyOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::JoinLobbyInputOperationOutputAlias, - crate::output::JoinLobbyOutput, - crate::error::JoinLobbyError, - crate::input::JoinLobbyInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn lobby_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.lobby_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_lobby_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_lobby_id(input); - self - } - /// Methods to verify a captcha. - pub fn captcha(mut self, input: crate::model::CaptchaConfig) -> Self { - self.inner = self.inner.captcha(input); - self - } - /// Methods to verify a captcha. - pub fn set_captcha( - mut self, - input: std::option::Option, - ) -> Self { - self.inner = self.inner.set_captcha(input); - self - } - } - /// Fluent builder constructing a request to `ListLobbies`. - /// - /// Lists all open lobbies. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct ListLobbies { - handle: std::sync::Arc>, - inner: crate::input::list_lobbies_input::Builder, - } - impl ListLobbies - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `ListLobbies`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::ListLobbiesOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::ListLobbiesInputOperationOutputAlias, - crate::output::ListLobbiesOutput, - crate::error::ListLobbiesError, - crate::input::ListLobbiesInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - } - /// Fluent builder constructing a request to `ListRegions`. - /// - /// Returns a list of regions available to this namespace. Regions are sorted by most optimal to least optimal. The player's IP address is used to calculate the regions' optimality. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct ListRegions { - handle: std::sync::Arc>, - inner: crate::input::list_regions_input::Builder, - } - impl ListRegions - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `ListRegions`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::ListRegionsOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::ListRegionsInputOperationOutputAlias, - crate::output::ListRegionsOutput, - crate::error::ListRegionsError, - crate::input::ListRegionsInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - } - /// Fluent builder constructing a request to `LobbyReady`. - /// - /// Marks the current lobby as ready to accept connections. Players will not be able to connect to this lobby until the lobby is flagged as ready. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct LobbyReady { - handle: std::sync::Arc>, - inner: crate::input::lobby_ready_input::Builder, - } - impl LobbyReady - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `LobbyReady`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::LobbyReadyOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::LobbyReadyInputOperationOutputAlias, - crate::output::LobbyReadyOutput, - crate::error::LobbyReadyError, - crate::input::LobbyReadyInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - } - /// Fluent builder constructing a request to `PlayerConnected`. - /// - /// Validates the player token is valid and has not already been consumed then marks the player as connected. # Player Tokens and Reserved Slots Player tokens reserve a spot in the lobby until they expire. This allows for precise matchmaking up to exactly the lobby's player limit, which is important for games with small lobbies and a high influx of players. By calling this endpoint with the player token, the player's spot is marked as connected and will not expire. If this endpoint is never called, the player's token will expire and this spot will be filled by another player. # Anti-Botting Player tokens are only issued by caling `rivet.api.matchmaker#JoinLobby`, calling `rivet.api.matchmaker#FindLobby`, or from the `rivet.api.identity.common#GlobalEventMatchmakerLobbyJoin` event. These endpoints have anti-botting measures (i.e. enforcing max player limits, captchas, and detecting bots), so valid player tokens provide some confidence that the player is not a bot. Therefore, it's important to make sure the token is valid by waiting for this endpoint to return OK before allowing the connected socket to do anything else. If this endpoint returns an error, the socket should be disconnected immediately. # How to Transmit the Player Token The client is responsible for acquiring the player token by caling `rivet.api.matchmaker#JoinLobby`, calling `rivet.api.matchmaker#FindLobby`, or from the `rivet.api.identity.common#GlobalEventMatchmakerLobbyJoin` event. Beyond that, it's up to the developer how the player token is transmitted to the lobby. If using WebSockets, the player token can be transmitted as a query parameter. Otherwise, the player token will likely be automatically sent by the client once the socket opens. As mentioned above, nothing else should happen until the player token is validated. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct PlayerConnected { - handle: std::sync::Arc>, - inner: crate::input::player_connected_input::Builder, - } - impl PlayerConnected - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `PlayerConnected`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::PlayerConnectedOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::PlayerConnectedInputOperationOutputAlias, - crate::output::PlayerConnectedOutput, - crate::error::PlayerConnectedError, - crate::input::PlayerConnectedInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn player_token(mut self, input: impl Into) -> Self { - self.inner = self.inner.player_token(input.into()); - self - } - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn set_player_token(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_player_token(input); - self - } - } - /// Fluent builder constructing a request to `PlayerDisconnected`. - /// - /// Marks a player as disconnected. # Ghost Players If players are not marked as disconnected, lobbies will result with "ghost players" that the matchmaker thinks exist but are no longer connected to the lobby. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct PlayerDisconnected { - handle: std::sync::Arc>, - inner: crate::input::player_disconnected_input::Builder, - } - impl PlayerDisconnected - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `PlayerDisconnected`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::PlayerDisconnectedOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::PlayerDisconnectedInputOperationOutputAlias, - crate::output::PlayerDisconnectedOutput, - crate::error::PlayerDisconnectedError, - crate::input::PlayerDisconnectedInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn player_token(mut self, input: impl Into) -> Self { - self.inner = self.inner.player_token(input.into()); - self - } - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn set_player_token(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_player_token(input); - self - } - } - /// Fluent builder constructing a request to `SetLobbyClosed`. - /// - /// If `is_closed` is `true`, players will be prevented from joining the lobby. Does not shutdown the lobby. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct SetLobbyClosed { - handle: std::sync::Arc>, - inner: crate::input::set_lobby_closed_input::Builder, - } - impl SetLobbyClosed - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `SetLobbyClosed`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::SetLobbyClosedOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::SetLobbyClosedInputOperationOutputAlias, - crate::output::SetLobbyClosedOutput, - crate::error::SetLobbyClosedError, - crate::input::SetLobbyClosedInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - #[allow(missing_docs)] // documentation missing in model - pub fn is_closed(mut self, input: bool) -> Self { - self.inner = self.inner.is_closed(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_is_closed(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_is_closed(input); - self - } - } -} -/// A wrapper around [`Client`]. Helps reduce external imports. -pub struct ClientWrapper { - pub(crate) client: Client, -} - -impl std::ops::Deref for ClientWrapper { - type Target = Client; - - fn deref(&self) -> &Self::Target { - &self.client - } -} diff --git a/lib/smithy-output/api-matchmaker/rust/rust/src/config.rs b/lib/smithy-output/api-matchmaker/rust/rust/src/config.rs deleted file mode 100644 index 284f1e5df..000000000 --- a/lib/smithy-output/api-matchmaker/rust/rust/src/config.rs +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Service config. -/// -pub struct Config { - pub(crate) auth: Option, - pub(crate) uri: String, -} -impl std::fmt::Debug for Config { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut config = f.debug_struct("Config"); - config.finish() - } -} -impl Config { - /// Constructs a config builder. - pub fn builder() -> Builder { - Builder::default() - } -} -/// Builder for creating a `Config`. -#[derive(Default)] -pub struct Builder { - pub(crate) auth: Option, - pub(crate) uri: Option, -} -impl Builder { - /// Constructs a config builder. - pub fn new() -> Self { - Self::default() - } - /// Sets the bearer token to be used with the Smithy client. - pub fn set_bearer_token(mut self, bearer_token: impl std::fmt::Display) -> Self { - self.auth = Some(format!("Bearer {}", bearer_token)); - self - } - /// Sets the base URI to be used with the Smithy client. - pub fn set_uri(mut self, uri: impl ToString) -> Self { - self.uri = Some(uri.to_string()); - self - } - /// Builds a [`Config`]. - pub fn build(self) -> Config { - Config { - auth: self - .auth - .or_else(|| std::env::var("RIVET_LOBBY_TOKEN").ok()) - .or_else(|| std::env::var("RIVET_CLIENT_TOKEN").ok()), - uri: self - .uri - .or_else(|| std::env::var("RIVET_MATCHMAKER_API_URL").ok()) - .unwrap_or_else(|| "https://matchmaker.api.rivet.gg/v1".to_string()), - } - } - /// Builds a default [`Client`] from the given config. - pub fn build_client(self) -> crate::client::ClientWrapper { - let raw_client = aws_smithy_client::Builder::dyn_https() - .middleware(tower::layer::util::Identity::new()) - .sleep_impl(None) - .build(); - crate::client::ClientWrapper { - client: crate::Client::with_config(raw_client, self.build()), - } - } -} diff --git a/lib/smithy-output/api-matchmaker/rust/rust/src/error.rs b/lib/smithy-output/api-matchmaker/rust/rust/src/error.rs deleted file mode 100644 index 1953c76d0..000000000 --- a/lib/smithy-output/api-matchmaker/rust/rust/src/error.rs +++ /dev/null @@ -1,1997 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Error type for the `FindLobby` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct FindLobbyError { - /// Kind of error that occurred. - pub kind: FindLobbyErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `FindLobby` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum FindLobbyErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for FindLobbyError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - FindLobbyErrorKind::InternalError(_inner) => _inner.fmt(f), - FindLobbyErrorKind::RateLimitError(_inner) => _inner.fmt(f), - FindLobbyErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - FindLobbyErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - FindLobbyErrorKind::NotFoundError(_inner) => _inner.fmt(f), - FindLobbyErrorKind::BadRequestError(_inner) => _inner.fmt(f), - FindLobbyErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for FindLobbyError { - fn code(&self) -> Option<&str> { - FindLobbyError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - FindLobbyErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - FindLobbyErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl FindLobbyError { - /// Creates a new `FindLobbyError`. - pub fn new(kind: FindLobbyErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `FindLobbyError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: FindLobbyErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `FindLobbyError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: FindLobbyErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `FindLobbyErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, FindLobbyErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `FindLobbyErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, FindLobbyErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `FindLobbyErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, FindLobbyErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `FindLobbyErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, FindLobbyErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `FindLobbyErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, FindLobbyErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `FindLobbyErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, FindLobbyErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for FindLobbyError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - FindLobbyErrorKind::InternalError(_inner) => Some(_inner), - FindLobbyErrorKind::RateLimitError(_inner) => Some(_inner), - FindLobbyErrorKind::ForbiddenError(_inner) => Some(_inner), - FindLobbyErrorKind::UnauthorizedError(_inner) => Some(_inner), - FindLobbyErrorKind::NotFoundError(_inner) => Some(_inner), - FindLobbyErrorKind::BadRequestError(_inner) => Some(_inner), - FindLobbyErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `GetGameStatistics` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GetGameStatisticsError { - /// Kind of error that occurred. - pub kind: GetGameStatisticsErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GetGameStatistics` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GetGameStatisticsErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GetGameStatisticsError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GetGameStatisticsErrorKind::InternalError(_inner) => _inner.fmt(f), - GetGameStatisticsErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GetGameStatisticsErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GetGameStatisticsErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GetGameStatisticsErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GetGameStatisticsErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GetGameStatisticsErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GetGameStatisticsError { - fn code(&self) -> Option<&str> { - GetGameStatisticsError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GetGameStatisticsErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - GetGameStatisticsErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl GetGameStatisticsError { - /// Creates a new `GetGameStatisticsError`. - pub fn new(kind: GetGameStatisticsErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GetGameStatisticsError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GetGameStatisticsErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GetGameStatisticsError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GetGameStatisticsErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GetGameStatisticsErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, GetGameStatisticsErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `GetGameStatisticsErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, GetGameStatisticsErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `GetGameStatisticsErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, GetGameStatisticsErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `GetGameStatisticsErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, GetGameStatisticsErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `GetGameStatisticsErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, GetGameStatisticsErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `GetGameStatisticsErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, GetGameStatisticsErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for GetGameStatisticsError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GetGameStatisticsErrorKind::InternalError(_inner) => Some(_inner), - GetGameStatisticsErrorKind::RateLimitError(_inner) => Some(_inner), - GetGameStatisticsErrorKind::ForbiddenError(_inner) => Some(_inner), - GetGameStatisticsErrorKind::UnauthorizedError(_inner) => Some(_inner), - GetGameStatisticsErrorKind::NotFoundError(_inner) => Some(_inner), - GetGameStatisticsErrorKind::BadRequestError(_inner) => Some(_inner), - GetGameStatisticsErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `JoinLobby` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct JoinLobbyError { - /// Kind of error that occurred. - pub kind: JoinLobbyErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `JoinLobby` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum JoinLobbyErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for JoinLobbyError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - JoinLobbyErrorKind::InternalError(_inner) => _inner.fmt(f), - JoinLobbyErrorKind::RateLimitError(_inner) => _inner.fmt(f), - JoinLobbyErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - JoinLobbyErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - JoinLobbyErrorKind::NotFoundError(_inner) => _inner.fmt(f), - JoinLobbyErrorKind::BadRequestError(_inner) => _inner.fmt(f), - JoinLobbyErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for JoinLobbyError { - fn code(&self) -> Option<&str> { - JoinLobbyError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - JoinLobbyErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - JoinLobbyErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl JoinLobbyError { - /// Creates a new `JoinLobbyError`. - pub fn new(kind: JoinLobbyErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `JoinLobbyError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: JoinLobbyErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `JoinLobbyError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: JoinLobbyErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `JoinLobbyErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, JoinLobbyErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `JoinLobbyErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, JoinLobbyErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `JoinLobbyErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, JoinLobbyErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `JoinLobbyErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, JoinLobbyErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `JoinLobbyErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, JoinLobbyErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `JoinLobbyErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, JoinLobbyErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for JoinLobbyError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - JoinLobbyErrorKind::InternalError(_inner) => Some(_inner), - JoinLobbyErrorKind::RateLimitError(_inner) => Some(_inner), - JoinLobbyErrorKind::ForbiddenError(_inner) => Some(_inner), - JoinLobbyErrorKind::UnauthorizedError(_inner) => Some(_inner), - JoinLobbyErrorKind::NotFoundError(_inner) => Some(_inner), - JoinLobbyErrorKind::BadRequestError(_inner) => Some(_inner), - JoinLobbyErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `ListLobbies` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct ListLobbiesError { - /// Kind of error that occurred. - pub kind: ListLobbiesErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `ListLobbies` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum ListLobbiesErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for ListLobbiesError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - ListLobbiesErrorKind::InternalError(_inner) => _inner.fmt(f), - ListLobbiesErrorKind::RateLimitError(_inner) => _inner.fmt(f), - ListLobbiesErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - ListLobbiesErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - ListLobbiesErrorKind::NotFoundError(_inner) => _inner.fmt(f), - ListLobbiesErrorKind::BadRequestError(_inner) => _inner.fmt(f), - ListLobbiesErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for ListLobbiesError { - fn code(&self) -> Option<&str> { - ListLobbiesError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - ListLobbiesErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - ListLobbiesErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl ListLobbiesError { - /// Creates a new `ListLobbiesError`. - pub fn new(kind: ListLobbiesErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `ListLobbiesError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: ListLobbiesErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `ListLobbiesError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: ListLobbiesErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `ListLobbiesErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, ListLobbiesErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `ListLobbiesErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, ListLobbiesErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `ListLobbiesErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, ListLobbiesErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `ListLobbiesErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, ListLobbiesErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `ListLobbiesErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, ListLobbiesErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `ListLobbiesErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, ListLobbiesErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for ListLobbiesError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - ListLobbiesErrorKind::InternalError(_inner) => Some(_inner), - ListLobbiesErrorKind::RateLimitError(_inner) => Some(_inner), - ListLobbiesErrorKind::ForbiddenError(_inner) => Some(_inner), - ListLobbiesErrorKind::UnauthorizedError(_inner) => Some(_inner), - ListLobbiesErrorKind::NotFoundError(_inner) => Some(_inner), - ListLobbiesErrorKind::BadRequestError(_inner) => Some(_inner), - ListLobbiesErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `ListRegions` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct ListRegionsError { - /// Kind of error that occurred. - pub kind: ListRegionsErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `ListRegions` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum ListRegionsErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for ListRegionsError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - ListRegionsErrorKind::InternalError(_inner) => _inner.fmt(f), - ListRegionsErrorKind::RateLimitError(_inner) => _inner.fmt(f), - ListRegionsErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - ListRegionsErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - ListRegionsErrorKind::NotFoundError(_inner) => _inner.fmt(f), - ListRegionsErrorKind::BadRequestError(_inner) => _inner.fmt(f), - ListRegionsErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for ListRegionsError { - fn code(&self) -> Option<&str> { - ListRegionsError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - ListRegionsErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - ListRegionsErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl ListRegionsError { - /// Creates a new `ListRegionsError`. - pub fn new(kind: ListRegionsErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `ListRegionsError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: ListRegionsErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `ListRegionsError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: ListRegionsErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `ListRegionsErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, ListRegionsErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `ListRegionsErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, ListRegionsErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `ListRegionsErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, ListRegionsErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `ListRegionsErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, ListRegionsErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `ListRegionsErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, ListRegionsErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `ListRegionsErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, ListRegionsErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for ListRegionsError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - ListRegionsErrorKind::InternalError(_inner) => Some(_inner), - ListRegionsErrorKind::RateLimitError(_inner) => Some(_inner), - ListRegionsErrorKind::ForbiddenError(_inner) => Some(_inner), - ListRegionsErrorKind::UnauthorizedError(_inner) => Some(_inner), - ListRegionsErrorKind::NotFoundError(_inner) => Some(_inner), - ListRegionsErrorKind::BadRequestError(_inner) => Some(_inner), - ListRegionsErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `LobbyReady` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct LobbyReadyError { - /// Kind of error that occurred. - pub kind: LobbyReadyErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `LobbyReady` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum LobbyReadyErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for LobbyReadyError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - LobbyReadyErrorKind::InternalError(_inner) => _inner.fmt(f), - LobbyReadyErrorKind::RateLimitError(_inner) => _inner.fmt(f), - LobbyReadyErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - LobbyReadyErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - LobbyReadyErrorKind::NotFoundError(_inner) => _inner.fmt(f), - LobbyReadyErrorKind::BadRequestError(_inner) => _inner.fmt(f), - LobbyReadyErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for LobbyReadyError { - fn code(&self) -> Option<&str> { - LobbyReadyError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - LobbyReadyErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - LobbyReadyErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl LobbyReadyError { - /// Creates a new `LobbyReadyError`. - pub fn new(kind: LobbyReadyErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `LobbyReadyError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: LobbyReadyErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `LobbyReadyError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: LobbyReadyErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `LobbyReadyErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, LobbyReadyErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `LobbyReadyErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, LobbyReadyErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `LobbyReadyErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, LobbyReadyErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `LobbyReadyErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, LobbyReadyErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `LobbyReadyErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, LobbyReadyErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `LobbyReadyErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, LobbyReadyErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for LobbyReadyError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - LobbyReadyErrorKind::InternalError(_inner) => Some(_inner), - LobbyReadyErrorKind::RateLimitError(_inner) => Some(_inner), - LobbyReadyErrorKind::ForbiddenError(_inner) => Some(_inner), - LobbyReadyErrorKind::UnauthorizedError(_inner) => Some(_inner), - LobbyReadyErrorKind::NotFoundError(_inner) => Some(_inner), - LobbyReadyErrorKind::BadRequestError(_inner) => Some(_inner), - LobbyReadyErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `PlayerConnected` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct PlayerConnectedError { - /// Kind of error that occurred. - pub kind: PlayerConnectedErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `PlayerConnected` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum PlayerConnectedErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for PlayerConnectedError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - PlayerConnectedErrorKind::InternalError(_inner) => _inner.fmt(f), - PlayerConnectedErrorKind::RateLimitError(_inner) => _inner.fmt(f), - PlayerConnectedErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - PlayerConnectedErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - PlayerConnectedErrorKind::NotFoundError(_inner) => _inner.fmt(f), - PlayerConnectedErrorKind::BadRequestError(_inner) => _inner.fmt(f), - PlayerConnectedErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for PlayerConnectedError { - fn code(&self) -> Option<&str> { - PlayerConnectedError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - PlayerConnectedErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - PlayerConnectedErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl PlayerConnectedError { - /// Creates a new `PlayerConnectedError`. - pub fn new(kind: PlayerConnectedErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `PlayerConnectedError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: PlayerConnectedErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `PlayerConnectedError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: PlayerConnectedErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `PlayerConnectedErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, PlayerConnectedErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `PlayerConnectedErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, PlayerConnectedErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `PlayerConnectedErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, PlayerConnectedErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `PlayerConnectedErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, PlayerConnectedErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `PlayerConnectedErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, PlayerConnectedErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `PlayerConnectedErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, PlayerConnectedErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for PlayerConnectedError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - PlayerConnectedErrorKind::InternalError(_inner) => Some(_inner), - PlayerConnectedErrorKind::RateLimitError(_inner) => Some(_inner), - PlayerConnectedErrorKind::ForbiddenError(_inner) => Some(_inner), - PlayerConnectedErrorKind::UnauthorizedError(_inner) => Some(_inner), - PlayerConnectedErrorKind::NotFoundError(_inner) => Some(_inner), - PlayerConnectedErrorKind::BadRequestError(_inner) => Some(_inner), - PlayerConnectedErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `PlayerDisconnected` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct PlayerDisconnectedError { - /// Kind of error that occurred. - pub kind: PlayerDisconnectedErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `PlayerDisconnected` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum PlayerDisconnectedErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for PlayerDisconnectedError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - PlayerDisconnectedErrorKind::InternalError(_inner) => _inner.fmt(f), - PlayerDisconnectedErrorKind::RateLimitError(_inner) => _inner.fmt(f), - PlayerDisconnectedErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - PlayerDisconnectedErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - PlayerDisconnectedErrorKind::NotFoundError(_inner) => _inner.fmt(f), - PlayerDisconnectedErrorKind::BadRequestError(_inner) => _inner.fmt(f), - PlayerDisconnectedErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for PlayerDisconnectedError { - fn code(&self) -> Option<&str> { - PlayerDisconnectedError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - PlayerDisconnectedErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - PlayerDisconnectedErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl PlayerDisconnectedError { - /// Creates a new `PlayerDisconnectedError`. - pub fn new(kind: PlayerDisconnectedErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `PlayerDisconnectedError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: PlayerDisconnectedErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `PlayerDisconnectedError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: PlayerDisconnectedErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `PlayerDisconnectedErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, PlayerDisconnectedErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `PlayerDisconnectedErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, PlayerDisconnectedErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `PlayerDisconnectedErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, PlayerDisconnectedErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `PlayerDisconnectedErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - PlayerDisconnectedErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `PlayerDisconnectedErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, PlayerDisconnectedErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `PlayerDisconnectedErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, PlayerDisconnectedErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for PlayerDisconnectedError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - PlayerDisconnectedErrorKind::InternalError(_inner) => Some(_inner), - PlayerDisconnectedErrorKind::RateLimitError(_inner) => Some(_inner), - PlayerDisconnectedErrorKind::ForbiddenError(_inner) => Some(_inner), - PlayerDisconnectedErrorKind::UnauthorizedError(_inner) => Some(_inner), - PlayerDisconnectedErrorKind::NotFoundError(_inner) => Some(_inner), - PlayerDisconnectedErrorKind::BadRequestError(_inner) => Some(_inner), - PlayerDisconnectedErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `SetLobbyClosed` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct SetLobbyClosedError { - /// Kind of error that occurred. - pub kind: SetLobbyClosedErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `SetLobbyClosed` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum SetLobbyClosedErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for SetLobbyClosedError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - SetLobbyClosedErrorKind::InternalError(_inner) => _inner.fmt(f), - SetLobbyClosedErrorKind::RateLimitError(_inner) => _inner.fmt(f), - SetLobbyClosedErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - SetLobbyClosedErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - SetLobbyClosedErrorKind::NotFoundError(_inner) => _inner.fmt(f), - SetLobbyClosedErrorKind::BadRequestError(_inner) => _inner.fmt(f), - SetLobbyClosedErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for SetLobbyClosedError { - fn code(&self) -> Option<&str> { - SetLobbyClosedError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - SetLobbyClosedErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - SetLobbyClosedErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl SetLobbyClosedError { - /// Creates a new `SetLobbyClosedError`. - pub fn new(kind: SetLobbyClosedErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `SetLobbyClosedError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: SetLobbyClosedErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `SetLobbyClosedError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: SetLobbyClosedErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `SetLobbyClosedErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, SetLobbyClosedErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `SetLobbyClosedErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, SetLobbyClosedErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `SetLobbyClosedErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, SetLobbyClosedErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `SetLobbyClosedErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, SetLobbyClosedErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `SetLobbyClosedErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, SetLobbyClosedErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `SetLobbyClosedErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, SetLobbyClosedErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for SetLobbyClosedError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - SetLobbyClosedErrorKind::InternalError(_inner) => Some(_inner), - SetLobbyClosedErrorKind::RateLimitError(_inner) => Some(_inner), - SetLobbyClosedErrorKind::ForbiddenError(_inner) => Some(_inner), - SetLobbyClosedErrorKind::UnauthorizedError(_inner) => Some(_inner), - SetLobbyClosedErrorKind::NotFoundError(_inner) => Some(_inner), - SetLobbyClosedErrorKind::BadRequestError(_inner) => Some(_inner), - SetLobbyClosedErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// An error thrown when the requestee has sent an invalid or malformed request. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct BadRequestError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl BadRequestError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for BadRequestError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("BadRequestError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl BadRequestError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for BadRequestError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "BadRequestError")?; - if let Some(inner_1) = &self.message { - write!(f, ": {}", inner_1)?; - } - Ok(()) - } -} -impl std::error::Error for BadRequestError {} -/// See [`BadRequestError`](crate::error::BadRequestError) -pub mod bad_request_error { - /// A builder for [`BadRequestError`](crate::error::BadRequestError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`BadRequestError`](crate::error::BadRequestError) - pub fn build(self) -> crate::error::BadRequestError { - crate::error::BadRequestError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl BadRequestError { - /// Creates a new builder-style object to manufacture [`BadRequestError`](crate::error::BadRequestError) - pub fn builder() -> crate::error::bad_request_error::Builder { - crate::error::bad_request_error::Builder::default() - } -} - -/// An error thrown when the requestee requests a non existent resource. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct NotFoundError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl NotFoundError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for NotFoundError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("NotFoundError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl NotFoundError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for NotFoundError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "NotFoundError")?; - if let Some(inner_2) = &self.message { - write!(f, ": {}", inner_2)?; - } - Ok(()) - } -} -impl std::error::Error for NotFoundError {} -/// See [`NotFoundError`](crate::error::NotFoundError) -pub mod not_found_error { - /// A builder for [`NotFoundError`](crate::error::NotFoundError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`NotFoundError`](crate::error::NotFoundError) - pub fn build(self) -> crate::error::NotFoundError { - crate::error::NotFoundError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl NotFoundError { - /// Creates a new builder-style object to manufacture [`NotFoundError`](crate::error::NotFoundError) - pub fn builder() -> crate::error::not_found_error::Builder { - crate::error::not_found_error::Builder::default() - } -} - -/// An error thrown when the requestee is not authenticated. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UnauthorizedError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl UnauthorizedError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for UnauthorizedError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UnauthorizedError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl UnauthorizedError { - /// Returns `Some(ErrorKind)` if the error is retryable. Otherwise, returns `None`. - pub fn retryable_error_kind(&self) -> aws_smithy_types::retry::ErrorKind { - aws_smithy_types::retry::ErrorKind::ClientError - } - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for UnauthorizedError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "UnauthorizedError")?; - if let Some(inner_3) = &self.message { - write!(f, ": {}", inner_3)?; - } - Ok(()) - } -} -impl std::error::Error for UnauthorizedError {} -/// See [`UnauthorizedError`](crate::error::UnauthorizedError) -pub mod unauthorized_error { - /// A builder for [`UnauthorizedError`](crate::error::UnauthorizedError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`UnauthorizedError`](crate::error::UnauthorizedError) - pub fn build(self) -> crate::error::UnauthorizedError { - crate::error::UnauthorizedError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl UnauthorizedError { - /// Creates a new builder-style object to manufacture [`UnauthorizedError`](crate::error::UnauthorizedError) - pub fn builder() -> crate::error::unauthorized_error::Builder { - crate::error::unauthorized_error::Builder::default() - } -} - -/// An error thrown when the requestee requests a resource they do not have access to. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ForbiddenError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl ForbiddenError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for ForbiddenError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ForbiddenError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl ForbiddenError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for ForbiddenError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "ForbiddenError")?; - if let Some(inner_4) = &self.message { - write!(f, ": {}", inner_4)?; - } - Ok(()) - } -} -impl std::error::Error for ForbiddenError {} -/// See [`ForbiddenError`](crate::error::ForbiddenError) -pub mod forbidden_error { - /// A builder for [`ForbiddenError`](crate::error::ForbiddenError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`ForbiddenError`](crate::error::ForbiddenError) - pub fn build(self) -> crate::error::ForbiddenError { - crate::error::ForbiddenError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl ForbiddenError { - /// Creates a new builder-style object to manufacture [`ForbiddenError`](crate::error::ForbiddenError) - pub fn builder() -> crate::error::forbidden_error::Builder { - crate::error::forbidden_error::Builder::default() - } -} - -/// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct RateLimitError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl RateLimitError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for RateLimitError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("RateLimitError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl RateLimitError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for RateLimitError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "RateLimitError")?; - if let Some(inner_5) = &self.message { - write!(f, ": {}", inner_5)?; - } - Ok(()) - } -} -impl std::error::Error for RateLimitError {} -/// See [`RateLimitError`](crate::error::RateLimitError) -pub mod rate_limit_error { - /// A builder for [`RateLimitError`](crate::error::RateLimitError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`RateLimitError`](crate::error::RateLimitError) - pub fn build(self) -> crate::error::RateLimitError { - crate::error::RateLimitError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl RateLimitError { - /// Creates a new builder-style object to manufacture [`RateLimitError`](crate::error::RateLimitError) - pub fn builder() -> crate::error::rate_limit_error::Builder { - crate::error::rate_limit_error::Builder::default() - } -} - -/// An error caused by internal server problems. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct InternalError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl InternalError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for InternalError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("InternalError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl InternalError { - /// Returns `Some(ErrorKind)` if the error is retryable. Otherwise, returns `None`. - pub fn retryable_error_kind(&self) -> aws_smithy_types::retry::ErrorKind { - aws_smithy_types::retry::ErrorKind::ServerError - } - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for InternalError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "InternalError")?; - if let Some(inner_6) = &self.message { - write!(f, ": {}", inner_6)?; - } - Ok(()) - } -} -impl std::error::Error for InternalError {} -/// See [`InternalError`](crate::error::InternalError) -pub mod internal_error { - /// A builder for [`InternalError`](crate::error::InternalError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`InternalError`](crate::error::InternalError) - pub fn build(self) -> crate::error::InternalError { - crate::error::InternalError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl InternalError { - /// Creates a new builder-style object to manufacture [`InternalError`](crate::error::InternalError) - pub fn builder() -> crate::error::internal_error::Builder { - crate::error::internal_error::Builder::default() - } -} diff --git a/lib/smithy-output/api-matchmaker/rust/rust/src/error_meta.rs b/lib/smithy-output/api-matchmaker/rust/rust/src/error_meta.rs deleted file mode 100644 index 8d2fc6d02..000000000 --- a/lib/smithy-output/api-matchmaker/rust/rust/src/error_meta.rs +++ /dev/null @@ -1,321 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// All possible error types for this service. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum Error { - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An unhandled error occurred. - Unhandled(Box), -} -impl std::fmt::Display for Error { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Error::BadRequestError(inner) => inner.fmt(f), - Error::ForbiddenError(inner) => inner.fmt(f), - Error::InternalError(inner) => inner.fmt(f), - Error::NotFoundError(inner) => inner.fmt(f), - Error::RateLimitError(inner) => inner.fmt(f), - Error::UnauthorizedError(inner) => inner.fmt(f), - Error::Unhandled(inner) => inner.fmt(f), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::FindLobbyErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::FindLobbyErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::FindLobbyErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::FindLobbyErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::FindLobbyErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::FindLobbyErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::FindLobbyErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GetGameStatisticsErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GetGameStatisticsErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GetGameStatisticsErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GetGameStatisticsErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GetGameStatisticsErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GetGameStatisticsErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GetGameStatisticsErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::JoinLobbyErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::JoinLobbyErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::JoinLobbyErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::JoinLobbyErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::JoinLobbyErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::JoinLobbyErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::JoinLobbyErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::ListLobbiesErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::ListLobbiesErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::ListLobbiesErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::ListLobbiesErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::ListLobbiesErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::ListLobbiesErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::ListLobbiesErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::ListRegionsErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::ListRegionsErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::ListRegionsErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::ListRegionsErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::ListRegionsErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::ListRegionsErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::ListRegionsErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::LobbyReadyErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::LobbyReadyErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::LobbyReadyErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::LobbyReadyErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::LobbyReadyErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::LobbyReadyErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::LobbyReadyErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::PlayerConnectedErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::PlayerConnectedErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::PlayerConnectedErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::PlayerConnectedErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::PlayerConnectedErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::PlayerConnectedErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::PlayerConnectedErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::PlayerDisconnectedErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::PlayerDisconnectedErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::PlayerDisconnectedErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::PlayerDisconnectedErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::PlayerDisconnectedErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::PlayerDisconnectedErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::PlayerDisconnectedErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::SetLobbyClosedErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::SetLobbyClosedErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::SetLobbyClosedErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::SetLobbyClosedErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::SetLobbyClosedErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::SetLobbyClosedErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::SetLobbyClosedErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl std::error::Error for Error {} diff --git a/lib/smithy-output/api-matchmaker/rust/rust/src/http_serde.rs b/lib/smithy-output/api-matchmaker/rust/rust/src/http_serde.rs deleted file mode 100644 index 00f05b854..000000000 --- a/lib/smithy-output/api-matchmaker/rust/rust/src/http_serde.rs +++ /dev/null @@ -1,41 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub fn add_headers_find_lobby( - input: &crate::input::FindLobbyInput, - mut builder: http::request::Builder, -) -> std::result::Result { - if let Some(inner_1) = &input.origin { - let formatted_2 = AsRef::::as_ref(inner_1); - if !formatted_2.is_empty() { - let header_value = formatted_2; - let header_value = - http::header::HeaderValue::try_from(&*header_value).map_err(|err| { - aws_smithy_http::operation::BuildError::InvalidField { - field: "origin", - details: format!( - "`{}` cannot be used as a header value: {}", - &header_value, err - ), - } - })?; - builder = builder.header("origin", header_value); - } - } - if let Some(inner_3) = &input.bypass_token { - let formatted_4 = AsRef::::as_ref(inner_3); - if !formatted_4.is_empty() { - let header_value = formatted_4; - let header_value = - http::header::HeaderValue::try_from(&*header_value).map_err(|err| { - aws_smithy_http::operation::BuildError::InvalidField { - field: "bypass_token", - details: format!( - "`{}` cannot be used as a header value: {}", - &"*** Sensitive Data Redacted ***", err - ), - } - })?; - builder = builder.header("x-bypass-token", header_value); - } - } - Ok(builder) -} diff --git a/lib/smithy-output/api-matchmaker/rust/rust/src/input.rs b/lib/smithy-output/api-matchmaker/rust/rust/src/input.rs deleted file mode 100644 index 2658f82ed..000000000 --- a/lib/smithy-output/api-matchmaker/rust/rust/src/input.rs +++ /dev/null @@ -1,1234 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -use std::fmt::Write; -/// See [`FindLobbyInput`](crate::input::FindLobbyInput) -pub mod find_lobby_input { - /// A builder for [`FindLobbyInput`](crate::input::FindLobbyInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_modes: std::option::Option>, - pub(crate) regions: std::option::Option>, - pub(crate) prevent_auto_create_lobby: std::option::Option, - pub(crate) captcha: std::option::Option, - pub(crate) origin: std::option::Option, - pub(crate) bypass_token: std::option::Option, - } - impl Builder { - /// Appends an item to `game_modes`. - /// - /// To override the contents of this collection use [`set_game_modes`](Self::set_game_modes). - /// - /// Game modes to match lobbies against. - pub fn game_modes(mut self, input: impl Into) -> Self { - let mut v = self.game_modes.unwrap_or_default(); - v.push(input.into()); - self.game_modes = Some(v); - self - } - /// Game modes to match lobbies against. - pub fn set_game_modes( - mut self, - input: std::option::Option>, - ) -> Self { - self.game_modes = input; - self - } - /// Appends an item to `regions`. - /// - /// To override the contents of this collection use [`set_regions`](Self::set_regions). - /// - /// Regions to match lobbies against. If not specified, the optimal region will be determined and will attempt to find lobbies in that region. - pub fn regions(mut self, input: impl Into) -> Self { - let mut v = self.regions.unwrap_or_default(); - v.push(input.into()); - self.regions = Some(v); - self - } - /// Regions to match lobbies against. If not specified, the optimal region will be determined and will attempt to find lobbies in that region. - pub fn set_regions( - mut self, - input: std::option::Option>, - ) -> Self { - self.regions = input; - self - } - /// Prevents a new lobby from being created when finding a lobby. If no lobby is found, a `MATCHMAKER_LOBBY_NOT_FOUND` error will be thrown. - pub fn prevent_auto_create_lobby(mut self, input: bool) -> Self { - self.prevent_auto_create_lobby = Some(input); - self - } - /// Prevents a new lobby from being created when finding a lobby. If no lobby is found, a `MATCHMAKER_LOBBY_NOT_FOUND` error will be thrown. - pub fn set_prevent_auto_create_lobby(mut self, input: std::option::Option) -> Self { - self.prevent_auto_create_lobby = input; - self - } - /// Methods to verify a captcha. - pub fn captcha(mut self, input: crate::model::CaptchaConfig) -> Self { - self.captcha = Some(input); - self - } - /// Methods to verify a captcha. - pub fn set_captcha( - mut self, - input: std::option::Option, - ) -> Self { - self.captcha = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn origin(mut self, input: impl Into) -> Self { - self.origin = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_origin(mut self, input: std::option::Option) -> Self { - self.origin = input; - self - } - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn bypass_token(mut self, input: impl Into) -> Self { - self.bypass_token = Some(input.into()); - self - } - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn set_bypass_token(mut self, input: std::option::Option) -> Self { - self.bypass_token = input; - self - } - /// Consumes the builder and constructs a [`FindLobbyInput`](crate::input::FindLobbyInput) - pub fn build( - self, - ) -> std::result::Result - { - Ok(crate::input::FindLobbyInput { - game_modes: self.game_modes, - regions: self.regions, - prevent_auto_create_lobby: self.prevent_auto_create_lobby, - captcha: self.captcha, - origin: self.origin, - bypass_token: self.bypass_token, - }) - } - } -} -#[doc(hidden)] -pub type FindLobbyInputOperationOutputAlias = crate::operation::FindLobby; -#[doc(hidden)] -pub type FindLobbyInputOperationRetryAlias = (); -impl FindLobbyInput { - /// Consumes the builder and constructs an Operation<[`FindLobby`](crate::operation::FindLobby)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::FindLobbyInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/lobbies/find").expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::FindLobbyInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - let builder = crate::http_serde::add_headers_find_lobby(input, builder)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_find_lobby(&self)?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = - aws_smithy_http::operation::Operation::new(request, crate::operation::FindLobby::new()) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "FindLobby", - "MatchmakerService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`FindLobbyInput`](crate::input::FindLobbyInput) - pub fn builder() -> crate::input::find_lobby_input::Builder { - crate::input::find_lobby_input::Builder::default() - } -} - -/// See [`GetGameStatisticsInput`](crate::input::GetGameStatisticsInput) -pub mod get_game_statistics_input { - /// A builder for [`GetGameStatisticsInput`](crate::input::GetGameStatisticsInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// Consumes the builder and constructs a [`GetGameStatisticsInput`](crate::input::GetGameStatisticsInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::GetGameStatisticsInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::GetGameStatisticsInput { - game_id: self.game_id, - }) - } - } -} -#[doc(hidden)] -pub type GetGameStatisticsInputOperationOutputAlias = crate::operation::GetGameStatistics; -#[doc(hidden)] -pub type GetGameStatisticsInputOperationRetryAlias = (); -impl GetGameStatisticsInput { - /// Consumes the builder and constructs an Operation<[`GetGameStatistics`](crate::operation::GetGameStatistics)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GetGameStatisticsInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_1 = &_input.game_id; - let input_1 = input_1.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }, - )?; - let game_id = aws_smithy_http::label::fmt_string(input_1, false); - if game_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_id", - details: "cannot be empty or unset", - }); - } - write!(output, "/games/{game_id}/statistics", game_id = game_id) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GetGameStatisticsInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::GetGameStatistics::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GetGameStatistics", - "MatchmakerService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GetGameStatisticsInput`](crate::input::GetGameStatisticsInput) - pub fn builder() -> crate::input::get_game_statistics_input::Builder { - crate::input::get_game_statistics_input::Builder::default() - } -} - -/// See [`JoinLobbyInput`](crate::input::JoinLobbyInput) -pub mod join_lobby_input { - /// A builder for [`JoinLobbyInput`](crate::input::JoinLobbyInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) lobby_id: std::option::Option, - pub(crate) captcha: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn lobby_id(mut self, input: impl Into) -> Self { - self.lobby_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_lobby_id(mut self, input: std::option::Option) -> Self { - self.lobby_id = input; - self - } - /// Methods to verify a captcha. - pub fn captcha(mut self, input: crate::model::CaptchaConfig) -> Self { - self.captcha = Some(input); - self - } - /// Methods to verify a captcha. - pub fn set_captcha( - mut self, - input: std::option::Option, - ) -> Self { - self.captcha = input; - self - } - /// Consumes the builder and constructs a [`JoinLobbyInput`](crate::input::JoinLobbyInput) - pub fn build( - self, - ) -> std::result::Result - { - Ok(crate::input::JoinLobbyInput { - lobby_id: self.lobby_id, - captcha: self.captcha, - }) - } - } -} -#[doc(hidden)] -pub type JoinLobbyInputOperationOutputAlias = crate::operation::JoinLobby; -#[doc(hidden)] -pub type JoinLobbyInputOperationRetryAlias = (); -impl JoinLobbyInput { - /// Consumes the builder and constructs an Operation<[`JoinLobby`](crate::operation::JoinLobby)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::JoinLobbyInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/lobbies/join").expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::JoinLobbyInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_join_lobby(&self)?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = - aws_smithy_http::operation::Operation::new(request, crate::operation::JoinLobby::new()) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "JoinLobby", - "MatchmakerService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`JoinLobbyInput`](crate::input::JoinLobbyInput) - pub fn builder() -> crate::input::join_lobby_input::Builder { - crate::input::join_lobby_input::Builder::default() - } -} - -/// See [`ListLobbiesInput`](crate::input::ListLobbiesInput) -pub mod list_lobbies_input { - /// A builder for [`ListLobbiesInput`](crate::input::ListLobbiesInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`ListLobbiesInput`](crate::input::ListLobbiesInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::ListLobbiesInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::ListLobbiesInput {}) - } - } -} -#[doc(hidden)] -pub type ListLobbiesInputOperationOutputAlias = crate::operation::ListLobbies; -#[doc(hidden)] -pub type ListLobbiesInputOperationRetryAlias = (); -impl ListLobbiesInput { - /// Consumes the builder and constructs an Operation<[`ListLobbies`](crate::operation::ListLobbies)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::ListLobbiesInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/lobbies/list").expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::ListLobbiesInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::ListLobbies::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "ListLobbies", - "MatchmakerService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`ListLobbiesInput`](crate::input::ListLobbiesInput) - pub fn builder() -> crate::input::list_lobbies_input::Builder { - crate::input::list_lobbies_input::Builder::default() - } -} - -/// See [`ListRegionsInput`](crate::input::ListRegionsInput) -pub mod list_regions_input { - /// A builder for [`ListRegionsInput`](crate::input::ListRegionsInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`ListRegionsInput`](crate::input::ListRegionsInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::ListRegionsInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::ListRegionsInput {}) - } - } -} -#[doc(hidden)] -pub type ListRegionsInputOperationOutputAlias = crate::operation::ListRegions; -#[doc(hidden)] -pub type ListRegionsInputOperationRetryAlias = (); -impl ListRegionsInput { - /// Consumes the builder and constructs an Operation<[`ListRegions`](crate::operation::ListRegions)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::ListRegionsInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/regions").expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::ListRegionsInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::ListRegions::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "ListRegions", - "MatchmakerService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`ListRegionsInput`](crate::input::ListRegionsInput) - pub fn builder() -> crate::input::list_regions_input::Builder { - crate::input::list_regions_input::Builder::default() - } -} - -/// See [`LobbyReadyInput`](crate::input::LobbyReadyInput) -pub mod lobby_ready_input { - /// A builder for [`LobbyReadyInput`](crate::input::LobbyReadyInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`LobbyReadyInput`](crate::input::LobbyReadyInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::LobbyReadyInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::LobbyReadyInput {}) - } - } -} -#[doc(hidden)] -pub type LobbyReadyInputOperationOutputAlias = crate::operation::LobbyReady; -#[doc(hidden)] -pub type LobbyReadyInputOperationRetryAlias = (); -impl LobbyReadyInput { - /// Consumes the builder and constructs an Operation<[`LobbyReady`](crate::operation::LobbyReady)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::LobbyReadyInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/lobbies/ready").expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::LobbyReadyInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from("{}"); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::LobbyReady::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "LobbyReady", - "MatchmakerService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`LobbyReadyInput`](crate::input::LobbyReadyInput) - pub fn builder() -> crate::input::lobby_ready_input::Builder { - crate::input::lobby_ready_input::Builder::default() - } -} - -/// See [`PlayerConnectedInput`](crate::input::PlayerConnectedInput) -pub mod player_connected_input { - /// A builder for [`PlayerConnectedInput`](crate::input::PlayerConnectedInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) player_token: std::option::Option, - } - impl Builder { - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn player_token(mut self, input: impl Into) -> Self { - self.player_token = Some(input.into()); - self - } - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn set_player_token(mut self, input: std::option::Option) -> Self { - self.player_token = input; - self - } - /// Consumes the builder and constructs a [`PlayerConnectedInput`](crate::input::PlayerConnectedInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::PlayerConnectedInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::PlayerConnectedInput { - player_token: self.player_token, - }) - } - } -} -#[doc(hidden)] -pub type PlayerConnectedInputOperationOutputAlias = crate::operation::PlayerConnected; -#[doc(hidden)] -pub type PlayerConnectedInputOperationRetryAlias = (); -impl PlayerConnectedInput { - /// Consumes the builder and constructs an Operation<[`PlayerConnected`](crate::operation::PlayerConnected)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::PlayerConnectedInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/players/connected").expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::PlayerConnectedInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_player_connected(&self)?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::PlayerConnected::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "PlayerConnected", - "MatchmakerService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`PlayerConnectedInput`](crate::input::PlayerConnectedInput) - pub fn builder() -> crate::input::player_connected_input::Builder { - crate::input::player_connected_input::Builder::default() - } -} - -/// See [`PlayerDisconnectedInput`](crate::input::PlayerDisconnectedInput) -pub mod player_disconnected_input { - /// A builder for [`PlayerDisconnectedInput`](crate::input::PlayerDisconnectedInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) player_token: std::option::Option, - } - impl Builder { - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn player_token(mut self, input: impl Into) -> Self { - self.player_token = Some(input.into()); - self - } - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn set_player_token(mut self, input: std::option::Option) -> Self { - self.player_token = input; - self - } - /// Consumes the builder and constructs a [`PlayerDisconnectedInput`](crate::input::PlayerDisconnectedInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::PlayerDisconnectedInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::PlayerDisconnectedInput { - player_token: self.player_token, - }) - } - } -} -#[doc(hidden)] -pub type PlayerDisconnectedInputOperationOutputAlias = crate::operation::PlayerDisconnected; -#[doc(hidden)] -pub type PlayerDisconnectedInputOperationRetryAlias = (); -impl PlayerDisconnectedInput { - /// Consumes the builder and constructs an Operation<[`PlayerDisconnected`](crate::operation::PlayerDisconnected)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::PlayerDisconnectedInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/players/disconnected").expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::PlayerDisconnectedInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_player_disconnected(&self)?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::PlayerDisconnected::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "PlayerDisconnected", - "MatchmakerService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`PlayerDisconnectedInput`](crate::input::PlayerDisconnectedInput) - pub fn builder() -> crate::input::player_disconnected_input::Builder { - crate::input::player_disconnected_input::Builder::default() - } -} - -/// See [`SetLobbyClosedInput`](crate::input::SetLobbyClosedInput) -pub mod set_lobby_closed_input { - /// A builder for [`SetLobbyClosedInput`](crate::input::SetLobbyClosedInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) is_closed: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn is_closed(mut self, input: bool) -> Self { - self.is_closed = Some(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_is_closed(mut self, input: std::option::Option) -> Self { - self.is_closed = input; - self - } - /// Consumes the builder and constructs a [`SetLobbyClosedInput`](crate::input::SetLobbyClosedInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::SetLobbyClosedInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::SetLobbyClosedInput { - is_closed: self.is_closed, - }) - } - } -} -#[doc(hidden)] -pub type SetLobbyClosedInputOperationOutputAlias = crate::operation::SetLobbyClosed; -#[doc(hidden)] -pub type SetLobbyClosedInputOperationRetryAlias = (); -impl SetLobbyClosedInput { - /// Consumes the builder and constructs an Operation<[`SetLobbyClosed`](crate::operation::SetLobbyClosed)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::SetLobbyClosedInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/lobbies/closed").expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::SetLobbyClosedInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("PUT").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_set_lobby_closed(&self)?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::SetLobbyClosed::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "SetLobbyClosed", - "MatchmakerService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`SetLobbyClosedInput`](crate::input::SetLobbyClosedInput) - pub fn builder() -> crate::input::set_lobby_closed_input::Builder { - crate::input::set_lobby_closed_input::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetGameStatisticsInput { - /// A universally unique identifier. - pub game_id: std::option::Option, -} -impl GetGameStatisticsInput { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } -} -impl std::fmt::Debug for GetGameStatisticsInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetGameStatisticsInput"); - formatter.field("game_id", &self.game_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ListRegionsInput {} -impl std::fmt::Debug for ListRegionsInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ListRegionsInput"); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PlayerDisconnectedInput { - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub player_token: std::option::Option, -} -impl PlayerDisconnectedInput { - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn player_token(&self) -> std::option::Option<&str> { - self.player_token.as_deref() - } -} -impl std::fmt::Debug for PlayerDisconnectedInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PlayerDisconnectedInput"); - formatter.field("player_token", &"*** Sensitive Data Redacted ***"); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PlayerConnectedInput { - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub player_token: std::option::Option, -} -impl PlayerConnectedInput { - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn player_token(&self) -> std::option::Option<&str> { - self.player_token.as_deref() - } -} -impl std::fmt::Debug for PlayerConnectedInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PlayerConnectedInput"); - formatter.field("player_token", &"*** Sensitive Data Redacted ***"); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct SetLobbyClosedInput { - #[allow(missing_docs)] // documentation missing in model - pub is_closed: std::option::Option, -} -impl SetLobbyClosedInput { - #[allow(missing_docs)] // documentation missing in model - pub fn is_closed(&self) -> std::option::Option { - self.is_closed - } -} -impl std::fmt::Debug for SetLobbyClosedInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("SetLobbyClosedInput"); - formatter.field("is_closed", &self.is_closed); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ListLobbiesInput {} -impl std::fmt::Debug for ListLobbiesInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ListLobbiesInput"); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct FindLobbyInput { - /// Game modes to match lobbies against. - pub game_modes: std::option::Option>, - /// Regions to match lobbies against. If not specified, the optimal region will be determined and will attempt to find lobbies in that region. - pub regions: std::option::Option>, - /// Prevents a new lobby from being created when finding a lobby. If no lobby is found, a `MATCHMAKER_LOBBY_NOT_FOUND` error will be thrown. - pub prevent_auto_create_lobby: std::option::Option, - /// Methods to verify a captcha. - pub captcha: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub origin: std::option::Option, - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub bypass_token: std::option::Option, -} -impl FindLobbyInput { - /// Game modes to match lobbies against. - pub fn game_modes(&self) -> std::option::Option<&[std::string::String]> { - self.game_modes.as_deref() - } - /// Regions to match lobbies against. If not specified, the optimal region will be determined and will attempt to find lobbies in that region. - pub fn regions(&self) -> std::option::Option<&[std::string::String]> { - self.regions.as_deref() - } - /// Prevents a new lobby from being created when finding a lobby. If no lobby is found, a `MATCHMAKER_LOBBY_NOT_FOUND` error will be thrown. - pub fn prevent_auto_create_lobby(&self) -> std::option::Option { - self.prevent_auto_create_lobby - } - /// Methods to verify a captcha. - pub fn captcha(&self) -> std::option::Option<&crate::model::CaptchaConfig> { - self.captcha.as_ref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn origin(&self) -> std::option::Option<&str> { - self.origin.as_deref() - } - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn bypass_token(&self) -> std::option::Option<&str> { - self.bypass_token.as_deref() - } -} -impl std::fmt::Debug for FindLobbyInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("FindLobbyInput"); - formatter.field("game_modes", &self.game_modes); - formatter.field("regions", &self.regions); - formatter.field("prevent_auto_create_lobby", &self.prevent_auto_create_lobby); - formatter.field("captcha", &self.captcha); - formatter.field("origin", &self.origin); - formatter.field("bypass_token", &"*** Sensitive Data Redacted ***"); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct JoinLobbyInput { - /// A universally unique identifier. - pub lobby_id: std::option::Option, - /// Methods to verify a captcha. - pub captcha: std::option::Option, -} -impl JoinLobbyInput { - /// A universally unique identifier. - pub fn lobby_id(&self) -> std::option::Option<&str> { - self.lobby_id.as_deref() - } - /// Methods to verify a captcha. - pub fn captcha(&self) -> std::option::Option<&crate::model::CaptchaConfig> { - self.captcha.as_ref() - } -} -impl std::fmt::Debug for JoinLobbyInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("JoinLobbyInput"); - formatter.field("lobby_id", &self.lobby_id); - formatter.field("captcha", &self.captcha); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct LobbyReadyInput {} -impl std::fmt::Debug for LobbyReadyInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("LobbyReadyInput"); - formatter.finish() - } -} diff --git a/lib/smithy-output/api-matchmaker/rust/rust/src/json_deser.rs b/lib/smithy-output/api-matchmaker/rust/rust/src/json_deser.rs deleted file mode 100644 index a65005a83..000000000 --- a/lib/smithy-output/api-matchmaker/rust/rust/src/json_deser.rs +++ /dev/null @@ -1,1675 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub fn parse_http_generic_error( - response: &http::Response, -) -> Result { - crate::json_errors::parse_generic_error(response.body(), response.headers()) -} - -pub fn deser_structure_crate_error_internal_error_json_err( - value: &[u8], - mut builder: crate::error::internal_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_rate_limit_error_json_err( - value: &[u8], - mut builder: crate::error::rate_limit_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_forbidden_error_json_err( - value: &[u8], - mut builder: crate::error::forbidden_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_unauthorized_error_json_err( - value: &[u8], - mut builder: crate::error::unauthorized_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_not_found_error_json_err( - value: &[u8], - mut builder: crate::error::not_found_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_bad_request_error_json_err( - value: &[u8], - mut builder: crate::error::bad_request_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_find_lobby( - value: &[u8], - mut builder: crate::output::find_lobby_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "lobby" => { - builder = builder.set_lobby( - crate::json_deser::deser_structure_crate_model_matchmaker_lobby_join_info(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_get_game_statistics( - value: &[u8], - mut builder: crate::output::get_game_statistics_output::Builder, -) -> Result -{ - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "namespaces" => { - builder = builder.set_namespaces( - crate::json_deser::deser_map_rivet_api_matchmaker_common_multiple_namespace_statistics(tokens)? - ); - } - "player_count" => { - builder = builder.set_player_count( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i64()), - ); - } - "regions" => { - builder = builder.set_regions( - crate::json_deser::deser_map_rivet_api_matchmaker_common_multiple_region_statistics(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_join_lobby( - value: &[u8], - mut builder: crate::output::join_lobby_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "lobby" => { - builder = builder.set_lobby( - crate::json_deser::deser_structure_crate_model_matchmaker_lobby_join_info(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_list_lobbies( - value: &[u8], - mut builder: crate::output::list_lobbies_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "game_modes" => { - builder = builder.set_game_modes( - crate::json_deser::deser_list_rivet_api_matchmaker_common_game_mode_infos(tokens)? - ); - } - "lobbies" => { - builder = builder.set_lobbies( - crate::json_deser::deser_list_rivet_api_matchmaker_common_lobby_infos( - tokens, - )?, - ); - } - "regions" => { - builder = builder.set_regions( - crate::json_deser::deser_list_rivet_api_matchmaker_common_region_infos( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_list_regions( - value: &[u8], - mut builder: crate::output::list_regions_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "regions" => { - builder = builder.set_regions( - crate::json_deser::deser_list_rivet_api_matchmaker_common_region_infos( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn or_empty_doc(data: &[u8]) -> &[u8] { - if data.is_empty() { - b"{}" - } else { - data - } -} - -pub fn deser_structure_crate_model_matchmaker_lobby_join_info<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::MatchmakerLobbyJoinInfo::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "lobby_id" => { - builder = builder.set_lobby_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "region" => { - builder = builder.set_region( - crate::json_deser::deser_structure_crate_model_matchmaker_lobby_join_info_region(tokens)? - ); - } - "ports" => { - builder = builder.set_ports( - crate::json_deser::deser_map_rivet_matchmaker_matchmaker_lobby_join_info_ports(tokens)? - ); - } - "player" => { - builder = builder.set_player( - crate::json_deser::deser_structure_crate_model_matchmaker_lobby_join_info_player(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_map_rivet_api_matchmaker_common_multiple_namespace_statistics<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option>, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - let mut map = std::collections::HashMap::new(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - let key = key.to_unescaped().map(|u| u.into_owned())?; - let value = - crate::json_deser::deser_structure_crate_model_namespace_statistics( - tokens, - )?; - if let Some(value) = value { - map.insert(key, value); - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(map)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_map_rivet_api_matchmaker_common_multiple_region_statistics<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option>, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - let mut map = std::collections::HashMap::new(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - let key = key.to_unescaped().map(|u| u.into_owned())?; - let value = - crate::json_deser::deser_structure_crate_model_region_statistics( - tokens, - )?; - if let Some(value) = value { - map.insert(key, value); - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(map)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_api_matchmaker_common_game_mode_infos<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_game_mode_info(tokens)?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_api_matchmaker_common_lobby_infos<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_lobby_info(tokens)?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_api_matchmaker_common_region_infos<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_region_info(tokens)?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_structure_crate_model_matchmaker_lobby_join_info_region<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::MatchmakerLobbyJoinInfoRegion::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "region_id" => { - builder = builder.set_region_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "display_name" => { - builder = builder.set_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_map_rivet_matchmaker_matchmaker_lobby_join_info_ports<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option< - std::collections::HashMap, - >, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - let mut map = std::collections::HashMap::new(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - let key = key.to_unescaped().map(|u| u.into_owned())?; - let value = - crate::json_deser::deser_structure_crate_model_matchmaker_lobby_join_info_port(tokens)? - ; - if let Some(value) = value { - map.insert(key, value); - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(map)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_matchmaker_lobby_join_info_player<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::MatchmakerLobbyJoinInfoPlayer::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "token" => { - builder = builder.set_token( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_namespace_statistics<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::NamespaceStatistics::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "player_count" => { - builder = builder.set_player_count( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i64()), - ); - } - "game_modes" => { - builder = builder.set_game_modes( - crate::json_deser::deser_map_rivet_api_matchmaker_common_multiple_game_mode_statistics(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_region_statistics<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::RegionStatistics::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "player_count" => { - builder = builder.set_player_count( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i64()), - ); - } - "game_modes" => { - builder = builder.set_game_modes( - crate::json_deser::deser_map_rivet_api_matchmaker_common_multiple_game_mode_statistics(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_game_mode_info<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GameModeInfo::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "game_mode_id" => { - builder = builder.set_game_mode_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_lobby_info<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::LobbyInfo::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "region_id" => { - builder = builder.set_region_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "game_mode_id" => { - builder = builder.set_game_mode_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "lobby_id" => { - builder = builder.set_lobby_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "max_players_normal" => { - builder = builder.set_max_players_normal( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "max_players_direct" => { - builder = builder.set_max_players_direct( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "max_players_party" => { - builder = builder.set_max_players_party( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "total_player_count" => { - builder = builder.set_total_player_count( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_region_info<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::RegionInfo::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "region_id" => { - builder = builder.set_region_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "provider_display_name" => { - builder = builder.set_provider_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "region_display_name" => { - builder = builder.set_region_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "datacenter_coord" => { - builder = builder.set_datacenter_coord( - crate::json_deser::deser_structure_crate_model_coord(tokens)?, - ); - } - "datacenter_distance_from_client" => { - builder = builder.set_datacenter_distance_from_client( - crate::json_deser::deser_structure_crate_model_distance( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_matchmaker_lobby_join_info_port<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::MatchmakerLobbyJoinInfoPort::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "host" => { - builder = builder.set_host( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "hostname" => { - builder = builder.set_hostname( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "port" => { - builder = builder.set_port( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "port_range" => { - builder = builder.set_port_range( - crate::json_deser::deser_structure_crate_model_matchmaker_lobby_join_info_port_range(tokens)? - ); - } - "is_tls" => { - builder = builder.set_is_tls( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_map_rivet_api_matchmaker_common_multiple_game_mode_statistics<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option>, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - let mut map = std::collections::HashMap::new(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - let key = key.to_unescaped().map(|u| u.into_owned())?; - let value = - crate::json_deser::deser_structure_crate_model_game_mode_statistics( - tokens, - )?; - if let Some(value) = value { - map.insert(key, value); - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(map)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_coord<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::Coord::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "latitude" => { - builder = builder.set_latitude( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_f64()), - ); - } - "longitude" => { - builder = builder.set_longitude( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_f64()), - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_distance<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::Distance::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "kilometers" => { - builder = builder.set_kilometers( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_f64()), - ); - } - "miles" => { - builder = builder.set_miles( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_f64()), - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_matchmaker_lobby_join_info_port_range<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::MatchmakerLobbyJoinInfoPortRange::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "min" => { - builder = builder.set_min( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "max" => { - builder = builder.set_max( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_game_mode_statistics<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GameModeStatistics::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "player_count" => { - builder = builder.set_player_count( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i64()), - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} diff --git a/lib/smithy-output/api-matchmaker/rust/rust/src/json_errors.rs b/lib/smithy-output/api-matchmaker/rust/rust/src/json_errors.rs deleted file mode 100644 index 7b7574319..000000000 --- a/lib/smithy-output/api-matchmaker/rust/rust/src/json_errors.rs +++ /dev/null @@ -1,220 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -use aws_smithy_json::deserialize::token::skip_value; -use aws_smithy_json::deserialize::{json_token_iter, Error as DeserializeError, Token}; -use aws_smithy_types::Error as SmithyError; -use bytes::Bytes; -use http::header::ToStrError; -use http::{HeaderMap, HeaderValue}; -use std::borrow::Cow; - -// currently only used by AwsJson -#[allow(unused)] -pub fn is_error(response: &http::Response) -> bool { - !response.status().is_success() -} - -fn sanitize_error_code(error_code: &str) -> &str { - // Trim a trailing URL from the error code, beginning with a `:` - let error_code = match error_code.find(':') { - Some(idx) => &error_code[..idx], - None => error_code, - }; - - // Trim a prefixing namespace from the error code, beginning with a `#` - match error_code.find('#') { - Some(idx) => &error_code[idx + 1..], - None => error_code, - } -} - -struct ErrorBody<'a> { - code: Option>, - message: Option>, -} - -fn parse_error_body(bytes: &[u8]) -> Result { - let mut tokens = json_token_iter(bytes).peekable(); - let (mut typ, mut code, mut message) = (None, None, None); - if let Some(Token::StartObject { .. }) = tokens.next().transpose()? { - loop { - match tokens.next().transpose()? { - Some(Token::EndObject { .. }) => break, - Some(Token::ObjectKey { key, .. }) => { - if let Some(Ok(Token::ValueString { value, .. })) = tokens.peek() { - match key.as_escaped_str() { - "code" => code = Some(value.to_unescaped()?), - "__type" => typ = Some(value.to_unescaped()?), - "message" | "Message" | "errorMessage" => { - message = Some(value.to_unescaped()?) - } - _ => {} - } - } - skip_value(&mut tokens)?; - } - _ => { - return Err(DeserializeError::custom( - "expected object key or end object", - )) - } - } - } - if tokens.next().is_some() { - return Err(DeserializeError::custom( - "found more JSON tokens after completing parsing", - )); - } - } - Ok(ErrorBody { - code: code.or(typ), - message, - }) -} - -fn error_type_from_header(headers: &HeaderMap) -> Result, ToStrError> { - headers - .get("X-Amzn-Errortype") - .map(|v| v.to_str()) - .transpose() -} - -fn request_id(headers: &HeaderMap) -> Option<&str> { - headers - .get("X-Amzn-Requestid") - .and_then(|v| v.to_str().ok()) -} - -pub fn parse_generic_error( - payload: &Bytes, - headers: &HeaderMap, -) -> Result { - let ErrorBody { code, message } = parse_error_body(payload.as_ref())?; - - let mut err_builder = SmithyError::builder(); - if let Some(code) = error_type_from_header(headers) - .map_err(|_| DeserializeError::custom("X-Amzn-Errortype header was not valid UTF-8"))? - .or_else(|| code.as_deref()) - .map(sanitize_error_code) - { - err_builder.code(code); - } - if let Some(message) = message { - err_builder.message(message); - } - if let Some(request_id) = request_id(headers) { - err_builder.request_id(request_id); - } - Ok(err_builder.build()) -} - -#[cfg(test)] -mod test { - use crate::json_errors::{parse_error_body, parse_generic_error, sanitize_error_code}; - use aws_smithy_types::Error; - use bytes::Bytes; - use std::borrow::Cow; - - #[test] - fn generic_error() { - let response = http::Response::builder() - .header("X-Amzn-Requestid", "1234") - .body(Bytes::from_static( - br#"{ "__type": "FooError", "message": "Go to foo" }"#, - )) - .unwrap(); - assert_eq!( - parse_generic_error(response.body(), response.headers()).unwrap(), - Error::builder() - .code("FooError") - .message("Go to foo") - .request_id("1234") - .build() - ) - } - - #[test] - fn error_type() { - assert_eq!( - Some(Cow::Borrowed("FooError")), - parse_error_body(br#"{ "__type": "FooError" }"#) - .unwrap() - .code - ); - } - - #[test] - fn code_takes_priority() { - assert_eq!( - Some(Cow::Borrowed("BarError")), - parse_error_body(br#"{ "code": "BarError", "__type": "FooError" }"#) - .unwrap() - .code - ); - } - - #[test] - fn ignore_unrecognized_fields() { - assert_eq!( - Some(Cow::Borrowed("FooError")), - parse_error_body(br#"{ "__type": "FooError", "asdf": 5, "fdsa": {}, "foo": "1" }"#) - .unwrap() - .code - ); - } - - #[test] - fn sanitize_namespace_and_url() { - assert_eq!( - sanitize_error_code("aws.protocoltests.restjson#FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/"), - "FooError"); - } - - #[test] - fn sanitize_noop() { - assert_eq!(sanitize_error_code("FooError"), "FooError"); - } - - #[test] - fn sanitize_url() { - assert_eq!( - sanitize_error_code( - "FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/" - ), - "FooError" - ); - } - - #[test] - fn sanitize_namespace() { - assert_eq!( - sanitize_error_code("aws.protocoltests.restjson#FooError"), - "FooError" - ); - } - - // services like lambda use an alternate `Message` instead of `message` - #[test] - fn alternative_error_message_names() { - let response = http::Response::builder() - .header("x-amzn-errortype", "ResourceNotFoundException") - .body(Bytes::from_static( - br#"{ - "Type": "User", - "Message": "Functions from 'us-west-2' are not reachable from us-east-1" - }"#, - )) - .unwrap(); - assert_eq!( - parse_generic_error(response.body(), response.headers()).unwrap(), - Error::builder() - .code("ResourceNotFoundException") - .message("Functions from 'us-west-2' are not reachable from us-east-1") - .build() - ); - } -} diff --git a/lib/smithy-output/api-matchmaker/rust/rust/src/json_ser.rs b/lib/smithy-output/api-matchmaker/rust/rust/src/json_ser.rs deleted file mode 100644 index 79b0d75cf..000000000 --- a/lib/smithy-output/api-matchmaker/rust/rust/src/json_ser.rs +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub fn serialize_structure_crate_input_find_lobby_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::FindLobbyInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_1) = &input.captcha { - let mut object_2 = object.key("captcha").start_object(); - crate::json_ser::serialize_union_crate_model_captcha_config(&mut object_2, var_1)?; - object_2.finish(); - } - if let Some(var_3) = &input.game_modes { - let mut array_4 = object.key("game_modes").start_array(); - for item_5 in var_3 { - { - array_4.value().string(item_5.as_str()); - } - } - array_4.finish(); - } - if let Some(var_6) = &input.prevent_auto_create_lobby { - object.key("prevent_auto_create_lobby").boolean(*var_6); - } - if let Some(var_7) = &input.regions { - let mut array_8 = object.key("regions").start_array(); - for item_9 in var_7 { - { - array_8.value().string(item_9.as_str()); - } - } - array_8.finish(); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_join_lobby_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::JoinLobbyInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_10) = &input.captcha { - let mut object_11 = object.key("captcha").start_object(); - crate::json_ser::serialize_union_crate_model_captcha_config(&mut object_11, var_10)?; - object_11.finish(); - } - if let Some(var_12) = &input.lobby_id { - object.key("lobby_id").string(var_12.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_player_connected_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::PlayerConnectedInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_13) = &input.player_token { - object.key("player_token").string(var_13.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_player_disconnected_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::PlayerDisconnectedInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_14) = &input.player_token { - object.key("player_token").string(var_14.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_set_lobby_closed_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::SetLobbyClosedInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_15) = &input.is_closed { - object.key("is_closed").boolean(*var_15); - } - Ok(()) -} - -pub fn serialize_union_crate_model_captcha_config( - object_2: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::CaptchaConfig, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - match input { - crate::model::CaptchaConfig::Hcaptcha(inner) => { - let mut object_16 = object_2.key("hcaptcha").start_object(); - crate::json_ser::serialize_structure_crate_model_captcha_config_hcaptcha( - &mut object_16, - inner, - )?; - object_16.finish(); - } - crate::model::CaptchaConfig::Turnstile(inner) => { - let mut object_17 = object_2.key("turnstile").start_object(); - crate::json_ser::serialize_structure_crate_model_captcha_config_turnstile( - &mut object_17, - inner, - )?; - object_17.finish(); - } - crate::model::CaptchaConfig::Unknown => { - return Err( - aws_smithy_http::operation::SerializationError::unknown_variant("CaptchaConfig"), - ) - } - } - Ok(()) -} - -pub fn serialize_structure_crate_model_captcha_config_hcaptcha( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::CaptchaConfigHcaptcha, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_18) = &input.client_response { - object.key("client_response").string(var_18.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_model_captcha_config_turnstile( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::CaptchaConfigTurnstile, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_19) = &input.client_response { - object.key("client_response").string(var_19.as_str()); - } - Ok(()) -} diff --git a/lib/smithy-output/api-matchmaker/rust/rust/src/lib.rs b/lib/smithy-output/api-matchmaker/rust/rust/src/lib.rs deleted file mode 100644 index 2b8b30f7f..000000000 --- a/lib/smithy-output/api-matchmaker/rust/rust/src/lib.rs +++ /dev/null @@ -1,58 +0,0 @@ -#![allow(clippy::module_inception)] -#![allow(clippy::upper_case_acronyms)] -#![allow(clippy::large_enum_variant)] -#![allow(clippy::wrong_self_convention)] -#![allow(clippy::should_implement_trait)] -#![allow(clippy::blacklisted_name)] -#![allow(clippy::vec_init_then_push)] -#![allow(rustdoc::bare_urls)] -#![warn(missing_docs)] -//! rivet-matchmaker -//! -//! # Crate Organization -//! -//! The entry point for most customers will be [`Client`]. [`Client`] exposes one method for each API offered -//! by the service. -//! -//! Some APIs require complex or nested arguments. These exist in [`model`](crate::model). -//! -//! Lastly, errors that can be returned by the service are contained within [`error`]. [`Error`] defines a meta -//! error encompassing all possible errors that can be returned by the service. -//! -//! The other modules within this crate are not required for normal usage. - -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use error_meta::Error; - -#[doc(inline)] -pub use config::Config; - -/// Client and fluent builders for calling the service. -pub mod client; -/// Configuration for the service. -pub mod config; -/// Errors that can occur when calling the service. -pub mod error; -mod error_meta; -mod http_serde; -/// Input structures for operations. -pub mod input; -mod json_deser; -mod json_errors; -mod json_ser; -/// Data structures used by operation inputs/outputs. -pub mod model; -/// All operations that this crate can perform. -pub mod operation; -mod operation_deser; -mod operation_ser; -/// Output structures for operations. -pub mod output; -pub use client::{Builder, Client, ClientWrapper}; -/// Crate version number. -pub static PKG_VERSION: &str = env!("CARGO_PKG_VERSION"); -/// Re-exported types from supporting crates. -pub mod types { - pub use aws_smithy_http::result::SdkError; - pub use aws_smithy_types::DateTime; -} diff --git a/lib/smithy-output/api-matchmaker/rust/rust/src/model.rs b/lib/smithy-output/api-matchmaker/rust/rust/src/model.rs deleted file mode 100644 index a8c508608..000000000 --- a/lib/smithy-output/api-matchmaker/rust/rust/src/model.rs +++ /dev/null @@ -1,1403 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Game region statistics. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct RegionStatistics { - /// Unsigned 64 bit integer. - pub player_count: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub game_modes: std::option::Option< - std::collections::HashMap, - >, -} -impl RegionStatistics { - /// Unsigned 64 bit integer. - pub fn player_count(&self) -> std::option::Option { - self.player_count - } - #[allow(missing_docs)] // documentation missing in model - pub fn game_modes( - &self, - ) -> std::option::Option< - &std::collections::HashMap, - > { - self.game_modes.as_ref() - } -} -impl std::fmt::Debug for RegionStatistics { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("RegionStatistics"); - formatter.field("player_count", &self.player_count); - formatter.field("game_modes", &self.game_modes); - formatter.finish() - } -} -/// See [`RegionStatistics`](crate::model::RegionStatistics) -pub mod region_statistics { - /// A builder for [`RegionStatistics`](crate::model::RegionStatistics) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) player_count: std::option::Option, - pub(crate) game_modes: std::option::Option< - std::collections::HashMap, - >, - } - impl Builder { - /// Unsigned 64 bit integer. - pub fn player_count(mut self, input: i64) -> Self { - self.player_count = Some(input); - self - } - /// Unsigned 64 bit integer. - pub fn set_player_count(mut self, input: std::option::Option) -> Self { - self.player_count = input; - self - } - /// Adds a key-value pair to `game_modes`. - /// - /// To override the contents of this collection use [`set_game_modes`](Self::set_game_modes). - /// - pub fn game_modes( - mut self, - k: impl Into, - v: crate::model::GameModeStatistics, - ) -> Self { - let mut hash_map = self.game_modes.unwrap_or_default(); - hash_map.insert(k.into(), v); - self.game_modes = Some(hash_map); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_game_modes( - mut self, - input: std::option::Option< - std::collections::HashMap, - >, - ) -> Self { - self.game_modes = input; - self - } - /// Consumes the builder and constructs a [`RegionStatistics`](crate::model::RegionStatistics) - pub fn build(self) -> crate::model::RegionStatistics { - crate::model::RegionStatistics { - player_count: self.player_count, - game_modes: self.game_modes, - } - } - } -} -impl RegionStatistics { - /// Creates a new builder-style object to manufacture [`RegionStatistics`](crate::model::RegionStatistics) - pub fn builder() -> crate::model::region_statistics::Builder { - crate::model::region_statistics::Builder::default() - } -} - -/// Game mode statistics -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GameModeStatistics { - /// Unsigned 64 bit integer. - pub player_count: std::option::Option, -} -impl GameModeStatistics { - /// Unsigned 64 bit integer. - pub fn player_count(&self) -> std::option::Option { - self.player_count - } -} -impl std::fmt::Debug for GameModeStatistics { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GameModeStatistics"); - formatter.field("player_count", &self.player_count); - formatter.finish() - } -} -/// See [`GameModeStatistics`](crate::model::GameModeStatistics) -pub mod game_mode_statistics { - /// A builder for [`GameModeStatistics`](crate::model::GameModeStatistics) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) player_count: std::option::Option, - } - impl Builder { - /// Unsigned 64 bit integer. - pub fn player_count(mut self, input: i64) -> Self { - self.player_count = Some(input); - self - } - /// Unsigned 64 bit integer. - pub fn set_player_count(mut self, input: std::option::Option) -> Self { - self.player_count = input; - self - } - /// Consumes the builder and constructs a [`GameModeStatistics`](crate::model::GameModeStatistics) - pub fn build(self) -> crate::model::GameModeStatistics { - crate::model::GameModeStatistics { - player_count: self.player_count, - } - } - } -} -impl GameModeStatistics { - /// Creates a new builder-style object to manufacture [`GameModeStatistics`](crate::model::GameModeStatistics) - pub fn builder() -> crate::model::game_mode_statistics::Builder { - crate::model::game_mode_statistics::Builder::default() - } -} - -/// Game namespace statistics. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct NamespaceStatistics { - /// Unsigned 64 bit integer. - pub player_count: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub game_modes: std::option::Option< - std::collections::HashMap, - >, -} -impl NamespaceStatistics { - /// Unsigned 64 bit integer. - pub fn player_count(&self) -> std::option::Option { - self.player_count - } - #[allow(missing_docs)] // documentation missing in model - pub fn game_modes( - &self, - ) -> std::option::Option< - &std::collections::HashMap, - > { - self.game_modes.as_ref() - } -} -impl std::fmt::Debug for NamespaceStatistics { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("NamespaceStatistics"); - formatter.field("player_count", &self.player_count); - formatter.field("game_modes", &self.game_modes); - formatter.finish() - } -} -/// See [`NamespaceStatistics`](crate::model::NamespaceStatistics) -pub mod namespace_statistics { - /// A builder for [`NamespaceStatistics`](crate::model::NamespaceStatistics) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) player_count: std::option::Option, - pub(crate) game_modes: std::option::Option< - std::collections::HashMap, - >, - } - impl Builder { - /// Unsigned 64 bit integer. - pub fn player_count(mut self, input: i64) -> Self { - self.player_count = Some(input); - self - } - /// Unsigned 64 bit integer. - pub fn set_player_count(mut self, input: std::option::Option) -> Self { - self.player_count = input; - self - } - /// Adds a key-value pair to `game_modes`. - /// - /// To override the contents of this collection use [`set_game_modes`](Self::set_game_modes). - /// - pub fn game_modes( - mut self, - k: impl Into, - v: crate::model::GameModeStatistics, - ) -> Self { - let mut hash_map = self.game_modes.unwrap_or_default(); - hash_map.insert(k.into(), v); - self.game_modes = Some(hash_map); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_game_modes( - mut self, - input: std::option::Option< - std::collections::HashMap, - >, - ) -> Self { - self.game_modes = input; - self - } - /// Consumes the builder and constructs a [`NamespaceStatistics`](crate::model::NamespaceStatistics) - pub fn build(self) -> crate::model::NamespaceStatistics { - crate::model::NamespaceStatistics { - player_count: self.player_count, - game_modes: self.game_modes, - } - } - } -} -impl NamespaceStatistics { - /// Creates a new builder-style object to manufacture [`NamespaceStatistics`](crate::model::NamespaceStatistics) - pub fn builder() -> crate::model::namespace_statistics::Builder { - crate::model::namespace_statistics::Builder::default() - } -} - -/// A region that the player can connect to. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct RegionInfo { - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub region_id: std::option::Option, - /// A universally unique identifier. - pub provider_display_name: std::option::Option, - /// A universally unique identifier. - pub region_display_name: std::option::Option, - /// Geographical coordinates for a location on Planet Earth. - pub datacenter_coord: std::option::Option, - /// Distance available in multiple units. - pub datacenter_distance_from_client: std::option::Option, -} -impl RegionInfo { - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn region_id(&self) -> std::option::Option<&str> { - self.region_id.as_deref() - } - /// A universally unique identifier. - pub fn provider_display_name(&self) -> std::option::Option<&str> { - self.provider_display_name.as_deref() - } - /// A universally unique identifier. - pub fn region_display_name(&self) -> std::option::Option<&str> { - self.region_display_name.as_deref() - } - /// Geographical coordinates for a location on Planet Earth. - pub fn datacenter_coord(&self) -> std::option::Option<&crate::model::Coord> { - self.datacenter_coord.as_ref() - } - /// Distance available in multiple units. - pub fn datacenter_distance_from_client(&self) -> std::option::Option<&crate::model::Distance> { - self.datacenter_distance_from_client.as_ref() - } -} -impl std::fmt::Debug for RegionInfo { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("RegionInfo"); - formatter.field("region_id", &self.region_id); - formatter.field("provider_display_name", &self.provider_display_name); - formatter.field("region_display_name", &self.region_display_name); - formatter.field("datacenter_coord", &self.datacenter_coord); - formatter.field( - "datacenter_distance_from_client", - &self.datacenter_distance_from_client, - ); - formatter.finish() - } -} -/// See [`RegionInfo`](crate::model::RegionInfo) -pub mod region_info { - /// A builder for [`RegionInfo`](crate::model::RegionInfo) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) region_id: std::option::Option, - pub(crate) provider_display_name: std::option::Option, - pub(crate) region_display_name: std::option::Option, - pub(crate) datacenter_coord: std::option::Option, - pub(crate) datacenter_distance_from_client: std::option::Option, - } - impl Builder { - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn region_id(mut self, input: impl Into) -> Self { - self.region_id = Some(input.into()); - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn set_region_id(mut self, input: std::option::Option) -> Self { - self.region_id = input; - self - } - /// A universally unique identifier. - pub fn provider_display_name(mut self, input: impl Into) -> Self { - self.provider_display_name = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_provider_display_name( - mut self, - input: std::option::Option, - ) -> Self { - self.provider_display_name = input; - self - } - /// A universally unique identifier. - pub fn region_display_name(mut self, input: impl Into) -> Self { - self.region_display_name = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_region_display_name( - mut self, - input: std::option::Option, - ) -> Self { - self.region_display_name = input; - self - } - /// Geographical coordinates for a location on Planet Earth. - pub fn datacenter_coord(mut self, input: crate::model::Coord) -> Self { - self.datacenter_coord = Some(input); - self - } - /// Geographical coordinates for a location on Planet Earth. - pub fn set_datacenter_coord( - mut self, - input: std::option::Option, - ) -> Self { - self.datacenter_coord = input; - self - } - /// Distance available in multiple units. - pub fn datacenter_distance_from_client(mut self, input: crate::model::Distance) -> Self { - self.datacenter_distance_from_client = Some(input); - self - } - /// Distance available in multiple units. - pub fn set_datacenter_distance_from_client( - mut self, - input: std::option::Option, - ) -> Self { - self.datacenter_distance_from_client = input; - self - } - /// Consumes the builder and constructs a [`RegionInfo`](crate::model::RegionInfo) - pub fn build(self) -> crate::model::RegionInfo { - crate::model::RegionInfo { - region_id: self.region_id, - provider_display_name: self.provider_display_name, - region_display_name: self.region_display_name, - datacenter_coord: self.datacenter_coord, - datacenter_distance_from_client: self.datacenter_distance_from_client, - } - } - } -} -impl RegionInfo { - /// Creates a new builder-style object to manufacture [`RegionInfo`](crate::model::RegionInfo) - pub fn builder() -> crate::model::region_info::Builder { - crate::model::region_info::Builder::default() - } -} - -/// Distance available in multiple units. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct Distance { - #[allow(missing_docs)] // documentation missing in model - pub kilometers: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub miles: std::option::Option, -} -impl Distance { - #[allow(missing_docs)] // documentation missing in model - pub fn kilometers(&self) -> std::option::Option { - self.kilometers - } - #[allow(missing_docs)] // documentation missing in model - pub fn miles(&self) -> std::option::Option { - self.miles - } -} -impl std::fmt::Debug for Distance { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("Distance"); - formatter.field("kilometers", &self.kilometers); - formatter.field("miles", &self.miles); - formatter.finish() - } -} -/// See [`Distance`](crate::model::Distance) -pub mod distance { - /// A builder for [`Distance`](crate::model::Distance) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) kilometers: std::option::Option, - pub(crate) miles: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn kilometers(mut self, input: f64) -> Self { - self.kilometers = Some(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_kilometers(mut self, input: std::option::Option) -> Self { - self.kilometers = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn miles(mut self, input: f64) -> Self { - self.miles = Some(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_miles(mut self, input: std::option::Option) -> Self { - self.miles = input; - self - } - /// Consumes the builder and constructs a [`Distance`](crate::model::Distance) - pub fn build(self) -> crate::model::Distance { - crate::model::Distance { - kilometers: self.kilometers, - miles: self.miles, - } - } - } -} -impl Distance { - /// Creates a new builder-style object to manufacture [`Distance`](crate::model::Distance) - pub fn builder() -> crate::model::distance::Builder { - crate::model::distance::Builder::default() - } -} - -/// Geographical coordinates for a location on Planet Earth. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct Coord { - #[allow(missing_docs)] // documentation missing in model - pub latitude: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub longitude: std::option::Option, -} -impl Coord { - #[allow(missing_docs)] // documentation missing in model - pub fn latitude(&self) -> std::option::Option { - self.latitude - } - #[allow(missing_docs)] // documentation missing in model - pub fn longitude(&self) -> std::option::Option { - self.longitude - } -} -impl std::fmt::Debug for Coord { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("Coord"); - formatter.field("latitude", &self.latitude); - formatter.field("longitude", &self.longitude); - formatter.finish() - } -} -/// See [`Coord`](crate::model::Coord) -pub mod coord { - /// A builder for [`Coord`](crate::model::Coord) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) latitude: std::option::Option, - pub(crate) longitude: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn latitude(mut self, input: f64) -> Self { - self.latitude = Some(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_latitude(mut self, input: std::option::Option) -> Self { - self.latitude = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn longitude(mut self, input: f64) -> Self { - self.longitude = Some(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_longitude(mut self, input: std::option::Option) -> Self { - self.longitude = input; - self - } - /// Consumes the builder and constructs a [`Coord`](crate::model::Coord) - pub fn build(self) -> crate::model::Coord { - crate::model::Coord { - latitude: self.latitude, - longitude: self.longitude, - } - } - } -} -impl Coord { - /// Creates a new builder-style object to manufacture [`Coord`](crate::model::Coord) - pub fn builder() -> crate::model::coord::Builder { - crate::model::coord::Builder::default() - } -} - -/// A public lobby in the lobby list. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct LobbyInfo { - #[allow(missing_docs)] // documentation missing in model - pub region_id: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub game_mode_id: std::option::Option, - /// A universally unique identifier. - pub lobby_id: std::option::Option, - /// Unsigned 32 bit integer. - pub max_players_normal: std::option::Option, - /// Unsigned 32 bit integer. - pub max_players_direct: std::option::Option, - /// Unsigned 32 bit integer. - pub max_players_party: std::option::Option, - /// Unsigned 32 bit integer. - pub total_player_count: std::option::Option, -} -impl LobbyInfo { - #[allow(missing_docs)] // documentation missing in model - pub fn region_id(&self) -> std::option::Option<&str> { - self.region_id.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn game_mode_id(&self) -> std::option::Option<&str> { - self.game_mode_id.as_deref() - } - /// A universally unique identifier. - pub fn lobby_id(&self) -> std::option::Option<&str> { - self.lobby_id.as_deref() - } - /// Unsigned 32 bit integer. - pub fn max_players_normal(&self) -> std::option::Option { - self.max_players_normal - } - /// Unsigned 32 bit integer. - pub fn max_players_direct(&self) -> std::option::Option { - self.max_players_direct - } - /// Unsigned 32 bit integer. - pub fn max_players_party(&self) -> std::option::Option { - self.max_players_party - } - /// Unsigned 32 bit integer. - pub fn total_player_count(&self) -> std::option::Option { - self.total_player_count - } -} -impl std::fmt::Debug for LobbyInfo { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("LobbyInfo"); - formatter.field("region_id", &self.region_id); - formatter.field("game_mode_id", &self.game_mode_id); - formatter.field("lobby_id", &self.lobby_id); - formatter.field("max_players_normal", &self.max_players_normal); - formatter.field("max_players_direct", &self.max_players_direct); - formatter.field("max_players_party", &self.max_players_party); - formatter.field("total_player_count", &self.total_player_count); - formatter.finish() - } -} -/// See [`LobbyInfo`](crate::model::LobbyInfo) -pub mod lobby_info { - /// A builder for [`LobbyInfo`](crate::model::LobbyInfo) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) region_id: std::option::Option, - pub(crate) game_mode_id: std::option::Option, - pub(crate) lobby_id: std::option::Option, - pub(crate) max_players_normal: std::option::Option, - pub(crate) max_players_direct: std::option::Option, - pub(crate) max_players_party: std::option::Option, - pub(crate) total_player_count: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn region_id(mut self, input: impl Into) -> Self { - self.region_id = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_region_id(mut self, input: std::option::Option) -> Self { - self.region_id = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn game_mode_id(mut self, input: impl Into) -> Self { - self.game_mode_id = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_game_mode_id(mut self, input: std::option::Option) -> Self { - self.game_mode_id = input; - self - } - /// A universally unique identifier. - pub fn lobby_id(mut self, input: impl Into) -> Self { - self.lobby_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_lobby_id(mut self, input: std::option::Option) -> Self { - self.lobby_id = input; - self - } - /// Unsigned 32 bit integer. - pub fn max_players_normal(mut self, input: i32) -> Self { - self.max_players_normal = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_max_players_normal(mut self, input: std::option::Option) -> Self { - self.max_players_normal = input; - self - } - /// Unsigned 32 bit integer. - pub fn max_players_direct(mut self, input: i32) -> Self { - self.max_players_direct = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_max_players_direct(mut self, input: std::option::Option) -> Self { - self.max_players_direct = input; - self - } - /// Unsigned 32 bit integer. - pub fn max_players_party(mut self, input: i32) -> Self { - self.max_players_party = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_max_players_party(mut self, input: std::option::Option) -> Self { - self.max_players_party = input; - self - } - /// Unsigned 32 bit integer. - pub fn total_player_count(mut self, input: i32) -> Self { - self.total_player_count = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_total_player_count(mut self, input: std::option::Option) -> Self { - self.total_player_count = input; - self - } - /// Consumes the builder and constructs a [`LobbyInfo`](crate::model::LobbyInfo) - pub fn build(self) -> crate::model::LobbyInfo { - crate::model::LobbyInfo { - region_id: self.region_id, - game_mode_id: self.game_mode_id, - lobby_id: self.lobby_id, - max_players_normal: self.max_players_normal, - max_players_direct: self.max_players_direct, - max_players_party: self.max_players_party, - total_player_count: self.total_player_count, - } - } - } -} -impl LobbyInfo { - /// Creates a new builder-style object to manufacture [`LobbyInfo`](crate::model::LobbyInfo) - pub fn builder() -> crate::model::lobby_info::Builder { - crate::model::lobby_info::Builder::default() - } -} - -/// A game mode that the player can join. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GameModeInfo { - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub game_mode_id: std::option::Option, -} -impl GameModeInfo { - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn game_mode_id(&self) -> std::option::Option<&str> { - self.game_mode_id.as_deref() - } -} -impl std::fmt::Debug for GameModeInfo { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GameModeInfo"); - formatter.field("game_mode_id", &self.game_mode_id); - formatter.finish() - } -} -/// See [`GameModeInfo`](crate::model::GameModeInfo) -pub mod game_mode_info { - /// A builder for [`GameModeInfo`](crate::model::GameModeInfo) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_mode_id: std::option::Option, - } - impl Builder { - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn game_mode_id(mut self, input: impl Into) -> Self { - self.game_mode_id = Some(input.into()); - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn set_game_mode_id(mut self, input: std::option::Option) -> Self { - self.game_mode_id = input; - self - } - /// Consumes the builder and constructs a [`GameModeInfo`](crate::model::GameModeInfo) - pub fn build(self) -> crate::model::GameModeInfo { - crate::model::GameModeInfo { - game_mode_id: self.game_mode_id, - } - } - } -} -impl GameModeInfo { - /// Creates a new builder-style object to manufacture [`GameModeInfo`](crate::model::GameModeInfo) - pub fn builder() -> crate::model::game_mode_info::Builder { - crate::model::game_mode_info::Builder::default() - } -} - -/// A matchmaker lobby. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct MatchmakerLobbyJoinInfo { - /// A universally unique identifier. - pub lobby_id: std::option::Option, - /// A matchmaker lobby region. - pub region: std::option::Option, - /// A list of lobby ports. - pub ports: std::option::Option< - std::collections::HashMap, - >, - /// A matchmaker lobby player. - pub player: std::option::Option, -} -impl MatchmakerLobbyJoinInfo { - /// A universally unique identifier. - pub fn lobby_id(&self) -> std::option::Option<&str> { - self.lobby_id.as_deref() - } - /// A matchmaker lobby region. - pub fn region(&self) -> std::option::Option<&crate::model::MatchmakerLobbyJoinInfoRegion> { - self.region.as_ref() - } - /// A list of lobby ports. - pub fn ports( - &self, - ) -> std::option::Option< - &std::collections::HashMap, - > { - self.ports.as_ref() - } - /// A matchmaker lobby player. - pub fn player(&self) -> std::option::Option<&crate::model::MatchmakerLobbyJoinInfoPlayer> { - self.player.as_ref() - } -} -impl std::fmt::Debug for MatchmakerLobbyJoinInfo { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("MatchmakerLobbyJoinInfo"); - formatter.field("lobby_id", &self.lobby_id); - formatter.field("region", &self.region); - formatter.field("ports", &self.ports); - formatter.field("player", &self.player); - formatter.finish() - } -} -/// See [`MatchmakerLobbyJoinInfo`](crate::model::MatchmakerLobbyJoinInfo) -pub mod matchmaker_lobby_join_info { - /// A builder for [`MatchmakerLobbyJoinInfo`](crate::model::MatchmakerLobbyJoinInfo) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) lobby_id: std::option::Option, - pub(crate) region: std::option::Option, - pub(crate) ports: std::option::Option< - std::collections::HashMap< - std::string::String, - crate::model::MatchmakerLobbyJoinInfoPort, - >, - >, - pub(crate) player: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn lobby_id(mut self, input: impl Into) -> Self { - self.lobby_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_lobby_id(mut self, input: std::option::Option) -> Self { - self.lobby_id = input; - self - } - /// A matchmaker lobby region. - pub fn region(mut self, input: crate::model::MatchmakerLobbyJoinInfoRegion) -> Self { - self.region = Some(input); - self - } - /// A matchmaker lobby region. - pub fn set_region( - mut self, - input: std::option::Option, - ) -> Self { - self.region = input; - self - } - /// Adds a key-value pair to `ports`. - /// - /// To override the contents of this collection use [`set_ports`](Self::set_ports). - /// - /// A list of lobby ports. - pub fn ports( - mut self, - k: impl Into, - v: crate::model::MatchmakerLobbyJoinInfoPort, - ) -> Self { - let mut hash_map = self.ports.unwrap_or_default(); - hash_map.insert(k.into(), v); - self.ports = Some(hash_map); - self - } - /// A list of lobby ports. - pub fn set_ports( - mut self, - input: std::option::Option< - std::collections::HashMap< - std::string::String, - crate::model::MatchmakerLobbyJoinInfoPort, - >, - >, - ) -> Self { - self.ports = input; - self - } - /// A matchmaker lobby player. - pub fn player(mut self, input: crate::model::MatchmakerLobbyJoinInfoPlayer) -> Self { - self.player = Some(input); - self - } - /// A matchmaker lobby player. - pub fn set_player( - mut self, - input: std::option::Option, - ) -> Self { - self.player = input; - self - } - /// Consumes the builder and constructs a [`MatchmakerLobbyJoinInfo`](crate::model::MatchmakerLobbyJoinInfo) - pub fn build(self) -> crate::model::MatchmakerLobbyJoinInfo { - crate::model::MatchmakerLobbyJoinInfo { - lobby_id: self.lobby_id, - region: self.region, - ports: self.ports, - player: self.player, - } - } - } -} -impl MatchmakerLobbyJoinInfo { - /// Creates a new builder-style object to manufacture [`MatchmakerLobbyJoinInfo`](crate::model::MatchmakerLobbyJoinInfo) - pub fn builder() -> crate::model::matchmaker_lobby_join_info::Builder { - crate::model::matchmaker_lobby_join_info::Builder::default() - } -} - -/// A matchmaker lobby player. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct MatchmakerLobbyJoinInfoPlayer { - /// Pass this token through the socket to the lobby server. The lobby server will validate this token with `rivet.api.matchmaker#PlayerConnected$player_token`. - pub token: std::option::Option, -} -impl MatchmakerLobbyJoinInfoPlayer { - /// Pass this token through the socket to the lobby server. The lobby server will validate this token with `rivet.api.matchmaker#PlayerConnected$player_token`. - pub fn token(&self) -> std::option::Option<&str> { - self.token.as_deref() - } -} -impl std::fmt::Debug for MatchmakerLobbyJoinInfoPlayer { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("MatchmakerLobbyJoinInfoPlayer"); - formatter.field("token", &"*** Sensitive Data Redacted ***"); - formatter.finish() - } -} -/// See [`MatchmakerLobbyJoinInfoPlayer`](crate::model::MatchmakerLobbyJoinInfoPlayer) -pub mod matchmaker_lobby_join_info_player { - /// A builder for [`MatchmakerLobbyJoinInfoPlayer`](crate::model::MatchmakerLobbyJoinInfoPlayer) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) token: std::option::Option, - } - impl Builder { - /// Pass this token through the socket to the lobby server. The lobby server will validate this token with `rivet.api.matchmaker#PlayerConnected$player_token`. - pub fn token(mut self, input: impl Into) -> Self { - self.token = Some(input.into()); - self - } - /// Pass this token through the socket to the lobby server. The lobby server will validate this token with `rivet.api.matchmaker#PlayerConnected$player_token`. - pub fn set_token(mut self, input: std::option::Option) -> Self { - self.token = input; - self - } - /// Consumes the builder and constructs a [`MatchmakerLobbyJoinInfoPlayer`](crate::model::MatchmakerLobbyJoinInfoPlayer) - pub fn build(self) -> crate::model::MatchmakerLobbyJoinInfoPlayer { - crate::model::MatchmakerLobbyJoinInfoPlayer { token: self.token } - } - } -} -impl MatchmakerLobbyJoinInfoPlayer { - /// Creates a new builder-style object to manufacture [`MatchmakerLobbyJoinInfoPlayer`](crate::model::MatchmakerLobbyJoinInfoPlayer) - pub fn builder() -> crate::model::matchmaker_lobby_join_info_player::Builder { - crate::model::matchmaker_lobby_join_info_player::Builder::default() - } -} - -/// A matchmaker lobby port. Configured by `rivet.cloud#LobbyGroupRuntimeDockerPort$label`. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct MatchmakerLobbyJoinInfoPort { - /// The host for the given port. Will be null if using a port range. - pub host: std::option::Option, - /// The hostname for the given port. - pub hostname: std::option::Option, - /// The port number for this lobby. Will be null if using a port range. - pub port: std::option::Option, - /// The port range for this lobby. - pub port_range: std::option::Option, - /// Wether or not this lobby port uses TLS. You cannot mix a non-TLS and TLS ports. - pub is_tls: std::option::Option, -} -impl MatchmakerLobbyJoinInfoPort { - /// The host for the given port. Will be null if using a port range. - pub fn host(&self) -> std::option::Option<&str> { - self.host.as_deref() - } - /// The hostname for the given port. - pub fn hostname(&self) -> std::option::Option<&str> { - self.hostname.as_deref() - } - /// The port number for this lobby. Will be null if using a port range. - pub fn port(&self) -> std::option::Option { - self.port - } - /// The port range for this lobby. - pub fn port_range( - &self, - ) -> std::option::Option<&crate::model::MatchmakerLobbyJoinInfoPortRange> { - self.port_range.as_ref() - } - /// Wether or not this lobby port uses TLS. You cannot mix a non-TLS and TLS ports. - pub fn is_tls(&self) -> std::option::Option { - self.is_tls - } -} -impl std::fmt::Debug for MatchmakerLobbyJoinInfoPort { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("MatchmakerLobbyJoinInfoPort"); - formatter.field("host", &self.host); - formatter.field("hostname", &self.hostname); - formatter.field("port", &self.port); - formatter.field("port_range", &self.port_range); - formatter.field("is_tls", &self.is_tls); - formatter.finish() - } -} -/// See [`MatchmakerLobbyJoinInfoPort`](crate::model::MatchmakerLobbyJoinInfoPort) -pub mod matchmaker_lobby_join_info_port { - /// A builder for [`MatchmakerLobbyJoinInfoPort`](crate::model::MatchmakerLobbyJoinInfoPort) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) host: std::option::Option, - pub(crate) hostname: std::option::Option, - pub(crate) port: std::option::Option, - pub(crate) port_range: std::option::Option, - pub(crate) is_tls: std::option::Option, - } - impl Builder { - /// The host for the given port. Will be null if using a port range. - pub fn host(mut self, input: impl Into) -> Self { - self.host = Some(input.into()); - self - } - /// The host for the given port. Will be null if using a port range. - pub fn set_host(mut self, input: std::option::Option) -> Self { - self.host = input; - self - } - /// The hostname for the given port. - pub fn hostname(mut self, input: impl Into) -> Self { - self.hostname = Some(input.into()); - self - } - /// The hostname for the given port. - pub fn set_hostname(mut self, input: std::option::Option) -> Self { - self.hostname = input; - self - } - /// The port number for this lobby. Will be null if using a port range. - pub fn port(mut self, input: i32) -> Self { - self.port = Some(input); - self - } - /// The port number for this lobby. Will be null if using a port range. - pub fn set_port(mut self, input: std::option::Option) -> Self { - self.port = input; - self - } - /// The port range for this lobby. - pub fn port_range(mut self, input: crate::model::MatchmakerLobbyJoinInfoPortRange) -> Self { - self.port_range = Some(input); - self - } - /// The port range for this lobby. - pub fn set_port_range( - mut self, - input: std::option::Option, - ) -> Self { - self.port_range = input; - self - } - /// Wether or not this lobby port uses TLS. You cannot mix a non-TLS and TLS ports. - pub fn is_tls(mut self, input: bool) -> Self { - self.is_tls = Some(input); - self - } - /// Wether or not this lobby port uses TLS. You cannot mix a non-TLS and TLS ports. - pub fn set_is_tls(mut self, input: std::option::Option) -> Self { - self.is_tls = input; - self - } - /// Consumes the builder and constructs a [`MatchmakerLobbyJoinInfoPort`](crate::model::MatchmakerLobbyJoinInfoPort) - pub fn build(self) -> crate::model::MatchmakerLobbyJoinInfoPort { - crate::model::MatchmakerLobbyJoinInfoPort { - host: self.host, - hostname: self.hostname, - port: self.port, - port_range: self.port_range, - is_tls: self.is_tls, - } - } - } -} -impl MatchmakerLobbyJoinInfoPort { - /// Creates a new builder-style object to manufacture [`MatchmakerLobbyJoinInfoPort`](crate::model::MatchmakerLobbyJoinInfoPort) - pub fn builder() -> crate::model::matchmaker_lobby_join_info_port::Builder { - crate::model::matchmaker_lobby_join_info_port::Builder::default() - } -} - -/// Inclusive range of ports that can be connected to. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct MatchmakerLobbyJoinInfoPortRange { - /// Minimum port that can be connected to. Inclusive range. - pub min: std::option::Option, - /// Maximum port that can be connected to. Inclusive range. - pub max: std::option::Option, -} -impl MatchmakerLobbyJoinInfoPortRange { - /// Minimum port that can be connected to. Inclusive range. - pub fn min(&self) -> std::option::Option { - self.min - } - /// Maximum port that can be connected to. Inclusive range. - pub fn max(&self) -> std::option::Option { - self.max - } -} -impl std::fmt::Debug for MatchmakerLobbyJoinInfoPortRange { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("MatchmakerLobbyJoinInfoPortRange"); - formatter.field("min", &self.min); - formatter.field("max", &self.max); - formatter.finish() - } -} -/// See [`MatchmakerLobbyJoinInfoPortRange`](crate::model::MatchmakerLobbyJoinInfoPortRange) -pub mod matchmaker_lobby_join_info_port_range { - /// A builder for [`MatchmakerLobbyJoinInfoPortRange`](crate::model::MatchmakerLobbyJoinInfoPortRange) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) min: std::option::Option, - pub(crate) max: std::option::Option, - } - impl Builder { - /// Minimum port that can be connected to. Inclusive range. - pub fn min(mut self, input: i32) -> Self { - self.min = Some(input); - self - } - /// Minimum port that can be connected to. Inclusive range. - pub fn set_min(mut self, input: std::option::Option) -> Self { - self.min = input; - self - } - /// Maximum port that can be connected to. Inclusive range. - pub fn max(mut self, input: i32) -> Self { - self.max = Some(input); - self - } - /// Maximum port that can be connected to. Inclusive range. - pub fn set_max(mut self, input: std::option::Option) -> Self { - self.max = input; - self - } - /// Consumes the builder and constructs a [`MatchmakerLobbyJoinInfoPortRange`](crate::model::MatchmakerLobbyJoinInfoPortRange) - pub fn build(self) -> crate::model::MatchmakerLobbyJoinInfoPortRange { - crate::model::MatchmakerLobbyJoinInfoPortRange { - min: self.min, - max: self.max, - } - } - } -} -impl MatchmakerLobbyJoinInfoPortRange { - /// Creates a new builder-style object to manufacture [`MatchmakerLobbyJoinInfoPortRange`](crate::model::MatchmakerLobbyJoinInfoPortRange) - pub fn builder() -> crate::model::matchmaker_lobby_join_info_port_range::Builder { - crate::model::matchmaker_lobby_join_info_port_range::Builder::default() - } -} - -/// A matchmaker lobby region. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct MatchmakerLobbyJoinInfoRegion { - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub region_id: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, -} -impl MatchmakerLobbyJoinInfoRegion { - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn region_id(&self) -> std::option::Option<&str> { - self.region_id.as_deref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } -} -impl std::fmt::Debug for MatchmakerLobbyJoinInfoRegion { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("MatchmakerLobbyJoinInfoRegion"); - formatter.field("region_id", &self.region_id); - formatter.field("display_name", &self.display_name); - formatter.finish() - } -} -/// See [`MatchmakerLobbyJoinInfoRegion`](crate::model::MatchmakerLobbyJoinInfoRegion) -pub mod matchmaker_lobby_join_info_region { - /// A builder for [`MatchmakerLobbyJoinInfoRegion`](crate::model::MatchmakerLobbyJoinInfoRegion) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) region_id: std::option::Option, - pub(crate) display_name: std::option::Option, - } - impl Builder { - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn region_id(mut self, input: impl Into) -> Self { - self.region_id = Some(input.into()); - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn set_region_id(mut self, input: std::option::Option) -> Self { - self.region_id = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// Consumes the builder and constructs a [`MatchmakerLobbyJoinInfoRegion`](crate::model::MatchmakerLobbyJoinInfoRegion) - pub fn build(self) -> crate::model::MatchmakerLobbyJoinInfoRegion { - crate::model::MatchmakerLobbyJoinInfoRegion { - region_id: self.region_id, - display_name: self.display_name, - } - } - } -} -impl MatchmakerLobbyJoinInfoRegion { - /// Creates a new builder-style object to manufacture [`MatchmakerLobbyJoinInfoRegion`](crate::model::MatchmakerLobbyJoinInfoRegion) - pub fn builder() -> crate::model::matchmaker_lobby_join_info_region::Builder { - crate::model::matchmaker_lobby_join_info_region::Builder::default() - } -} - -/// Methods to verify a captcha. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] -pub enum CaptchaConfig { - /// hCaptcha configuration. - Hcaptcha(crate::model::CaptchaConfigHcaptcha), - /// Cloudflare Turnstile configuration. - Turnstile(crate::model::CaptchaConfigTurnstile), - /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version. - /// An unknown enum variant - /// - /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._ - /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized - /// by the client. This can happen when the server adds new functionality, but the client has not been updated. - /// To investigate this, consider turning on debug logging to print the raw HTTP response. - #[non_exhaustive] - Unknown, -} -impl CaptchaConfig { - /// Tries to convert the enum instance into [`Hcaptcha`](crate::model::CaptchaConfig::Hcaptcha), extracting the inner [`CaptchaConfigHcaptcha`](crate::model::CaptchaConfigHcaptcha). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_hcaptcha(&self) -> std::result::Result<&crate::model::CaptchaConfigHcaptcha, &Self> { - if let CaptchaConfig::Hcaptcha(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`Hcaptcha`](crate::model::CaptchaConfig::Hcaptcha). - pub fn is_hcaptcha(&self) -> bool { - self.as_hcaptcha().is_ok() - } - /// Tries to convert the enum instance into [`Turnstile`](crate::model::CaptchaConfig::Turnstile), extracting the inner [`CaptchaConfigTurnstile`](crate::model::CaptchaConfigTurnstile). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_turnstile( - &self, - ) -> std::result::Result<&crate::model::CaptchaConfigTurnstile, &Self> { - if let CaptchaConfig::Turnstile(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`Turnstile`](crate::model::CaptchaConfig::Turnstile). - pub fn is_turnstile(&self) -> bool { - self.as_turnstile().is_ok() - } - /// Returns true if the enum instance is the `Unknown` variant. - pub fn is_unknown(&self) -> bool { - matches!(self, Self::Unknown) - } -} - -/// Cloudflare Turnstile configuration. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CaptchaConfigTurnstile { - #[allow(missing_docs)] // documentation missing in model - pub client_response: std::option::Option, -} -impl CaptchaConfigTurnstile { - #[allow(missing_docs)] // documentation missing in model - pub fn client_response(&self) -> std::option::Option<&str> { - self.client_response.as_deref() - } -} -impl std::fmt::Debug for CaptchaConfigTurnstile { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CaptchaConfigTurnstile"); - formatter.field("client_response", &self.client_response); - formatter.finish() - } -} -/// See [`CaptchaConfigTurnstile`](crate::model::CaptchaConfigTurnstile) -pub mod captcha_config_turnstile { - /// A builder for [`CaptchaConfigTurnstile`](crate::model::CaptchaConfigTurnstile) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) client_response: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn client_response(mut self, input: impl Into) -> Self { - self.client_response = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_client_response( - mut self, - input: std::option::Option, - ) -> Self { - self.client_response = input; - self - } - /// Consumes the builder and constructs a [`CaptchaConfigTurnstile`](crate::model::CaptchaConfigTurnstile) - pub fn build(self) -> crate::model::CaptchaConfigTurnstile { - crate::model::CaptchaConfigTurnstile { - client_response: self.client_response, - } - } - } -} -impl CaptchaConfigTurnstile { - /// Creates a new builder-style object to manufacture [`CaptchaConfigTurnstile`](crate::model::CaptchaConfigTurnstile) - pub fn builder() -> crate::model::captcha_config_turnstile::Builder { - crate::model::captcha_config_turnstile::Builder::default() - } -} - -/// hCaptcha configuration. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CaptchaConfigHcaptcha { - #[allow(missing_docs)] // documentation missing in model - pub client_response: std::option::Option, -} -impl CaptchaConfigHcaptcha { - #[allow(missing_docs)] // documentation missing in model - pub fn client_response(&self) -> std::option::Option<&str> { - self.client_response.as_deref() - } -} -impl std::fmt::Debug for CaptchaConfigHcaptcha { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CaptchaConfigHcaptcha"); - formatter.field("client_response", &self.client_response); - formatter.finish() - } -} -/// See [`CaptchaConfigHcaptcha`](crate::model::CaptchaConfigHcaptcha) -pub mod captcha_config_hcaptcha { - /// A builder for [`CaptchaConfigHcaptcha`](crate::model::CaptchaConfigHcaptcha) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) client_response: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn client_response(mut self, input: impl Into) -> Self { - self.client_response = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_client_response( - mut self, - input: std::option::Option, - ) -> Self { - self.client_response = input; - self - } - /// Consumes the builder and constructs a [`CaptchaConfigHcaptcha`](crate::model::CaptchaConfigHcaptcha) - pub fn build(self) -> crate::model::CaptchaConfigHcaptcha { - crate::model::CaptchaConfigHcaptcha { - client_response: self.client_response, - } - } - } -} -impl CaptchaConfigHcaptcha { - /// Creates a new builder-style object to manufacture [`CaptchaConfigHcaptcha`](crate::model::CaptchaConfigHcaptcha) - pub fn builder() -> crate::model::captcha_config_hcaptcha::Builder { - crate::model::captcha_config_hcaptcha::Builder::default() - } -} diff --git a/lib/smithy-output/api-matchmaker/rust/rust/src/operation.rs b/lib/smithy-output/api-matchmaker/rust/rust/src/operation.rs deleted file mode 100644 index 1a3c38a6b..000000000 --- a/lib/smithy-output/api-matchmaker/rust/rust/src/operation.rs +++ /dev/null @@ -1,292 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Operation shape for `FindLobby`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`find_lobby`](crate::client::Client::find_lobby). -/// -/// See [`crate::client::fluent_builders::FindLobby`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct FindLobby { - _private: (), -} -impl FindLobby { - /// Creates a new builder-style object to manufacture [`FindLobbyInput`](crate::input::FindLobbyInput) - pub fn builder() -> crate::input::find_lobby_input::Builder { - crate::input::find_lobby_input::Builder::default() - } - /// Creates a new `FindLobby` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for FindLobby { - type Output = std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_find_lobby_error(response) - } else { - crate::operation_deser::parse_find_lobby_response(response) - } - } -} - -/// Operation shape for `GetGameStatistics`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`get_game_statistics`](crate::client::Client::get_game_statistics). -/// -/// See [`crate::client::fluent_builders::GetGameStatistics`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GetGameStatistics { - _private: (), -} -impl GetGameStatistics { - /// Creates a new builder-style object to manufacture [`GetGameStatisticsInput`](crate::input::GetGameStatisticsInput) - pub fn builder() -> crate::input::get_game_statistics_input::Builder { - crate::input::get_game_statistics_input::Builder::default() - } - /// Creates a new `GetGameStatistics` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GetGameStatistics { - type Output = std::result::Result< - crate::output::GetGameStatisticsOutput, - crate::error::GetGameStatisticsError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_get_game_statistics_error(response) - } else { - crate::operation_deser::parse_get_game_statistics_response(response) - } - } -} - -/// Operation shape for `JoinLobby`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`join_lobby`](crate::client::Client::join_lobby). -/// -/// See [`crate::client::fluent_builders::JoinLobby`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct JoinLobby { - _private: (), -} -impl JoinLobby { - /// Creates a new builder-style object to manufacture [`JoinLobbyInput`](crate::input::JoinLobbyInput) - pub fn builder() -> crate::input::join_lobby_input::Builder { - crate::input::join_lobby_input::Builder::default() - } - /// Creates a new `JoinLobby` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for JoinLobby { - type Output = std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_join_lobby_error(response) - } else { - crate::operation_deser::parse_join_lobby_response(response) - } - } -} - -/// Operation shape for `ListLobbies`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`list_lobbies`](crate::client::Client::list_lobbies). -/// -/// See [`crate::client::fluent_builders::ListLobbies`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct ListLobbies { - _private: (), -} -impl ListLobbies { - /// Creates a new builder-style object to manufacture [`ListLobbiesInput`](crate::input::ListLobbiesInput) - pub fn builder() -> crate::input::list_lobbies_input::Builder { - crate::input::list_lobbies_input::Builder::default() - } - /// Creates a new `ListLobbies` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for ListLobbies { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_list_lobbies_error(response) - } else { - crate::operation_deser::parse_list_lobbies_response(response) - } - } -} - -/// Operation shape for `ListRegions`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`list_regions`](crate::client::Client::list_regions). -/// -/// See [`crate::client::fluent_builders::ListRegions`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct ListRegions { - _private: (), -} -impl ListRegions { - /// Creates a new builder-style object to manufacture [`ListRegionsInput`](crate::input::ListRegionsInput) - pub fn builder() -> crate::input::list_regions_input::Builder { - crate::input::list_regions_input::Builder::default() - } - /// Creates a new `ListRegions` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for ListRegions { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_list_regions_error(response) - } else { - crate::operation_deser::parse_list_regions_response(response) - } - } -} - -/// Operation shape for `LobbyReady`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`lobby_ready`](crate::client::Client::lobby_ready). -/// -/// See [`crate::client::fluent_builders::LobbyReady`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct LobbyReady { - _private: (), -} -impl LobbyReady { - /// Creates a new builder-style object to manufacture [`LobbyReadyInput`](crate::input::LobbyReadyInput) - pub fn builder() -> crate::input::lobby_ready_input::Builder { - crate::input::lobby_ready_input::Builder::default() - } - /// Creates a new `LobbyReady` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for LobbyReady { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_lobby_ready_error(response) - } else { - crate::operation_deser::parse_lobby_ready_response(response) - } - } -} - -/// Operation shape for `PlayerConnected`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`player_connected`](crate::client::Client::player_connected). -/// -/// See [`crate::client::fluent_builders::PlayerConnected`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct PlayerConnected { - _private: (), -} -impl PlayerConnected { - /// Creates a new builder-style object to manufacture [`PlayerConnectedInput`](crate::input::PlayerConnectedInput) - pub fn builder() -> crate::input::player_connected_input::Builder { - crate::input::player_connected_input::Builder::default() - } - /// Creates a new `PlayerConnected` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for PlayerConnected { - type Output = std::result::Result< - crate::output::PlayerConnectedOutput, - crate::error::PlayerConnectedError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_player_connected_error(response) - } else { - crate::operation_deser::parse_player_connected_response(response) - } - } -} - -/// Operation shape for `PlayerDisconnected`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`player_disconnected`](crate::client::Client::player_disconnected). -/// -/// See [`crate::client::fluent_builders::PlayerDisconnected`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct PlayerDisconnected { - _private: (), -} -impl PlayerDisconnected { - /// Creates a new builder-style object to manufacture [`PlayerDisconnectedInput`](crate::input::PlayerDisconnectedInput) - pub fn builder() -> crate::input::player_disconnected_input::Builder { - crate::input::player_disconnected_input::Builder::default() - } - /// Creates a new `PlayerDisconnected` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for PlayerDisconnected { - type Output = std::result::Result< - crate::output::PlayerDisconnectedOutput, - crate::error::PlayerDisconnectedError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_player_disconnected_error(response) - } else { - crate::operation_deser::parse_player_disconnected_response(response) - } - } -} - -/// Operation shape for `SetLobbyClosed`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`set_lobby_closed`](crate::client::Client::set_lobby_closed). -/// -/// See [`crate::client::fluent_builders::SetLobbyClosed`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct SetLobbyClosed { - _private: (), -} -impl SetLobbyClosed { - /// Creates a new builder-style object to manufacture [`SetLobbyClosedInput`](crate::input::SetLobbyClosedInput) - pub fn builder() -> crate::input::set_lobby_closed_input::Builder { - crate::input::set_lobby_closed_input::Builder::default() - } - /// Creates a new `SetLobbyClosed` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for SetLobbyClosed { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_set_lobby_closed_error(response) - } else { - crate::operation_deser::parse_set_lobby_closed_response(response) - } - } -} diff --git a/lib/smithy-output/api-matchmaker/rust/rust/src/operation_deser.rs b/lib/smithy-output/api-matchmaker/rust/rust/src/operation_deser.rs deleted file mode 100644 index 239e9af2e..000000000 --- a/lib/smithy-output/api-matchmaker/rust/rust/src/operation_deser.rs +++ /dev/null @@ -1,1347 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[allow(clippy::unnecessary_wraps)] -pub fn parse_find_lobby_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::FindLobbyError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::FindLobbyError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::FindLobbyError { - meta: generic, - kind: crate::error::FindLobbyErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::FindLobbyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::FindLobbyError { - meta: generic, - kind: crate::error::FindLobbyErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::FindLobbyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::FindLobbyError { - meta: generic, - kind: crate::error::FindLobbyErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::FindLobbyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::FindLobbyError { - meta: generic, - kind: crate::error::FindLobbyErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::FindLobbyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::FindLobbyError { - meta: generic, - kind: crate::error::FindLobbyErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::FindLobbyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::FindLobbyError { - meta: generic, - kind: crate::error::FindLobbyErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::FindLobbyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::FindLobbyError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_find_lobby_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::find_lobby_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_find_lobby( - response.body().as_ref(), - output, - ) - .map_err(crate::error::FindLobbyError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_game_statistics_error( - response: &http::Response, -) -> std::result::Result -{ - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GetGameStatisticsError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::GetGameStatisticsError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GetGameStatisticsError { - meta: generic, - kind: crate::error::GetGameStatisticsErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetGameStatisticsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GetGameStatisticsError { - meta: generic, - kind: crate::error::GetGameStatisticsErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameStatisticsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GetGameStatisticsError { - meta: generic, - kind: crate::error::GetGameStatisticsErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameStatisticsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GetGameStatisticsError { - meta: generic, - kind: crate::error::GetGameStatisticsErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameStatisticsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GetGameStatisticsError { - meta: generic, - kind: crate::error::GetGameStatisticsErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameStatisticsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GetGameStatisticsError { - meta: generic, - kind: crate::error::GetGameStatisticsErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameStatisticsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GetGameStatisticsError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_game_statistics_response( - response: &http::Response, -) -> std::result::Result -{ - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::get_game_statistics_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_get_game_statistics( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetGameStatisticsError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_join_lobby_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::JoinLobbyError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::JoinLobbyError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::JoinLobbyError { - meta: generic, - kind: crate::error::JoinLobbyErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::JoinLobbyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::JoinLobbyError { - meta: generic, - kind: crate::error::JoinLobbyErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::JoinLobbyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::JoinLobbyError { - meta: generic, - kind: crate::error::JoinLobbyErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::JoinLobbyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::JoinLobbyError { - meta: generic, - kind: crate::error::JoinLobbyErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::JoinLobbyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::JoinLobbyError { - meta: generic, - kind: crate::error::JoinLobbyErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::JoinLobbyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::JoinLobbyError { - meta: generic, - kind: crate::error::JoinLobbyErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::JoinLobbyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::JoinLobbyError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_join_lobby_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::join_lobby_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_join_lobby( - response.body().as_ref(), - output, - ) - .map_err(crate::error::JoinLobbyError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_list_lobbies_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::ListLobbiesError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::ListLobbiesError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::ListLobbiesError { - meta: generic, - kind: crate::error::ListLobbiesErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ListLobbiesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::ListLobbiesError { - meta: generic, - kind: crate::error::ListLobbiesErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListLobbiesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::ListLobbiesError { - meta: generic, - kind: crate::error::ListLobbiesErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListLobbiesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::ListLobbiesError { - meta: generic, - kind: crate::error::ListLobbiesErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListLobbiesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::ListLobbiesError { - meta: generic, - kind: crate::error::ListLobbiesErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListLobbiesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::ListLobbiesError { - meta: generic, - kind: crate::error::ListLobbiesErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListLobbiesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::ListLobbiesError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_list_lobbies_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::list_lobbies_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_list_lobbies( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ListLobbiesError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_list_regions_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::ListRegionsError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::ListRegionsError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::ListRegionsError { - meta: generic, - kind: crate::error::ListRegionsErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ListRegionsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::ListRegionsError { - meta: generic, - kind: crate::error::ListRegionsErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListRegionsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::ListRegionsError { - meta: generic, - kind: crate::error::ListRegionsErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListRegionsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::ListRegionsError { - meta: generic, - kind: crate::error::ListRegionsErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListRegionsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::ListRegionsError { - meta: generic, - kind: crate::error::ListRegionsErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListRegionsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::ListRegionsError { - meta: generic, - kind: crate::error::ListRegionsErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListRegionsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::ListRegionsError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_list_regions_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::list_regions_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_list_regions( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ListRegionsError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_lobby_ready_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::LobbyReadyError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::LobbyReadyError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::LobbyReadyError { - meta: generic, - kind: crate::error::LobbyReadyErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::LobbyReadyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::LobbyReadyError { - meta: generic, - kind: crate::error::LobbyReadyErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::LobbyReadyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::LobbyReadyError { - meta: generic, - kind: crate::error::LobbyReadyErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::LobbyReadyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::LobbyReadyError { - meta: generic, - kind: crate::error::LobbyReadyErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::LobbyReadyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::LobbyReadyError { - meta: generic, - kind: crate::error::LobbyReadyErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::LobbyReadyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::LobbyReadyError { - meta: generic, - kind: crate::error::LobbyReadyErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::LobbyReadyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::LobbyReadyError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_lobby_ready_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::lobby_ready_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_player_connected_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::PlayerConnectedError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::PlayerConnectedError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::PlayerConnectedError { - meta: generic, - kind: crate::error::PlayerConnectedErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::PlayerConnectedError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::PlayerConnectedError { - meta: generic, - kind: crate::error::PlayerConnectedErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::PlayerConnectedError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::PlayerConnectedError { - meta: generic, - kind: crate::error::PlayerConnectedErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::PlayerConnectedError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::PlayerConnectedError { - meta: generic, - kind: crate::error::PlayerConnectedErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::PlayerConnectedError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::PlayerConnectedError { - meta: generic, - kind: crate::error::PlayerConnectedErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::PlayerConnectedError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::PlayerConnectedError { - meta: generic, - kind: crate::error::PlayerConnectedErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::PlayerConnectedError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::PlayerConnectedError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_player_connected_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::player_connected_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_player_disconnected_error( - response: &http::Response, -) -> std::result::Result< - crate::output::PlayerDisconnectedOutput, - crate::error::PlayerDisconnectedError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::PlayerDisconnectedError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::PlayerDisconnectedError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::PlayerDisconnectedError { - meta: generic, - kind: crate::error::PlayerDisconnectedErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::PlayerDisconnectedError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::PlayerDisconnectedError { - meta: generic, - kind: crate::error::PlayerDisconnectedErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::PlayerDisconnectedError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::PlayerDisconnectedError { - meta: generic, - kind: crate::error::PlayerDisconnectedErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::PlayerDisconnectedError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::PlayerDisconnectedError { - meta: generic, - kind: crate::error::PlayerDisconnectedErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::PlayerDisconnectedError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::PlayerDisconnectedError { - meta: generic, - kind: crate::error::PlayerDisconnectedErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::PlayerDisconnectedError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::PlayerDisconnectedError { - meta: generic, - kind: crate::error::PlayerDisconnectedErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::PlayerDisconnectedError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::PlayerDisconnectedError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_player_disconnected_response( - response: &http::Response, -) -> std::result::Result< - crate::output::PlayerDisconnectedOutput, - crate::error::PlayerDisconnectedError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::player_disconnected_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_set_lobby_closed_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::SetLobbyClosedError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::SetLobbyClosedError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::SetLobbyClosedError { - meta: generic, - kind: crate::error::SetLobbyClosedErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::SetLobbyClosedError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::SetLobbyClosedError { - meta: generic, - kind: crate::error::SetLobbyClosedErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetLobbyClosedError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::SetLobbyClosedError { - meta: generic, - kind: crate::error::SetLobbyClosedErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetLobbyClosedError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::SetLobbyClosedError { - meta: generic, - kind: crate::error::SetLobbyClosedErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetLobbyClosedError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::SetLobbyClosedError { - meta: generic, - kind: crate::error::SetLobbyClosedErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetLobbyClosedError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::SetLobbyClosedError { - meta: generic, - kind: crate::error::SetLobbyClosedErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetLobbyClosedError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::SetLobbyClosedError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_set_lobby_closed_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::set_lobby_closed_output::Builder::default(); - let _ = response; - output.build() - }) -} diff --git a/lib/smithy-output/api-matchmaker/rust/rust/src/operation_ser.rs b/lib/smithy-output/api-matchmaker/rust/rust/src/operation_ser.rs deleted file mode 100644 index 803fa27d5..000000000 --- a/lib/smithy-output/api-matchmaker/rust/rust/src/operation_ser.rs +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub fn serialize_operation_crate_operation_find_lobby( - input: &crate::input::FindLobbyInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_find_lobby_input(&mut object, input)?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_join_lobby( - input: &crate::input::JoinLobbyInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_join_lobby_input(&mut object, input)?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_player_connected( - input: &crate::input::PlayerConnectedInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_player_connected_input(&mut object, input)?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_player_disconnected( - input: &crate::input::PlayerDisconnectedInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_player_disconnected_input(&mut object, input)?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_set_lobby_closed( - input: &crate::input::SetLobbyClosedInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_set_lobby_closed_input(&mut object, input)?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} diff --git a/lib/smithy-output/api-matchmaker/rust/rust/src/output.rs b/lib/smithy-output/api-matchmaker/rust/rust/src/output.rs deleted file mode 100644 index 54b9a8f88..000000000 --- a/lib/smithy-output/api-matchmaker/rust/rust/src/output.rs +++ /dev/null @@ -1,544 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetGameStatisticsOutput { - /// Unsigned 64 bit integer. - pub player_count: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub namespaces: std::option::Option< - std::collections::HashMap, - >, - #[allow(missing_docs)] // documentation missing in model - pub regions: std::option::Option< - std::collections::HashMap, - >, -} -impl GetGameStatisticsOutput { - /// Unsigned 64 bit integer. - pub fn player_count(&self) -> std::option::Option { - self.player_count - } - #[allow(missing_docs)] // documentation missing in model - pub fn namespaces( - &self, - ) -> std::option::Option< - &std::collections::HashMap, - > { - self.namespaces.as_ref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn regions( - &self, - ) -> std::option::Option< - &std::collections::HashMap, - > { - self.regions.as_ref() - } -} -impl std::fmt::Debug for GetGameStatisticsOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetGameStatisticsOutput"); - formatter.field("player_count", &self.player_count); - formatter.field("namespaces", &self.namespaces); - formatter.field("regions", &self.regions); - formatter.finish() - } -} -/// See [`GetGameStatisticsOutput`](crate::output::GetGameStatisticsOutput) -pub mod get_game_statistics_output { - /// A builder for [`GetGameStatisticsOutput`](crate::output::GetGameStatisticsOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) player_count: std::option::Option, - pub(crate) namespaces: std::option::Option< - std::collections::HashMap, - >, - pub(crate) regions: std::option::Option< - std::collections::HashMap, - >, - } - impl Builder { - /// Unsigned 64 bit integer. - pub fn player_count(mut self, input: i64) -> Self { - self.player_count = Some(input); - self - } - /// Unsigned 64 bit integer. - pub fn set_player_count(mut self, input: std::option::Option) -> Self { - self.player_count = input; - self - } - /// Adds a key-value pair to `namespaces`. - /// - /// To override the contents of this collection use [`set_namespaces`](Self::set_namespaces). - /// - pub fn namespaces( - mut self, - k: impl Into, - v: crate::model::NamespaceStatistics, - ) -> Self { - let mut hash_map = self.namespaces.unwrap_or_default(); - hash_map.insert(k.into(), v); - self.namespaces = Some(hash_map); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_namespaces( - mut self, - input: std::option::Option< - std::collections::HashMap, - >, - ) -> Self { - self.namespaces = input; - self - } - /// Adds a key-value pair to `regions`. - /// - /// To override the contents of this collection use [`set_regions`](Self::set_regions). - /// - pub fn regions( - mut self, - k: impl Into, - v: crate::model::RegionStatistics, - ) -> Self { - let mut hash_map = self.regions.unwrap_or_default(); - hash_map.insert(k.into(), v); - self.regions = Some(hash_map); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_regions( - mut self, - input: std::option::Option< - std::collections::HashMap, - >, - ) -> Self { - self.regions = input; - self - } - /// Consumes the builder and constructs a [`GetGameStatisticsOutput`](crate::output::GetGameStatisticsOutput) - pub fn build(self) -> crate::output::GetGameStatisticsOutput { - crate::output::GetGameStatisticsOutput { - player_count: self.player_count, - namespaces: self.namespaces, - regions: self.regions, - } - } - } -} -impl GetGameStatisticsOutput { - /// Creates a new builder-style object to manufacture [`GetGameStatisticsOutput`](crate::output::GetGameStatisticsOutput) - pub fn builder() -> crate::output::get_game_statistics_output::Builder { - crate::output::get_game_statistics_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ListRegionsOutput { - #[allow(missing_docs)] // documentation missing in model - pub regions: std::option::Option>, -} -impl ListRegionsOutput { - #[allow(missing_docs)] // documentation missing in model - pub fn regions(&self) -> std::option::Option<&[crate::model::RegionInfo]> { - self.regions.as_deref() - } -} -impl std::fmt::Debug for ListRegionsOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ListRegionsOutput"); - formatter.field("regions", &self.regions); - formatter.finish() - } -} -/// See [`ListRegionsOutput`](crate::output::ListRegionsOutput) -pub mod list_regions_output { - /// A builder for [`ListRegionsOutput`](crate::output::ListRegionsOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) regions: std::option::Option>, - } - impl Builder { - /// Appends an item to `regions`. - /// - /// To override the contents of this collection use [`set_regions`](Self::set_regions). - /// - pub fn regions(mut self, input: crate::model::RegionInfo) -> Self { - let mut v = self.regions.unwrap_or_default(); - v.push(input); - self.regions = Some(v); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_regions( - mut self, - input: std::option::Option>, - ) -> Self { - self.regions = input; - self - } - /// Consumes the builder and constructs a [`ListRegionsOutput`](crate::output::ListRegionsOutput) - pub fn build(self) -> crate::output::ListRegionsOutput { - crate::output::ListRegionsOutput { - regions: self.regions, - } - } - } -} -impl ListRegionsOutput { - /// Creates a new builder-style object to manufacture [`ListRegionsOutput`](crate::output::ListRegionsOutput) - pub fn builder() -> crate::output::list_regions_output::Builder { - crate::output::list_regions_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PlayerDisconnectedOutput {} -impl std::fmt::Debug for PlayerDisconnectedOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PlayerDisconnectedOutput"); - formatter.finish() - } -} -/// See [`PlayerDisconnectedOutput`](crate::output::PlayerDisconnectedOutput) -pub mod player_disconnected_output { - /// A builder for [`PlayerDisconnectedOutput`](crate::output::PlayerDisconnectedOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`PlayerDisconnectedOutput`](crate::output::PlayerDisconnectedOutput) - pub fn build(self) -> crate::output::PlayerDisconnectedOutput { - crate::output::PlayerDisconnectedOutput {} - } - } -} -impl PlayerDisconnectedOutput { - /// Creates a new builder-style object to manufacture [`PlayerDisconnectedOutput`](crate::output::PlayerDisconnectedOutput) - pub fn builder() -> crate::output::player_disconnected_output::Builder { - crate::output::player_disconnected_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PlayerConnectedOutput {} -impl std::fmt::Debug for PlayerConnectedOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PlayerConnectedOutput"); - formatter.finish() - } -} -/// See [`PlayerConnectedOutput`](crate::output::PlayerConnectedOutput) -pub mod player_connected_output { - /// A builder for [`PlayerConnectedOutput`](crate::output::PlayerConnectedOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`PlayerConnectedOutput`](crate::output::PlayerConnectedOutput) - pub fn build(self) -> crate::output::PlayerConnectedOutput { - crate::output::PlayerConnectedOutput {} - } - } -} -impl PlayerConnectedOutput { - /// Creates a new builder-style object to manufacture [`PlayerConnectedOutput`](crate::output::PlayerConnectedOutput) - pub fn builder() -> crate::output::player_connected_output::Builder { - crate::output::player_connected_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct SetLobbyClosedOutput {} -impl std::fmt::Debug for SetLobbyClosedOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("SetLobbyClosedOutput"); - formatter.finish() - } -} -/// See [`SetLobbyClosedOutput`](crate::output::SetLobbyClosedOutput) -pub mod set_lobby_closed_output { - /// A builder for [`SetLobbyClosedOutput`](crate::output::SetLobbyClosedOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`SetLobbyClosedOutput`](crate::output::SetLobbyClosedOutput) - pub fn build(self) -> crate::output::SetLobbyClosedOutput { - crate::output::SetLobbyClosedOutput {} - } - } -} -impl SetLobbyClosedOutput { - /// Creates a new builder-style object to manufacture [`SetLobbyClosedOutput`](crate::output::SetLobbyClosedOutput) - pub fn builder() -> crate::output::set_lobby_closed_output::Builder { - crate::output::set_lobby_closed_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ListLobbiesOutput { - #[allow(missing_docs)] // documentation missing in model - pub game_modes: std::option::Option>, - #[allow(missing_docs)] // documentation missing in model - pub regions: std::option::Option>, - #[allow(missing_docs)] // documentation missing in model - pub lobbies: std::option::Option>, -} -impl ListLobbiesOutput { - #[allow(missing_docs)] // documentation missing in model - pub fn game_modes(&self) -> std::option::Option<&[crate::model::GameModeInfo]> { - self.game_modes.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn regions(&self) -> std::option::Option<&[crate::model::RegionInfo]> { - self.regions.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn lobbies(&self) -> std::option::Option<&[crate::model::LobbyInfo]> { - self.lobbies.as_deref() - } -} -impl std::fmt::Debug for ListLobbiesOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ListLobbiesOutput"); - formatter.field("game_modes", &self.game_modes); - formatter.field("regions", &self.regions); - formatter.field("lobbies", &self.lobbies); - formatter.finish() - } -} -/// See [`ListLobbiesOutput`](crate::output::ListLobbiesOutput) -pub mod list_lobbies_output { - /// A builder for [`ListLobbiesOutput`](crate::output::ListLobbiesOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_modes: std::option::Option>, - pub(crate) regions: std::option::Option>, - pub(crate) lobbies: std::option::Option>, - } - impl Builder { - /// Appends an item to `game_modes`. - /// - /// To override the contents of this collection use [`set_game_modes`](Self::set_game_modes). - /// - pub fn game_modes(mut self, input: crate::model::GameModeInfo) -> Self { - let mut v = self.game_modes.unwrap_or_default(); - v.push(input); - self.game_modes = Some(v); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_game_modes( - mut self, - input: std::option::Option>, - ) -> Self { - self.game_modes = input; - self - } - /// Appends an item to `regions`. - /// - /// To override the contents of this collection use [`set_regions`](Self::set_regions). - /// - pub fn regions(mut self, input: crate::model::RegionInfo) -> Self { - let mut v = self.regions.unwrap_or_default(); - v.push(input); - self.regions = Some(v); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_regions( - mut self, - input: std::option::Option>, - ) -> Self { - self.regions = input; - self - } - /// Appends an item to `lobbies`. - /// - /// To override the contents of this collection use [`set_lobbies`](Self::set_lobbies). - /// - pub fn lobbies(mut self, input: crate::model::LobbyInfo) -> Self { - let mut v = self.lobbies.unwrap_or_default(); - v.push(input); - self.lobbies = Some(v); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_lobbies( - mut self, - input: std::option::Option>, - ) -> Self { - self.lobbies = input; - self - } - /// Consumes the builder and constructs a [`ListLobbiesOutput`](crate::output::ListLobbiesOutput) - pub fn build(self) -> crate::output::ListLobbiesOutput { - crate::output::ListLobbiesOutput { - game_modes: self.game_modes, - regions: self.regions, - lobbies: self.lobbies, - } - } - } -} -impl ListLobbiesOutput { - /// Creates a new builder-style object to manufacture [`ListLobbiesOutput`](crate::output::ListLobbiesOutput) - pub fn builder() -> crate::output::list_lobbies_output::Builder { - crate::output::list_lobbies_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct FindLobbyOutput { - /// A matchmaker lobby. - pub lobby: std::option::Option, -} -impl FindLobbyOutput { - /// A matchmaker lobby. - pub fn lobby(&self) -> std::option::Option<&crate::model::MatchmakerLobbyJoinInfo> { - self.lobby.as_ref() - } -} -impl std::fmt::Debug for FindLobbyOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("FindLobbyOutput"); - formatter.field("lobby", &self.lobby); - formatter.finish() - } -} -/// See [`FindLobbyOutput`](crate::output::FindLobbyOutput) -pub mod find_lobby_output { - /// A builder for [`FindLobbyOutput`](crate::output::FindLobbyOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) lobby: std::option::Option, - } - impl Builder { - /// A matchmaker lobby. - pub fn lobby(mut self, input: crate::model::MatchmakerLobbyJoinInfo) -> Self { - self.lobby = Some(input); - self - } - /// A matchmaker lobby. - pub fn set_lobby( - mut self, - input: std::option::Option, - ) -> Self { - self.lobby = input; - self - } - /// Consumes the builder and constructs a [`FindLobbyOutput`](crate::output::FindLobbyOutput) - pub fn build(self) -> crate::output::FindLobbyOutput { - crate::output::FindLobbyOutput { lobby: self.lobby } - } - } -} -impl FindLobbyOutput { - /// Creates a new builder-style object to manufacture [`FindLobbyOutput`](crate::output::FindLobbyOutput) - pub fn builder() -> crate::output::find_lobby_output::Builder { - crate::output::find_lobby_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct JoinLobbyOutput { - /// A matchmaker lobby. - pub lobby: std::option::Option, -} -impl JoinLobbyOutput { - /// A matchmaker lobby. - pub fn lobby(&self) -> std::option::Option<&crate::model::MatchmakerLobbyJoinInfo> { - self.lobby.as_ref() - } -} -impl std::fmt::Debug for JoinLobbyOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("JoinLobbyOutput"); - formatter.field("lobby", &self.lobby); - formatter.finish() - } -} -/// See [`JoinLobbyOutput`](crate::output::JoinLobbyOutput) -pub mod join_lobby_output { - /// A builder for [`JoinLobbyOutput`](crate::output::JoinLobbyOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) lobby: std::option::Option, - } - impl Builder { - /// A matchmaker lobby. - pub fn lobby(mut self, input: crate::model::MatchmakerLobbyJoinInfo) -> Self { - self.lobby = Some(input); - self - } - /// A matchmaker lobby. - pub fn set_lobby( - mut self, - input: std::option::Option, - ) -> Self { - self.lobby = input; - self - } - /// Consumes the builder and constructs a [`JoinLobbyOutput`](crate::output::JoinLobbyOutput) - pub fn build(self) -> crate::output::JoinLobbyOutput { - crate::output::JoinLobbyOutput { lobby: self.lobby } - } - } -} -impl JoinLobbyOutput { - /// Creates a new builder-style object to manufacture [`JoinLobbyOutput`](crate::output::JoinLobbyOutput) - pub fn builder() -> crate::output::join_lobby_output::Builder { - crate::output::join_lobby_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct LobbyReadyOutput {} -impl std::fmt::Debug for LobbyReadyOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("LobbyReadyOutput"); - formatter.finish() - } -} -/// See [`LobbyReadyOutput`](crate::output::LobbyReadyOutput) -pub mod lobby_ready_output { - /// A builder for [`LobbyReadyOutput`](crate::output::LobbyReadyOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`LobbyReadyOutput`](crate::output::LobbyReadyOutput) - pub fn build(self) -> crate::output::LobbyReadyOutput { - crate::output::LobbyReadyOutput {} - } - } -} -impl LobbyReadyOutput { - /// Creates a new builder-style object to manufacture [`LobbyReadyOutput`](crate::output::LobbyReadyOutput) - pub fn builder() -> crate::output::lobby_ready_output::Builder { - crate::output::lobby_ready_output::Builder::default() - } -} diff --git a/lib/smithy-output/api-party/rust-server/rust-server/Cargo.toml b/lib/smithy-output/api-party/rust-server/rust-server/Cargo.toml deleted file mode 100644 index 65420a800..000000000 --- a/lib/smithy-output/api-party/rust-server/rust-server/Cargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -[package] -name = "rivet-party-server" -version = "0.0.7" -authors = ["Rivet "] -edition = "2021" -license = "Apache-2.0" - -[package.metadata.docs.rs] -all-features = true -targets = ["x86_64-unknown-linux-gnu"] - -[dependencies] -serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" -chrono = { version = "0.4", features = ["serde"] } diff --git a/lib/smithy-output/api-party/rust-server/rust-server/src/lib.rs b/lib/smithy-output/api-party/rust-server/rust-server/src/lib.rs deleted file mode 100644 index ff9294697..000000000 --- a/lib/smithy-output/api-party/rust-server/rust-server/src/lib.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod models; \ No newline at end of file diff --git a/lib/smithy-output/api-party/rust-server/rust-server/src/models.rs b/lib/smithy-output/api-party/rust-server/rust-server/src/models.rs deleted file mode 100644 index be7302751..000000000 --- a/lib/smithy-output/api-party/rust-server/rust-server/src/models.rs +++ /dev/null @@ -1,666 +0,0 @@ -#[allow(unused_imports)] -use chrono; -#[allow(unused_imports)] -use serde::{Deserialize, Serialize}; - -/// Methods to verify a captcha. -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum CaptchaConfig { - /// hCaptcha configuration. - Hcaptcha(CaptchaConfigHcaptcha), - /// Cloudflare Turnstile configuration. - Turnstile(CaptchaConfigTurnstile), -} - -/// Cloudflare Turnstile configuration. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CaptchaConfigTurnstile { - #[allow(missing_docs)] // documentation missing in model - pub client_response: std::string::String, -} - -/// hCaptcha configuration. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CaptchaConfigHcaptcha { - #[allow(missing_docs)] // documentation missing in model - pub client_response: std::string::String, -} - -/// A party summary. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PartySummary { - /// A universally unique identifier. - pub party_id: std::string::String, - /// RFC3339 timestamp. - pub create_ts: chrono::DateTime, - /// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. - pub activity: PartyActivity, - /// External links for a party. - pub external: PartyExternalLinks, - #[allow(missing_docs)] // documentation missing in model - pub publicity: PartyPublicity, - /// Unsigned 32 bit integer. - pub party_size: i32, - /// A list of party members. - pub members: std::vec::Vec, - /// A universally unique identifier. - pub thread_id: std::string::String, -} - -/// A party member summary. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PartyMemberSummary { - /// An identity handle. - pub identity: IdentityHandle, - /// Whether or not this party member is the leader of the given party. - pub is_leader: bool, - /// RFC3339 timestamp. - pub join_ts: chrono::DateTime, - /// A union representing the current state of a party member. - `Inactive`: The player is not doing anything. For example, the player can be sitting in the game menu or hanging out on the hub. - It's possible for the member to be in an inactive state while the party is in a lobby; this means the player is simply observing/interacting with others in the party and not part of the matchmaking process. - `MatchmakerReady`: This means the member wants a player created for them. - Members can be in the ready state while the party is in an idle state. This means that the player will get a player created for them. - Members can be in the ready state while the party is in a lobby. This means that the player could not join the lobby because it was full or the player left the lobby unintentionally. - `MatchmakerFindingLobby`: A find request is in progress for the member. - `MatchmakerLobby`: The member is in a lobby. - pub state: PartyMemberState, -} - -/// A union representing the current state of a party member. - `Inactive`: The player is not doing anything. For example, the player can be sitting in the game menu or hanging out on the hub. - It's possible for the member to be in an inactive state while the party is in a lobby; this means the player is simply observing/interacting with others in the party and not part of the matchmaking process. - `MatchmakerReady`: This means the member wants a player created for them. - Members can be in the ready state while the party is in an idle state. This means that the player will get a player created for them. - Members can be in the ready state while the party is in a lobby. This means that the player could not join the lobby because it was full or the player left the lobby unintentionally. - `MatchmakerFindingLobby`: A find request is in progress for the member. - `MatchmakerLobby`: The member is in a lobby. -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum PartyMemberState { - /// A party member state denoting that the member is inactive. - Inactive(PartyMemberStateInactive), - /// A party member state denoting that the member is currently searching for a lobby. - MatchmakerFindingLobby(PartyMemberStateMatchmakerFindingLobby), - /// A party member state denoting that the member is in a lobby. - MatchmakerLobby(PartyMemberStateMatchmakerLobby), - /// A party member state denoting that the member is currently waiting to start matchmaking. - MatchmakerReady(PartyMemberStateMatchmakerReady), -} - -/// A party member state denoting that the member is in a lobby. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PartyMemberStateMatchmakerLobby { - /// A universally unique identifier. - pub player_id: std::string::String, -} - -/// A party member state denoting that the member is currently searching for a lobby. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PartyMemberStateMatchmakerFindingLobby {} - -/// A party member state denoting that the member is currently waiting to start matchmaking. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PartyMemberStateMatchmakerReady {} - -/// A party member state denoting that the member is inactive. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PartyMemberStateInactive {} - -/// An identity handle. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct IdentityHandle { - /// A universally unique identifier. - pub identity_id: std::string::String, - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub account_number: i32, - /// The URL of this identity's avatar image. - pub avatar_url: std::string::String, - /// Information about the identity's current status, party, and active game. - pub presence: std::option::Option, - /// A party handle. - pub party: std::option::Option, - /// Whether or not this identity is registered with a linked account. - pub is_registered: bool, - /// External links for an identity. - pub external: IdentityExternalLinks, -} - -/// External links for an identity. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct IdentityExternalLinks { - /// A link to this identity's profile page. - pub profile: std::string::String, - /// A link to the Rivet settings page. - pub settings: std::option::Option, - /// A link to a chat page with the given identity. - pub chat: std::option::Option, -} - -/// A party handle. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PartyHandle { - /// A universally unique identifier. - pub party_id: std::string::String, - /// RFC3339 timestamp. - pub create_ts: chrono::DateTime, - /// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. - pub activity: PartyActivity, - /// External links for a party. - pub external: PartyExternalLinks, -} - -/// External links for a party. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PartyExternalLinks { - /// A link to the given party's chat thread. - pub chat: std::string::String, -} - -/// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum PartyActivity { - /// A party activity denoting that the party is idle. - Idle(PartyActivityIdle), - /// A party activity denoting that the party is currently searching for a lobby. - MatchmakerFindingLobby(PartyActivityMatchmakerFindingLobby), - /// A party activity denoting that the party is currently in a lobby. - MatchmakerLobby(PartyActivityMatchmakerLobby), -} - -/// A party activity denoting that the party is currently in a lobby. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PartyActivityMatchmakerLobby { - /// A party lobby. - pub lobby: PartyMatchmakerLobby, - /// A game handle. - pub game: GameHandle, -} - -/// A game handle. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GameHandle { - /// A universally unique identifier. - pub game_id: std::string::String, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub name_id: std::string::String, - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// The URL of this game's logo image. - pub logo_url: std::option::Option, - /// The URL of this game's banner image. - pub banner_url: std::option::Option, -} - -/// A party lobby. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PartyMatchmakerLobby { - /// A universally unique identifier. - pub lobby_id: std::string::String, -} - -/// A party activity denoting that the party is currently searching for a lobby. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PartyActivityMatchmakerFindingLobby { - /// A game handle. - pub game: GameHandle, -} - -/// A party activity denoting that the party is idle. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PartyActivityIdle {} - -/// Information about the identity's current status, party, and active game. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct IdentityPresence { - /// RFC3339 timestamp. - pub update_ts: chrono::DateTime, - /// The current status of an identity. This helps players understand if another player is currently playing or has their game in the background. - pub status: IdentityStatus, - /// The game an identity is currently participating in. - pub game_activity: std::option::Option, -} - -/// The game an identity is currently participating in. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct IdentityGameActivity { - /// A game handle. - pub game: GameHandle, - /// A short activity message about the current game activity. - pub message: std::string::String, - /// JSON data seen by anyone. - pub public_metadata: std::option::Option, - /// JSON data seen only by the given identity and their mutual followers. - pub mutual_metadata: std::option::Option, -} - -/// The current status of an identity. This helps players understand if another -/// player is currently playing or has their game in the background. -#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd, Hash, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum IdentityStatus { - #[allow(missing_docs)] // documentation missing in model - Away, - #[allow(missing_docs)] // documentation missing in model - Offline, - #[allow(missing_docs)] // documentation missing in model - Online, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for IdentityStatus { - fn from(s: &str) -> Self { - match s { - "away" => IdentityStatus::Away, - "offline" => IdentityStatus::Offline, - "online" => IdentityStatus::Online, - other => IdentityStatus::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for IdentityStatus { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(IdentityStatus::from(s)) - } -} -impl IdentityStatus { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - IdentityStatus::Away => "away", - IdentityStatus::Offline => "offline", - IdentityStatus::Online => "online", - IdentityStatus::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["away", "offline", "online"] - } -} -impl AsRef for IdentityStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PartyPublicity { - #[allow(missing_docs)] // documentation missing in model - pub public: PartyPublicityLevel, - #[allow(missing_docs)] // documentation missing in model - pub mutual_followers: PartyPublicityLevel, - #[allow(missing_docs)] // documentation missing in model - pub groups: PartyPublicityLevel, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd, Hash, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum PartyPublicityLevel { - #[allow(missing_docs)] // documentation missing in model - Join, - #[allow(missing_docs)] // documentation missing in model - None, - #[allow(missing_docs)] // documentation missing in model - View, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for PartyPublicityLevel { - fn from(s: &str) -> Self { - match s { - "join" => PartyPublicityLevel::Join, - "none" => PartyPublicityLevel::None, - "view" => PartyPublicityLevel::View, - other => PartyPublicityLevel::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for PartyPublicityLevel { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(PartyPublicityLevel::from(s)) - } -} -impl PartyPublicityLevel { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - PartyPublicityLevel::Join => "join", - PartyPublicityLevel::None => "none", - PartyPublicityLevel::View => "view", - PartyPublicityLevel::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["join", "none", "view"] - } -} -impl AsRef for PartyPublicityLevel { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// Represents methods of joining a party. -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum JoinPartyInvite { - /// A party invite alias. See `rivet.api.party.common#CreatePartyInviteConfig$alias` and `rivet.api.party#CreatePartyInvite$alias`. - Alias(std::string::String), - /// Requires the party publicity to this identity to be `rivet.party#PartyPublicityLevel$JOIN`. - PartyId(std::string::String), - /// A party invite token. See `rivet.api.party.common#CreatedInvite$token`. - Token(std::string::String), -} - -/// Output from a created invite. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CreatedInvite { - /// An alias used to join a given party. This alias must be unique for all invites for your game. Pass this alias to `rivet.api.party.common#CreatedInvite$alias` to consume the invite. - pub alias: std::option::Option, - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub token: std::string::String, -} - -/// Configuration for creating a party invite. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CreatePartyInviteConfig { - /// An alias used to join a given party. This alias must be unique for all invites for your game. Pass this alias to `rivet.api.party.common#CreatedInvite$alias` to consume the invite. - pub alias: std::option::Option, -} - -/// Publicity configuration for creating a party. Null values will default -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CreatePartyPublicityConfig { - /// Defaults to `rivet.party#PartyPublicityLevel$VIEW`. - pub public: std::option::Option, - /// Defaults to `rivet.party#PartyPublicityLevel$JOIN`. - pub mutual_followers: std::option::Option, - /// Defaults to `rivet.party#PartyPublicityLevel$VIEW`. - pub groups: std::option::Option, -} - -/// Provided by watchable endpoints used in blocking loops. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct WatchResponse { - /// Index indicating the version of the data responded. Pas this to `rivet.common#WatchQuery` to block and wait for the next response. - pub index: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PartyProfile { - /// A universally unique identifier. - pub party_id: std::string::String, - /// RFC3339 timestamp. - pub create_ts: chrono::DateTime, - /// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. - pub activity: PartyActivity, - /// External links for a party. - pub external: PartyExternalLinks, - #[allow(missing_docs)] // documentation missing in model - pub publicity: PartyPublicity, - /// Unsigned 32 bit integer. - pub party_size: i32, - /// A list of party members. - pub members: std::vec::Vec, - /// A universally unique identifier. - pub thread_id: std::string::String, - /// A list of party invites. - pub invites: std::vec::Vec, -} - -/// A party invite. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PartyInvite { - /// A universally unique identifier. - pub invite_id: std::string::String, - /// RFC3339 timestamp. - pub create_ts: chrono::DateTime, - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub token: std::string::String, - /// An alias used to join a given party. - pub alias: std::option::Option, - /// Extenral links for a party invite. - pub external: PartyInviteExternalLinks, -} - -/// Extenral links for a party invite. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PartyInviteExternalLinks { - /// The invite link used to join this party from an external site. - pub invite: std::string::String, -} - -/// An alias used to join a given party. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PartyInviteAlias { - /// A universally unique identifier. - pub namespace_id: std::string::String, - /// The alias used to join a given party. - pub alias: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct MatchmakerSelfReadyRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct FindMatchmakerLobbyForPartyRequest { - /// Game modes to match lobbies against. - pub game_modes: std::vec::Vec, - /// Regions to match lobbies against. If not specified, the optimal region will be determined and will attempt to find lobbies in that region. - pub regions: std::option::Option>, - /// Prevents a new lobby from being created when finding a lobby. If no lobby is found, `MATCHMAKER_LOBBY_NOT_FOUND` will be returned. - pub prevent_auto_create_lobby: std::option::Option, - /// Methods to verify a captcha. - pub captcha: std::option::Option, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct JoinMatchmakerLobbyForPartyRequest { - /// A universally unique identifier. - pub lobby_id: std::string::String, - /// Methods to verify a captcha. - pub captcha: std::option::Option, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct SetSelfInactiveRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct SetPartyToIdleRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct SendJoinRequestRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetPartyFromInviteRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct RevokePartyInviteRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct KickMemberRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TransferPartyOwnershipRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct SetPartyPublicityRequest { - /// Defaults to `rivet.party#PartyPublicityLevel$VIEW`. - pub public: std::option::Option, - /// Defaults to `rivet.party#PartyPublicityLevel$JOIN`. - pub mutual_followers: std::option::Option, - /// Defaults to `rivet.party#PartyPublicityLevel$VIEW`. - pub groups: std::option::Option, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct LeavePartyRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct JoinPartyRequest { - /// Represents methods of joining a party. - pub invite: JoinPartyInvite, - /// Whether or not to automatically join the game lobby if a party is currently in game. - pub matchmaker_auto_join_lobby: std::option::Option, - /// If the player is currently in the lobby, pass the token from `rivet.matchmaker#MatchmakerLobbyJoinInfoPlayer$token`. This will prevent issuing a new player token. - pub matchmaker_current_player_token: std::option::Option, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CreatePartyInviteRequest { - /// An alias used to join a given party. - pub alias: std::option::Option, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CreatePartyRequest { - /// How many members can join the party. If using this party with the matchmaker, this number should be less than or equal to your party player limit. Super large parties may not be able to fit insite a lobby and be unable to join the game. - pub party_size: i32, - /// Publicity configuration for creating a party. Null values will default - pub publicity: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub invites: std::option::Option>, - /// If the player is currently in the lobby, pass the token from `rivet.matchmaker#MatchmakerLobbyJoinInfoPlayer$token`. This will prevent issuing a new player token and automatically set the party state to the player's current lobby. - pub matchmaker_current_player_token: std::option::Option, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetPartySelfProfileRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetPartyProfileRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetPartySelfSummaryRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetPartySummaryRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct MatchmakerSelfReadyResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct FindMatchmakerLobbyForPartyResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct JoinMatchmakerLobbyForPartyResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct SetSelfInactiveResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct SetPartyToIdleResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct SendJoinRequestResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetPartyFromInviteResponse { - /// A party summary. - pub party: PartySummary, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct RevokePartyInviteResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct KickMemberResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TransferPartyOwnershipResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct SetPartyPublicityResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct LeavePartyResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct JoinPartyResponse { - /// A universally unique identifier. - pub party_id: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CreatePartyInviteResponse { - /// Output from a created invite. - pub invite: CreatedInvite, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CreatePartyResponse { - /// A universally unique identifier. - pub party_id: std::string::String, - #[allow(missing_docs)] // documentation missing in model - pub invites: std::vec::Vec, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetPartySelfProfileResponse { - #[allow(missing_docs)] // documentation missing in model - pub party: std::option::Option, - /// Provided by watchable endpoints used in blocking loops. - pub watch: WatchResponse, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetPartyProfileResponse { - #[allow(missing_docs)] // documentation missing in model - pub party: PartyProfile, - /// Provided by watchable endpoints used in blocking loops. - pub watch: WatchResponse, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetPartySelfSummaryResponse { - /// A party summary. - pub party: std::option::Option, - /// Provided by watchable endpoints used in blocking loops. - pub watch: WatchResponse, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetPartySummaryResponse { - /// A party summary. - pub party: PartySummary, - /// Provided by watchable endpoints used in blocking loops. - pub watch: WatchResponse, -} - diff --git a/lib/smithy-output/api-party/rust/rust/Cargo.toml b/lib/smithy-output/api-party/rust/rust/Cargo.toml deleted file mode 100644 index 84bef14bd..000000000 --- a/lib/smithy-output/api-party/rust/rust/Cargo.toml +++ /dev/null @@ -1,33 +0,0 @@ -# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -[package] -name = "rivet-party" -version = "0.0.7" -authors = ["Rivet Gaming, LLC "] -description = "Rivet service enabling identities to play together in real time across games" -edition = "2021" -license = "Apache-2.0" - -[package.metadata.docs.rs] -all-features = true -targets = ["x86_64-unknown-linux-gnu"] -[dependencies.aws-smithy-client] -version = "^0.41.0" -[dependencies.aws-smithy-http] -version = "^0.41.0" -[dependencies.aws-smithy-json] -version = "^0.41.0" -[dependencies.aws-smithy-types] -version = "^0.41.0" -[dependencies.bytes] -version = "1" -[dependencies.http] -version = "0.2" -[dependencies.tower] -version = "0.4" -[features] -rt-tokio = ["aws-smithy-http/rt-tokio"] -rustls = ["aws-smithy-client/rustls"] -native-tls = ["aws-smithy-client/native-tls"] -default = ["rt-tokio", "rustls"] - - diff --git a/lib/smithy-output/api-party/rust/rust/src/client.rs b/lib/smithy-output/api-party/rust/rust/src/client.rs deleted file mode 100644 index 733840487..000000000 --- a/lib/smithy-output/api-party/rust/rust/src/client.rs +++ /dev/null @@ -1,1847 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[derive(Debug)] -pub(crate) struct Handle { - pub(crate) client: aws_smithy_client::Client, - pub(crate) conf: crate::Config, -} - -/// An ergonomic service client for `PartyService`. -/// -/// This client allows ergonomic access to a `PartyService`-shaped service. -/// Each method corresponds to an endpoint defined in the service's Smithy model, -/// and the request and response shapes are auto-generated from that same model. -/// -/// # Constructing a Client -/// -/// To construct a client, you need a few different things: -/// -/// - A [`Config`](crate::Config) that specifies additional configuration -/// required by the service. -/// - A connector (`C`) that specifies how HTTP requests are translated -/// into HTTP responses. This will typically be an HTTP client (like -/// `hyper`), though you can also substitute in your own, like a mock -/// mock connector for testing. -/// - A "middleware" (`M`) that modifies requests prior to them being -/// sent to the request. Most commonly, middleware will decide what -/// endpoint the requests should be sent to, as well as perform -/// authentication and authorization of requests (such as SigV4). -/// You can also have middleware that performs request/response -/// tracing, throttling, or other middleware-like tasks. -/// - A retry policy (`R`) that dictates the behavior for requests that -/// fail and should (potentially) be retried. The default type is -/// generally what you want, as it implements a well-vetted retry -/// policy implemented in [`RetryMode::Standard`](aws_smithy_types::retry::RetryMode::Standard). -/// -/// To construct a client, you will generally want to call -/// [`Client::with_config`], which takes a [`aws_smithy_client::Client`] (a -/// Smithy client that isn't specialized to a particular service), -/// and a [`Config`](crate::Config). Both of these are constructed using -/// the [builder pattern] where you first construct a `Builder` type, -/// then configure it with the necessary parameters, and then call -/// `build` to construct the finalized output type. The -/// [`aws_smithy_client::Client`] builder is re-exported in this crate as -/// [`Builder`] for convenience. -/// -/// In _most_ circumstances, you will want to use the following pattern -/// to construct a client: -/// -/// ``` -/// use rivet_party::{Builder, Client, Config}; -/// let raw_client = -/// Builder::dyn_https() -/// # /* -/// .middleware(/* discussed below */) -/// # */ -/// # .middleware_fn(|r| r) -/// .build(); -/// let config = Config::builder().build(); -/// let client = Client::with_config(raw_client, config); -/// ``` -/// -/// For the middleware, you'll want to use whatever matches the -/// routing, authentication and authorization required by the target -/// service. For example, for the standard AWS SDK which uses -/// [SigV4-signed requests], the middleware looks like this: -/// -// Ignored as otherwise we'd need to pull in all these dev-dependencies. -/// ```rust,ignore -/// use aws_endpoint::AwsEndpointStage; -/// use aws_http::auth::CredentialsStage; -/// use aws_http::recursion_detection::RecursionDetectionStage; -/// use aws_http::user_agent::UserAgentStage; -/// use aws_sig_auth::middleware::SigV4SigningStage; -/// use aws_sig_auth::signer::SigV4Signer; -/// use aws_smithy_client::retry::Config as RetryConfig; -/// use aws_smithy_http_tower::map_request::{AsyncMapRequestLayer, MapRequestLayer}; -/// use std::fmt::Debug; -/// use tower::layer::util::{Identity, Stack}; -/// use tower::ServiceBuilder; -/// -/// type AwsMiddlewareStack = Stack< -/// MapRequestLayer, -/// Stack< -/// MapRequestLayer, -/// Stack< -/// AsyncMapRequestLayer, -/// Stack< -/// MapRequestLayer, -/// Stack, Identity>, -/// >, -/// >, -/// >, -/// >; -/// -/// /// AWS Middleware Stack -/// /// -/// /// This implements the middleware stack for this service. It will: -/// /// 1. Load credentials asynchronously into the property bag -/// /// 2. Sign the request with SigV4 -/// /// 3. Resolve an Endpoint for the request -/// /// 4. Add a user agent to the request -/// #[derive(Debug, Default, Clone)] -/// #[non_exhaustive] -/// pub struct AwsMiddleware; -/// -/// impl AwsMiddleware { -/// /// Create a new `AwsMiddleware` stack -/// /// -/// /// Note: `AwsMiddleware` holds no state. -/// pub fn new() -> Self { -/// AwsMiddleware::default() -/// } -/// } -/// -/// // define the middleware stack in a non-generic location to reduce code bloat. -/// fn base() -> ServiceBuilder { -/// let credential_provider = AsyncMapRequestLayer::for_mapper(CredentialsStage::new()); -/// let signer = MapRequestLayer::for_mapper(SigV4SigningStage::new(SigV4Signer::new())); -/// let endpoint_resolver = MapRequestLayer::for_mapper(AwsEndpointStage); -/// let user_agent = MapRequestLayer::for_mapper(UserAgentStage::new()); -/// let recursion_detection = MapRequestLayer::for_mapper(RecursionDetectionStage::new()); -/// // These layers can be considered as occurring in order, that is: -/// // 1. Resolve an endpoint -/// // 2. Add a user agent -/// // 3. Acquire credentials -/// // 4. Sign with credentials -/// // (5. Dispatch over the wire) -/// ServiceBuilder::new() -/// .layer(endpoint_resolver) -/// .layer(user_agent) -/// .layer(credential_provider) -/// .layer(signer) -/// .layer(recursion_detection) -/// } -/// -/// impl tower::Layer for AwsMiddleware { -/// type Service = >::Service; -/// -/// fn layer(&self, inner: S) -> Self::Service { -/// base().service(inner) -/// } -/// } -/// ``` -/// -/// # Using a Client -/// -/// Once you have a client set up, you can access the service's endpoints -/// by calling the appropriate method on [`Client`]. Each such method -/// returns a request builder for that endpoint, with methods for setting -/// the various fields of the request. Once your request is complete, use -/// the `send` method to send the request. `send` returns a future, which -/// you then have to `.await` to get the service's response. -/// -/// [builder pattern]: https://rust-lang.github.io/api-guidelines/type-safety.html#c-builder -/// [SigV4-signed requests]: https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html -#[derive(std::fmt::Debug)] -pub struct Client { - handle: std::sync::Arc>, -} - -impl std::clone::Clone for Client { - fn clone(&self) -> Self { - Self { - handle: self.handle.clone(), - } - } -} - -#[doc(inline)] -pub use aws_smithy_client::Builder; - -impl From> for Client { - fn from(client: aws_smithy_client::Client) -> Self { - Self::with_config(client, crate::Config::builder().build()) - } -} - -impl Client { - /// Creates a client with the given service configuration. - pub fn with_config(client: aws_smithy_client::Client, conf: crate::Config) -> Self { - Self { - handle: std::sync::Arc::new(Handle { client, conf }), - } - } - - /// Returns the client's configuration. - pub fn conf(&self) -> &crate::Config { - &self.handle.conf - } -} -impl Client -where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, -{ - /// Constructs a fluent builder for the [`CreateParty`](crate::client::fluent_builders::CreateParty) operation. - /// - /// - The fluent builder is configurable: - /// - [`party_size(i32)`](crate::client::fluent_builders::CreateParty::party_size) / [`set_party_size(Option)`](crate::client::fluent_builders::CreateParty::set_party_size): How many members can join the party. If using this party with the matchmaker, this number should be less than or equal to your party player limit. Super large parties may not be able to fit insite a lobby and be unable to join the game. - /// - [`publicity(CreatePartyPublicityConfig)`](crate::client::fluent_builders::CreateParty::publicity) / [`set_publicity(Option)`](crate::client::fluent_builders::CreateParty::set_publicity): Publicity configuration for creating a party. Null values will default - /// - [`invites(Vec)`](crate::client::fluent_builders::CreateParty::invites) / [`set_invites(Option>)`](crate::client::fluent_builders::CreateParty::set_invites): (undocumented) - /// - [`matchmaker_current_player_token(impl Into)`](crate::client::fluent_builders::CreateParty::matchmaker_current_player_token) / [`set_matchmaker_current_player_token(Option)`](crate::client::fluent_builders::CreateParty::set_matchmaker_current_player_token): If the player is currently in the lobby, pass the token from `rivet.matchmaker#MatchmakerLobbyJoinInfoPlayer$token`. This will prevent issuing a new player token and automatically set the party state to the player's current lobby. - /// - On success, responds with [`CreatePartyOutput`](crate::output::CreatePartyOutput) with field(s): - /// - [`party_id(Option)`](crate::output::CreatePartyOutput::party_id): A universally unique identifier. - /// - [`invites(Option>)`](crate::output::CreatePartyOutput::invites): (undocumented) - /// - On failure, responds with [`SdkError`](crate::error::CreatePartyError) - pub fn create_party(&self) -> fluent_builders::CreateParty { - fluent_builders::CreateParty::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`CreatePartyInvite`](crate::client::fluent_builders::CreatePartyInvite) operation. - /// - /// - The fluent builder is configurable: - /// - [`alias(impl Into)`](crate::client::fluent_builders::CreatePartyInvite::alias) / [`set_alias(Option)`](crate::client::fluent_builders::CreatePartyInvite::set_alias): An alias used to join a given party. - /// - On success, responds with [`CreatePartyInviteOutput`](crate::output::CreatePartyInviteOutput) with field(s): - /// - [`invite(Option)`](crate::output::CreatePartyInviteOutput::invite): Output from a created invite. - /// - On failure, responds with [`SdkError`](crate::error::CreatePartyInviteError) - pub fn create_party_invite(&self) -> fluent_builders::CreatePartyInvite { - fluent_builders::CreatePartyInvite::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GetPartyFromInvite`](crate::client::fluent_builders::GetPartyFromInvite) operation. - /// - /// - The fluent builder is configurable: - /// - [`token(impl Into)`](crate::client::fluent_builders::GetPartyFromInvite::token) / [`set_token(Option)`](crate::client::fluent_builders::GetPartyFromInvite::set_token): See `rivet.api.party#CreatedInvite$token`. - /// - [`alias(impl Into)`](crate::client::fluent_builders::GetPartyFromInvite::alias) / [`set_alias(Option)`](crate::client::fluent_builders::GetPartyFromInvite::set_alias): An alias used to join a given party. This alias must be unique for all invites for your game. Pass this alias to `rivet.api.party.common#CreatedInvite$alias` to consume the invite. - /// - On success, responds with [`GetPartyFromInviteOutput`](crate::output::GetPartyFromInviteOutput) with field(s): - /// - [`party(Option)`](crate::output::GetPartyFromInviteOutput::party): A party summary. - /// - On failure, responds with [`SdkError`](crate::error::GetPartyFromInviteError) - pub fn get_party_from_invite(&self) -> fluent_builders::GetPartyFromInvite { - fluent_builders::GetPartyFromInvite::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GetPartyProfile`](crate::client::fluent_builders::GetPartyProfile) operation. - /// - /// - The fluent builder is configurable: - /// - [`party_id(impl Into)`](crate::client::fluent_builders::GetPartyProfile::party_id) / [`set_party_id(Option)`](crate::client::fluent_builders::GetPartyProfile::set_party_id): A universally unique identifier. - /// - [`watch_index(impl Into)`](crate::client::fluent_builders::GetPartyProfile::watch_index) / [`set_watch_index(Option)`](crate::client::fluent_builders::GetPartyProfile::set_watch_index): A query parameter denoting the requests watch index. - /// - On success, responds with [`GetPartyProfileOutput`](crate::output::GetPartyProfileOutput) with field(s): - /// - [`party(Option)`](crate::output::GetPartyProfileOutput::party): (undocumented) - /// - [`watch(Option)`](crate::output::GetPartyProfileOutput::watch): Provided by watchable endpoints used in blocking loops. - /// - On failure, responds with [`SdkError`](crate::error::GetPartyProfileError) - pub fn get_party_profile(&self) -> fluent_builders::GetPartyProfile { - fluent_builders::GetPartyProfile::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GetPartySelfProfile`](crate::client::fluent_builders::GetPartySelfProfile) operation. - /// - /// - The fluent builder is configurable: - /// - [`watch_index(impl Into)`](crate::client::fluent_builders::GetPartySelfProfile::watch_index) / [`set_watch_index(Option)`](crate::client::fluent_builders::GetPartySelfProfile::set_watch_index): A query parameter denoting the requests watch index. - /// - On success, responds with [`GetPartySelfProfileOutput`](crate::output::GetPartySelfProfileOutput) with field(s): - /// - [`party(Option)`](crate::output::GetPartySelfProfileOutput::party): (undocumented) - /// - [`watch(Option)`](crate::output::GetPartySelfProfileOutput::watch): Provided by watchable endpoints used in blocking loops. - /// - On failure, responds with [`SdkError`](crate::error::GetPartySelfProfileError) - pub fn get_party_self_profile(&self) -> fluent_builders::GetPartySelfProfile { - fluent_builders::GetPartySelfProfile::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GetPartySelfSummary`](crate::client::fluent_builders::GetPartySelfSummary) operation. - /// - /// - The fluent builder is configurable: - /// - [`watch_index(impl Into)`](crate::client::fluent_builders::GetPartySelfSummary::watch_index) / [`set_watch_index(Option)`](crate::client::fluent_builders::GetPartySelfSummary::set_watch_index): A query parameter denoting the requests watch index. - /// - On success, responds with [`GetPartySelfSummaryOutput`](crate::output::GetPartySelfSummaryOutput) with field(s): - /// - [`party(Option)`](crate::output::GetPartySelfSummaryOutput::party): A party summary. - /// - [`watch(Option)`](crate::output::GetPartySelfSummaryOutput::watch): Provided by watchable endpoints used in blocking loops. - /// - On failure, responds with [`SdkError`](crate::error::GetPartySelfSummaryError) - pub fn get_party_self_summary(&self) -> fluent_builders::GetPartySelfSummary { - fluent_builders::GetPartySelfSummary::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GetPartySummary`](crate::client::fluent_builders::GetPartySummary) operation. - /// - /// - The fluent builder is configurable: - /// - [`party_id(impl Into)`](crate::client::fluent_builders::GetPartySummary::party_id) / [`set_party_id(Option)`](crate::client::fluent_builders::GetPartySummary::set_party_id): A universally unique identifier. - /// - [`watch_index(impl Into)`](crate::client::fluent_builders::GetPartySummary::watch_index) / [`set_watch_index(Option)`](crate::client::fluent_builders::GetPartySummary::set_watch_index): A query parameter denoting the requests watch index. - /// - On success, responds with [`GetPartySummaryOutput`](crate::output::GetPartySummaryOutput) with field(s): - /// - [`party(Option)`](crate::output::GetPartySummaryOutput::party): A party summary. - /// - [`watch(Option)`](crate::output::GetPartySummaryOutput::watch): Provided by watchable endpoints used in blocking loops. - /// - On failure, responds with [`SdkError`](crate::error::GetPartySummaryError) - pub fn get_party_summary(&self) -> fluent_builders::GetPartySummary { - fluent_builders::GetPartySummary::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`JoinParty`](crate::client::fluent_builders::JoinParty) operation. - /// - /// - The fluent builder is configurable: - /// - [`invite(JoinPartyInvite)`](crate::client::fluent_builders::JoinParty::invite) / [`set_invite(Option)`](crate::client::fluent_builders::JoinParty::set_invite): Represents methods of joining a party. - /// - [`matchmaker_auto_join_lobby(bool)`](crate::client::fluent_builders::JoinParty::matchmaker_auto_join_lobby) / [`set_matchmaker_auto_join_lobby(Option)`](crate::client::fluent_builders::JoinParty::set_matchmaker_auto_join_lobby): Whether or not to automatically join the game lobby if a party is currently in game. - /// - [`matchmaker_current_player_token(impl Into)`](crate::client::fluent_builders::JoinParty::matchmaker_current_player_token) / [`set_matchmaker_current_player_token(Option)`](crate::client::fluent_builders::JoinParty::set_matchmaker_current_player_token): If the player is currently in the lobby, pass the token from `rivet.matchmaker#MatchmakerLobbyJoinInfoPlayer$token`. This will prevent issuing a new player token. - /// - On success, responds with [`JoinPartyOutput`](crate::output::JoinPartyOutput) with field(s): - /// - [`party_id(Option)`](crate::output::JoinPartyOutput::party_id): A universally unique identifier. - /// - On failure, responds with [`SdkError`](crate::error::JoinPartyError) - pub fn join_party(&self) -> fluent_builders::JoinParty { - fluent_builders::JoinParty::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`KickMember`](crate::client::fluent_builders::KickMember) operation. - /// - /// - The fluent builder is configurable: - /// - [`identity_id(impl Into)`](crate::client::fluent_builders::KickMember::identity_id) / [`set_identity_id(Option)`](crate::client::fluent_builders::KickMember::set_identity_id): A universally unique identifier. - /// - On success, responds with [`KickMemberOutput`](crate::output::KickMemberOutput) - - /// - On failure, responds with [`SdkError`](crate::error::KickMemberError) - pub fn kick_member(&self) -> fluent_builders::KickMember { - fluent_builders::KickMember::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`LeaveParty`](crate::client::fluent_builders::LeaveParty) operation. - /// - /// - The fluent builder takes no input, just [`send`](crate::client::fluent_builders::LeaveParty::send) it. - - /// - On success, responds with [`LeavePartyOutput`](crate::output::LeavePartyOutput) - - /// - On failure, responds with [`SdkError`](crate::error::LeavePartyError) - pub fn leave_party(&self) -> fluent_builders::LeaveParty { - fluent_builders::LeaveParty::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`RevokePartyInvite`](crate::client::fluent_builders::RevokePartyInvite) operation. - /// - /// - The fluent builder is configurable: - /// - [`invite_id(impl Into)`](crate::client::fluent_builders::RevokePartyInvite::invite_id) / [`set_invite_id(Option)`](crate::client::fluent_builders::RevokePartyInvite::set_invite_id): A universally unique identifier. - /// - On success, responds with [`RevokePartyInviteOutput`](crate::output::RevokePartyInviteOutput) - - /// - On failure, responds with [`SdkError`](crate::error::RevokePartyInviteError) - pub fn revoke_party_invite(&self) -> fluent_builders::RevokePartyInvite { - fluent_builders::RevokePartyInvite::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`SendJoinRequest`](crate::client::fluent_builders::SendJoinRequest) operation. - /// - /// - The fluent builder is configurable: - /// - [`party_id(impl Into)`](crate::client::fluent_builders::SendJoinRequest::party_id) / [`set_party_id(Option)`](crate::client::fluent_builders::SendJoinRequest::set_party_id): A universally unique identifier. - /// - On success, responds with [`SendJoinRequestOutput`](crate::output::SendJoinRequestOutput) - - /// - On failure, responds with [`SdkError`](crate::error::SendJoinRequestError) - pub fn send_join_request(&self) -> fluent_builders::SendJoinRequest { - fluent_builders::SendJoinRequest::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`SetPartyPublicity`](crate::client::fluent_builders::SetPartyPublicity) operation. - /// - /// - The fluent builder is configurable: - /// - [`public(PartyPublicityLevel)`](crate::client::fluent_builders::SetPartyPublicity::public) / [`set_public(Option)`](crate::client::fluent_builders::SetPartyPublicity::set_public): Defaults to `rivet.party#PartyPublicityLevel$VIEW`. - /// - [`mutual_followers(PartyPublicityLevel)`](crate::client::fluent_builders::SetPartyPublicity::mutual_followers) / [`set_mutual_followers(Option)`](crate::client::fluent_builders::SetPartyPublicity::set_mutual_followers): Defaults to `rivet.party#PartyPublicityLevel$JOIN`. - /// - [`groups(PartyPublicityLevel)`](crate::client::fluent_builders::SetPartyPublicity::groups) / [`set_groups(Option)`](crate::client::fluent_builders::SetPartyPublicity::set_groups): Defaults to `rivet.party#PartyPublicityLevel$VIEW`. - /// - On success, responds with [`SetPartyPublicityOutput`](crate::output::SetPartyPublicityOutput) - - /// - On failure, responds with [`SdkError`](crate::error::SetPartyPublicityError) - pub fn set_party_publicity(&self) -> fluent_builders::SetPartyPublicity { - fluent_builders::SetPartyPublicity::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`TransferPartyOwnership`](crate::client::fluent_builders::TransferPartyOwnership) operation. - /// - /// - The fluent builder is configurable: - /// - [`identity_id(impl Into)`](crate::client::fluent_builders::TransferPartyOwnership::identity_id) / [`set_identity_id(Option)`](crate::client::fluent_builders::TransferPartyOwnership::set_identity_id): A universally unique identifier. - /// - On success, responds with [`TransferPartyOwnershipOutput`](crate::output::TransferPartyOwnershipOutput) - - /// - On failure, responds with [`SdkError`](crate::error::TransferPartyOwnershipError) - pub fn transfer_party_ownership(&self) -> fluent_builders::TransferPartyOwnership { - fluent_builders::TransferPartyOwnership::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`FindMatchmakerLobbyForParty`](crate::client::fluent_builders::FindMatchmakerLobbyForParty) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_modes(Vec)`](crate::client::fluent_builders::FindMatchmakerLobbyForParty::game_modes) / [`set_game_modes(Option>)`](crate::client::fluent_builders::FindMatchmakerLobbyForParty::set_game_modes): Game modes to match lobbies against. - /// - [`regions(Vec)`](crate::client::fluent_builders::FindMatchmakerLobbyForParty::regions) / [`set_regions(Option>)`](crate::client::fluent_builders::FindMatchmakerLobbyForParty::set_regions): Regions to match lobbies against. If not specified, the optimal region will be determined and will attempt to find lobbies in that region. - /// - [`prevent_auto_create_lobby(bool)`](crate::client::fluent_builders::FindMatchmakerLobbyForParty::prevent_auto_create_lobby) / [`set_prevent_auto_create_lobby(Option)`](crate::client::fluent_builders::FindMatchmakerLobbyForParty::set_prevent_auto_create_lobby): Prevents a new lobby from being created when finding a lobby. If no lobby is found, `MATCHMAKER_LOBBY_NOT_FOUND` will be returned. - /// - [`captcha(CaptchaConfig)`](crate::client::fluent_builders::FindMatchmakerLobbyForParty::captcha) / [`set_captcha(Option)`](crate::client::fluent_builders::FindMatchmakerLobbyForParty::set_captcha): Methods to verify a captcha. - /// - [`origin(impl Into)`](crate::client::fluent_builders::FindMatchmakerLobbyForParty::origin) / [`set_origin(Option)`](crate::client::fluent_builders::FindMatchmakerLobbyForParty::set_origin): (undocumented) - /// - On success, responds with [`FindMatchmakerLobbyForPartyOutput`](crate::output::FindMatchmakerLobbyForPartyOutput) - - /// - On failure, responds with [`SdkError`](crate::error::FindMatchmakerLobbyForPartyError) - pub fn find_matchmaker_lobby_for_party( - &self, - ) -> fluent_builders::FindMatchmakerLobbyForParty { - fluent_builders::FindMatchmakerLobbyForParty::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`JoinMatchmakerLobbyForParty`](crate::client::fluent_builders::JoinMatchmakerLobbyForParty) operation. - /// - /// - The fluent builder is configurable: - /// - [`lobby_id(impl Into)`](crate::client::fluent_builders::JoinMatchmakerLobbyForParty::lobby_id) / [`set_lobby_id(Option)`](crate::client::fluent_builders::JoinMatchmakerLobbyForParty::set_lobby_id): A universally unique identifier. - /// - [`captcha(CaptchaConfig)`](crate::client::fluent_builders::JoinMatchmakerLobbyForParty::captcha) / [`set_captcha(Option)`](crate::client::fluent_builders::JoinMatchmakerLobbyForParty::set_captcha): Methods to verify a captcha. - /// - On success, responds with [`JoinMatchmakerLobbyForPartyOutput`](crate::output::JoinMatchmakerLobbyForPartyOutput) - - /// - On failure, responds with [`SdkError`](crate::error::JoinMatchmakerLobbyForPartyError) - pub fn join_matchmaker_lobby_for_party( - &self, - ) -> fluent_builders::JoinMatchmakerLobbyForParty { - fluent_builders::JoinMatchmakerLobbyForParty::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`MatchmakerSelfReady`](crate::client::fluent_builders::MatchmakerSelfReady) operation. - /// - /// - The fluent builder takes no input, just [`send`](crate::client::fluent_builders::MatchmakerSelfReady::send) it. - - /// - On success, responds with [`MatchmakerSelfReadyOutput`](crate::output::MatchmakerSelfReadyOutput) - - /// - On failure, responds with [`SdkError`](crate::error::MatchmakerSelfReadyError) - pub fn matchmaker_self_ready(&self) -> fluent_builders::MatchmakerSelfReady { - fluent_builders::MatchmakerSelfReady::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`SetPartyToIdle`](crate::client::fluent_builders::SetPartyToIdle) operation. - /// - /// - The fluent builder takes no input, just [`send`](crate::client::fluent_builders::SetPartyToIdle::send) it. - - /// - On success, responds with [`SetPartyToIdleOutput`](crate::output::SetPartyToIdleOutput) - - /// - On failure, responds with [`SdkError`](crate::error::SetPartyToIdleError) - pub fn set_party_to_idle(&self) -> fluent_builders::SetPartyToIdle { - fluent_builders::SetPartyToIdle::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`SetSelfInactive`](crate::client::fluent_builders::SetSelfInactive) operation. - /// - /// - The fluent builder takes no input, just [`send`](crate::client::fluent_builders::SetSelfInactive::send) it. - - /// - On success, responds with [`SetSelfInactiveOutput`](crate::output::SetSelfInactiveOutput) - - /// - On failure, responds with [`SdkError`](crate::error::SetSelfInactiveError) - pub fn set_self_inactive(&self) -> fluent_builders::SetSelfInactive { - fluent_builders::SetSelfInactive::new(self.handle.clone()) - } -} -pub mod fluent_builders { - //! - //! Utilities to ergonomically construct a request to the service. - //! - //! Fluent builders are created through the [`Client`](crate::client::Client) by calling - //! one if its operation methods. After parameters are set using the builder methods, - //! the `send` method can be called to initiate the request. - //! - /// Fluent builder constructing a request to `CreateParty`. - /// - /// Creates a new party. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct CreateParty { - handle: std::sync::Arc>, - inner: crate::input::create_party_input::Builder, - } - impl CreateParty - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `CreateParty`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::CreatePartyOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::CreatePartyInputOperationOutputAlias, - crate::output::CreatePartyOutput, - crate::error::CreatePartyError, - crate::input::CreatePartyInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// How many members can join the party. If using this party with the matchmaker, this number should be less than or equal to your party player limit. Super large parties may not be able to fit insite a lobby and be unable to join the game. - pub fn party_size(mut self, input: i32) -> Self { - self.inner = self.inner.party_size(input); - self - } - /// How many members can join the party. If using this party with the matchmaker, this number should be less than or equal to your party player limit. Super large parties may not be able to fit insite a lobby and be unable to join the game. - pub fn set_party_size(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_party_size(input); - self - } - /// Publicity configuration for creating a party. Null values will default - pub fn publicity(mut self, input: crate::model::CreatePartyPublicityConfig) -> Self { - self.inner = self.inner.publicity(input); - self - } - /// Publicity configuration for creating a party. Null values will default - pub fn set_publicity( - mut self, - input: std::option::Option, - ) -> Self { - self.inner = self.inner.set_publicity(input); - self - } - /// Appends an item to `invites`. - /// - /// To override the contents of this collection use [`set_invites`](Self::set_invites). - /// - #[allow(missing_docs)] // documentation missing in model - pub fn invites(mut self, input: crate::model::CreatePartyInviteConfig) -> Self { - self.inner = self.inner.invites(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_invites( - mut self, - input: std::option::Option>, - ) -> Self { - self.inner = self.inner.set_invites(input); - self - } - /// If the player is currently in the lobby, pass the token from `rivet.matchmaker#MatchmakerLobbyJoinInfoPlayer$token`. This will prevent issuing a new player token and automatically set the party state to the player's current lobby. - pub fn matchmaker_current_player_token( - mut self, - input: impl Into, - ) -> Self { - self.inner = self.inner.matchmaker_current_player_token(input.into()); - self - } - /// If the player is currently in the lobby, pass the token from `rivet.matchmaker#MatchmakerLobbyJoinInfoPlayer$token`. This will prevent issuing a new player token and automatically set the party state to the player's current lobby. - pub fn set_matchmaker_current_player_token( - mut self, - input: std::option::Option, - ) -> Self { - self.inner = self.inner.set_matchmaker_current_player_token(input); - self - } - } - /// Fluent builder constructing a request to `CreatePartyInvite`. - /// - /// Creates a new party invite for the current identity's party. Identity must be the party leader. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct CreatePartyInvite { - handle: std::sync::Arc>, - inner: crate::input::create_party_invite_input::Builder, - } - impl CreatePartyInvite - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `CreatePartyInvite`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::CreatePartyInviteOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::CreatePartyInviteInputOperationOutputAlias, - crate::output::CreatePartyInviteOutput, - crate::error::CreatePartyInviteError, - crate::input::CreatePartyInviteInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// An alias used to join a given party. - pub fn alias(mut self, input: impl Into) -> Self { - self.inner = self.inner.alias(input.into()); - self - } - /// An alias used to join a given party. - pub fn set_alias(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_alias(input); - self - } - } - /// Fluent builder constructing a request to `GetPartyFromInvite`. - /// - /// Fetches a party based on a given invite. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GetPartyFromInvite { - handle: std::sync::Arc>, - inner: crate::input::get_party_from_invite_input::Builder, - } - impl GetPartyFromInvite - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GetPartyFromInvite`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GetPartyFromInviteOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GetPartyFromInviteInputOperationOutputAlias, - crate::output::GetPartyFromInviteOutput, - crate::error::GetPartyFromInviteError, - crate::input::GetPartyFromInviteInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// See `rivet.api.party#CreatedInvite$token`. - pub fn token(mut self, input: impl Into) -> Self { - self.inner = self.inner.token(input.into()); - self - } - /// See `rivet.api.party#CreatedInvite$token`. - pub fn set_token(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_token(input); - self - } - /// An alias used to join a given party. This alias must be unique for all invites for your game. Pass this alias to `rivet.api.party.common#CreatedInvite$alias` to consume the invite. - pub fn alias(mut self, input: impl Into) -> Self { - self.inner = self.inner.alias(input.into()); - self - } - /// An alias used to join a given party. This alias must be unique for all invites for your game. Pass this alias to `rivet.api.party.common#CreatedInvite$alias` to consume the invite. - pub fn set_alias(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_alias(input); - self - } - } - /// Fluent builder constructing a request to `GetPartyProfile`. - /// - /// Returns a party profile. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GetPartyProfile { - handle: std::sync::Arc>, - inner: crate::input::get_party_profile_input::Builder, - } - impl GetPartyProfile - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GetPartyProfile`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GetPartyProfileOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GetPartyProfileInputOperationOutputAlias, - crate::output::GetPartyProfileOutput, - crate::error::GetPartyProfileError, - crate::input::GetPartyProfileInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn party_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.party_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_party_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_party_id(input); - self - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.inner = self.inner.watch_index(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_watch_index(input); - self - } - } - /// Fluent builder constructing a request to `GetPartySelfProfile`. - /// - /// Returns a party profile for the party the current identity is a member of. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GetPartySelfProfile { - handle: std::sync::Arc>, - inner: crate::input::get_party_self_profile_input::Builder, - } - impl GetPartySelfProfile - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GetPartySelfProfile`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GetPartySelfProfileOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GetPartySelfProfileInputOperationOutputAlias, - crate::output::GetPartySelfProfileOutput, - crate::error::GetPartySelfProfileError, - crate::input::GetPartySelfProfileInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.inner = self.inner.watch_index(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_watch_index(input); - self - } - } - /// Fluent builder constructing a request to `GetPartySelfSummary`. - /// - /// Returns a party summary for the party the current identity is a member of. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GetPartySelfSummary { - handle: std::sync::Arc>, - inner: crate::input::get_party_self_summary_input::Builder, - } - impl GetPartySelfSummary - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GetPartySelfSummary`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GetPartySelfSummaryOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GetPartySelfSummaryInputOperationOutputAlias, - crate::output::GetPartySelfSummaryOutput, - crate::error::GetPartySelfSummaryError, - crate::input::GetPartySelfSummaryInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.inner = self.inner.watch_index(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_watch_index(input); - self - } - } - /// Fluent builder constructing a request to `GetPartySummary`. - /// - /// Returns a party summary. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GetPartySummary { - handle: std::sync::Arc>, - inner: crate::input::get_party_summary_input::Builder, - } - impl GetPartySummary - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GetPartySummary`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GetPartySummaryOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GetPartySummaryInputOperationOutputAlias, - crate::output::GetPartySummaryOutput, - crate::error::GetPartySummaryError, - crate::input::GetPartySummaryInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn party_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.party_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_party_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_party_id(input); - self - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.inner = self.inner.watch_index(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_watch_index(input); - self - } - } - /// Fluent builder constructing a request to `JoinParty`. - /// - /// Joins a party using a given party invite. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct JoinParty { - handle: std::sync::Arc>, - inner: crate::input::join_party_input::Builder, - } - impl JoinParty - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `JoinParty`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::JoinPartyOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::JoinPartyInputOperationOutputAlias, - crate::output::JoinPartyOutput, - crate::error::JoinPartyError, - crate::input::JoinPartyInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// Represents methods of joining a party. - pub fn invite(mut self, input: crate::model::JoinPartyInvite) -> Self { - self.inner = self.inner.invite(input); - self - } - /// Represents methods of joining a party. - pub fn set_invite( - mut self, - input: std::option::Option, - ) -> Self { - self.inner = self.inner.set_invite(input); - self - } - /// Whether or not to automatically join the game lobby if a party is currently in game. - pub fn matchmaker_auto_join_lobby(mut self, input: bool) -> Self { - self.inner = self.inner.matchmaker_auto_join_lobby(input); - self - } - /// Whether or not to automatically join the game lobby if a party is currently in game. - pub fn set_matchmaker_auto_join_lobby(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_matchmaker_auto_join_lobby(input); - self - } - /// If the player is currently in the lobby, pass the token from `rivet.matchmaker#MatchmakerLobbyJoinInfoPlayer$token`. This will prevent issuing a new player token. - pub fn matchmaker_current_player_token( - mut self, - input: impl Into, - ) -> Self { - self.inner = self.inner.matchmaker_current_player_token(input.into()); - self - } - /// If the player is currently in the lobby, pass the token from `rivet.matchmaker#MatchmakerLobbyJoinInfoPlayer$token`. This will prevent issuing a new player token. - pub fn set_matchmaker_current_player_token( - mut self, - input: std::option::Option, - ) -> Self { - self.inner = self.inner.set_matchmaker_current_player_token(input); - self - } - } - /// Fluent builder constructing a request to `KickMember`. - /// - /// Kicks a member from the current identity's current party. Identity must be the party leader. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct KickMember { - handle: std::sync::Arc>, - inner: crate::input::kick_member_input::Builder, - } - impl KickMember - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `KickMember`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::KickMemberOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::KickMemberInputOperationOutputAlias, - crate::output::KickMemberOutput, - crate::error::KickMemberError, - crate::input::KickMemberInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.identity_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_identity_id(input); - self - } - } - /// Fluent builder constructing a request to `LeaveParty`. - /// - /// Leaves the current identity's party. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct LeaveParty { - handle: std::sync::Arc>, - inner: crate::input::leave_party_input::Builder, - } - impl LeaveParty - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `LeaveParty`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::LeavePartyOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::LeavePartyInputOperationOutputAlias, - crate::output::LeavePartyOutput, - crate::error::LeavePartyError, - crate::input::LeavePartyInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - } - /// Fluent builder constructing a request to `RevokePartyInvite`. - /// - /// Revokes a party invite from the current identity's party. Identity must be the party leader. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct RevokePartyInvite { - handle: std::sync::Arc>, - inner: crate::input::revoke_party_invite_input::Builder, - } - impl RevokePartyInvite - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `RevokePartyInvite`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::RevokePartyInviteOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::RevokePartyInviteInputOperationOutputAlias, - crate::output::RevokePartyInviteOutput, - crate::error::RevokePartyInviteError, - crate::input::RevokePartyInviteInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn invite_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.invite_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_invite_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_invite_id(input); - self - } - } - /// Fluent builder constructing a request to `SendJoinRequest`. - /// - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct SendJoinRequest { - handle: std::sync::Arc>, - inner: crate::input::send_join_request_input::Builder, - } - impl SendJoinRequest - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `SendJoinRequest`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::SendJoinRequestOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::SendJoinRequestInputOperationOutputAlias, - crate::output::SendJoinRequestOutput, - crate::error::SendJoinRequestError, - crate::input::SendJoinRequestInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn party_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.party_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_party_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_party_id(input); - self - } - } - /// Fluent builder constructing a request to `SetPartyPublicity`. - /// - /// Sets the publicity of a party. This configures who can view and join the party. Identity must be the party leader. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct SetPartyPublicity { - handle: std::sync::Arc>, - inner: crate::input::set_party_publicity_input::Builder, - } - impl SetPartyPublicity - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `SetPartyPublicity`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::SetPartyPublicityOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::SetPartyPublicityInputOperationOutputAlias, - crate::output::SetPartyPublicityOutput, - crate::error::SetPartyPublicityError, - crate::input::SetPartyPublicityInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// Defaults to `rivet.party#PartyPublicityLevel$VIEW`. - pub fn public(mut self, input: crate::model::PartyPublicityLevel) -> Self { - self.inner = self.inner.public(input); - self - } - /// Defaults to `rivet.party#PartyPublicityLevel$VIEW`. - pub fn set_public( - mut self, - input: std::option::Option, - ) -> Self { - self.inner = self.inner.set_public(input); - self - } - /// Defaults to `rivet.party#PartyPublicityLevel$JOIN`. - pub fn mutual_followers(mut self, input: crate::model::PartyPublicityLevel) -> Self { - self.inner = self.inner.mutual_followers(input); - self - } - /// Defaults to `rivet.party#PartyPublicityLevel$JOIN`. - pub fn set_mutual_followers( - mut self, - input: std::option::Option, - ) -> Self { - self.inner = self.inner.set_mutual_followers(input); - self - } - /// Defaults to `rivet.party#PartyPublicityLevel$VIEW`. - pub fn groups(mut self, input: crate::model::PartyPublicityLevel) -> Self { - self.inner = self.inner.groups(input); - self - } - /// Defaults to `rivet.party#PartyPublicityLevel$VIEW`. - pub fn set_groups( - mut self, - input: std::option::Option, - ) -> Self { - self.inner = self.inner.set_groups(input); - self - } - } - /// Fluent builder constructing a request to `TransferPartyOwnership`. - /// - /// Transfers ownership of the party to another party member. Identity must be the party leader. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct TransferPartyOwnership { - handle: std::sync::Arc>, - inner: crate::input::transfer_party_ownership_input::Builder, - } - impl TransferPartyOwnership - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `TransferPartyOwnership`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::TransferPartyOwnershipOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::TransferPartyOwnershipInputOperationOutputAlias, - crate::output::TransferPartyOwnershipOutput, - crate::error::TransferPartyOwnershipError, - crate::input::TransferPartyOwnershipInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.identity_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_identity_id(input); - self - } - } - /// Fluent builder constructing a request to `FindMatchmakerLobbyForParty`. - /// - /// Attempts to make the current identity's party find a lobby based on the given criteria. If succeeds, all party members will receive a `GlobalEventMatchmakerLobbyJoin` event with all the information required to join the lobby. This request will use the party player count configured for the lobby group. See `FindLobby`. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct FindMatchmakerLobbyForParty { - handle: std::sync::Arc>, - inner: crate::input::find_matchmaker_lobby_for_party_input::Builder, - } - impl FindMatchmakerLobbyForParty - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `FindMatchmakerLobbyForParty`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::FindMatchmakerLobbyForPartyOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::FindMatchmakerLobbyForPartyInputOperationOutputAlias, - crate::output::FindMatchmakerLobbyForPartyOutput, - crate::error::FindMatchmakerLobbyForPartyError, - crate::input::FindMatchmakerLobbyForPartyInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// Appends an item to `game_modes`. - /// - /// To override the contents of this collection use [`set_game_modes`](Self::set_game_modes). - /// - /// Game modes to match lobbies against. - pub fn game_modes(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_modes(input.into()); - self - } - /// Game modes to match lobbies against. - pub fn set_game_modes( - mut self, - input: std::option::Option>, - ) -> Self { - self.inner = self.inner.set_game_modes(input); - self - } - /// Appends an item to `regions`. - /// - /// To override the contents of this collection use [`set_regions`](Self::set_regions). - /// - /// Regions to match lobbies against. If not specified, the optimal region will be determined and will attempt to find lobbies in that region. - pub fn regions(mut self, input: impl Into) -> Self { - self.inner = self.inner.regions(input.into()); - self - } - /// Regions to match lobbies against. If not specified, the optimal region will be determined and will attempt to find lobbies in that region. - pub fn set_regions( - mut self, - input: std::option::Option>, - ) -> Self { - self.inner = self.inner.set_regions(input); - self - } - /// Prevents a new lobby from being created when finding a lobby. If no lobby is found, `MATCHMAKER_LOBBY_NOT_FOUND` will be returned. - pub fn prevent_auto_create_lobby(mut self, input: bool) -> Self { - self.inner = self.inner.prevent_auto_create_lobby(input); - self - } - /// Prevents a new lobby from being created when finding a lobby. If no lobby is found, `MATCHMAKER_LOBBY_NOT_FOUND` will be returned. - pub fn set_prevent_auto_create_lobby(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_prevent_auto_create_lobby(input); - self - } - /// Methods to verify a captcha. - pub fn captcha(mut self, input: crate::model::CaptchaConfig) -> Self { - self.inner = self.inner.captcha(input); - self - } - /// Methods to verify a captcha. - pub fn set_captcha( - mut self, - input: std::option::Option, - ) -> Self { - self.inner = self.inner.set_captcha(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn origin(mut self, input: impl Into) -> Self { - self.inner = self.inner.origin(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_origin(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_origin(input); - self - } - } - /// Fluent builder constructing a request to `JoinMatchmakerLobbyForParty`. - /// - /// Attempts to make the current identity's party join a specific matchmaker lobby. This request will use the party player count configured for the lobby group. If succeeds, all party members will receive a `GlobalEventMatchmakerLobbyJoin` event with all the information required to join the lobby. Identity must be the party leader. See `JoinLobby`. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct JoinMatchmakerLobbyForParty { - handle: std::sync::Arc>, - inner: crate::input::join_matchmaker_lobby_for_party_input::Builder, - } - impl JoinMatchmakerLobbyForParty - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `JoinMatchmakerLobbyForParty`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::JoinMatchmakerLobbyForPartyOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::JoinMatchmakerLobbyForPartyInputOperationOutputAlias, - crate::output::JoinMatchmakerLobbyForPartyOutput, - crate::error::JoinMatchmakerLobbyForPartyError, - crate::input::JoinMatchmakerLobbyForPartyInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn lobby_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.lobby_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_lobby_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_lobby_id(input); - self - } - /// Methods to verify a captcha. - pub fn captcha(mut self, input: crate::model::CaptchaConfig) -> Self { - self.inner = self.inner.captcha(input); - self - } - /// Methods to verify a captcha. - pub fn set_captcha( - mut self, - input: std::option::Option, - ) -> Self { - self.inner = self.inner.set_captcha(input); - self - } - } - /// Fluent builder constructing a request to `MatchmakerSelfReady`. - /// - /// Attempts to create a new matchmaker player for the current identity. If succeeds, the identity will receive a `GlobalEventMatchmakerLobbyJoin` event with all the information required to join the lobby. Only relevant if the party is already in a matchmaker lobby. # When To Use This Endpoint ## Joining a Party Already In a Lobby When an identity joins a party that's already in a lobby, a new matchmaker player will not automatically be created unless `JoinParty#matchmaker_auto_join_lobby` is set to `true`. ## Leaving the Game and Returning If the user leaves the game and comes back but is still in the party, then they will have to create a new matchmaker player. ## Failed to Connect to Lobby or Disconnected From Lobby If the user failed to establish a connection with the lobby or they got disconnected, their matchmaker player will be removed. Use this endpoint to create a new matchmaker player. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct MatchmakerSelfReady { - handle: std::sync::Arc>, - inner: crate::input::matchmaker_self_ready_input::Builder, - } - impl MatchmakerSelfReady - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `MatchmakerSelfReady`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::MatchmakerSelfReadyOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::MatchmakerSelfReadyInputOperationOutputAlias, - crate::output::MatchmakerSelfReadyOutput, - crate::error::MatchmakerSelfReadyError, - crate::input::MatchmakerSelfReadyInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - } - /// Fluent builder constructing a request to `SetPartyToIdle`. - /// - /// Sets the activity of the current identity's party to idle. Identity must be the party leader. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct SetPartyToIdle { - handle: std::sync::Arc>, - inner: crate::input::set_party_to_idle_input::Builder, - } - impl SetPartyToIdle - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `SetPartyToIdle`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::SetPartyToIdleOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::SetPartyToIdleInputOperationOutputAlias, - crate::output::SetPartyToIdleOutput, - crate::error::SetPartyToIdleError, - crate::input::SetPartyToIdleInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - } - /// Fluent builder constructing a request to `SetSelfInactive`. - /// - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct SetSelfInactive { - handle: std::sync::Arc>, - inner: crate::input::set_self_inactive_input::Builder, - } - impl SetSelfInactive - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `SetSelfInactive`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::SetSelfInactiveOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::SetSelfInactiveInputOperationOutputAlias, - crate::output::SetSelfInactiveOutput, - crate::error::SetSelfInactiveError, - crate::input::SetSelfInactiveInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - } -} -/// A wrapper around [`Client`]. Helps reduce external imports. -pub struct ClientWrapper { - pub(crate) client: Client, -} - -impl std::ops::Deref for ClientWrapper { - type Target = Client; - - fn deref(&self) -> &Self::Target { - &self.client - } -} diff --git a/lib/smithy-output/api-party/rust/rust/src/config.rs b/lib/smithy-output/api-party/rust/rust/src/config.rs deleted file mode 100644 index ad752bab6..000000000 --- a/lib/smithy-output/api-party/rust/rust/src/config.rs +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Service config. -/// -pub struct Config { - pub(crate) auth: Option, - pub(crate) uri: String, -} -impl std::fmt::Debug for Config { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut config = f.debug_struct("Config"); - config.finish() - } -} -impl Config { - /// Constructs a config builder. - pub fn builder() -> Builder { - Builder::default() - } -} -/// Builder for creating a `Config`. -#[derive(Default)] -pub struct Builder { - pub(crate) auth: Option, - pub(crate) uri: Option, -} -impl Builder { - /// Constructs a config builder. - pub fn new() -> Self { - Self::default() - } - /// Sets the bearer token to be used with the Smithy client. - pub fn set_bearer_token(mut self, bearer_token: impl std::fmt::Display) -> Self { - self.auth = Some(format!("Bearer {}", bearer_token)); - self - } - /// Sets the base URI to be used with the Smithy client. - pub fn set_uri(mut self, uri: impl ToString) -> Self { - self.uri = Some(uri.to_string()); - self - } - /// Builds a [`Config`]. - pub fn build(self) -> Config { - Config { - auth: self - .auth - .or_else(|| std::env::var("RIVET_LOBBY_TOKEN").ok()) - .or_else(|| std::env::var("RIVET_CLIENT_TOKEN").ok()), - uri: self - .uri - .or_else(|| std::env::var("RIVET_PARTY_API_URL").ok()) - .unwrap_or_else(|| "https://party.api.rivet.gg/v1".to_string()), - } - } - /// Builds a default [`Client`] from the given config. - pub fn build_client(self) -> crate::client::ClientWrapper { - let raw_client = aws_smithy_client::Builder::dyn_https() - .middleware(tower::layer::util::Identity::new()) - .sleep_impl(None) - .build(); - crate::client::ClientWrapper { - client: crate::Client::with_config(raw_client, self.build()), - } - } -} diff --git a/lib/smithy-output/api-party/rust/rust/src/error.rs b/lib/smithy-output/api-party/rust/rust/src/error.rs deleted file mode 100644 index cd6920419..000000000 --- a/lib/smithy-output/api-party/rust/rust/src/error.rs +++ /dev/null @@ -1,3434 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Error type for the `CreateParty` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct CreatePartyError { - /// Kind of error that occurred. - pub kind: CreatePartyErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `CreateParty` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum CreatePartyErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for CreatePartyError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - CreatePartyErrorKind::InternalError(_inner) => _inner.fmt(f), - CreatePartyErrorKind::RateLimitError(_inner) => _inner.fmt(f), - CreatePartyErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - CreatePartyErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - CreatePartyErrorKind::NotFoundError(_inner) => _inner.fmt(f), - CreatePartyErrorKind::BadRequestError(_inner) => _inner.fmt(f), - CreatePartyErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for CreatePartyError { - fn code(&self) -> Option<&str> { - CreatePartyError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - CreatePartyErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - CreatePartyErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl CreatePartyError { - /// Creates a new `CreatePartyError`. - pub fn new(kind: CreatePartyErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `CreatePartyError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: CreatePartyErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `CreatePartyError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: CreatePartyErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `CreatePartyErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, CreatePartyErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `CreatePartyErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, CreatePartyErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `CreatePartyErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, CreatePartyErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `CreatePartyErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, CreatePartyErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `CreatePartyErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, CreatePartyErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `CreatePartyErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, CreatePartyErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for CreatePartyError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - CreatePartyErrorKind::InternalError(_inner) => Some(_inner), - CreatePartyErrorKind::RateLimitError(_inner) => Some(_inner), - CreatePartyErrorKind::ForbiddenError(_inner) => Some(_inner), - CreatePartyErrorKind::UnauthorizedError(_inner) => Some(_inner), - CreatePartyErrorKind::NotFoundError(_inner) => Some(_inner), - CreatePartyErrorKind::BadRequestError(_inner) => Some(_inner), - CreatePartyErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `CreatePartyInvite` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct CreatePartyInviteError { - /// Kind of error that occurred. - pub kind: CreatePartyInviteErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `CreatePartyInvite` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum CreatePartyInviteErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for CreatePartyInviteError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - CreatePartyInviteErrorKind::InternalError(_inner) => _inner.fmt(f), - CreatePartyInviteErrorKind::RateLimitError(_inner) => _inner.fmt(f), - CreatePartyInviteErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - CreatePartyInviteErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - CreatePartyInviteErrorKind::NotFoundError(_inner) => _inner.fmt(f), - CreatePartyInviteErrorKind::BadRequestError(_inner) => _inner.fmt(f), - CreatePartyInviteErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for CreatePartyInviteError { - fn code(&self) -> Option<&str> { - CreatePartyInviteError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - CreatePartyInviteErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - CreatePartyInviteErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl CreatePartyInviteError { - /// Creates a new `CreatePartyInviteError`. - pub fn new(kind: CreatePartyInviteErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `CreatePartyInviteError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: CreatePartyInviteErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `CreatePartyInviteError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: CreatePartyInviteErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `CreatePartyInviteErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, CreatePartyInviteErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `CreatePartyInviteErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, CreatePartyInviteErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `CreatePartyInviteErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, CreatePartyInviteErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `CreatePartyInviteErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, CreatePartyInviteErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `CreatePartyInviteErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, CreatePartyInviteErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `CreatePartyInviteErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, CreatePartyInviteErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for CreatePartyInviteError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - CreatePartyInviteErrorKind::InternalError(_inner) => Some(_inner), - CreatePartyInviteErrorKind::RateLimitError(_inner) => Some(_inner), - CreatePartyInviteErrorKind::ForbiddenError(_inner) => Some(_inner), - CreatePartyInviteErrorKind::UnauthorizedError(_inner) => Some(_inner), - CreatePartyInviteErrorKind::NotFoundError(_inner) => Some(_inner), - CreatePartyInviteErrorKind::BadRequestError(_inner) => Some(_inner), - CreatePartyInviteErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `GetPartyFromInvite` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GetPartyFromInviteError { - /// Kind of error that occurred. - pub kind: GetPartyFromInviteErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GetPartyFromInvite` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GetPartyFromInviteErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GetPartyFromInviteError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GetPartyFromInviteErrorKind::InternalError(_inner) => _inner.fmt(f), - GetPartyFromInviteErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GetPartyFromInviteErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GetPartyFromInviteErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GetPartyFromInviteErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GetPartyFromInviteErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GetPartyFromInviteErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GetPartyFromInviteError { - fn code(&self) -> Option<&str> { - GetPartyFromInviteError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GetPartyFromInviteErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - GetPartyFromInviteErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl GetPartyFromInviteError { - /// Creates a new `GetPartyFromInviteError`. - pub fn new(kind: GetPartyFromInviteErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GetPartyFromInviteError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GetPartyFromInviteErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GetPartyFromInviteError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GetPartyFromInviteErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GetPartyFromInviteErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, GetPartyFromInviteErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `GetPartyFromInviteErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, GetPartyFromInviteErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `GetPartyFromInviteErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, GetPartyFromInviteErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `GetPartyFromInviteErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - GetPartyFromInviteErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `GetPartyFromInviteErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, GetPartyFromInviteErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `GetPartyFromInviteErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, GetPartyFromInviteErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for GetPartyFromInviteError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GetPartyFromInviteErrorKind::InternalError(_inner) => Some(_inner), - GetPartyFromInviteErrorKind::RateLimitError(_inner) => Some(_inner), - GetPartyFromInviteErrorKind::ForbiddenError(_inner) => Some(_inner), - GetPartyFromInviteErrorKind::UnauthorizedError(_inner) => Some(_inner), - GetPartyFromInviteErrorKind::NotFoundError(_inner) => Some(_inner), - GetPartyFromInviteErrorKind::BadRequestError(_inner) => Some(_inner), - GetPartyFromInviteErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `GetPartyProfile` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GetPartyProfileError { - /// Kind of error that occurred. - pub kind: GetPartyProfileErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GetPartyProfile` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GetPartyProfileErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GetPartyProfileError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GetPartyProfileErrorKind::InternalError(_inner) => _inner.fmt(f), - GetPartyProfileErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GetPartyProfileErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GetPartyProfileErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GetPartyProfileErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GetPartyProfileErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GetPartyProfileErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GetPartyProfileError { - fn code(&self) -> Option<&str> { - GetPartyProfileError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GetPartyProfileErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - GetPartyProfileErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl GetPartyProfileError { - /// Creates a new `GetPartyProfileError`. - pub fn new(kind: GetPartyProfileErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GetPartyProfileError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GetPartyProfileErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GetPartyProfileError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GetPartyProfileErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GetPartyProfileErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, GetPartyProfileErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `GetPartyProfileErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, GetPartyProfileErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `GetPartyProfileErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, GetPartyProfileErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `GetPartyProfileErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, GetPartyProfileErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `GetPartyProfileErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, GetPartyProfileErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `GetPartyProfileErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, GetPartyProfileErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for GetPartyProfileError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GetPartyProfileErrorKind::InternalError(_inner) => Some(_inner), - GetPartyProfileErrorKind::RateLimitError(_inner) => Some(_inner), - GetPartyProfileErrorKind::ForbiddenError(_inner) => Some(_inner), - GetPartyProfileErrorKind::UnauthorizedError(_inner) => Some(_inner), - GetPartyProfileErrorKind::NotFoundError(_inner) => Some(_inner), - GetPartyProfileErrorKind::BadRequestError(_inner) => Some(_inner), - GetPartyProfileErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `GetPartySelfProfile` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GetPartySelfProfileError { - /// Kind of error that occurred. - pub kind: GetPartySelfProfileErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GetPartySelfProfile` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GetPartySelfProfileErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GetPartySelfProfileError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GetPartySelfProfileErrorKind::InternalError(_inner) => _inner.fmt(f), - GetPartySelfProfileErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GetPartySelfProfileErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GetPartySelfProfileErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GetPartySelfProfileErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GetPartySelfProfileErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GetPartySelfProfileErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GetPartySelfProfileError { - fn code(&self) -> Option<&str> { - GetPartySelfProfileError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GetPartySelfProfileErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - GetPartySelfProfileErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl GetPartySelfProfileError { - /// Creates a new `GetPartySelfProfileError`. - pub fn new(kind: GetPartySelfProfileErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GetPartySelfProfileError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GetPartySelfProfileErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GetPartySelfProfileError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GetPartySelfProfileErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GetPartySelfProfileErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, GetPartySelfProfileErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `GetPartySelfProfileErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, GetPartySelfProfileErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `GetPartySelfProfileErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, GetPartySelfProfileErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `GetPartySelfProfileErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - GetPartySelfProfileErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `GetPartySelfProfileErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, GetPartySelfProfileErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `GetPartySelfProfileErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, GetPartySelfProfileErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for GetPartySelfProfileError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GetPartySelfProfileErrorKind::InternalError(_inner) => Some(_inner), - GetPartySelfProfileErrorKind::RateLimitError(_inner) => Some(_inner), - GetPartySelfProfileErrorKind::ForbiddenError(_inner) => Some(_inner), - GetPartySelfProfileErrorKind::UnauthorizedError(_inner) => Some(_inner), - GetPartySelfProfileErrorKind::NotFoundError(_inner) => Some(_inner), - GetPartySelfProfileErrorKind::BadRequestError(_inner) => Some(_inner), - GetPartySelfProfileErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `GetPartySelfSummary` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GetPartySelfSummaryError { - /// Kind of error that occurred. - pub kind: GetPartySelfSummaryErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GetPartySelfSummary` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GetPartySelfSummaryErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GetPartySelfSummaryError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GetPartySelfSummaryErrorKind::InternalError(_inner) => _inner.fmt(f), - GetPartySelfSummaryErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GetPartySelfSummaryErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GetPartySelfSummaryErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GetPartySelfSummaryErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GetPartySelfSummaryErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GetPartySelfSummaryErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GetPartySelfSummaryError { - fn code(&self) -> Option<&str> { - GetPartySelfSummaryError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GetPartySelfSummaryErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - GetPartySelfSummaryErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl GetPartySelfSummaryError { - /// Creates a new `GetPartySelfSummaryError`. - pub fn new(kind: GetPartySelfSummaryErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GetPartySelfSummaryError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GetPartySelfSummaryErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GetPartySelfSummaryError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GetPartySelfSummaryErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GetPartySelfSummaryErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, GetPartySelfSummaryErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `GetPartySelfSummaryErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, GetPartySelfSummaryErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `GetPartySelfSummaryErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, GetPartySelfSummaryErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `GetPartySelfSummaryErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - GetPartySelfSummaryErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `GetPartySelfSummaryErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, GetPartySelfSummaryErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `GetPartySelfSummaryErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, GetPartySelfSummaryErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for GetPartySelfSummaryError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GetPartySelfSummaryErrorKind::InternalError(_inner) => Some(_inner), - GetPartySelfSummaryErrorKind::RateLimitError(_inner) => Some(_inner), - GetPartySelfSummaryErrorKind::ForbiddenError(_inner) => Some(_inner), - GetPartySelfSummaryErrorKind::UnauthorizedError(_inner) => Some(_inner), - GetPartySelfSummaryErrorKind::NotFoundError(_inner) => Some(_inner), - GetPartySelfSummaryErrorKind::BadRequestError(_inner) => Some(_inner), - GetPartySelfSummaryErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `GetPartySummary` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GetPartySummaryError { - /// Kind of error that occurred. - pub kind: GetPartySummaryErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GetPartySummary` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GetPartySummaryErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GetPartySummaryError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GetPartySummaryErrorKind::InternalError(_inner) => _inner.fmt(f), - GetPartySummaryErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GetPartySummaryErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GetPartySummaryErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GetPartySummaryErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GetPartySummaryErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GetPartySummaryErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GetPartySummaryError { - fn code(&self) -> Option<&str> { - GetPartySummaryError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GetPartySummaryErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - GetPartySummaryErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl GetPartySummaryError { - /// Creates a new `GetPartySummaryError`. - pub fn new(kind: GetPartySummaryErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GetPartySummaryError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GetPartySummaryErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GetPartySummaryError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GetPartySummaryErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GetPartySummaryErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, GetPartySummaryErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `GetPartySummaryErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, GetPartySummaryErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `GetPartySummaryErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, GetPartySummaryErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `GetPartySummaryErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, GetPartySummaryErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `GetPartySummaryErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, GetPartySummaryErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `GetPartySummaryErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, GetPartySummaryErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for GetPartySummaryError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GetPartySummaryErrorKind::InternalError(_inner) => Some(_inner), - GetPartySummaryErrorKind::RateLimitError(_inner) => Some(_inner), - GetPartySummaryErrorKind::ForbiddenError(_inner) => Some(_inner), - GetPartySummaryErrorKind::UnauthorizedError(_inner) => Some(_inner), - GetPartySummaryErrorKind::NotFoundError(_inner) => Some(_inner), - GetPartySummaryErrorKind::BadRequestError(_inner) => Some(_inner), - GetPartySummaryErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `JoinParty` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct JoinPartyError { - /// Kind of error that occurred. - pub kind: JoinPartyErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `JoinParty` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum JoinPartyErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for JoinPartyError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - JoinPartyErrorKind::InternalError(_inner) => _inner.fmt(f), - JoinPartyErrorKind::RateLimitError(_inner) => _inner.fmt(f), - JoinPartyErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - JoinPartyErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - JoinPartyErrorKind::NotFoundError(_inner) => _inner.fmt(f), - JoinPartyErrorKind::BadRequestError(_inner) => _inner.fmt(f), - JoinPartyErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for JoinPartyError { - fn code(&self) -> Option<&str> { - JoinPartyError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - JoinPartyErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - JoinPartyErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl JoinPartyError { - /// Creates a new `JoinPartyError`. - pub fn new(kind: JoinPartyErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `JoinPartyError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: JoinPartyErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `JoinPartyError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: JoinPartyErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `JoinPartyErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, JoinPartyErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `JoinPartyErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, JoinPartyErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `JoinPartyErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, JoinPartyErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `JoinPartyErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, JoinPartyErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `JoinPartyErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, JoinPartyErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `JoinPartyErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, JoinPartyErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for JoinPartyError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - JoinPartyErrorKind::InternalError(_inner) => Some(_inner), - JoinPartyErrorKind::RateLimitError(_inner) => Some(_inner), - JoinPartyErrorKind::ForbiddenError(_inner) => Some(_inner), - JoinPartyErrorKind::UnauthorizedError(_inner) => Some(_inner), - JoinPartyErrorKind::NotFoundError(_inner) => Some(_inner), - JoinPartyErrorKind::BadRequestError(_inner) => Some(_inner), - JoinPartyErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `KickMember` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct KickMemberError { - /// Kind of error that occurred. - pub kind: KickMemberErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `KickMember` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum KickMemberErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for KickMemberError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - KickMemberErrorKind::InternalError(_inner) => _inner.fmt(f), - KickMemberErrorKind::RateLimitError(_inner) => _inner.fmt(f), - KickMemberErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - KickMemberErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - KickMemberErrorKind::NotFoundError(_inner) => _inner.fmt(f), - KickMemberErrorKind::BadRequestError(_inner) => _inner.fmt(f), - KickMemberErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for KickMemberError { - fn code(&self) -> Option<&str> { - KickMemberError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - KickMemberErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - KickMemberErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl KickMemberError { - /// Creates a new `KickMemberError`. - pub fn new(kind: KickMemberErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `KickMemberError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: KickMemberErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `KickMemberError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: KickMemberErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `KickMemberErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, KickMemberErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `KickMemberErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, KickMemberErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `KickMemberErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, KickMemberErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `KickMemberErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, KickMemberErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `KickMemberErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, KickMemberErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `KickMemberErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, KickMemberErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for KickMemberError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - KickMemberErrorKind::InternalError(_inner) => Some(_inner), - KickMemberErrorKind::RateLimitError(_inner) => Some(_inner), - KickMemberErrorKind::ForbiddenError(_inner) => Some(_inner), - KickMemberErrorKind::UnauthorizedError(_inner) => Some(_inner), - KickMemberErrorKind::NotFoundError(_inner) => Some(_inner), - KickMemberErrorKind::BadRequestError(_inner) => Some(_inner), - KickMemberErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `LeaveParty` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct LeavePartyError { - /// Kind of error that occurred. - pub kind: LeavePartyErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `LeaveParty` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum LeavePartyErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for LeavePartyError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - LeavePartyErrorKind::InternalError(_inner) => _inner.fmt(f), - LeavePartyErrorKind::RateLimitError(_inner) => _inner.fmt(f), - LeavePartyErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - LeavePartyErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - LeavePartyErrorKind::NotFoundError(_inner) => _inner.fmt(f), - LeavePartyErrorKind::BadRequestError(_inner) => _inner.fmt(f), - LeavePartyErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for LeavePartyError { - fn code(&self) -> Option<&str> { - LeavePartyError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - LeavePartyErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - LeavePartyErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl LeavePartyError { - /// Creates a new `LeavePartyError`. - pub fn new(kind: LeavePartyErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `LeavePartyError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: LeavePartyErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `LeavePartyError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: LeavePartyErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `LeavePartyErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, LeavePartyErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `LeavePartyErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, LeavePartyErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `LeavePartyErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, LeavePartyErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `LeavePartyErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, LeavePartyErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `LeavePartyErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, LeavePartyErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `LeavePartyErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, LeavePartyErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for LeavePartyError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - LeavePartyErrorKind::InternalError(_inner) => Some(_inner), - LeavePartyErrorKind::RateLimitError(_inner) => Some(_inner), - LeavePartyErrorKind::ForbiddenError(_inner) => Some(_inner), - LeavePartyErrorKind::UnauthorizedError(_inner) => Some(_inner), - LeavePartyErrorKind::NotFoundError(_inner) => Some(_inner), - LeavePartyErrorKind::BadRequestError(_inner) => Some(_inner), - LeavePartyErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `RevokePartyInvite` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct RevokePartyInviteError { - /// Kind of error that occurred. - pub kind: RevokePartyInviteErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `RevokePartyInvite` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum RevokePartyInviteErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for RevokePartyInviteError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - RevokePartyInviteErrorKind::InternalError(_inner) => _inner.fmt(f), - RevokePartyInviteErrorKind::RateLimitError(_inner) => _inner.fmt(f), - RevokePartyInviteErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - RevokePartyInviteErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - RevokePartyInviteErrorKind::NotFoundError(_inner) => _inner.fmt(f), - RevokePartyInviteErrorKind::BadRequestError(_inner) => _inner.fmt(f), - RevokePartyInviteErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for RevokePartyInviteError { - fn code(&self) -> Option<&str> { - RevokePartyInviteError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - RevokePartyInviteErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - RevokePartyInviteErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl RevokePartyInviteError { - /// Creates a new `RevokePartyInviteError`. - pub fn new(kind: RevokePartyInviteErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `RevokePartyInviteError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: RevokePartyInviteErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `RevokePartyInviteError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: RevokePartyInviteErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `RevokePartyInviteErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, RevokePartyInviteErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `RevokePartyInviteErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, RevokePartyInviteErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `RevokePartyInviteErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, RevokePartyInviteErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `RevokePartyInviteErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, RevokePartyInviteErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `RevokePartyInviteErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, RevokePartyInviteErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `RevokePartyInviteErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, RevokePartyInviteErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for RevokePartyInviteError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - RevokePartyInviteErrorKind::InternalError(_inner) => Some(_inner), - RevokePartyInviteErrorKind::RateLimitError(_inner) => Some(_inner), - RevokePartyInviteErrorKind::ForbiddenError(_inner) => Some(_inner), - RevokePartyInviteErrorKind::UnauthorizedError(_inner) => Some(_inner), - RevokePartyInviteErrorKind::NotFoundError(_inner) => Some(_inner), - RevokePartyInviteErrorKind::BadRequestError(_inner) => Some(_inner), - RevokePartyInviteErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `SendJoinRequest` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct SendJoinRequestError { - /// Kind of error that occurred. - pub kind: SendJoinRequestErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `SendJoinRequest` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum SendJoinRequestErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for SendJoinRequestError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - SendJoinRequestErrorKind::InternalError(_inner) => _inner.fmt(f), - SendJoinRequestErrorKind::RateLimitError(_inner) => _inner.fmt(f), - SendJoinRequestErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - SendJoinRequestErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - SendJoinRequestErrorKind::NotFoundError(_inner) => _inner.fmt(f), - SendJoinRequestErrorKind::BadRequestError(_inner) => _inner.fmt(f), - SendJoinRequestErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for SendJoinRequestError { - fn code(&self) -> Option<&str> { - SendJoinRequestError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - SendJoinRequestErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - SendJoinRequestErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl SendJoinRequestError { - /// Creates a new `SendJoinRequestError`. - pub fn new(kind: SendJoinRequestErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `SendJoinRequestError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: SendJoinRequestErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `SendJoinRequestError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: SendJoinRequestErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `SendJoinRequestErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, SendJoinRequestErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `SendJoinRequestErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, SendJoinRequestErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `SendJoinRequestErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, SendJoinRequestErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `SendJoinRequestErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, SendJoinRequestErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `SendJoinRequestErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, SendJoinRequestErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `SendJoinRequestErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, SendJoinRequestErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for SendJoinRequestError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - SendJoinRequestErrorKind::InternalError(_inner) => Some(_inner), - SendJoinRequestErrorKind::RateLimitError(_inner) => Some(_inner), - SendJoinRequestErrorKind::ForbiddenError(_inner) => Some(_inner), - SendJoinRequestErrorKind::UnauthorizedError(_inner) => Some(_inner), - SendJoinRequestErrorKind::NotFoundError(_inner) => Some(_inner), - SendJoinRequestErrorKind::BadRequestError(_inner) => Some(_inner), - SendJoinRequestErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `SetPartyPublicity` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct SetPartyPublicityError { - /// Kind of error that occurred. - pub kind: SetPartyPublicityErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `SetPartyPublicity` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum SetPartyPublicityErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for SetPartyPublicityError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - SetPartyPublicityErrorKind::InternalError(_inner) => _inner.fmt(f), - SetPartyPublicityErrorKind::RateLimitError(_inner) => _inner.fmt(f), - SetPartyPublicityErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - SetPartyPublicityErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - SetPartyPublicityErrorKind::NotFoundError(_inner) => _inner.fmt(f), - SetPartyPublicityErrorKind::BadRequestError(_inner) => _inner.fmt(f), - SetPartyPublicityErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for SetPartyPublicityError { - fn code(&self) -> Option<&str> { - SetPartyPublicityError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - SetPartyPublicityErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - SetPartyPublicityErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl SetPartyPublicityError { - /// Creates a new `SetPartyPublicityError`. - pub fn new(kind: SetPartyPublicityErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `SetPartyPublicityError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: SetPartyPublicityErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `SetPartyPublicityError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: SetPartyPublicityErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `SetPartyPublicityErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, SetPartyPublicityErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `SetPartyPublicityErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, SetPartyPublicityErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `SetPartyPublicityErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, SetPartyPublicityErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `SetPartyPublicityErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, SetPartyPublicityErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `SetPartyPublicityErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, SetPartyPublicityErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `SetPartyPublicityErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, SetPartyPublicityErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for SetPartyPublicityError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - SetPartyPublicityErrorKind::InternalError(_inner) => Some(_inner), - SetPartyPublicityErrorKind::RateLimitError(_inner) => Some(_inner), - SetPartyPublicityErrorKind::ForbiddenError(_inner) => Some(_inner), - SetPartyPublicityErrorKind::UnauthorizedError(_inner) => Some(_inner), - SetPartyPublicityErrorKind::NotFoundError(_inner) => Some(_inner), - SetPartyPublicityErrorKind::BadRequestError(_inner) => Some(_inner), - SetPartyPublicityErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `TransferPartyOwnership` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct TransferPartyOwnershipError { - /// Kind of error that occurred. - pub kind: TransferPartyOwnershipErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `TransferPartyOwnership` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum TransferPartyOwnershipErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for TransferPartyOwnershipError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - TransferPartyOwnershipErrorKind::InternalError(_inner) => _inner.fmt(f), - TransferPartyOwnershipErrorKind::RateLimitError(_inner) => _inner.fmt(f), - TransferPartyOwnershipErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - TransferPartyOwnershipErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - TransferPartyOwnershipErrorKind::NotFoundError(_inner) => _inner.fmt(f), - TransferPartyOwnershipErrorKind::BadRequestError(_inner) => _inner.fmt(f), - TransferPartyOwnershipErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for TransferPartyOwnershipError { - fn code(&self) -> Option<&str> { - TransferPartyOwnershipError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - TransferPartyOwnershipErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - TransferPartyOwnershipErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl TransferPartyOwnershipError { - /// Creates a new `TransferPartyOwnershipError`. - pub fn new(kind: TransferPartyOwnershipErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `TransferPartyOwnershipError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: TransferPartyOwnershipErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `TransferPartyOwnershipError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: TransferPartyOwnershipErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `TransferPartyOwnershipErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!( - &self.kind, - TransferPartyOwnershipErrorKind::InternalError(_) - ) - } - /// Returns `true` if the error kind is `TransferPartyOwnershipErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - TransferPartyOwnershipErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `TransferPartyOwnershipErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - TransferPartyOwnershipErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `TransferPartyOwnershipErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - TransferPartyOwnershipErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `TransferPartyOwnershipErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!( - &self.kind, - TransferPartyOwnershipErrorKind::NotFoundError(_) - ) - } - /// Returns `true` if the error kind is `TransferPartyOwnershipErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - TransferPartyOwnershipErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for TransferPartyOwnershipError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - TransferPartyOwnershipErrorKind::InternalError(_inner) => Some(_inner), - TransferPartyOwnershipErrorKind::RateLimitError(_inner) => Some(_inner), - TransferPartyOwnershipErrorKind::ForbiddenError(_inner) => Some(_inner), - TransferPartyOwnershipErrorKind::UnauthorizedError(_inner) => Some(_inner), - TransferPartyOwnershipErrorKind::NotFoundError(_inner) => Some(_inner), - TransferPartyOwnershipErrorKind::BadRequestError(_inner) => Some(_inner), - TransferPartyOwnershipErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `FindMatchmakerLobbyForParty` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct FindMatchmakerLobbyForPartyError { - /// Kind of error that occurred. - pub kind: FindMatchmakerLobbyForPartyErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `FindMatchmakerLobbyForParty` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum FindMatchmakerLobbyForPartyErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for FindMatchmakerLobbyForPartyError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - FindMatchmakerLobbyForPartyErrorKind::InternalError(_inner) => _inner.fmt(f), - FindMatchmakerLobbyForPartyErrorKind::RateLimitError(_inner) => _inner.fmt(f), - FindMatchmakerLobbyForPartyErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - FindMatchmakerLobbyForPartyErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - FindMatchmakerLobbyForPartyErrorKind::NotFoundError(_inner) => _inner.fmt(f), - FindMatchmakerLobbyForPartyErrorKind::BadRequestError(_inner) => _inner.fmt(f), - FindMatchmakerLobbyForPartyErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for FindMatchmakerLobbyForPartyError { - fn code(&self) -> Option<&str> { - FindMatchmakerLobbyForPartyError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - FindMatchmakerLobbyForPartyErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - FindMatchmakerLobbyForPartyErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl FindMatchmakerLobbyForPartyError { - /// Creates a new `FindMatchmakerLobbyForPartyError`. - pub fn new(kind: FindMatchmakerLobbyForPartyErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `FindMatchmakerLobbyForPartyError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: FindMatchmakerLobbyForPartyErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `FindMatchmakerLobbyForPartyError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: FindMatchmakerLobbyForPartyErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `FindMatchmakerLobbyForPartyErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!( - &self.kind, - FindMatchmakerLobbyForPartyErrorKind::InternalError(_) - ) - } - /// Returns `true` if the error kind is `FindMatchmakerLobbyForPartyErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - FindMatchmakerLobbyForPartyErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `FindMatchmakerLobbyForPartyErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - FindMatchmakerLobbyForPartyErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `FindMatchmakerLobbyForPartyErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - FindMatchmakerLobbyForPartyErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `FindMatchmakerLobbyForPartyErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!( - &self.kind, - FindMatchmakerLobbyForPartyErrorKind::NotFoundError(_) - ) - } - /// Returns `true` if the error kind is `FindMatchmakerLobbyForPartyErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - FindMatchmakerLobbyForPartyErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for FindMatchmakerLobbyForPartyError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - FindMatchmakerLobbyForPartyErrorKind::InternalError(_inner) => Some(_inner), - FindMatchmakerLobbyForPartyErrorKind::RateLimitError(_inner) => Some(_inner), - FindMatchmakerLobbyForPartyErrorKind::ForbiddenError(_inner) => Some(_inner), - FindMatchmakerLobbyForPartyErrorKind::UnauthorizedError(_inner) => Some(_inner), - FindMatchmakerLobbyForPartyErrorKind::NotFoundError(_inner) => Some(_inner), - FindMatchmakerLobbyForPartyErrorKind::BadRequestError(_inner) => Some(_inner), - FindMatchmakerLobbyForPartyErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `JoinMatchmakerLobbyForParty` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct JoinMatchmakerLobbyForPartyError { - /// Kind of error that occurred. - pub kind: JoinMatchmakerLobbyForPartyErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `JoinMatchmakerLobbyForParty` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum JoinMatchmakerLobbyForPartyErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for JoinMatchmakerLobbyForPartyError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - JoinMatchmakerLobbyForPartyErrorKind::InternalError(_inner) => _inner.fmt(f), - JoinMatchmakerLobbyForPartyErrorKind::RateLimitError(_inner) => _inner.fmt(f), - JoinMatchmakerLobbyForPartyErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - JoinMatchmakerLobbyForPartyErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - JoinMatchmakerLobbyForPartyErrorKind::NotFoundError(_inner) => _inner.fmt(f), - JoinMatchmakerLobbyForPartyErrorKind::BadRequestError(_inner) => _inner.fmt(f), - JoinMatchmakerLobbyForPartyErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for JoinMatchmakerLobbyForPartyError { - fn code(&self) -> Option<&str> { - JoinMatchmakerLobbyForPartyError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - JoinMatchmakerLobbyForPartyErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - JoinMatchmakerLobbyForPartyErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl JoinMatchmakerLobbyForPartyError { - /// Creates a new `JoinMatchmakerLobbyForPartyError`. - pub fn new(kind: JoinMatchmakerLobbyForPartyErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `JoinMatchmakerLobbyForPartyError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: JoinMatchmakerLobbyForPartyErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `JoinMatchmakerLobbyForPartyError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: JoinMatchmakerLobbyForPartyErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `JoinMatchmakerLobbyForPartyErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!( - &self.kind, - JoinMatchmakerLobbyForPartyErrorKind::InternalError(_) - ) - } - /// Returns `true` if the error kind is `JoinMatchmakerLobbyForPartyErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - JoinMatchmakerLobbyForPartyErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `JoinMatchmakerLobbyForPartyErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - JoinMatchmakerLobbyForPartyErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `JoinMatchmakerLobbyForPartyErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - JoinMatchmakerLobbyForPartyErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `JoinMatchmakerLobbyForPartyErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!( - &self.kind, - JoinMatchmakerLobbyForPartyErrorKind::NotFoundError(_) - ) - } - /// Returns `true` if the error kind is `JoinMatchmakerLobbyForPartyErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - JoinMatchmakerLobbyForPartyErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for JoinMatchmakerLobbyForPartyError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - JoinMatchmakerLobbyForPartyErrorKind::InternalError(_inner) => Some(_inner), - JoinMatchmakerLobbyForPartyErrorKind::RateLimitError(_inner) => Some(_inner), - JoinMatchmakerLobbyForPartyErrorKind::ForbiddenError(_inner) => Some(_inner), - JoinMatchmakerLobbyForPartyErrorKind::UnauthorizedError(_inner) => Some(_inner), - JoinMatchmakerLobbyForPartyErrorKind::NotFoundError(_inner) => Some(_inner), - JoinMatchmakerLobbyForPartyErrorKind::BadRequestError(_inner) => Some(_inner), - JoinMatchmakerLobbyForPartyErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `MatchmakerSelfReady` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct MatchmakerSelfReadyError { - /// Kind of error that occurred. - pub kind: MatchmakerSelfReadyErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `MatchmakerSelfReady` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum MatchmakerSelfReadyErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for MatchmakerSelfReadyError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - MatchmakerSelfReadyErrorKind::InternalError(_inner) => _inner.fmt(f), - MatchmakerSelfReadyErrorKind::RateLimitError(_inner) => _inner.fmt(f), - MatchmakerSelfReadyErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - MatchmakerSelfReadyErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - MatchmakerSelfReadyErrorKind::NotFoundError(_inner) => _inner.fmt(f), - MatchmakerSelfReadyErrorKind::BadRequestError(_inner) => _inner.fmt(f), - MatchmakerSelfReadyErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for MatchmakerSelfReadyError { - fn code(&self) -> Option<&str> { - MatchmakerSelfReadyError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - MatchmakerSelfReadyErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - MatchmakerSelfReadyErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl MatchmakerSelfReadyError { - /// Creates a new `MatchmakerSelfReadyError`. - pub fn new(kind: MatchmakerSelfReadyErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `MatchmakerSelfReadyError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: MatchmakerSelfReadyErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `MatchmakerSelfReadyError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: MatchmakerSelfReadyErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `MatchmakerSelfReadyErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, MatchmakerSelfReadyErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `MatchmakerSelfReadyErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, MatchmakerSelfReadyErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `MatchmakerSelfReadyErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, MatchmakerSelfReadyErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `MatchmakerSelfReadyErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - MatchmakerSelfReadyErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `MatchmakerSelfReadyErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, MatchmakerSelfReadyErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `MatchmakerSelfReadyErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, MatchmakerSelfReadyErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for MatchmakerSelfReadyError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - MatchmakerSelfReadyErrorKind::InternalError(_inner) => Some(_inner), - MatchmakerSelfReadyErrorKind::RateLimitError(_inner) => Some(_inner), - MatchmakerSelfReadyErrorKind::ForbiddenError(_inner) => Some(_inner), - MatchmakerSelfReadyErrorKind::UnauthorizedError(_inner) => Some(_inner), - MatchmakerSelfReadyErrorKind::NotFoundError(_inner) => Some(_inner), - MatchmakerSelfReadyErrorKind::BadRequestError(_inner) => Some(_inner), - MatchmakerSelfReadyErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `SetPartyToIdle` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct SetPartyToIdleError { - /// Kind of error that occurred. - pub kind: SetPartyToIdleErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `SetPartyToIdle` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum SetPartyToIdleErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for SetPartyToIdleError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - SetPartyToIdleErrorKind::InternalError(_inner) => _inner.fmt(f), - SetPartyToIdleErrorKind::RateLimitError(_inner) => _inner.fmt(f), - SetPartyToIdleErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - SetPartyToIdleErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - SetPartyToIdleErrorKind::NotFoundError(_inner) => _inner.fmt(f), - SetPartyToIdleErrorKind::BadRequestError(_inner) => _inner.fmt(f), - SetPartyToIdleErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for SetPartyToIdleError { - fn code(&self) -> Option<&str> { - SetPartyToIdleError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - SetPartyToIdleErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - SetPartyToIdleErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl SetPartyToIdleError { - /// Creates a new `SetPartyToIdleError`. - pub fn new(kind: SetPartyToIdleErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `SetPartyToIdleError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: SetPartyToIdleErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `SetPartyToIdleError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: SetPartyToIdleErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `SetPartyToIdleErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, SetPartyToIdleErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `SetPartyToIdleErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, SetPartyToIdleErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `SetPartyToIdleErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, SetPartyToIdleErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `SetPartyToIdleErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, SetPartyToIdleErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `SetPartyToIdleErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, SetPartyToIdleErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `SetPartyToIdleErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, SetPartyToIdleErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for SetPartyToIdleError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - SetPartyToIdleErrorKind::InternalError(_inner) => Some(_inner), - SetPartyToIdleErrorKind::RateLimitError(_inner) => Some(_inner), - SetPartyToIdleErrorKind::ForbiddenError(_inner) => Some(_inner), - SetPartyToIdleErrorKind::UnauthorizedError(_inner) => Some(_inner), - SetPartyToIdleErrorKind::NotFoundError(_inner) => Some(_inner), - SetPartyToIdleErrorKind::BadRequestError(_inner) => Some(_inner), - SetPartyToIdleErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `SetSelfInactive` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct SetSelfInactiveError { - /// Kind of error that occurred. - pub kind: SetSelfInactiveErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `SetSelfInactive` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum SetSelfInactiveErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for SetSelfInactiveError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - SetSelfInactiveErrorKind::InternalError(_inner) => _inner.fmt(f), - SetSelfInactiveErrorKind::RateLimitError(_inner) => _inner.fmt(f), - SetSelfInactiveErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - SetSelfInactiveErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - SetSelfInactiveErrorKind::NotFoundError(_inner) => _inner.fmt(f), - SetSelfInactiveErrorKind::BadRequestError(_inner) => _inner.fmt(f), - SetSelfInactiveErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for SetSelfInactiveError { - fn code(&self) -> Option<&str> { - SetSelfInactiveError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - SetSelfInactiveErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - SetSelfInactiveErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl SetSelfInactiveError { - /// Creates a new `SetSelfInactiveError`. - pub fn new(kind: SetSelfInactiveErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `SetSelfInactiveError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: SetSelfInactiveErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `SetSelfInactiveError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: SetSelfInactiveErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `SetSelfInactiveErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, SetSelfInactiveErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `SetSelfInactiveErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, SetSelfInactiveErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `SetSelfInactiveErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, SetSelfInactiveErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `SetSelfInactiveErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, SetSelfInactiveErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `SetSelfInactiveErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, SetSelfInactiveErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `SetSelfInactiveErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, SetSelfInactiveErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for SetSelfInactiveError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - SetSelfInactiveErrorKind::InternalError(_inner) => Some(_inner), - SetSelfInactiveErrorKind::RateLimitError(_inner) => Some(_inner), - SetSelfInactiveErrorKind::ForbiddenError(_inner) => Some(_inner), - SetSelfInactiveErrorKind::UnauthorizedError(_inner) => Some(_inner), - SetSelfInactiveErrorKind::NotFoundError(_inner) => Some(_inner), - SetSelfInactiveErrorKind::BadRequestError(_inner) => Some(_inner), - SetSelfInactiveErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// An error thrown when the requestee has sent an invalid or malformed request. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct BadRequestError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl BadRequestError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for BadRequestError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("BadRequestError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl BadRequestError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for BadRequestError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "BadRequestError")?; - if let Some(inner_1) = &self.message { - write!(f, ": {}", inner_1)?; - } - Ok(()) - } -} -impl std::error::Error for BadRequestError {} -/// See [`BadRequestError`](crate::error::BadRequestError) -pub mod bad_request_error { - /// A builder for [`BadRequestError`](crate::error::BadRequestError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`BadRequestError`](crate::error::BadRequestError) - pub fn build(self) -> crate::error::BadRequestError { - crate::error::BadRequestError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl BadRequestError { - /// Creates a new builder-style object to manufacture [`BadRequestError`](crate::error::BadRequestError) - pub fn builder() -> crate::error::bad_request_error::Builder { - crate::error::bad_request_error::Builder::default() - } -} - -/// An error thrown when the requestee requests a non existent resource. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct NotFoundError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl NotFoundError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for NotFoundError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("NotFoundError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl NotFoundError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for NotFoundError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "NotFoundError")?; - if let Some(inner_2) = &self.message { - write!(f, ": {}", inner_2)?; - } - Ok(()) - } -} -impl std::error::Error for NotFoundError {} -/// See [`NotFoundError`](crate::error::NotFoundError) -pub mod not_found_error { - /// A builder for [`NotFoundError`](crate::error::NotFoundError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`NotFoundError`](crate::error::NotFoundError) - pub fn build(self) -> crate::error::NotFoundError { - crate::error::NotFoundError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl NotFoundError { - /// Creates a new builder-style object to manufacture [`NotFoundError`](crate::error::NotFoundError) - pub fn builder() -> crate::error::not_found_error::Builder { - crate::error::not_found_error::Builder::default() - } -} - -/// An error thrown when the requestee is not authenticated. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UnauthorizedError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl UnauthorizedError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for UnauthorizedError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UnauthorizedError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl UnauthorizedError { - /// Returns `Some(ErrorKind)` if the error is retryable. Otherwise, returns `None`. - pub fn retryable_error_kind(&self) -> aws_smithy_types::retry::ErrorKind { - aws_smithy_types::retry::ErrorKind::ClientError - } - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for UnauthorizedError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "UnauthorizedError")?; - if let Some(inner_3) = &self.message { - write!(f, ": {}", inner_3)?; - } - Ok(()) - } -} -impl std::error::Error for UnauthorizedError {} -/// See [`UnauthorizedError`](crate::error::UnauthorizedError) -pub mod unauthorized_error { - /// A builder for [`UnauthorizedError`](crate::error::UnauthorizedError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`UnauthorizedError`](crate::error::UnauthorizedError) - pub fn build(self) -> crate::error::UnauthorizedError { - crate::error::UnauthorizedError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl UnauthorizedError { - /// Creates a new builder-style object to manufacture [`UnauthorizedError`](crate::error::UnauthorizedError) - pub fn builder() -> crate::error::unauthorized_error::Builder { - crate::error::unauthorized_error::Builder::default() - } -} - -/// An error thrown when the requestee requests a resource they do not have access to. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ForbiddenError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl ForbiddenError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for ForbiddenError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ForbiddenError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl ForbiddenError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for ForbiddenError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "ForbiddenError")?; - if let Some(inner_4) = &self.message { - write!(f, ": {}", inner_4)?; - } - Ok(()) - } -} -impl std::error::Error for ForbiddenError {} -/// See [`ForbiddenError`](crate::error::ForbiddenError) -pub mod forbidden_error { - /// A builder for [`ForbiddenError`](crate::error::ForbiddenError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`ForbiddenError`](crate::error::ForbiddenError) - pub fn build(self) -> crate::error::ForbiddenError { - crate::error::ForbiddenError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl ForbiddenError { - /// Creates a new builder-style object to manufacture [`ForbiddenError`](crate::error::ForbiddenError) - pub fn builder() -> crate::error::forbidden_error::Builder { - crate::error::forbidden_error::Builder::default() - } -} - -/// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct RateLimitError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl RateLimitError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for RateLimitError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("RateLimitError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl RateLimitError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for RateLimitError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "RateLimitError")?; - if let Some(inner_5) = &self.message { - write!(f, ": {}", inner_5)?; - } - Ok(()) - } -} -impl std::error::Error for RateLimitError {} -/// See [`RateLimitError`](crate::error::RateLimitError) -pub mod rate_limit_error { - /// A builder for [`RateLimitError`](crate::error::RateLimitError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`RateLimitError`](crate::error::RateLimitError) - pub fn build(self) -> crate::error::RateLimitError { - crate::error::RateLimitError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl RateLimitError { - /// Creates a new builder-style object to manufacture [`RateLimitError`](crate::error::RateLimitError) - pub fn builder() -> crate::error::rate_limit_error::Builder { - crate::error::rate_limit_error::Builder::default() - } -} - -/// An error caused by internal server problems. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct InternalError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl InternalError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for InternalError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("InternalError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl InternalError { - /// Returns `Some(ErrorKind)` if the error is retryable. Otherwise, returns `None`. - pub fn retryable_error_kind(&self) -> aws_smithy_types::retry::ErrorKind { - aws_smithy_types::retry::ErrorKind::ServerError - } - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for InternalError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "InternalError")?; - if let Some(inner_6) = &self.message { - write!(f, ": {}", inner_6)?; - } - Ok(()) - } -} -impl std::error::Error for InternalError {} -/// See [`InternalError`](crate::error::InternalError) -pub mod internal_error { - /// A builder for [`InternalError`](crate::error::InternalError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`InternalError`](crate::error::InternalError) - pub fn build(self) -> crate::error::InternalError { - crate::error::InternalError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl InternalError { - /// Creates a new builder-style object to manufacture [`InternalError`](crate::error::InternalError) - pub fn builder() -> crate::error::internal_error::Builder { - crate::error::internal_error::Builder::default() - } -} diff --git a/lib/smithy-output/api-party/rust/rust/src/error_meta.rs b/lib/smithy-output/api-party/rust/rust/src/error_meta.rs deleted file mode 100644 index a6dd3c792..000000000 --- a/lib/smithy-output/api-party/rust/rust/src/error_meta.rs +++ /dev/null @@ -1,666 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// All possible error types for this service. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum Error { - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An unhandled error occurred. - Unhandled(Box), -} -impl std::fmt::Display for Error { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Error::BadRequestError(inner) => inner.fmt(f), - Error::ForbiddenError(inner) => inner.fmt(f), - Error::InternalError(inner) => inner.fmt(f), - Error::NotFoundError(inner) => inner.fmt(f), - Error::RateLimitError(inner) => inner.fmt(f), - Error::UnauthorizedError(inner) => inner.fmt(f), - Error::Unhandled(inner) => inner.fmt(f), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::CreatePartyErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::CreatePartyErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::CreatePartyErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::CreatePartyErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::CreatePartyErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::CreatePartyErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::CreatePartyErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::CreatePartyInviteErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::CreatePartyInviteErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::CreatePartyInviteErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::CreatePartyInviteErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::CreatePartyInviteErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::CreatePartyInviteErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::CreatePartyInviteErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GetPartyFromInviteErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GetPartyFromInviteErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GetPartyFromInviteErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GetPartyFromInviteErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GetPartyFromInviteErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GetPartyFromInviteErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GetPartyFromInviteErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GetPartyProfileErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GetPartyProfileErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GetPartyProfileErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GetPartyProfileErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GetPartyProfileErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GetPartyProfileErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GetPartyProfileErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GetPartySelfProfileErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GetPartySelfProfileErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GetPartySelfProfileErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GetPartySelfProfileErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GetPartySelfProfileErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GetPartySelfProfileErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GetPartySelfProfileErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GetPartySelfSummaryErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GetPartySelfSummaryErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GetPartySelfSummaryErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GetPartySelfSummaryErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GetPartySelfSummaryErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GetPartySelfSummaryErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GetPartySelfSummaryErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GetPartySummaryErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GetPartySummaryErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GetPartySummaryErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GetPartySummaryErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GetPartySummaryErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GetPartySummaryErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GetPartySummaryErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::JoinPartyErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::JoinPartyErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::JoinPartyErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::JoinPartyErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::JoinPartyErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::JoinPartyErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::JoinPartyErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::KickMemberErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::KickMemberErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::KickMemberErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::KickMemberErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::KickMemberErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::KickMemberErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::KickMemberErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::LeavePartyErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::LeavePartyErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::LeavePartyErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::LeavePartyErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::LeavePartyErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::LeavePartyErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::LeavePartyErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::RevokePartyInviteErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::RevokePartyInviteErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::RevokePartyInviteErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::RevokePartyInviteErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::RevokePartyInviteErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::RevokePartyInviteErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::RevokePartyInviteErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::SendJoinRequestErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::SendJoinRequestErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::SendJoinRequestErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::SendJoinRequestErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::SendJoinRequestErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::SendJoinRequestErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::SendJoinRequestErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::SetPartyPublicityErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::SetPartyPublicityErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::SetPartyPublicityErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::SetPartyPublicityErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::SetPartyPublicityErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::SetPartyPublicityErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::SetPartyPublicityErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::TransferPartyOwnershipErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::TransferPartyOwnershipErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::TransferPartyOwnershipErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::TransferPartyOwnershipErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::TransferPartyOwnershipErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::TransferPartyOwnershipErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::TransferPartyOwnershipErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::FindMatchmakerLobbyForPartyErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::FindMatchmakerLobbyForPartyErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::FindMatchmakerLobbyForPartyErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::FindMatchmakerLobbyForPartyErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::FindMatchmakerLobbyForPartyErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::FindMatchmakerLobbyForPartyErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::FindMatchmakerLobbyForPartyErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::JoinMatchmakerLobbyForPartyErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::JoinMatchmakerLobbyForPartyErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::JoinMatchmakerLobbyForPartyErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::JoinMatchmakerLobbyForPartyErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::JoinMatchmakerLobbyForPartyErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::JoinMatchmakerLobbyForPartyErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::JoinMatchmakerLobbyForPartyErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::MatchmakerSelfReadyErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::MatchmakerSelfReadyErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::MatchmakerSelfReadyErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::MatchmakerSelfReadyErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::MatchmakerSelfReadyErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::MatchmakerSelfReadyErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::MatchmakerSelfReadyErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::SetPartyToIdleErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::SetPartyToIdleErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::SetPartyToIdleErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::SetPartyToIdleErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::SetPartyToIdleErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::SetPartyToIdleErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::SetPartyToIdleErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::SetSelfInactiveErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::SetSelfInactiveErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::SetSelfInactiveErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::SetSelfInactiveErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::SetSelfInactiveErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::SetSelfInactiveErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::SetSelfInactiveErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl std::error::Error for Error {} diff --git a/lib/smithy-output/api-party/rust/rust/src/http_serde.rs b/lib/smithy-output/api-party/rust/rust/src/http_serde.rs deleted file mode 100644 index 1af0c454b..000000000 --- a/lib/smithy-output/api-party/rust/rust/src/http_serde.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub fn add_headers_find_matchmaker_lobby_for_party( - input: &crate::input::FindMatchmakerLobbyForPartyInput, - mut builder: http::request::Builder, -) -> std::result::Result { - if let Some(inner_1) = &input.origin { - let formatted_2 = AsRef::::as_ref(inner_1); - if !formatted_2.is_empty() { - let header_value = formatted_2; - let header_value = - http::header::HeaderValue::try_from(&*header_value).map_err(|err| { - aws_smithy_http::operation::BuildError::InvalidField { - field: "origin", - details: format!( - "`{}` cannot be used as a header value: {}", - &header_value, err - ), - } - })?; - builder = builder.header("origin", header_value); - } - } - Ok(builder) -} diff --git a/lib/smithy-output/api-party/rust/rust/src/input.rs b/lib/smithy-output/api-party/rust/rust/src/input.rs deleted file mode 100644 index 53a18da0a..000000000 --- a/lib/smithy-output/api-party/rust/rust/src/input.rs +++ /dev/null @@ -1,2806 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -use std::fmt::Write; -/// See [`CreatePartyInput`](crate::input::CreatePartyInput) -pub mod create_party_input { - /// A builder for [`CreatePartyInput`](crate::input::CreatePartyInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) party_size: std::option::Option, - pub(crate) publicity: std::option::Option, - pub(crate) invites: - std::option::Option>, - pub(crate) matchmaker_current_player_token: std::option::Option, - } - impl Builder { - /// How many members can join the party. If using this party with the matchmaker, this number should be less than or equal to your party player limit. Super large parties may not be able to fit insite a lobby and be unable to join the game. - pub fn party_size(mut self, input: i32) -> Self { - self.party_size = Some(input); - self - } - /// How many members can join the party. If using this party with the matchmaker, this number should be less than or equal to your party player limit. Super large parties may not be able to fit insite a lobby and be unable to join the game. - pub fn set_party_size(mut self, input: std::option::Option) -> Self { - self.party_size = input; - self - } - /// Publicity configuration for creating a party. Null values will default - pub fn publicity(mut self, input: crate::model::CreatePartyPublicityConfig) -> Self { - self.publicity = Some(input); - self - } - /// Publicity configuration for creating a party. Null values will default - pub fn set_publicity( - mut self, - input: std::option::Option, - ) -> Self { - self.publicity = input; - self - } - /// Appends an item to `invites`. - /// - /// To override the contents of this collection use [`set_invites`](Self::set_invites). - /// - pub fn invites(mut self, input: crate::model::CreatePartyInviteConfig) -> Self { - let mut v = self.invites.unwrap_or_default(); - v.push(input); - self.invites = Some(v); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_invites( - mut self, - input: std::option::Option>, - ) -> Self { - self.invites = input; - self - } - /// If the player is currently in the lobby, pass the token from `rivet.matchmaker#MatchmakerLobbyJoinInfoPlayer$token`. This will prevent issuing a new player token and automatically set the party state to the player's current lobby. - pub fn matchmaker_current_player_token( - mut self, - input: impl Into, - ) -> Self { - self.matchmaker_current_player_token = Some(input.into()); - self - } - /// If the player is currently in the lobby, pass the token from `rivet.matchmaker#MatchmakerLobbyJoinInfoPlayer$token`. This will prevent issuing a new player token and automatically set the party state to the player's current lobby. - pub fn set_matchmaker_current_player_token( - mut self, - input: std::option::Option, - ) -> Self { - self.matchmaker_current_player_token = input; - self - } - /// Consumes the builder and constructs a [`CreatePartyInput`](crate::input::CreatePartyInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::CreatePartyInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::CreatePartyInput { - party_size: self.party_size, - publicity: self.publicity, - invites: self.invites, - matchmaker_current_player_token: self.matchmaker_current_player_token, - }) - } - } -} -#[doc(hidden)] -pub type CreatePartyInputOperationOutputAlias = crate::operation::CreateParty; -#[doc(hidden)] -pub type CreatePartyInputOperationRetryAlias = (); -impl CreatePartyInput { - /// Consumes the builder and constructs an Operation<[`CreateParty`](crate::operation::CreateParty)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::CreatePartyInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/parties").expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::CreatePartyInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_create_party(&self)?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::CreateParty::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "CreateParty", - "PartyService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`CreatePartyInput`](crate::input::CreatePartyInput) - pub fn builder() -> crate::input::create_party_input::Builder { - crate::input::create_party_input::Builder::default() - } -} - -/// See [`CreatePartyInviteInput`](crate::input::CreatePartyInviteInput) -pub mod create_party_invite_input { - /// A builder for [`CreatePartyInviteInput`](crate::input::CreatePartyInviteInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) alias: std::option::Option, - } - impl Builder { - /// An alias used to join a given party. - pub fn alias(mut self, input: impl Into) -> Self { - self.alias = Some(input.into()); - self - } - /// An alias used to join a given party. - pub fn set_alias(mut self, input: std::option::Option) -> Self { - self.alias = input; - self - } - /// Consumes the builder and constructs a [`CreatePartyInviteInput`](crate::input::CreatePartyInviteInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::CreatePartyInviteInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::CreatePartyInviteInput { alias: self.alias }) - } - } -} -#[doc(hidden)] -pub type CreatePartyInviteInputOperationOutputAlias = crate::operation::CreatePartyInvite; -#[doc(hidden)] -pub type CreatePartyInviteInputOperationRetryAlias = (); -impl CreatePartyInviteInput { - /// Consumes the builder and constructs an Operation<[`CreatePartyInvite`](crate::operation::CreatePartyInvite)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::CreatePartyInviteInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/parties/self/invites").expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::CreatePartyInviteInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_create_party_invite(&self)?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::CreatePartyInvite::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "CreatePartyInvite", - "PartyService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`CreatePartyInviteInput`](crate::input::CreatePartyInviteInput) - pub fn builder() -> crate::input::create_party_invite_input::Builder { - crate::input::create_party_invite_input::Builder::default() - } -} - -/// See [`GetPartyFromInviteInput`](crate::input::GetPartyFromInviteInput) -pub mod get_party_from_invite_input { - /// A builder for [`GetPartyFromInviteInput`](crate::input::GetPartyFromInviteInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) token: std::option::Option, - pub(crate) alias: std::option::Option, - } - impl Builder { - /// See `rivet.api.party#CreatedInvite$token`. - pub fn token(mut self, input: impl Into) -> Self { - self.token = Some(input.into()); - self - } - /// See `rivet.api.party#CreatedInvite$token`. - pub fn set_token(mut self, input: std::option::Option) -> Self { - self.token = input; - self - } - /// An alias used to join a given party. This alias must be unique for all invites for your game. Pass this alias to `rivet.api.party.common#CreatedInvite$alias` to consume the invite. - pub fn alias(mut self, input: impl Into) -> Self { - self.alias = Some(input.into()); - self - } - /// An alias used to join a given party. This alias must be unique for all invites for your game. Pass this alias to `rivet.api.party.common#CreatedInvite$alias` to consume the invite. - pub fn set_alias(mut self, input: std::option::Option) -> Self { - self.alias = input; - self - } - /// Consumes the builder and constructs a [`GetPartyFromInviteInput`](crate::input::GetPartyFromInviteInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::GetPartyFromInviteInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::GetPartyFromInviteInput { - token: self.token, - alias: self.alias, - }) - } - } -} -#[doc(hidden)] -pub type GetPartyFromInviteInputOperationOutputAlias = crate::operation::GetPartyFromInvite; -#[doc(hidden)] -pub type GetPartyFromInviteInputOperationRetryAlias = (); -impl GetPartyFromInviteInput { - /// Consumes the builder and constructs an Operation<[`GetPartyFromInvite`](crate::operation::GetPartyFromInvite)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GetPartyFromInviteInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/invites").expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::GetPartyFromInviteInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_1) = &_input.token { - query.push_kv("token", &aws_smithy_http::query::fmt_string(&inner_1)); - } - if let Some(inner_2) = &_input.alias { - query.push_kv("alias", &aws_smithy_http::query::fmt_string(&inner_2)); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GetPartyFromInviteInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::GetPartyFromInvite::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GetPartyFromInvite", - "PartyService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GetPartyFromInviteInput`](crate::input::GetPartyFromInviteInput) - pub fn builder() -> crate::input::get_party_from_invite_input::Builder { - crate::input::get_party_from_invite_input::Builder::default() - } -} - -/// See [`GetPartyProfileInput`](crate::input::GetPartyProfileInput) -pub mod get_party_profile_input { - /// A builder for [`GetPartyProfileInput`](crate::input::GetPartyProfileInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) party_id: std::option::Option, - pub(crate) watch_index: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn party_id(mut self, input: impl Into) -> Self { - self.party_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_party_id(mut self, input: std::option::Option) -> Self { - self.party_id = input; - self - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.watch_index = Some(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.watch_index = input; - self - } - /// Consumes the builder and constructs a [`GetPartyProfileInput`](crate::input::GetPartyProfileInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::GetPartyProfileInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::GetPartyProfileInput { - party_id: self.party_id, - watch_index: self.watch_index, - }) - } - } -} -#[doc(hidden)] -pub type GetPartyProfileInputOperationOutputAlias = crate::operation::GetPartyProfile; -#[doc(hidden)] -pub type GetPartyProfileInputOperationRetryAlias = (); -impl GetPartyProfileInput { - /// Consumes the builder and constructs an Operation<[`GetPartyProfile`](crate::operation::GetPartyProfile)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GetPartyProfileInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_3 = &_input.party_id; - let input_3 = input_3.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "party_id", - details: "cannot be empty or unset", - }, - )?; - let party_id = aws_smithy_http::label::fmt_string(input_3, false); - if party_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "party_id", - details: "cannot be empty or unset", - }); - } - write!(output, "/parties/{party_id}/profile", party_id = party_id) - .expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::GetPartyProfileInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_4) = &_input.watch_index { - query.push_kv("watch_index", &aws_smithy_http::query::fmt_string(&inner_4)); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GetPartyProfileInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::GetPartyProfile::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GetPartyProfile", - "PartyService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GetPartyProfileInput`](crate::input::GetPartyProfileInput) - pub fn builder() -> crate::input::get_party_profile_input::Builder { - crate::input::get_party_profile_input::Builder::default() - } -} - -/// See [`GetPartySelfProfileInput`](crate::input::GetPartySelfProfileInput) -pub mod get_party_self_profile_input { - /// A builder for [`GetPartySelfProfileInput`](crate::input::GetPartySelfProfileInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) watch_index: std::option::Option, - } - impl Builder { - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.watch_index = Some(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.watch_index = input; - self - } - /// Consumes the builder and constructs a [`GetPartySelfProfileInput`](crate::input::GetPartySelfProfileInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::GetPartySelfProfileInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::GetPartySelfProfileInput { - watch_index: self.watch_index, - }) - } - } -} -#[doc(hidden)] -pub type GetPartySelfProfileInputOperationOutputAlias = crate::operation::GetPartySelfProfile; -#[doc(hidden)] -pub type GetPartySelfProfileInputOperationRetryAlias = (); -impl GetPartySelfProfileInput { - /// Consumes the builder and constructs an Operation<[`GetPartySelfProfile`](crate::operation::GetPartySelfProfile)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GetPartySelfProfileInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/parties/self/profile").expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::GetPartySelfProfileInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_5) = &_input.watch_index { - query.push_kv("watch_index", &aws_smithy_http::query::fmt_string(&inner_5)); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GetPartySelfProfileInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::GetPartySelfProfile::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GetPartySelfProfile", - "PartyService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GetPartySelfProfileInput`](crate::input::GetPartySelfProfileInput) - pub fn builder() -> crate::input::get_party_self_profile_input::Builder { - crate::input::get_party_self_profile_input::Builder::default() - } -} - -/// See [`GetPartySelfSummaryInput`](crate::input::GetPartySelfSummaryInput) -pub mod get_party_self_summary_input { - /// A builder for [`GetPartySelfSummaryInput`](crate::input::GetPartySelfSummaryInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) watch_index: std::option::Option, - } - impl Builder { - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.watch_index = Some(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.watch_index = input; - self - } - /// Consumes the builder and constructs a [`GetPartySelfSummaryInput`](crate::input::GetPartySelfSummaryInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::GetPartySelfSummaryInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::GetPartySelfSummaryInput { - watch_index: self.watch_index, - }) - } - } -} -#[doc(hidden)] -pub type GetPartySelfSummaryInputOperationOutputAlias = crate::operation::GetPartySelfSummary; -#[doc(hidden)] -pub type GetPartySelfSummaryInputOperationRetryAlias = (); -impl GetPartySelfSummaryInput { - /// Consumes the builder and constructs an Operation<[`GetPartySelfSummary`](crate::operation::GetPartySelfSummary)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GetPartySelfSummaryInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/parties/self/summary").expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::GetPartySelfSummaryInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_6) = &_input.watch_index { - query.push_kv("watch_index", &aws_smithy_http::query::fmt_string(&inner_6)); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GetPartySelfSummaryInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::GetPartySelfSummary::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GetPartySelfSummary", - "PartyService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GetPartySelfSummaryInput`](crate::input::GetPartySelfSummaryInput) - pub fn builder() -> crate::input::get_party_self_summary_input::Builder { - crate::input::get_party_self_summary_input::Builder::default() - } -} - -/// See [`GetPartySummaryInput`](crate::input::GetPartySummaryInput) -pub mod get_party_summary_input { - /// A builder for [`GetPartySummaryInput`](crate::input::GetPartySummaryInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) party_id: std::option::Option, - pub(crate) watch_index: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn party_id(mut self, input: impl Into) -> Self { - self.party_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_party_id(mut self, input: std::option::Option) -> Self { - self.party_id = input; - self - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.watch_index = Some(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.watch_index = input; - self - } - /// Consumes the builder and constructs a [`GetPartySummaryInput`](crate::input::GetPartySummaryInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::GetPartySummaryInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::GetPartySummaryInput { - party_id: self.party_id, - watch_index: self.watch_index, - }) - } - } -} -#[doc(hidden)] -pub type GetPartySummaryInputOperationOutputAlias = crate::operation::GetPartySummary; -#[doc(hidden)] -pub type GetPartySummaryInputOperationRetryAlias = (); -impl GetPartySummaryInput { - /// Consumes the builder and constructs an Operation<[`GetPartySummary`](crate::operation::GetPartySummary)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GetPartySummaryInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_7 = &_input.party_id; - let input_7 = input_7.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "party_id", - details: "cannot be empty or unset", - }, - )?; - let party_id = aws_smithy_http::label::fmt_string(input_7, false); - if party_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "party_id", - details: "cannot be empty or unset", - }); - } - write!(output, "/parties/{party_id}/summary", party_id = party_id) - .expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::GetPartySummaryInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_8) = &_input.watch_index { - query.push_kv("watch_index", &aws_smithy_http::query::fmt_string(&inner_8)); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GetPartySummaryInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::GetPartySummary::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GetPartySummary", - "PartyService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GetPartySummaryInput`](crate::input::GetPartySummaryInput) - pub fn builder() -> crate::input::get_party_summary_input::Builder { - crate::input::get_party_summary_input::Builder::default() - } -} - -/// See [`JoinPartyInput`](crate::input::JoinPartyInput) -pub mod join_party_input { - /// A builder for [`JoinPartyInput`](crate::input::JoinPartyInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) invite: std::option::Option, - pub(crate) matchmaker_auto_join_lobby: std::option::Option, - pub(crate) matchmaker_current_player_token: std::option::Option, - } - impl Builder { - /// Represents methods of joining a party. - pub fn invite(mut self, input: crate::model::JoinPartyInvite) -> Self { - self.invite = Some(input); - self - } - /// Represents methods of joining a party. - pub fn set_invite( - mut self, - input: std::option::Option, - ) -> Self { - self.invite = input; - self - } - /// Whether or not to automatically join the game lobby if a party is currently in game. - pub fn matchmaker_auto_join_lobby(mut self, input: bool) -> Self { - self.matchmaker_auto_join_lobby = Some(input); - self - } - /// Whether or not to automatically join the game lobby if a party is currently in game. - pub fn set_matchmaker_auto_join_lobby(mut self, input: std::option::Option) -> Self { - self.matchmaker_auto_join_lobby = input; - self - } - /// If the player is currently in the lobby, pass the token from `rivet.matchmaker#MatchmakerLobbyJoinInfoPlayer$token`. This will prevent issuing a new player token. - pub fn matchmaker_current_player_token( - mut self, - input: impl Into, - ) -> Self { - self.matchmaker_current_player_token = Some(input.into()); - self - } - /// If the player is currently in the lobby, pass the token from `rivet.matchmaker#MatchmakerLobbyJoinInfoPlayer$token`. This will prevent issuing a new player token. - pub fn set_matchmaker_current_player_token( - mut self, - input: std::option::Option, - ) -> Self { - self.matchmaker_current_player_token = input; - self - } - /// Consumes the builder and constructs a [`JoinPartyInput`](crate::input::JoinPartyInput) - pub fn build( - self, - ) -> std::result::Result - { - Ok(crate::input::JoinPartyInput { - invite: self.invite, - matchmaker_auto_join_lobby: self.matchmaker_auto_join_lobby, - matchmaker_current_player_token: self.matchmaker_current_player_token, - }) - } - } -} -#[doc(hidden)] -pub type JoinPartyInputOperationOutputAlias = crate::operation::JoinParty; -#[doc(hidden)] -pub type JoinPartyInputOperationRetryAlias = (); -impl JoinPartyInput { - /// Consumes the builder and constructs an Operation<[`JoinParty`](crate::operation::JoinParty)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::JoinPartyInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/parties/join").expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::JoinPartyInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_join_party(&self)?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = - aws_smithy_http::operation::Operation::new(request, crate::operation::JoinParty::new()) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "JoinParty", - "PartyService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`JoinPartyInput`](crate::input::JoinPartyInput) - pub fn builder() -> crate::input::join_party_input::Builder { - crate::input::join_party_input::Builder::default() - } -} - -/// See [`KickMemberInput`](crate::input::KickMemberInput) -pub mod kick_member_input { - /// A builder for [`KickMemberInput`](crate::input::KickMemberInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.identity_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.identity_id = input; - self - } - /// Consumes the builder and constructs a [`KickMemberInput`](crate::input::KickMemberInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::KickMemberInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::KickMemberInput { - identity_id: self.identity_id, - }) - } - } -} -#[doc(hidden)] -pub type KickMemberInputOperationOutputAlias = crate::operation::KickMember; -#[doc(hidden)] -pub type KickMemberInputOperationRetryAlias = (); -impl KickMemberInput { - /// Consumes the builder and constructs an Operation<[`KickMember`](crate::operation::KickMember)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::KickMemberInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_9 = &_input.identity_id; - let input_9 = input_9.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "identity_id", - details: "cannot be empty or unset", - }, - )?; - let identity_id = aws_smithy_http::label::fmt_string(input_9, false); - if identity_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "identity_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/parties/self/members/{identity_id}/kick", - identity_id = identity_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::KickMemberInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from("{}"); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::KickMember::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "KickMember", - "PartyService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`KickMemberInput`](crate::input::KickMemberInput) - pub fn builder() -> crate::input::kick_member_input::Builder { - crate::input::kick_member_input::Builder::default() - } -} - -/// See [`LeavePartyInput`](crate::input::LeavePartyInput) -pub mod leave_party_input { - /// A builder for [`LeavePartyInput`](crate::input::LeavePartyInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`LeavePartyInput`](crate::input::LeavePartyInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::LeavePartyInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::LeavePartyInput {}) - } - } -} -#[doc(hidden)] -pub type LeavePartyInputOperationOutputAlias = crate::operation::LeaveParty; -#[doc(hidden)] -pub type LeavePartyInputOperationRetryAlias = (); -impl LeavePartyInput { - /// Consumes the builder and constructs an Operation<[`LeaveParty`](crate::operation::LeaveParty)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::LeavePartyInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/parties/self/leave").expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::LeavePartyInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from("{}"); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::LeaveParty::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "LeaveParty", - "PartyService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`LeavePartyInput`](crate::input::LeavePartyInput) - pub fn builder() -> crate::input::leave_party_input::Builder { - crate::input::leave_party_input::Builder::default() - } -} - -/// See [`RevokePartyInviteInput`](crate::input::RevokePartyInviteInput) -pub mod revoke_party_invite_input { - /// A builder for [`RevokePartyInviteInput`](crate::input::RevokePartyInviteInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) invite_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn invite_id(mut self, input: impl Into) -> Self { - self.invite_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_invite_id(mut self, input: std::option::Option) -> Self { - self.invite_id = input; - self - } - /// Consumes the builder and constructs a [`RevokePartyInviteInput`](crate::input::RevokePartyInviteInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::RevokePartyInviteInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::RevokePartyInviteInput { - invite_id: self.invite_id, - }) - } - } -} -#[doc(hidden)] -pub type RevokePartyInviteInputOperationOutputAlias = crate::operation::RevokePartyInvite; -#[doc(hidden)] -pub type RevokePartyInviteInputOperationRetryAlias = (); -impl RevokePartyInviteInput { - /// Consumes the builder and constructs an Operation<[`RevokePartyInvite`](crate::operation::RevokePartyInvite)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::RevokePartyInviteInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_10 = &_input.invite_id; - let input_10 = input_10.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "invite_id", - details: "cannot be empty or unset", - }, - )?; - let invite_id = aws_smithy_http::label::fmt_string(input_10, false); - if invite_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "invite_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/parties/self/invites/{invite_id}", - invite_id = invite_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::RevokePartyInviteInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("DELETE").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::RevokePartyInvite::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "RevokePartyInvite", - "PartyService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`RevokePartyInviteInput`](crate::input::RevokePartyInviteInput) - pub fn builder() -> crate::input::revoke_party_invite_input::Builder { - crate::input::revoke_party_invite_input::Builder::default() - } -} - -/// See [`SendJoinRequestInput`](crate::input::SendJoinRequestInput) -pub mod send_join_request_input { - /// A builder for [`SendJoinRequestInput`](crate::input::SendJoinRequestInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) party_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn party_id(mut self, input: impl Into) -> Self { - self.party_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_party_id(mut self, input: std::option::Option) -> Self { - self.party_id = input; - self - } - /// Consumes the builder and constructs a [`SendJoinRequestInput`](crate::input::SendJoinRequestInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::SendJoinRequestInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::SendJoinRequestInput { - party_id: self.party_id, - }) - } - } -} -#[doc(hidden)] -pub type SendJoinRequestInputOperationOutputAlias = crate::operation::SendJoinRequest; -#[doc(hidden)] -pub type SendJoinRequestInputOperationRetryAlias = (); -impl SendJoinRequestInput { - /// Consumes the builder and constructs an Operation<[`SendJoinRequest`](crate::operation::SendJoinRequest)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::SendJoinRequestInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_11 = &_input.party_id; - let input_11 = input_11.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "party_id", - details: "cannot be empty or unset", - }, - )?; - let party_id = aws_smithy_http::label::fmt_string(input_11, false); - if party_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "party_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/parties/{party_id}/join-request/send", - party_id = party_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::SendJoinRequestInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from("{}"); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::SendJoinRequest::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "SendJoinRequest", - "PartyService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`SendJoinRequestInput`](crate::input::SendJoinRequestInput) - pub fn builder() -> crate::input::send_join_request_input::Builder { - crate::input::send_join_request_input::Builder::default() - } -} - -/// See [`SetPartyPublicityInput`](crate::input::SetPartyPublicityInput) -pub mod set_party_publicity_input { - /// A builder for [`SetPartyPublicityInput`](crate::input::SetPartyPublicityInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) public: std::option::Option, - pub(crate) mutual_followers: std::option::Option, - pub(crate) groups: std::option::Option, - } - impl Builder { - /// Defaults to `rivet.party#PartyPublicityLevel$VIEW`. - pub fn public(mut self, input: crate::model::PartyPublicityLevel) -> Self { - self.public = Some(input); - self - } - /// Defaults to `rivet.party#PartyPublicityLevel$VIEW`. - pub fn set_public( - mut self, - input: std::option::Option, - ) -> Self { - self.public = input; - self - } - /// Defaults to `rivet.party#PartyPublicityLevel$JOIN`. - pub fn mutual_followers(mut self, input: crate::model::PartyPublicityLevel) -> Self { - self.mutual_followers = Some(input); - self - } - /// Defaults to `rivet.party#PartyPublicityLevel$JOIN`. - pub fn set_mutual_followers( - mut self, - input: std::option::Option, - ) -> Self { - self.mutual_followers = input; - self - } - /// Defaults to `rivet.party#PartyPublicityLevel$VIEW`. - pub fn groups(mut self, input: crate::model::PartyPublicityLevel) -> Self { - self.groups = Some(input); - self - } - /// Defaults to `rivet.party#PartyPublicityLevel$VIEW`. - pub fn set_groups( - mut self, - input: std::option::Option, - ) -> Self { - self.groups = input; - self - } - /// Consumes the builder and constructs a [`SetPartyPublicityInput`](crate::input::SetPartyPublicityInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::SetPartyPublicityInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::SetPartyPublicityInput { - public: self.public, - mutual_followers: self.mutual_followers, - groups: self.groups, - }) - } - } -} -#[doc(hidden)] -pub type SetPartyPublicityInputOperationOutputAlias = crate::operation::SetPartyPublicity; -#[doc(hidden)] -pub type SetPartyPublicityInputOperationRetryAlias = (); -impl SetPartyPublicityInput { - /// Consumes the builder and constructs an Operation<[`SetPartyPublicity`](crate::operation::SetPartyPublicity)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::SetPartyPublicityInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/parties/self/publicity").expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::SetPartyPublicityInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("PUT").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_set_party_publicity(&self)?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::SetPartyPublicity::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "SetPartyPublicity", - "PartyService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`SetPartyPublicityInput`](crate::input::SetPartyPublicityInput) - pub fn builder() -> crate::input::set_party_publicity_input::Builder { - crate::input::set_party_publicity_input::Builder::default() - } -} - -/// See [`TransferPartyOwnershipInput`](crate::input::TransferPartyOwnershipInput) -pub mod transfer_party_ownership_input { - /// A builder for [`TransferPartyOwnershipInput`](crate::input::TransferPartyOwnershipInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.identity_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.identity_id = input; - self - } - /// Consumes the builder and constructs a [`TransferPartyOwnershipInput`](crate::input::TransferPartyOwnershipInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::TransferPartyOwnershipInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::TransferPartyOwnershipInput { - identity_id: self.identity_id, - }) - } - } -} -#[doc(hidden)] -pub type TransferPartyOwnershipInputOperationOutputAlias = crate::operation::TransferPartyOwnership; -#[doc(hidden)] -pub type TransferPartyOwnershipInputOperationRetryAlias = (); -impl TransferPartyOwnershipInput { - /// Consumes the builder and constructs an Operation<[`TransferPartyOwnership`](crate::operation::TransferPartyOwnership)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::TransferPartyOwnershipInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_12 = &_input.identity_id; - let input_12 = input_12.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "identity_id", - details: "cannot be empty or unset", - }, - )?; - let identity_id = aws_smithy_http::label::fmt_string(input_12, false); - if identity_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "identity_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/parties/self/members/{identity_id}/transfer-ownership", - identity_id = identity_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::TransferPartyOwnershipInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from("{}"); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::TransferPartyOwnership::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "TransferPartyOwnership", - "PartyService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`TransferPartyOwnershipInput`](crate::input::TransferPartyOwnershipInput) - pub fn builder() -> crate::input::transfer_party_ownership_input::Builder { - crate::input::transfer_party_ownership_input::Builder::default() - } -} - -/// See [`FindMatchmakerLobbyForPartyInput`](crate::input::FindMatchmakerLobbyForPartyInput) -pub mod find_matchmaker_lobby_for_party_input { - /// A builder for [`FindMatchmakerLobbyForPartyInput`](crate::input::FindMatchmakerLobbyForPartyInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_modes: std::option::Option>, - pub(crate) regions: std::option::Option>, - pub(crate) prevent_auto_create_lobby: std::option::Option, - pub(crate) captcha: std::option::Option, - pub(crate) origin: std::option::Option, - } - impl Builder { - /// Appends an item to `game_modes`. - /// - /// To override the contents of this collection use [`set_game_modes`](Self::set_game_modes). - /// - /// Game modes to match lobbies against. - pub fn game_modes(mut self, input: impl Into) -> Self { - let mut v = self.game_modes.unwrap_or_default(); - v.push(input.into()); - self.game_modes = Some(v); - self - } - /// Game modes to match lobbies against. - pub fn set_game_modes( - mut self, - input: std::option::Option>, - ) -> Self { - self.game_modes = input; - self - } - /// Appends an item to `regions`. - /// - /// To override the contents of this collection use [`set_regions`](Self::set_regions). - /// - /// Regions to match lobbies against. If not specified, the optimal region will be determined and will attempt to find lobbies in that region. - pub fn regions(mut self, input: impl Into) -> Self { - let mut v = self.regions.unwrap_or_default(); - v.push(input.into()); - self.regions = Some(v); - self - } - /// Regions to match lobbies against. If not specified, the optimal region will be determined and will attempt to find lobbies in that region. - pub fn set_regions( - mut self, - input: std::option::Option>, - ) -> Self { - self.regions = input; - self - } - /// Prevents a new lobby from being created when finding a lobby. If no lobby is found, `MATCHMAKER_LOBBY_NOT_FOUND` will be returned. - pub fn prevent_auto_create_lobby(mut self, input: bool) -> Self { - self.prevent_auto_create_lobby = Some(input); - self - } - /// Prevents a new lobby from being created when finding a lobby. If no lobby is found, `MATCHMAKER_LOBBY_NOT_FOUND` will be returned. - pub fn set_prevent_auto_create_lobby(mut self, input: std::option::Option) -> Self { - self.prevent_auto_create_lobby = input; - self - } - /// Methods to verify a captcha. - pub fn captcha(mut self, input: crate::model::CaptchaConfig) -> Self { - self.captcha = Some(input); - self - } - /// Methods to verify a captcha. - pub fn set_captcha( - mut self, - input: std::option::Option, - ) -> Self { - self.captcha = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn origin(mut self, input: impl Into) -> Self { - self.origin = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_origin(mut self, input: std::option::Option) -> Self { - self.origin = input; - self - } - /// Consumes the builder and constructs a [`FindMatchmakerLobbyForPartyInput`](crate::input::FindMatchmakerLobbyForPartyInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::FindMatchmakerLobbyForPartyInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::FindMatchmakerLobbyForPartyInput { - game_modes: self.game_modes, - regions: self.regions, - prevent_auto_create_lobby: self.prevent_auto_create_lobby, - captcha: self.captcha, - origin: self.origin, - }) - } - } -} -#[doc(hidden)] -pub type FindMatchmakerLobbyForPartyInputOperationOutputAlias = - crate::operation::FindMatchmakerLobbyForParty; -#[doc(hidden)] -pub type FindMatchmakerLobbyForPartyInputOperationRetryAlias = (); -impl FindMatchmakerLobbyForPartyInput { - /// Consumes the builder and constructs an Operation<[`FindMatchmakerLobbyForParty`](crate::operation::FindMatchmakerLobbyForParty)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::FindMatchmakerLobbyForPartyInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/parties/self/activity/matchmaker/lobbies/find") - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::FindMatchmakerLobbyForPartyInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - let builder = - crate::http_serde::add_headers_find_matchmaker_lobby_for_party(input, builder)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)]let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_find_matchmaker_lobby_for_party(&self)? - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::FindMatchmakerLobbyForParty::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "FindMatchmakerLobbyForParty", - "PartyService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`FindMatchmakerLobbyForPartyInput`](crate::input::FindMatchmakerLobbyForPartyInput) - pub fn builder() -> crate::input::find_matchmaker_lobby_for_party_input::Builder { - crate::input::find_matchmaker_lobby_for_party_input::Builder::default() - } -} - -/// See [`JoinMatchmakerLobbyForPartyInput`](crate::input::JoinMatchmakerLobbyForPartyInput) -pub mod join_matchmaker_lobby_for_party_input { - /// A builder for [`JoinMatchmakerLobbyForPartyInput`](crate::input::JoinMatchmakerLobbyForPartyInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) lobby_id: std::option::Option, - pub(crate) captcha: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn lobby_id(mut self, input: impl Into) -> Self { - self.lobby_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_lobby_id(mut self, input: std::option::Option) -> Self { - self.lobby_id = input; - self - } - /// Methods to verify a captcha. - pub fn captcha(mut self, input: crate::model::CaptchaConfig) -> Self { - self.captcha = Some(input); - self - } - /// Methods to verify a captcha. - pub fn set_captcha( - mut self, - input: std::option::Option, - ) -> Self { - self.captcha = input; - self - } - /// Consumes the builder and constructs a [`JoinMatchmakerLobbyForPartyInput`](crate::input::JoinMatchmakerLobbyForPartyInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::JoinMatchmakerLobbyForPartyInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::JoinMatchmakerLobbyForPartyInput { - lobby_id: self.lobby_id, - captcha: self.captcha, - }) - } - } -} -#[doc(hidden)] -pub type JoinMatchmakerLobbyForPartyInputOperationOutputAlias = - crate::operation::JoinMatchmakerLobbyForParty; -#[doc(hidden)] -pub type JoinMatchmakerLobbyForPartyInputOperationRetryAlias = (); -impl JoinMatchmakerLobbyForPartyInput { - /// Consumes the builder and constructs an Operation<[`JoinMatchmakerLobbyForParty`](crate::operation::JoinMatchmakerLobbyForParty)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::JoinMatchmakerLobbyForPartyInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/parties/self/activity/matchmaker/lobbies/join") - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::JoinMatchmakerLobbyForPartyInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)]let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_join_matchmaker_lobby_for_party(&self)? - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::JoinMatchmakerLobbyForParty::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "JoinMatchmakerLobbyForParty", - "PartyService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`JoinMatchmakerLobbyForPartyInput`](crate::input::JoinMatchmakerLobbyForPartyInput) - pub fn builder() -> crate::input::join_matchmaker_lobby_for_party_input::Builder { - crate::input::join_matchmaker_lobby_for_party_input::Builder::default() - } -} - -/// See [`MatchmakerSelfReadyInput`](crate::input::MatchmakerSelfReadyInput) -pub mod matchmaker_self_ready_input { - /// A builder for [`MatchmakerSelfReadyInput`](crate::input::MatchmakerSelfReadyInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`MatchmakerSelfReadyInput`](crate::input::MatchmakerSelfReadyInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::MatchmakerSelfReadyInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::MatchmakerSelfReadyInput {}) - } - } -} -#[doc(hidden)] -pub type MatchmakerSelfReadyInputOperationOutputAlias = crate::operation::MatchmakerSelfReady; -#[doc(hidden)] -pub type MatchmakerSelfReadyInputOperationRetryAlias = (); -impl MatchmakerSelfReadyInput { - /// Consumes the builder and constructs an Operation<[`MatchmakerSelfReady`](crate::operation::MatchmakerSelfReady)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::MatchmakerSelfReadyInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/parties/self/members/self/matchmaker/ready") - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::MatchmakerSelfReadyInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from("{}"); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::MatchmakerSelfReady::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "MatchmakerSelfReady", - "PartyService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`MatchmakerSelfReadyInput`](crate::input::MatchmakerSelfReadyInput) - pub fn builder() -> crate::input::matchmaker_self_ready_input::Builder { - crate::input::matchmaker_self_ready_input::Builder::default() - } -} - -/// See [`SetPartyToIdleInput`](crate::input::SetPartyToIdleInput) -pub mod set_party_to_idle_input { - /// A builder for [`SetPartyToIdleInput`](crate::input::SetPartyToIdleInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`SetPartyToIdleInput`](crate::input::SetPartyToIdleInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::SetPartyToIdleInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::SetPartyToIdleInput {}) - } - } -} -#[doc(hidden)] -pub type SetPartyToIdleInputOperationOutputAlias = crate::operation::SetPartyToIdle; -#[doc(hidden)] -pub type SetPartyToIdleInputOperationRetryAlias = (); -impl SetPartyToIdleInput { - /// Consumes the builder and constructs an Operation<[`SetPartyToIdle`](crate::operation::SetPartyToIdle)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::SetPartyToIdleInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/parties/self/activity").expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::SetPartyToIdleInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("DELETE").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::SetPartyToIdle::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "SetPartyToIdle", - "PartyService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`SetPartyToIdleInput`](crate::input::SetPartyToIdleInput) - pub fn builder() -> crate::input::set_party_to_idle_input::Builder { - crate::input::set_party_to_idle_input::Builder::default() - } -} - -/// See [`SetSelfInactiveInput`](crate::input::SetSelfInactiveInput) -pub mod set_self_inactive_input { - /// A builder for [`SetSelfInactiveInput`](crate::input::SetSelfInactiveInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`SetSelfInactiveInput`](crate::input::SetSelfInactiveInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::SetSelfInactiveInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::SetSelfInactiveInput {}) - } - } -} -#[doc(hidden)] -pub type SetSelfInactiveInputOperationOutputAlias = crate::operation::SetSelfInactive; -#[doc(hidden)] -pub type SetSelfInactiveInputOperationRetryAlias = (); -impl SetSelfInactiveInput { - /// Consumes the builder and constructs an Operation<[`SetSelfInactive`](crate::operation::SetSelfInactive)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::SetSelfInactiveInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/parties/self/members/self/inactive") - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::SetSelfInactiveInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("DELETE").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::SetSelfInactive::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "SetSelfInactive", - "PartyService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`SetSelfInactiveInput`](crate::input::SetSelfInactiveInput) - pub fn builder() -> crate::input::set_self_inactive_input::Builder { - crate::input::set_self_inactive_input::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct MatchmakerSelfReadyInput {} -impl std::fmt::Debug for MatchmakerSelfReadyInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("MatchmakerSelfReadyInput"); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct FindMatchmakerLobbyForPartyInput { - /// Game modes to match lobbies against. - pub game_modes: std::option::Option>, - /// Regions to match lobbies against. If not specified, the optimal region will be determined and will attempt to find lobbies in that region. - pub regions: std::option::Option>, - /// Prevents a new lobby from being created when finding a lobby. If no lobby is found, `MATCHMAKER_LOBBY_NOT_FOUND` will be returned. - pub prevent_auto_create_lobby: std::option::Option, - /// Methods to verify a captcha. - pub captcha: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub origin: std::option::Option, -} -impl FindMatchmakerLobbyForPartyInput { - /// Game modes to match lobbies against. - pub fn game_modes(&self) -> std::option::Option<&[std::string::String]> { - self.game_modes.as_deref() - } - /// Regions to match lobbies against. If not specified, the optimal region will be determined and will attempt to find lobbies in that region. - pub fn regions(&self) -> std::option::Option<&[std::string::String]> { - self.regions.as_deref() - } - /// Prevents a new lobby from being created when finding a lobby. If no lobby is found, `MATCHMAKER_LOBBY_NOT_FOUND` will be returned. - pub fn prevent_auto_create_lobby(&self) -> std::option::Option { - self.prevent_auto_create_lobby - } - /// Methods to verify a captcha. - pub fn captcha(&self) -> std::option::Option<&crate::model::CaptchaConfig> { - self.captcha.as_ref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn origin(&self) -> std::option::Option<&str> { - self.origin.as_deref() - } -} -impl std::fmt::Debug for FindMatchmakerLobbyForPartyInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("FindMatchmakerLobbyForPartyInput"); - formatter.field("game_modes", &self.game_modes); - formatter.field("regions", &self.regions); - formatter.field("prevent_auto_create_lobby", &self.prevent_auto_create_lobby); - formatter.field("captcha", &self.captcha); - formatter.field("origin", &self.origin); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct JoinMatchmakerLobbyForPartyInput { - /// A universally unique identifier. - pub lobby_id: std::option::Option, - /// Methods to verify a captcha. - pub captcha: std::option::Option, -} -impl JoinMatchmakerLobbyForPartyInput { - /// A universally unique identifier. - pub fn lobby_id(&self) -> std::option::Option<&str> { - self.lobby_id.as_deref() - } - /// Methods to verify a captcha. - pub fn captcha(&self) -> std::option::Option<&crate::model::CaptchaConfig> { - self.captcha.as_ref() - } -} -impl std::fmt::Debug for JoinMatchmakerLobbyForPartyInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("JoinMatchmakerLobbyForPartyInput"); - formatter.field("lobby_id", &self.lobby_id); - formatter.field("captcha", &self.captcha); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct SetSelfInactiveInput {} -impl std::fmt::Debug for SetSelfInactiveInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("SetSelfInactiveInput"); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct SetPartyToIdleInput {} -impl std::fmt::Debug for SetPartyToIdleInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("SetPartyToIdleInput"); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct SendJoinRequestInput { - /// A universally unique identifier. - pub party_id: std::option::Option, -} -impl SendJoinRequestInput { - /// A universally unique identifier. - pub fn party_id(&self) -> std::option::Option<&str> { - self.party_id.as_deref() - } -} -impl std::fmt::Debug for SendJoinRequestInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("SendJoinRequestInput"); - formatter.field("party_id", &self.party_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetPartyFromInviteInput { - /// See `rivet.api.party#CreatedInvite$token`. - pub token: std::option::Option, - /// An alias used to join a given party. This alias must be unique for all invites for your game. Pass this alias to `rivet.api.party.common#CreatedInvite$alias` to consume the invite. - pub alias: std::option::Option, -} -impl GetPartyFromInviteInput { - /// See `rivet.api.party#CreatedInvite$token`. - pub fn token(&self) -> std::option::Option<&str> { - self.token.as_deref() - } - /// An alias used to join a given party. This alias must be unique for all invites for your game. Pass this alias to `rivet.api.party.common#CreatedInvite$alias` to consume the invite. - pub fn alias(&self) -> std::option::Option<&str> { - self.alias.as_deref() - } -} -impl std::fmt::Debug for GetPartyFromInviteInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetPartyFromInviteInput"); - formatter.field("token", &"*** Sensitive Data Redacted ***"); - formatter.field("alias", &self.alias); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct RevokePartyInviteInput { - /// A universally unique identifier. - pub invite_id: std::option::Option, -} -impl RevokePartyInviteInput { - /// A universally unique identifier. - pub fn invite_id(&self) -> std::option::Option<&str> { - self.invite_id.as_deref() - } -} -impl std::fmt::Debug for RevokePartyInviteInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("RevokePartyInviteInput"); - formatter.field("invite_id", &self.invite_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct KickMemberInput { - /// A universally unique identifier. - pub identity_id: std::option::Option, -} -impl KickMemberInput { - /// A universally unique identifier. - pub fn identity_id(&self) -> std::option::Option<&str> { - self.identity_id.as_deref() - } -} -impl std::fmt::Debug for KickMemberInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("KickMemberInput"); - formatter.field("identity_id", &self.identity_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct TransferPartyOwnershipInput { - /// A universally unique identifier. - pub identity_id: std::option::Option, -} -impl TransferPartyOwnershipInput { - /// A universally unique identifier. - pub fn identity_id(&self) -> std::option::Option<&str> { - self.identity_id.as_deref() - } -} -impl std::fmt::Debug for TransferPartyOwnershipInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("TransferPartyOwnershipInput"); - formatter.field("identity_id", &self.identity_id); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct SetPartyPublicityInput { - /// Defaults to `rivet.party#PartyPublicityLevel$VIEW`. - pub public: std::option::Option, - /// Defaults to `rivet.party#PartyPublicityLevel$JOIN`. - pub mutual_followers: std::option::Option, - /// Defaults to `rivet.party#PartyPublicityLevel$VIEW`. - pub groups: std::option::Option, -} -impl SetPartyPublicityInput { - /// Defaults to `rivet.party#PartyPublicityLevel$VIEW`. - pub fn public(&self) -> std::option::Option<&crate::model::PartyPublicityLevel> { - self.public.as_ref() - } - /// Defaults to `rivet.party#PartyPublicityLevel$JOIN`. - pub fn mutual_followers(&self) -> std::option::Option<&crate::model::PartyPublicityLevel> { - self.mutual_followers.as_ref() - } - /// Defaults to `rivet.party#PartyPublicityLevel$VIEW`. - pub fn groups(&self) -> std::option::Option<&crate::model::PartyPublicityLevel> { - self.groups.as_ref() - } -} -impl std::fmt::Debug for SetPartyPublicityInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("SetPartyPublicityInput"); - formatter.field("public", &self.public); - formatter.field("mutual_followers", &self.mutual_followers); - formatter.field("groups", &self.groups); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct LeavePartyInput {} -impl std::fmt::Debug for LeavePartyInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("LeavePartyInput"); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct JoinPartyInput { - /// Represents methods of joining a party. - pub invite: std::option::Option, - /// Whether or not to automatically join the game lobby if a party is currently in game. - pub matchmaker_auto_join_lobby: std::option::Option, - /// If the player is currently in the lobby, pass the token from `rivet.matchmaker#MatchmakerLobbyJoinInfoPlayer$token`. This will prevent issuing a new player token. - pub matchmaker_current_player_token: std::option::Option, -} -impl JoinPartyInput { - /// Represents methods of joining a party. - pub fn invite(&self) -> std::option::Option<&crate::model::JoinPartyInvite> { - self.invite.as_ref() - } - /// Whether or not to automatically join the game lobby if a party is currently in game. - pub fn matchmaker_auto_join_lobby(&self) -> std::option::Option { - self.matchmaker_auto_join_lobby - } - /// If the player is currently in the lobby, pass the token from `rivet.matchmaker#MatchmakerLobbyJoinInfoPlayer$token`. This will prevent issuing a new player token. - pub fn matchmaker_current_player_token(&self) -> std::option::Option<&str> { - self.matchmaker_current_player_token.as_deref() - } -} -impl std::fmt::Debug for JoinPartyInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("JoinPartyInput"); - formatter.field("invite", &self.invite); - formatter.field( - "matchmaker_auto_join_lobby", - &self.matchmaker_auto_join_lobby, - ); - formatter.field( - "matchmaker_current_player_token", - &"*** Sensitive Data Redacted ***", - ); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CreatePartyInviteInput { - /// An alias used to join a given party. - pub alias: std::option::Option, -} -impl CreatePartyInviteInput { - /// An alias used to join a given party. - pub fn alias(&self) -> std::option::Option<&str> { - self.alias.as_deref() - } -} -impl std::fmt::Debug for CreatePartyInviteInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CreatePartyInviteInput"); - formatter.field("alias", &self.alias); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CreatePartyInput { - /// How many members can join the party. If using this party with the matchmaker, this number should be less than or equal to your party player limit. Super large parties may not be able to fit insite a lobby and be unable to join the game. - pub party_size: std::option::Option, - /// Publicity configuration for creating a party. Null values will default - pub publicity: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub invites: std::option::Option>, - /// If the player is currently in the lobby, pass the token from `rivet.matchmaker#MatchmakerLobbyJoinInfoPlayer$token`. This will prevent issuing a new player token and automatically set the party state to the player's current lobby. - pub matchmaker_current_player_token: std::option::Option, -} -impl CreatePartyInput { - /// How many members can join the party. If using this party with the matchmaker, this number should be less than or equal to your party player limit. Super large parties may not be able to fit insite a lobby and be unable to join the game. - pub fn party_size(&self) -> std::option::Option { - self.party_size - } - /// Publicity configuration for creating a party. Null values will default - pub fn publicity(&self) -> std::option::Option<&crate::model::CreatePartyPublicityConfig> { - self.publicity.as_ref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn invites(&self) -> std::option::Option<&[crate::model::CreatePartyInviteConfig]> { - self.invites.as_deref() - } - /// If the player is currently in the lobby, pass the token from `rivet.matchmaker#MatchmakerLobbyJoinInfoPlayer$token`. This will prevent issuing a new player token and automatically set the party state to the player's current lobby. - pub fn matchmaker_current_player_token(&self) -> std::option::Option<&str> { - self.matchmaker_current_player_token.as_deref() - } -} -impl std::fmt::Debug for CreatePartyInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CreatePartyInput"); - formatter.field("party_size", &self.party_size); - formatter.field("publicity", &self.publicity); - formatter.field("invites", &self.invites); - formatter.field( - "matchmaker_current_player_token", - &"*** Sensitive Data Redacted ***", - ); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetPartySelfProfileInput { - /// A query parameter denoting the requests watch index. - pub watch_index: std::option::Option, -} -impl GetPartySelfProfileInput { - /// A query parameter denoting the requests watch index. - pub fn watch_index(&self) -> std::option::Option<&str> { - self.watch_index.as_deref() - } -} -impl std::fmt::Debug for GetPartySelfProfileInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetPartySelfProfileInput"); - formatter.field("watch_index", &self.watch_index); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetPartyProfileInput { - /// A universally unique identifier. - pub party_id: std::option::Option, - /// A query parameter denoting the requests watch index. - pub watch_index: std::option::Option, -} -impl GetPartyProfileInput { - /// A universally unique identifier. - pub fn party_id(&self) -> std::option::Option<&str> { - self.party_id.as_deref() - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(&self) -> std::option::Option<&str> { - self.watch_index.as_deref() - } -} -impl std::fmt::Debug for GetPartyProfileInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetPartyProfileInput"); - formatter.field("party_id", &self.party_id); - formatter.field("watch_index", &self.watch_index); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetPartySelfSummaryInput { - /// A query parameter denoting the requests watch index. - pub watch_index: std::option::Option, -} -impl GetPartySelfSummaryInput { - /// A query parameter denoting the requests watch index. - pub fn watch_index(&self) -> std::option::Option<&str> { - self.watch_index.as_deref() - } -} -impl std::fmt::Debug for GetPartySelfSummaryInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetPartySelfSummaryInput"); - formatter.field("watch_index", &self.watch_index); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetPartySummaryInput { - /// A universally unique identifier. - pub party_id: std::option::Option, - /// A query parameter denoting the requests watch index. - pub watch_index: std::option::Option, -} -impl GetPartySummaryInput { - /// A universally unique identifier. - pub fn party_id(&self) -> std::option::Option<&str> { - self.party_id.as_deref() - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(&self) -> std::option::Option<&str> { - self.watch_index.as_deref() - } -} -impl std::fmt::Debug for GetPartySummaryInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetPartySummaryInput"); - formatter.field("party_id", &self.party_id); - formatter.field("watch_index", &self.watch_index); - formatter.finish() - } -} diff --git a/lib/smithy-output/api-party/rust/rust/src/json_deser.rs b/lib/smithy-output/api-party/rust/rust/src/json_deser.rs deleted file mode 100644 index cae90b8cb..000000000 --- a/lib/smithy-output/api-party/rust/rust/src/json_deser.rs +++ /dev/null @@ -1,2372 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub fn parse_http_generic_error( - response: &http::Response, -) -> Result { - crate::json_errors::parse_generic_error(response.body(), response.headers()) -} - -pub fn deser_structure_crate_error_internal_error_json_err( - value: &[u8], - mut builder: crate::error::internal_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_rate_limit_error_json_err( - value: &[u8], - mut builder: crate::error::rate_limit_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_forbidden_error_json_err( - value: &[u8], - mut builder: crate::error::forbidden_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_unauthorized_error_json_err( - value: &[u8], - mut builder: crate::error::unauthorized_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_not_found_error_json_err( - value: &[u8], - mut builder: crate::error::not_found_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_bad_request_error_json_err( - value: &[u8], - mut builder: crate::error::bad_request_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_create_party( - value: &[u8], - mut builder: crate::output::create_party_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "invites" => { - builder = builder.set_invites( - crate::json_deser::deser_list_rivet_api_party_common_created_invites( - tokens, - )?, - ); - } - "party_id" => { - builder = builder.set_party_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_create_party_invite( - value: &[u8], - mut builder: crate::output::create_party_invite_output::Builder, -) -> Result -{ - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "invite" => { - builder = builder.set_invite( - crate::json_deser::deser_structure_crate_model_created_invite(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_get_party_from_invite( - value: &[u8], - mut builder: crate::output::get_party_from_invite_output::Builder, -) -> Result -{ - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "party" => { - builder = builder.set_party( - crate::json_deser::deser_structure_crate_model_party_summary(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_get_party_profile( - value: &[u8], - mut builder: crate::output::get_party_profile_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "party" => { - builder = builder.set_party( - crate::json_deser::deser_structure_crate_model_party_profile(tokens)?, - ); - } - "watch" => { - builder = builder.set_watch( - crate::json_deser::deser_structure_crate_model_watch_response(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_get_party_self_profile( - value: &[u8], - mut builder: crate::output::get_party_self_profile_output::Builder, -) -> Result< - crate::output::get_party_self_profile_output::Builder, - aws_smithy_json::deserialize::Error, -> { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "party" => { - builder = builder.set_party( - crate::json_deser::deser_structure_crate_model_party_profile(tokens)?, - ); - } - "watch" => { - builder = builder.set_watch( - crate::json_deser::deser_structure_crate_model_watch_response(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_get_party_self_summary( - value: &[u8], - mut builder: crate::output::get_party_self_summary_output::Builder, -) -> Result< - crate::output::get_party_self_summary_output::Builder, - aws_smithy_json::deserialize::Error, -> { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "party" => { - builder = builder.set_party( - crate::json_deser::deser_structure_crate_model_party_summary(tokens)?, - ); - } - "watch" => { - builder = builder.set_watch( - crate::json_deser::deser_structure_crate_model_watch_response(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_get_party_summary( - value: &[u8], - mut builder: crate::output::get_party_summary_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "party" => { - builder = builder.set_party( - crate::json_deser::deser_structure_crate_model_party_summary(tokens)?, - ); - } - "watch" => { - builder = builder.set_watch( - crate::json_deser::deser_structure_crate_model_watch_response(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_join_party( - value: &[u8], - mut builder: crate::output::join_party_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "party_id" => { - builder = builder.set_party_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn or_empty_doc(data: &[u8]) -> &[u8] { - if data.is_empty() { - b"{}" - } else { - data - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_api_party_common_created_invites<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_created_invite(tokens)?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_structure_crate_model_created_invite<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::CreatedInvite::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "alias" => { - builder = builder.set_alias( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "token" => { - builder = builder.set_token( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_party_summary<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PartySummary::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "party_id" => { - builder = builder.set_party_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "create_ts" => { - builder = builder.set_create_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "activity" => { - builder = builder.set_activity( - crate::json_deser::deser_union_crate_model_party_activity( - tokens, - )?, - ); - } - "external" => { - builder = builder.set_external( - crate::json_deser::deser_structure_crate_model_party_external_links(tokens)? - ); - } - "publicity" => { - builder = builder.set_publicity( - crate::json_deser::deser_structure_crate_model_party_publicity( - tokens, - )?, - ); - } - "party_size" => { - builder = builder.set_party_size( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "members" => { - builder = builder.set_members( - crate::json_deser::deser_list_rivet_party_party_member_summaries(tokens)? - ); - } - "thread_id" => { - builder = builder.set_thread_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_party_profile<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PartyProfile::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "party_id" => { - builder = builder.set_party_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "create_ts" => { - builder = builder.set_create_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "activity" => { - builder = builder.set_activity( - crate::json_deser::deser_union_crate_model_party_activity( - tokens, - )?, - ); - } - "external" => { - builder = builder.set_external( - crate::json_deser::deser_structure_crate_model_party_external_links(tokens)? - ); - } - "publicity" => { - builder = builder.set_publicity( - crate::json_deser::deser_structure_crate_model_party_publicity( - tokens, - )?, - ); - } - "party_size" => { - builder = builder.set_party_size( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "members" => { - builder = builder.set_members( - crate::json_deser::deser_list_rivet_party_party_member_summaries(tokens)? - ); - } - "thread_id" => { - builder = builder.set_thread_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "invites" => { - builder = builder.set_invites( - crate::json_deser::deser_list_rivet_party_party_invites( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_watch_response<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::WatchResponse::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "index" => { - builder = builder.set_index( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_union_crate_model_party_activity<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - let mut variant = None; - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - if variant.is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "encountered mixed variants in union", - )); - } - variant = match key.to_unescaped()?.as_ref() { - "idle" => { - Some(crate::model::PartyActivity::Idle( - crate::json_deser::deser_structure_crate_model_party_activity_idle(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'idle' cannot be null"))? - )) - } - "matchmaker_finding_lobby" => { - Some(crate::model::PartyActivity::MatchmakerFindingLobby( - crate::json_deser::deser_structure_crate_model_party_activity_matchmaker_finding_lobby(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'matchmaker_finding_lobby' cannot be null"))? - )) - } - "matchmaker_lobby" => { - Some(crate::model::PartyActivity::MatchmakerLobby( - crate::json_deser::deser_structure_crate_model_party_activity_matchmaker_lobby(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'matchmaker_lobby' cannot be null"))? - )) - } - _ => { - aws_smithy_json::deserialize::token::skip_value(tokens)?; - Some(crate::model::PartyActivity::Unknown) - } - }; - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - }, - _ => { - return Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )) - } - } - Ok(variant) -} - -pub fn deser_structure_crate_model_party_external_links<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PartyExternalLinks::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "chat" => { - builder = builder.set_chat( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_party_publicity<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PartyPublicity::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "public" => { - builder = builder.set_public( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| { - s.to_unescaped().map(|u| { - crate::model::PartyPublicityLevel::from(u.as_ref()) - }) - }) - .transpose()?, - ); - } - "mutual_followers" => { - builder = builder.set_mutual_followers( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| { - s.to_unescaped().map(|u| { - crate::model::PartyPublicityLevel::from(u.as_ref()) - }) - }) - .transpose()?, - ); - } - "groups" => { - builder = builder.set_groups( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| { - s.to_unescaped().map(|u| { - crate::model::PartyPublicityLevel::from(u.as_ref()) - }) - }) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_party_party_member_summaries<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option>, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_party_member_summary( - tokens, - )?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_party_party_invites<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_party_invite(tokens)?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_structure_crate_model_party_activity_idle<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PartyActivityIdle::builder(); - aws_smithy_json::deserialize::token::skip_to_end(tokens)?; - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_party_activity_matchmaker_finding_lobby<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PartyActivityMatchmakerFindingLobby::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "game" => { - builder = builder.set_game( - crate::json_deser::deser_structure_crate_model_game_handle( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_party_activity_matchmaker_lobby<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PartyActivityMatchmakerLobby::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "lobby" => { - builder = builder.set_lobby( - crate::json_deser::deser_structure_crate_model_party_matchmaker_lobby(tokens)? - ); - } - "game" => { - builder = builder.set_game( - crate::json_deser::deser_structure_crate_model_game_handle( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_party_member_summary<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PartyMemberSummary::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "identity" => { - builder = builder.set_identity( - crate::json_deser::deser_structure_crate_model_identity_handle( - tokens, - )?, - ); - } - "is_leader" => { - builder = builder.set_is_leader( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - "join_ts" => { - builder = builder.set_join_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "state" => { - builder = builder.set_state( - crate::json_deser::deser_union_crate_model_party_member_state( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_party_invite<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PartyInvite::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "invite_id" => { - builder = builder.set_invite_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "create_ts" => { - builder = builder.set_create_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "token" => { - builder = builder.set_token( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "alias" => { - builder = builder.set_alias( - crate::json_deser::deser_structure_crate_model_party_invite_alias(tokens)? - ); - } - "external" => { - builder = builder.set_external( - crate::json_deser::deser_structure_crate_model_party_invite_external_links(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_game_handle<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GameHandle::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "game_id" => { - builder = builder.set_game_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "name_id" => { - builder = builder.set_name_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "display_name" => { - builder = builder.set_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "logo_url" => { - builder = builder.set_logo_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "banner_url" => { - builder = builder.set_banner_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_party_matchmaker_lobby<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PartyMatchmakerLobby::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "lobby_id" => { - builder = builder.set_lobby_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_identity_handle<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::IdentityHandle::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "identity_id" => { - builder = builder.set_identity_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "display_name" => { - builder = builder.set_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "account_number" => { - builder = builder.set_account_number( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "avatar_url" => { - builder = builder.set_avatar_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "presence" => { - builder = builder.set_presence( - crate::json_deser::deser_structure_crate_model_identity_presence(tokens)? - ); - } - "party" => { - builder = builder.set_party( - crate::json_deser::deser_structure_crate_model_party_handle( - tokens, - )?, - ); - } - "is_registered" => { - builder = builder.set_is_registered( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - "external" => { - builder = builder.set_external( - crate::json_deser::deser_structure_crate_model_identity_external_links(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_union_crate_model_party_member_state<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - let mut variant = None; - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - if variant.is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "encountered mixed variants in union", - )); - } - variant = match key.to_unescaped()?.as_ref() { - "inactive" => { - Some(crate::model::PartyMemberState::Inactive( - crate::json_deser::deser_structure_crate_model_party_member_state_inactive(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'inactive' cannot be null"))? - )) - } - "matchmaker_ready" => { - Some(crate::model::PartyMemberState::MatchmakerReady( - crate::json_deser::deser_structure_crate_model_party_member_state_matchmaker_ready(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'matchmaker_ready' cannot be null"))? - )) - } - "matchmaker_finding_lobby" => { - Some(crate::model::PartyMemberState::MatchmakerFindingLobby( - crate::json_deser::deser_structure_crate_model_party_member_state_matchmaker_finding_lobby(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'matchmaker_finding_lobby' cannot be null"))? - )) - } - "matchmaker_lobby" => { - Some(crate::model::PartyMemberState::MatchmakerLobby( - crate::json_deser::deser_structure_crate_model_party_member_state_matchmaker_lobby(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'matchmaker_lobby' cannot be null"))? - )) - } - _ => { - aws_smithy_json::deserialize::token::skip_value(tokens)?; - Some(crate::model::PartyMemberState::Unknown) - } - }; - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - }, - _ => { - return Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )) - } - } - Ok(variant) -} - -pub fn deser_structure_crate_model_party_invite_alias<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PartyInviteAlias::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "namespace_id" => { - builder = builder.set_namespace_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "alias" => { - builder = builder.set_alias( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_party_invite_external_links<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PartyInviteExternalLinks::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "invite" => { - builder = builder.set_invite( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_identity_presence<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::IdentityPresence::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "update_ts" => { - builder = builder.set_update_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "status" => { - builder = builder.set_status( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| { - s.to_unescaped() - .map(|u| crate::model::IdentityStatus::from(u.as_ref())) - }) - .transpose()?, - ); - } - "game_activity" => { - builder = builder.set_game_activity( - crate::json_deser::deser_structure_crate_model_identity_game_activity(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_party_handle<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PartyHandle::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "party_id" => { - builder = builder.set_party_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "create_ts" => { - builder = builder.set_create_ts( - aws_smithy_json::deserialize::token::expect_timestamp_or_null( - tokens.next(), - aws_smithy_types::date_time::Format::DateTime, - )?, - ); - } - "activity" => { - builder = builder.set_activity( - crate::json_deser::deser_union_crate_model_party_activity( - tokens, - )?, - ); - } - "external" => { - builder = builder.set_external( - crate::json_deser::deser_structure_crate_model_party_external_links(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_identity_external_links<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::IdentityExternalLinks::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "profile" => { - builder = builder.set_profile( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "settings" => { - builder = builder.set_settings( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "chat" => { - builder = builder.set_chat( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_party_member_state_inactive<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PartyMemberStateInactive::builder(); - aws_smithy_json::deserialize::token::skip_to_end(tokens)?; - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_party_member_state_matchmaker_ready<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PartyMemberStateMatchmakerReady::builder(); - aws_smithy_json::deserialize::token::skip_to_end(tokens)?; - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_party_member_state_matchmaker_finding_lobby<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PartyMemberStateMatchmakerFindingLobby::builder(); - aws_smithy_json::deserialize::token::skip_to_end(tokens)?; - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_party_member_state_matchmaker_lobby<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::PartyMemberStateMatchmakerLobby::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "player_id" => { - builder = builder.set_player_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_identity_game_activity<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::IdentityGameActivity::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "game" => { - builder = builder.set_game( - crate::json_deser::deser_structure_crate_model_game_handle( - tokens, - )?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "public_metadata" => { - builder = builder.set_public_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - "mutual_metadata" => { - builder = builder.set_mutual_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} diff --git a/lib/smithy-output/api-party/rust/rust/src/json_errors.rs b/lib/smithy-output/api-party/rust/rust/src/json_errors.rs deleted file mode 100644 index 7b7574319..000000000 --- a/lib/smithy-output/api-party/rust/rust/src/json_errors.rs +++ /dev/null @@ -1,220 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -use aws_smithy_json::deserialize::token::skip_value; -use aws_smithy_json::deserialize::{json_token_iter, Error as DeserializeError, Token}; -use aws_smithy_types::Error as SmithyError; -use bytes::Bytes; -use http::header::ToStrError; -use http::{HeaderMap, HeaderValue}; -use std::borrow::Cow; - -// currently only used by AwsJson -#[allow(unused)] -pub fn is_error(response: &http::Response) -> bool { - !response.status().is_success() -} - -fn sanitize_error_code(error_code: &str) -> &str { - // Trim a trailing URL from the error code, beginning with a `:` - let error_code = match error_code.find(':') { - Some(idx) => &error_code[..idx], - None => error_code, - }; - - // Trim a prefixing namespace from the error code, beginning with a `#` - match error_code.find('#') { - Some(idx) => &error_code[idx + 1..], - None => error_code, - } -} - -struct ErrorBody<'a> { - code: Option>, - message: Option>, -} - -fn parse_error_body(bytes: &[u8]) -> Result { - let mut tokens = json_token_iter(bytes).peekable(); - let (mut typ, mut code, mut message) = (None, None, None); - if let Some(Token::StartObject { .. }) = tokens.next().transpose()? { - loop { - match tokens.next().transpose()? { - Some(Token::EndObject { .. }) => break, - Some(Token::ObjectKey { key, .. }) => { - if let Some(Ok(Token::ValueString { value, .. })) = tokens.peek() { - match key.as_escaped_str() { - "code" => code = Some(value.to_unescaped()?), - "__type" => typ = Some(value.to_unescaped()?), - "message" | "Message" | "errorMessage" => { - message = Some(value.to_unescaped()?) - } - _ => {} - } - } - skip_value(&mut tokens)?; - } - _ => { - return Err(DeserializeError::custom( - "expected object key or end object", - )) - } - } - } - if tokens.next().is_some() { - return Err(DeserializeError::custom( - "found more JSON tokens after completing parsing", - )); - } - } - Ok(ErrorBody { - code: code.or(typ), - message, - }) -} - -fn error_type_from_header(headers: &HeaderMap) -> Result, ToStrError> { - headers - .get("X-Amzn-Errortype") - .map(|v| v.to_str()) - .transpose() -} - -fn request_id(headers: &HeaderMap) -> Option<&str> { - headers - .get("X-Amzn-Requestid") - .and_then(|v| v.to_str().ok()) -} - -pub fn parse_generic_error( - payload: &Bytes, - headers: &HeaderMap, -) -> Result { - let ErrorBody { code, message } = parse_error_body(payload.as_ref())?; - - let mut err_builder = SmithyError::builder(); - if let Some(code) = error_type_from_header(headers) - .map_err(|_| DeserializeError::custom("X-Amzn-Errortype header was not valid UTF-8"))? - .or_else(|| code.as_deref()) - .map(sanitize_error_code) - { - err_builder.code(code); - } - if let Some(message) = message { - err_builder.message(message); - } - if let Some(request_id) = request_id(headers) { - err_builder.request_id(request_id); - } - Ok(err_builder.build()) -} - -#[cfg(test)] -mod test { - use crate::json_errors::{parse_error_body, parse_generic_error, sanitize_error_code}; - use aws_smithy_types::Error; - use bytes::Bytes; - use std::borrow::Cow; - - #[test] - fn generic_error() { - let response = http::Response::builder() - .header("X-Amzn-Requestid", "1234") - .body(Bytes::from_static( - br#"{ "__type": "FooError", "message": "Go to foo" }"#, - )) - .unwrap(); - assert_eq!( - parse_generic_error(response.body(), response.headers()).unwrap(), - Error::builder() - .code("FooError") - .message("Go to foo") - .request_id("1234") - .build() - ) - } - - #[test] - fn error_type() { - assert_eq!( - Some(Cow::Borrowed("FooError")), - parse_error_body(br#"{ "__type": "FooError" }"#) - .unwrap() - .code - ); - } - - #[test] - fn code_takes_priority() { - assert_eq!( - Some(Cow::Borrowed("BarError")), - parse_error_body(br#"{ "code": "BarError", "__type": "FooError" }"#) - .unwrap() - .code - ); - } - - #[test] - fn ignore_unrecognized_fields() { - assert_eq!( - Some(Cow::Borrowed("FooError")), - parse_error_body(br#"{ "__type": "FooError", "asdf": 5, "fdsa": {}, "foo": "1" }"#) - .unwrap() - .code - ); - } - - #[test] - fn sanitize_namespace_and_url() { - assert_eq!( - sanitize_error_code("aws.protocoltests.restjson#FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/"), - "FooError"); - } - - #[test] - fn sanitize_noop() { - assert_eq!(sanitize_error_code("FooError"), "FooError"); - } - - #[test] - fn sanitize_url() { - assert_eq!( - sanitize_error_code( - "FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/" - ), - "FooError" - ); - } - - #[test] - fn sanitize_namespace() { - assert_eq!( - sanitize_error_code("aws.protocoltests.restjson#FooError"), - "FooError" - ); - } - - // services like lambda use an alternate `Message` instead of `message` - #[test] - fn alternative_error_message_names() { - let response = http::Response::builder() - .header("x-amzn-errortype", "ResourceNotFoundException") - .body(Bytes::from_static( - br#"{ - "Type": "User", - "Message": "Functions from 'us-west-2' are not reachable from us-east-1" - }"#, - )) - .unwrap(); - assert_eq!( - parse_generic_error(response.body(), response.headers()).unwrap(), - Error::builder() - .code("ResourceNotFoundException") - .message("Functions from 'us-west-2' are not reachable from us-east-1") - .build() - ); - } -} diff --git a/lib/smithy-output/api-party/rust/rust/src/json_ser.rs b/lib/smithy-output/api-party/rust/rust/src/json_ser.rs deleted file mode 100644 index d7fc86338..000000000 --- a/lib/smithy-output/api-party/rust/rust/src/json_ser.rs +++ /dev/null @@ -1,233 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub fn serialize_structure_crate_input_create_party_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::CreatePartyInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_1) = &input.invites { - let mut array_2 = object.key("invites").start_array(); - for item_3 in var_1 { - { - let mut object_4 = array_2.value().start_object(); - crate::json_ser::serialize_structure_crate_model_create_party_invite_config( - &mut object_4, - item_3, - )?; - object_4.finish(); - } - } - array_2.finish(); - } - if let Some(var_5) = &input.matchmaker_current_player_token { - object - .key("matchmaker_current_player_token") - .string(var_5.as_str()); - } - if let Some(var_6) = &input.party_size { - object.key("party_size").number( - #[allow(clippy::useless_conversion)] - aws_smithy_types::Number::NegInt((*var_6).into()), - ); - } - if let Some(var_7) = &input.publicity { - let mut object_8 = object.key("publicity").start_object(); - crate::json_ser::serialize_structure_crate_model_create_party_publicity_config( - &mut object_8, - var_7, - )?; - object_8.finish(); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_create_party_invite_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::CreatePartyInviteInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_9) = &input.alias { - object.key("alias").string(var_9.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_join_party_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::JoinPartyInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_10) = &input.invite { - let mut object_11 = object.key("invite").start_object(); - crate::json_ser::serialize_union_crate_model_join_party_invite(&mut object_11, var_10)?; - object_11.finish(); - } - if let Some(var_12) = &input.matchmaker_auto_join_lobby { - object.key("matchmaker_auto_join_lobby").boolean(*var_12); - } - if let Some(var_13) = &input.matchmaker_current_player_token { - object - .key("matchmaker_current_player_token") - .string(var_13.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_set_party_publicity_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::SetPartyPublicityInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_14) = &input.groups { - object.key("groups").string(var_14.as_str()); - } - if let Some(var_15) = &input.mutual_followers { - object.key("mutual_followers").string(var_15.as_str()); - } - if let Some(var_16) = &input.public { - object.key("public").string(var_16.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_find_matchmaker_lobby_for_party_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::FindMatchmakerLobbyForPartyInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_17) = &input.captcha { - let mut object_18 = object.key("captcha").start_object(); - crate::json_ser::serialize_union_crate_model_captcha_config(&mut object_18, var_17)?; - object_18.finish(); - } - if let Some(var_19) = &input.game_modes { - let mut array_20 = object.key("game_modes").start_array(); - for item_21 in var_19 { - { - array_20.value().string(item_21.as_str()); - } - } - array_20.finish(); - } - if let Some(var_22) = &input.prevent_auto_create_lobby { - object.key("prevent_auto_create_lobby").boolean(*var_22); - } - if let Some(var_23) = &input.regions { - let mut array_24 = object.key("regions").start_array(); - for item_25 in var_23 { - { - array_24.value().string(item_25.as_str()); - } - } - array_24.finish(); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_join_matchmaker_lobby_for_party_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::JoinMatchmakerLobbyForPartyInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_26) = &input.captcha { - let mut object_27 = object.key("captcha").start_object(); - crate::json_ser::serialize_union_crate_model_captcha_config(&mut object_27, var_26)?; - object_27.finish(); - } - if let Some(var_28) = &input.lobby_id { - object.key("lobby_id").string(var_28.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_model_create_party_invite_config( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::CreatePartyInviteConfig, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_29) = &input.alias { - object.key("alias").string(var_29.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_model_create_party_publicity_config( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::CreatePartyPublicityConfig, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_30) = &input.public { - object.key("public").string(var_30.as_str()); - } - if let Some(var_31) = &input.mutual_followers { - object.key("mutual_followers").string(var_31.as_str()); - } - if let Some(var_32) = &input.groups { - object.key("groups").string(var_32.as_str()); - } - Ok(()) -} - -pub fn serialize_union_crate_model_join_party_invite( - object_11: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::JoinPartyInvite, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - match input { - crate::model::JoinPartyInvite::PartyId(inner) => { - object_11.key("party_id").string(inner.as_str()); - } - crate::model::JoinPartyInvite::Token(inner) => { - object_11.key("token").string(inner.as_str()); - } - crate::model::JoinPartyInvite::Alias(inner) => { - object_11.key("alias").string(inner.as_str()); - } - crate::model::JoinPartyInvite::Unknown => { - return Err( - aws_smithy_http::operation::SerializationError::unknown_variant("JoinPartyInvite"), - ) - } - } - Ok(()) -} - -pub fn serialize_union_crate_model_captcha_config( - object_18: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::CaptchaConfig, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - match input { - crate::model::CaptchaConfig::Hcaptcha(inner) => { - let mut object_33 = object_18.key("hcaptcha").start_object(); - crate::json_ser::serialize_structure_crate_model_captcha_config_hcaptcha( - &mut object_33, - inner, - )?; - object_33.finish(); - } - crate::model::CaptchaConfig::Turnstile(inner) => { - let mut object_34 = object_18.key("turnstile").start_object(); - crate::json_ser::serialize_structure_crate_model_captcha_config_turnstile( - &mut object_34, - inner, - )?; - object_34.finish(); - } - crate::model::CaptchaConfig::Unknown => { - return Err( - aws_smithy_http::operation::SerializationError::unknown_variant("CaptchaConfig"), - ) - } - } - Ok(()) -} - -pub fn serialize_structure_crate_model_captcha_config_hcaptcha( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::CaptchaConfigHcaptcha, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_35) = &input.client_response { - object.key("client_response").string(var_35.as_str()); - } - Ok(()) -} - -pub fn serialize_structure_crate_model_captcha_config_turnstile( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::CaptchaConfigTurnstile, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_36) = &input.client_response { - object.key("client_response").string(var_36.as_str()); - } - Ok(()) -} diff --git a/lib/smithy-output/api-party/rust/rust/src/lib.rs b/lib/smithy-output/api-party/rust/rust/src/lib.rs deleted file mode 100644 index c624eae45..000000000 --- a/lib/smithy-output/api-party/rust/rust/src/lib.rs +++ /dev/null @@ -1,58 +0,0 @@ -#![allow(clippy::module_inception)] -#![allow(clippy::upper_case_acronyms)] -#![allow(clippy::large_enum_variant)] -#![allow(clippy::wrong_self_convention)] -#![allow(clippy::should_implement_trait)] -#![allow(clippy::blacklisted_name)] -#![allow(clippy::vec_init_then_push)] -#![allow(rustdoc::bare_urls)] -#![warn(missing_docs)] -//! rivet-party -//! -//! # Crate Organization -//! -//! The entry point for most customers will be [`Client`]. [`Client`] exposes one method for each API offered -//! by the service. -//! -//! Some APIs require complex or nested arguments. These exist in [`model`](crate::model). -//! -//! Lastly, errors that can be returned by the service are contained within [`error`]. [`Error`] defines a meta -//! error encompassing all possible errors that can be returned by the service. -//! -//! The other modules within this crate are not required for normal usage. - -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use error_meta::Error; - -#[doc(inline)] -pub use config::Config; - -/// Client and fluent builders for calling the service. -pub mod client; -/// Configuration for the service. -pub mod config; -/// Errors that can occur when calling the service. -pub mod error; -mod error_meta; -mod http_serde; -/// Input structures for operations. -pub mod input; -mod json_deser; -mod json_errors; -mod json_ser; -/// Data structures used by operation inputs/outputs. -pub mod model; -/// All operations that this crate can perform. -pub mod operation; -mod operation_deser; -mod operation_ser; -/// Output structures for operations. -pub mod output; -pub use client::{Builder, Client, ClientWrapper}; -/// Crate version number. -pub static PKG_VERSION: &str = env!("CARGO_PKG_VERSION"); -/// Re-exported types from supporting crates. -pub mod types { - pub use aws_smithy_http::result::SdkError; - pub use aws_smithy_types::DateTime; -} diff --git a/lib/smithy-output/api-party/rust/rust/src/model.rs b/lib/smithy-output/api-party/rust/rust/src/model.rs deleted file mode 100644 index 90ac1871e..000000000 --- a/lib/smithy-output/api-party/rust/rust/src/model.rs +++ /dev/null @@ -1,2881 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Methods to verify a captcha. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] -pub enum CaptchaConfig { - /// hCaptcha configuration. - Hcaptcha(crate::model::CaptchaConfigHcaptcha), - /// Cloudflare Turnstile configuration. - Turnstile(crate::model::CaptchaConfigTurnstile), - /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version. - /// An unknown enum variant - /// - /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._ - /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized - /// by the client. This can happen when the server adds new functionality, but the client has not been updated. - /// To investigate this, consider turning on debug logging to print the raw HTTP response. - #[non_exhaustive] - Unknown, -} -impl CaptchaConfig { - /// Tries to convert the enum instance into [`Hcaptcha`](crate::model::CaptchaConfig::Hcaptcha), extracting the inner [`CaptchaConfigHcaptcha`](crate::model::CaptchaConfigHcaptcha). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_hcaptcha(&self) -> std::result::Result<&crate::model::CaptchaConfigHcaptcha, &Self> { - if let CaptchaConfig::Hcaptcha(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`Hcaptcha`](crate::model::CaptchaConfig::Hcaptcha). - pub fn is_hcaptcha(&self) -> bool { - self.as_hcaptcha().is_ok() - } - /// Tries to convert the enum instance into [`Turnstile`](crate::model::CaptchaConfig::Turnstile), extracting the inner [`CaptchaConfigTurnstile`](crate::model::CaptchaConfigTurnstile). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_turnstile( - &self, - ) -> std::result::Result<&crate::model::CaptchaConfigTurnstile, &Self> { - if let CaptchaConfig::Turnstile(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`Turnstile`](crate::model::CaptchaConfig::Turnstile). - pub fn is_turnstile(&self) -> bool { - self.as_turnstile().is_ok() - } - /// Returns true if the enum instance is the `Unknown` variant. - pub fn is_unknown(&self) -> bool { - matches!(self, Self::Unknown) - } -} - -/// Cloudflare Turnstile configuration. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CaptchaConfigTurnstile { - #[allow(missing_docs)] // documentation missing in model - pub client_response: std::option::Option, -} -impl CaptchaConfigTurnstile { - #[allow(missing_docs)] // documentation missing in model - pub fn client_response(&self) -> std::option::Option<&str> { - self.client_response.as_deref() - } -} -impl std::fmt::Debug for CaptchaConfigTurnstile { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CaptchaConfigTurnstile"); - formatter.field("client_response", &self.client_response); - formatter.finish() - } -} -/// See [`CaptchaConfigTurnstile`](crate::model::CaptchaConfigTurnstile) -pub mod captcha_config_turnstile { - /// A builder for [`CaptchaConfigTurnstile`](crate::model::CaptchaConfigTurnstile) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) client_response: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn client_response(mut self, input: impl Into) -> Self { - self.client_response = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_client_response( - mut self, - input: std::option::Option, - ) -> Self { - self.client_response = input; - self - } - /// Consumes the builder and constructs a [`CaptchaConfigTurnstile`](crate::model::CaptchaConfigTurnstile) - pub fn build(self) -> crate::model::CaptchaConfigTurnstile { - crate::model::CaptchaConfigTurnstile { - client_response: self.client_response, - } - } - } -} -impl CaptchaConfigTurnstile { - /// Creates a new builder-style object to manufacture [`CaptchaConfigTurnstile`](crate::model::CaptchaConfigTurnstile) - pub fn builder() -> crate::model::captcha_config_turnstile::Builder { - crate::model::captcha_config_turnstile::Builder::default() - } -} - -/// hCaptcha configuration. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CaptchaConfigHcaptcha { - #[allow(missing_docs)] // documentation missing in model - pub client_response: std::option::Option, -} -impl CaptchaConfigHcaptcha { - #[allow(missing_docs)] // documentation missing in model - pub fn client_response(&self) -> std::option::Option<&str> { - self.client_response.as_deref() - } -} -impl std::fmt::Debug for CaptchaConfigHcaptcha { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CaptchaConfigHcaptcha"); - formatter.field("client_response", &self.client_response); - formatter.finish() - } -} -/// See [`CaptchaConfigHcaptcha`](crate::model::CaptchaConfigHcaptcha) -pub mod captcha_config_hcaptcha { - /// A builder for [`CaptchaConfigHcaptcha`](crate::model::CaptchaConfigHcaptcha) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) client_response: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn client_response(mut self, input: impl Into) -> Self { - self.client_response = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_client_response( - mut self, - input: std::option::Option, - ) -> Self { - self.client_response = input; - self - } - /// Consumes the builder and constructs a [`CaptchaConfigHcaptcha`](crate::model::CaptchaConfigHcaptcha) - pub fn build(self) -> crate::model::CaptchaConfigHcaptcha { - crate::model::CaptchaConfigHcaptcha { - client_response: self.client_response, - } - } - } -} -impl CaptchaConfigHcaptcha { - /// Creates a new builder-style object to manufacture [`CaptchaConfigHcaptcha`](crate::model::CaptchaConfigHcaptcha) - pub fn builder() -> crate::model::captcha_config_hcaptcha::Builder { - crate::model::captcha_config_hcaptcha::Builder::default() - } -} - -/// A party summary. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PartySummary { - /// A universally unique identifier. - pub party_id: std::option::Option, - /// RFC3339 timestamp. - pub create_ts: std::option::Option, - /// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. - pub activity: std::option::Option, - /// External links for a party. - pub external: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub publicity: std::option::Option, - /// Unsigned 32 bit integer. - pub party_size: std::option::Option, - /// A list of party members. - pub members: std::option::Option>, - /// A universally unique identifier. - pub thread_id: std::option::Option, -} -impl PartySummary { - /// A universally unique identifier. - pub fn party_id(&self) -> std::option::Option<&str> { - self.party_id.as_deref() - } - /// RFC3339 timestamp. - pub fn create_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.create_ts.as_ref() - } - /// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. - pub fn activity(&self) -> std::option::Option<&crate::model::PartyActivity> { - self.activity.as_ref() - } - /// External links for a party. - pub fn external(&self) -> std::option::Option<&crate::model::PartyExternalLinks> { - self.external.as_ref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn publicity(&self) -> std::option::Option<&crate::model::PartyPublicity> { - self.publicity.as_ref() - } - /// Unsigned 32 bit integer. - pub fn party_size(&self) -> std::option::Option { - self.party_size - } - /// A list of party members. - pub fn members(&self) -> std::option::Option<&[crate::model::PartyMemberSummary]> { - self.members.as_deref() - } - /// A universally unique identifier. - pub fn thread_id(&self) -> std::option::Option<&str> { - self.thread_id.as_deref() - } -} -impl std::fmt::Debug for PartySummary { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PartySummary"); - formatter.field("party_id", &self.party_id); - formatter.field("create_ts", &self.create_ts); - formatter.field("activity", &self.activity); - formatter.field("external", &self.external); - formatter.field("publicity", &self.publicity); - formatter.field("party_size", &self.party_size); - formatter.field("members", &self.members); - formatter.field("thread_id", &self.thread_id); - formatter.finish() - } -} -/// See [`PartySummary`](crate::model::PartySummary) -pub mod party_summary { - /// A builder for [`PartySummary`](crate::model::PartySummary) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) party_id: std::option::Option, - pub(crate) create_ts: std::option::Option, - pub(crate) activity: std::option::Option, - pub(crate) external: std::option::Option, - pub(crate) publicity: std::option::Option, - pub(crate) party_size: std::option::Option, - pub(crate) members: std::option::Option>, - pub(crate) thread_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn party_id(mut self, input: impl Into) -> Self { - self.party_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_party_id(mut self, input: std::option::Option) -> Self { - self.party_id = input; - self - } - /// RFC3339 timestamp. - pub fn create_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.create_ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_create_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.create_ts = input; - self - } - /// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. - pub fn activity(mut self, input: crate::model::PartyActivity) -> Self { - self.activity = Some(input); - self - } - /// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. - pub fn set_activity( - mut self, - input: std::option::Option, - ) -> Self { - self.activity = input; - self - } - /// External links for a party. - pub fn external(mut self, input: crate::model::PartyExternalLinks) -> Self { - self.external = Some(input); - self - } - /// External links for a party. - pub fn set_external( - mut self, - input: std::option::Option, - ) -> Self { - self.external = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn publicity(mut self, input: crate::model::PartyPublicity) -> Self { - self.publicity = Some(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_publicity( - mut self, - input: std::option::Option, - ) -> Self { - self.publicity = input; - self - } - /// Unsigned 32 bit integer. - pub fn party_size(mut self, input: i32) -> Self { - self.party_size = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_party_size(mut self, input: std::option::Option) -> Self { - self.party_size = input; - self - } - /// Appends an item to `members`. - /// - /// To override the contents of this collection use [`set_members`](Self::set_members). - /// - /// A list of party members. - pub fn members(mut self, input: crate::model::PartyMemberSummary) -> Self { - let mut v = self.members.unwrap_or_default(); - v.push(input); - self.members = Some(v); - self - } - /// A list of party members. - pub fn set_members( - mut self, - input: std::option::Option>, - ) -> Self { - self.members = input; - self - } - /// A universally unique identifier. - pub fn thread_id(mut self, input: impl Into) -> Self { - self.thread_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_thread_id(mut self, input: std::option::Option) -> Self { - self.thread_id = input; - self - } - /// Consumes the builder and constructs a [`PartySummary`](crate::model::PartySummary) - pub fn build(self) -> crate::model::PartySummary { - crate::model::PartySummary { - party_id: self.party_id, - create_ts: self.create_ts, - activity: self.activity, - external: self.external, - publicity: self.publicity, - party_size: self.party_size, - members: self.members, - thread_id: self.thread_id, - } - } - } -} -impl PartySummary { - /// Creates a new builder-style object to manufacture [`PartySummary`](crate::model::PartySummary) - pub fn builder() -> crate::model::party_summary::Builder { - crate::model::party_summary::Builder::default() - } -} - -/// A party member summary. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PartyMemberSummary { - /// An identity handle. - pub identity: std::option::Option, - /// Whether or not this party member is the leader of the given party. - pub is_leader: std::option::Option, - /// RFC3339 timestamp. - pub join_ts: std::option::Option, - /// A union representing the current state of a party member. - `Inactive`: The player is not doing anything. For example, the player can be sitting in the game menu or hanging out on the hub. - It's possible for the member to be in an inactive state while the party is in a lobby; this means the player is simply observing/interacting with others in the party and not part of the matchmaking process. - `MatchmakerReady`: This means the member wants a player created for them. - Members can be in the ready state while the party is in an idle state. This means that the player will get a player created for them. - Members can be in the ready state while the party is in a lobby. This means that the player could not join the lobby because it was full or the player left the lobby unintentionally. - `MatchmakerFindingLobby`: A find request is in progress for the member. - `MatchmakerLobby`: The member is in a lobby. - pub state: std::option::Option, -} -impl PartyMemberSummary { - /// An identity handle. - pub fn identity(&self) -> std::option::Option<&crate::model::IdentityHandle> { - self.identity.as_ref() - } - /// Whether or not this party member is the leader of the given party. - pub fn is_leader(&self) -> std::option::Option { - self.is_leader - } - /// RFC3339 timestamp. - pub fn join_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.join_ts.as_ref() - } - /// A union representing the current state of a party member. - `Inactive`: The player is not doing anything. For example, the player can be sitting in the game menu or hanging out on the hub. - It's possible for the member to be in an inactive state while the party is in a lobby; this means the player is simply observing/interacting with others in the party and not part of the matchmaking process. - `MatchmakerReady`: This means the member wants a player created for them. - Members can be in the ready state while the party is in an idle state. This means that the player will get a player created for them. - Members can be in the ready state while the party is in a lobby. This means that the player could not join the lobby because it was full or the player left the lobby unintentionally. - `MatchmakerFindingLobby`: A find request is in progress for the member. - `MatchmakerLobby`: The member is in a lobby. - pub fn state(&self) -> std::option::Option<&crate::model::PartyMemberState> { - self.state.as_ref() - } -} -impl std::fmt::Debug for PartyMemberSummary { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PartyMemberSummary"); - formatter.field("identity", &self.identity); - formatter.field("is_leader", &self.is_leader); - formatter.field("join_ts", &self.join_ts); - formatter.field("state", &self.state); - formatter.finish() - } -} -/// See [`PartyMemberSummary`](crate::model::PartyMemberSummary) -pub mod party_member_summary { - /// A builder for [`PartyMemberSummary`](crate::model::PartyMemberSummary) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity: std::option::Option, - pub(crate) is_leader: std::option::Option, - pub(crate) join_ts: std::option::Option, - pub(crate) state: std::option::Option, - } - impl Builder { - /// An identity handle. - pub fn identity(mut self, input: crate::model::IdentityHandle) -> Self { - self.identity = Some(input); - self - } - /// An identity handle. - pub fn set_identity( - mut self, - input: std::option::Option, - ) -> Self { - self.identity = input; - self - } - /// Whether or not this party member is the leader of the given party. - pub fn is_leader(mut self, input: bool) -> Self { - self.is_leader = Some(input); - self - } - /// Whether or not this party member is the leader of the given party. - pub fn set_is_leader(mut self, input: std::option::Option) -> Self { - self.is_leader = input; - self - } - /// RFC3339 timestamp. - pub fn join_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.join_ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_join_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.join_ts = input; - self - } - /// A union representing the current state of a party member. - `Inactive`: The player is not doing anything. For example, the player can be sitting in the game menu or hanging out on the hub. - It's possible for the member to be in an inactive state while the party is in a lobby; this means the player is simply observing/interacting with others in the party and not part of the matchmaking process. - `MatchmakerReady`: This means the member wants a player created for them. - Members can be in the ready state while the party is in an idle state. This means that the player will get a player created for them. - Members can be in the ready state while the party is in a lobby. This means that the player could not join the lobby because it was full or the player left the lobby unintentionally. - `MatchmakerFindingLobby`: A find request is in progress for the member. - `MatchmakerLobby`: The member is in a lobby. - pub fn state(mut self, input: crate::model::PartyMemberState) -> Self { - self.state = Some(input); - self - } - /// A union representing the current state of a party member. - `Inactive`: The player is not doing anything. For example, the player can be sitting in the game menu or hanging out on the hub. - It's possible for the member to be in an inactive state while the party is in a lobby; this means the player is simply observing/interacting with others in the party and not part of the matchmaking process. - `MatchmakerReady`: This means the member wants a player created for them. - Members can be in the ready state while the party is in an idle state. This means that the player will get a player created for them. - Members can be in the ready state while the party is in a lobby. This means that the player could not join the lobby because it was full or the player left the lobby unintentionally. - `MatchmakerFindingLobby`: A find request is in progress for the member. - `MatchmakerLobby`: The member is in a lobby. - pub fn set_state( - mut self, - input: std::option::Option, - ) -> Self { - self.state = input; - self - } - /// Consumes the builder and constructs a [`PartyMemberSummary`](crate::model::PartyMemberSummary) - pub fn build(self) -> crate::model::PartyMemberSummary { - crate::model::PartyMemberSummary { - identity: self.identity, - is_leader: self.is_leader, - join_ts: self.join_ts, - state: self.state, - } - } - } -} -impl PartyMemberSummary { - /// Creates a new builder-style object to manufacture [`PartyMemberSummary`](crate::model::PartyMemberSummary) - pub fn builder() -> crate::model::party_member_summary::Builder { - crate::model::party_member_summary::Builder::default() - } -} - -/// A union representing the current state of a party member. - `Inactive`: The player is not doing anything. For example, the player can be sitting in the game menu or hanging out on the hub. - It's possible for the member to be in an inactive state while the party is in a lobby; this means the player is simply observing/interacting with others in the party and not part of the matchmaking process. - `MatchmakerReady`: This means the member wants a player created for them. - Members can be in the ready state while the party is in an idle state. This means that the player will get a player created for them. - Members can be in the ready state while the party is in a lobby. This means that the player could not join the lobby because it was full or the player left the lobby unintentionally. - `MatchmakerFindingLobby`: A find request is in progress for the member. - `MatchmakerLobby`: The member is in a lobby. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] -pub enum PartyMemberState { - /// A party member state denoting that the member is inactive. - Inactive(crate::model::PartyMemberStateInactive), - /// A party member state denoting that the member is currently searching for a lobby. - MatchmakerFindingLobby(crate::model::PartyMemberStateMatchmakerFindingLobby), - /// A party member state denoting that the member is in a lobby. - MatchmakerLobby(crate::model::PartyMemberStateMatchmakerLobby), - /// A party member state denoting that the member is currently waiting to start matchmaking. - MatchmakerReady(crate::model::PartyMemberStateMatchmakerReady), - /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version. - /// An unknown enum variant - /// - /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._ - /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized - /// by the client. This can happen when the server adds new functionality, but the client has not been updated. - /// To investigate this, consider turning on debug logging to print the raw HTTP response. - #[non_exhaustive] - Unknown, -} -impl PartyMemberState { - /// Tries to convert the enum instance into [`Inactive`](crate::model::PartyMemberState::Inactive), extracting the inner [`PartyMemberStateInactive`](crate::model::PartyMemberStateInactive). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_inactive( - &self, - ) -> std::result::Result<&crate::model::PartyMemberStateInactive, &Self> { - if let PartyMemberState::Inactive(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`Inactive`](crate::model::PartyMemberState::Inactive). - pub fn is_inactive(&self) -> bool { - self.as_inactive().is_ok() - } - /// Tries to convert the enum instance into [`MatchmakerFindingLobby`](crate::model::PartyMemberState::MatchmakerFindingLobby), extracting the inner [`PartyMemberStateMatchmakerFindingLobby`](crate::model::PartyMemberStateMatchmakerFindingLobby). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_matchmaker_finding_lobby( - &self, - ) -> std::result::Result<&crate::model::PartyMemberStateMatchmakerFindingLobby, &Self> { - if let PartyMemberState::MatchmakerFindingLobby(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`MatchmakerFindingLobby`](crate::model::PartyMemberState::MatchmakerFindingLobby). - pub fn is_matchmaker_finding_lobby(&self) -> bool { - self.as_matchmaker_finding_lobby().is_ok() - } - /// Tries to convert the enum instance into [`MatchmakerLobby`](crate::model::PartyMemberState::MatchmakerLobby), extracting the inner [`PartyMemberStateMatchmakerLobby`](crate::model::PartyMemberStateMatchmakerLobby). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_matchmaker_lobby( - &self, - ) -> std::result::Result<&crate::model::PartyMemberStateMatchmakerLobby, &Self> { - if let PartyMemberState::MatchmakerLobby(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`MatchmakerLobby`](crate::model::PartyMemberState::MatchmakerLobby). - pub fn is_matchmaker_lobby(&self) -> bool { - self.as_matchmaker_lobby().is_ok() - } - /// Tries to convert the enum instance into [`MatchmakerReady`](crate::model::PartyMemberState::MatchmakerReady), extracting the inner [`PartyMemberStateMatchmakerReady`](crate::model::PartyMemberStateMatchmakerReady). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_matchmaker_ready( - &self, - ) -> std::result::Result<&crate::model::PartyMemberStateMatchmakerReady, &Self> { - if let PartyMemberState::MatchmakerReady(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`MatchmakerReady`](crate::model::PartyMemberState::MatchmakerReady). - pub fn is_matchmaker_ready(&self) -> bool { - self.as_matchmaker_ready().is_ok() - } - /// Returns true if the enum instance is the `Unknown` variant. - pub fn is_unknown(&self) -> bool { - matches!(self, Self::Unknown) - } -} - -/// A party member state denoting that the member is in a lobby. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PartyMemberStateMatchmakerLobby { - /// A universally unique identifier. - pub player_id: std::option::Option, -} -impl PartyMemberStateMatchmakerLobby { - /// A universally unique identifier. - pub fn player_id(&self) -> std::option::Option<&str> { - self.player_id.as_deref() - } -} -impl std::fmt::Debug for PartyMemberStateMatchmakerLobby { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PartyMemberStateMatchmakerLobby"); - formatter.field("player_id", &self.player_id); - formatter.finish() - } -} -/// See [`PartyMemberStateMatchmakerLobby`](crate::model::PartyMemberStateMatchmakerLobby) -pub mod party_member_state_matchmaker_lobby { - /// A builder for [`PartyMemberStateMatchmakerLobby`](crate::model::PartyMemberStateMatchmakerLobby) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) player_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn player_id(mut self, input: impl Into) -> Self { - self.player_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_player_id(mut self, input: std::option::Option) -> Self { - self.player_id = input; - self - } - /// Consumes the builder and constructs a [`PartyMemberStateMatchmakerLobby`](crate::model::PartyMemberStateMatchmakerLobby) - pub fn build(self) -> crate::model::PartyMemberStateMatchmakerLobby { - crate::model::PartyMemberStateMatchmakerLobby { - player_id: self.player_id, - } - } - } -} -impl PartyMemberStateMatchmakerLobby { - /// Creates a new builder-style object to manufacture [`PartyMemberStateMatchmakerLobby`](crate::model::PartyMemberStateMatchmakerLobby) - pub fn builder() -> crate::model::party_member_state_matchmaker_lobby::Builder { - crate::model::party_member_state_matchmaker_lobby::Builder::default() - } -} - -/// A party member state denoting that the member is currently searching for a lobby. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PartyMemberStateMatchmakerFindingLobby {} -impl std::fmt::Debug for PartyMemberStateMatchmakerFindingLobby { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PartyMemberStateMatchmakerFindingLobby"); - formatter.finish() - } -} -/// See [`PartyMemberStateMatchmakerFindingLobby`](crate::model::PartyMemberStateMatchmakerFindingLobby) -pub mod party_member_state_matchmaker_finding_lobby { - /// A builder for [`PartyMemberStateMatchmakerFindingLobby`](crate::model::PartyMemberStateMatchmakerFindingLobby) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`PartyMemberStateMatchmakerFindingLobby`](crate::model::PartyMemberStateMatchmakerFindingLobby) - pub fn build(self) -> crate::model::PartyMemberStateMatchmakerFindingLobby { - crate::model::PartyMemberStateMatchmakerFindingLobby {} - } - } -} -impl PartyMemberStateMatchmakerFindingLobby { - /// Creates a new builder-style object to manufacture [`PartyMemberStateMatchmakerFindingLobby`](crate::model::PartyMemberStateMatchmakerFindingLobby) - pub fn builder() -> crate::model::party_member_state_matchmaker_finding_lobby::Builder { - crate::model::party_member_state_matchmaker_finding_lobby::Builder::default() - } -} - -/// A party member state denoting that the member is currently waiting to start matchmaking. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PartyMemberStateMatchmakerReady {} -impl std::fmt::Debug for PartyMemberStateMatchmakerReady { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PartyMemberStateMatchmakerReady"); - formatter.finish() - } -} -/// See [`PartyMemberStateMatchmakerReady`](crate::model::PartyMemberStateMatchmakerReady) -pub mod party_member_state_matchmaker_ready { - /// A builder for [`PartyMemberStateMatchmakerReady`](crate::model::PartyMemberStateMatchmakerReady) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`PartyMemberStateMatchmakerReady`](crate::model::PartyMemberStateMatchmakerReady) - pub fn build(self) -> crate::model::PartyMemberStateMatchmakerReady { - crate::model::PartyMemberStateMatchmakerReady {} - } - } -} -impl PartyMemberStateMatchmakerReady { - /// Creates a new builder-style object to manufacture [`PartyMemberStateMatchmakerReady`](crate::model::PartyMemberStateMatchmakerReady) - pub fn builder() -> crate::model::party_member_state_matchmaker_ready::Builder { - crate::model::party_member_state_matchmaker_ready::Builder::default() - } -} - -/// A party member state denoting that the member is inactive. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PartyMemberStateInactive {} -impl std::fmt::Debug for PartyMemberStateInactive { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PartyMemberStateInactive"); - formatter.finish() - } -} -/// See [`PartyMemberStateInactive`](crate::model::PartyMemberStateInactive) -pub mod party_member_state_inactive { - /// A builder for [`PartyMemberStateInactive`](crate::model::PartyMemberStateInactive) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`PartyMemberStateInactive`](crate::model::PartyMemberStateInactive) - pub fn build(self) -> crate::model::PartyMemberStateInactive { - crate::model::PartyMemberStateInactive {} - } - } -} -impl PartyMemberStateInactive { - /// Creates a new builder-style object to manufacture [`PartyMemberStateInactive`](crate::model::PartyMemberStateInactive) - pub fn builder() -> crate::model::party_member_state_inactive::Builder { - crate::model::party_member_state_inactive::Builder::default() - } -} - -/// An identity handle. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct IdentityHandle { - /// A universally unique identifier. - pub identity_id: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub account_number: std::option::Option, - /// The URL of this identity's avatar image. - pub avatar_url: std::option::Option, - /// Information about the identity's current status, party, and active game. - pub presence: std::option::Option, - /// A party handle. - pub party: std::option::Option, - /// Whether or not this identity is registered with a linked account. - pub is_registered: std::option::Option, - /// External links for an identity. - pub external: std::option::Option, -} -impl IdentityHandle { - /// A universally unique identifier. - pub fn identity_id(&self) -> std::option::Option<&str> { - self.identity_id.as_deref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub fn account_number(&self) -> std::option::Option { - self.account_number - } - /// The URL of this identity's avatar image. - pub fn avatar_url(&self) -> std::option::Option<&str> { - self.avatar_url.as_deref() - } - /// Information about the identity's current status, party, and active game. - pub fn presence(&self) -> std::option::Option<&crate::model::IdentityPresence> { - self.presence.as_ref() - } - /// A party handle. - pub fn party(&self) -> std::option::Option<&crate::model::PartyHandle> { - self.party.as_ref() - } - /// Whether or not this identity is registered with a linked account. - pub fn is_registered(&self) -> std::option::Option { - self.is_registered - } - /// External links for an identity. - pub fn external(&self) -> std::option::Option<&crate::model::IdentityExternalLinks> { - self.external.as_ref() - } -} -impl std::fmt::Debug for IdentityHandle { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("IdentityHandle"); - formatter.field("identity_id", &self.identity_id); - formatter.field("display_name", &self.display_name); - formatter.field("account_number", &self.account_number); - formatter.field("avatar_url", &self.avatar_url); - formatter.field("presence", &self.presence); - formatter.field("party", &self.party); - formatter.field("is_registered", &self.is_registered); - formatter.field("external", &self.external); - formatter.finish() - } -} -/// See [`IdentityHandle`](crate::model::IdentityHandle) -pub mod identity_handle { - /// A builder for [`IdentityHandle`](crate::model::IdentityHandle) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity_id: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) account_number: std::option::Option, - pub(crate) avatar_url: std::option::Option, - pub(crate) presence: std::option::Option, - pub(crate) party: std::option::Option, - pub(crate) is_registered: std::option::Option, - pub(crate) external: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.identity_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.identity_id = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub fn account_number(mut self, input: i32) -> Self { - self.account_number = Some(input); - self - } - /// Identity profile account number (#1234). These are assigned in addition to an identity's display name in order to allow multiple identities to have the same display name while still providing a unique handle. These are unique to each display name; you can have multiple accounts with different display names and the same account number. - pub fn set_account_number(mut self, input: std::option::Option) -> Self { - self.account_number = input; - self - } - /// The URL of this identity's avatar image. - pub fn avatar_url(mut self, input: impl Into) -> Self { - self.avatar_url = Some(input.into()); - self - } - /// The URL of this identity's avatar image. - pub fn set_avatar_url(mut self, input: std::option::Option) -> Self { - self.avatar_url = input; - self - } - /// Information about the identity's current status, party, and active game. - pub fn presence(mut self, input: crate::model::IdentityPresence) -> Self { - self.presence = Some(input); - self - } - /// Information about the identity's current status, party, and active game. - pub fn set_presence( - mut self, - input: std::option::Option, - ) -> Self { - self.presence = input; - self - } - /// A party handle. - pub fn party(mut self, input: crate::model::PartyHandle) -> Self { - self.party = Some(input); - self - } - /// A party handle. - pub fn set_party(mut self, input: std::option::Option) -> Self { - self.party = input; - self - } - /// Whether or not this identity is registered with a linked account. - pub fn is_registered(mut self, input: bool) -> Self { - self.is_registered = Some(input); - self - } - /// Whether or not this identity is registered with a linked account. - pub fn set_is_registered(mut self, input: std::option::Option) -> Self { - self.is_registered = input; - self - } - /// External links for an identity. - pub fn external(mut self, input: crate::model::IdentityExternalLinks) -> Self { - self.external = Some(input); - self - } - /// External links for an identity. - pub fn set_external( - mut self, - input: std::option::Option, - ) -> Self { - self.external = input; - self - } - /// Consumes the builder and constructs a [`IdentityHandle`](crate::model::IdentityHandle) - pub fn build(self) -> crate::model::IdentityHandle { - crate::model::IdentityHandle { - identity_id: self.identity_id, - display_name: self.display_name, - account_number: self.account_number, - avatar_url: self.avatar_url, - presence: self.presence, - party: self.party, - is_registered: self.is_registered, - external: self.external, - } - } - } -} -impl IdentityHandle { - /// Creates a new builder-style object to manufacture [`IdentityHandle`](crate::model::IdentityHandle) - pub fn builder() -> crate::model::identity_handle::Builder { - crate::model::identity_handle::Builder::default() - } -} - -/// External links for an identity. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct IdentityExternalLinks { - /// A link to this identity's profile page. - pub profile: std::option::Option, - /// A link to the Rivet settings page. - pub settings: std::option::Option, - /// A link to a chat page with the given identity. - pub chat: std::option::Option, -} -impl IdentityExternalLinks { - /// A link to this identity's profile page. - pub fn profile(&self) -> std::option::Option<&str> { - self.profile.as_deref() - } - /// A link to the Rivet settings page. - pub fn settings(&self) -> std::option::Option<&str> { - self.settings.as_deref() - } - /// A link to a chat page with the given identity. - pub fn chat(&self) -> std::option::Option<&str> { - self.chat.as_deref() - } -} -impl std::fmt::Debug for IdentityExternalLinks { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("IdentityExternalLinks"); - formatter.field("profile", &self.profile); - formatter.field("settings", &self.settings); - formatter.field("chat", &self.chat); - formatter.finish() - } -} -/// See [`IdentityExternalLinks`](crate::model::IdentityExternalLinks) -pub mod identity_external_links { - /// A builder for [`IdentityExternalLinks`](crate::model::IdentityExternalLinks) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) profile: std::option::Option, - pub(crate) settings: std::option::Option, - pub(crate) chat: std::option::Option, - } - impl Builder { - /// A link to this identity's profile page. - pub fn profile(mut self, input: impl Into) -> Self { - self.profile = Some(input.into()); - self - } - /// A link to this identity's profile page. - pub fn set_profile(mut self, input: std::option::Option) -> Self { - self.profile = input; - self - } - /// A link to the Rivet settings page. - pub fn settings(mut self, input: impl Into) -> Self { - self.settings = Some(input.into()); - self - } - /// A link to the Rivet settings page. - pub fn set_settings(mut self, input: std::option::Option) -> Self { - self.settings = input; - self - } - /// A link to a chat page with the given identity. - pub fn chat(mut self, input: impl Into) -> Self { - self.chat = Some(input.into()); - self - } - /// A link to a chat page with the given identity. - pub fn set_chat(mut self, input: std::option::Option) -> Self { - self.chat = input; - self - } - /// Consumes the builder and constructs a [`IdentityExternalLinks`](crate::model::IdentityExternalLinks) - pub fn build(self) -> crate::model::IdentityExternalLinks { - crate::model::IdentityExternalLinks { - profile: self.profile, - settings: self.settings, - chat: self.chat, - } - } - } -} -impl IdentityExternalLinks { - /// Creates a new builder-style object to manufacture [`IdentityExternalLinks`](crate::model::IdentityExternalLinks) - pub fn builder() -> crate::model::identity_external_links::Builder { - crate::model::identity_external_links::Builder::default() - } -} - -/// A party handle. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PartyHandle { - /// A universally unique identifier. - pub party_id: std::option::Option, - /// RFC3339 timestamp. - pub create_ts: std::option::Option, - /// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. - pub activity: std::option::Option, - /// External links for a party. - pub external: std::option::Option, -} -impl PartyHandle { - /// A universally unique identifier. - pub fn party_id(&self) -> std::option::Option<&str> { - self.party_id.as_deref() - } - /// RFC3339 timestamp. - pub fn create_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.create_ts.as_ref() - } - /// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. - pub fn activity(&self) -> std::option::Option<&crate::model::PartyActivity> { - self.activity.as_ref() - } - /// External links for a party. - pub fn external(&self) -> std::option::Option<&crate::model::PartyExternalLinks> { - self.external.as_ref() - } -} -impl std::fmt::Debug for PartyHandle { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PartyHandle"); - formatter.field("party_id", &self.party_id); - formatter.field("create_ts", &self.create_ts); - formatter.field("activity", &self.activity); - formatter.field("external", &self.external); - formatter.finish() - } -} -/// See [`PartyHandle`](crate::model::PartyHandle) -pub mod party_handle { - /// A builder for [`PartyHandle`](crate::model::PartyHandle) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) party_id: std::option::Option, - pub(crate) create_ts: std::option::Option, - pub(crate) activity: std::option::Option, - pub(crate) external: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn party_id(mut self, input: impl Into) -> Self { - self.party_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_party_id(mut self, input: std::option::Option) -> Self { - self.party_id = input; - self - } - /// RFC3339 timestamp. - pub fn create_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.create_ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_create_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.create_ts = input; - self - } - /// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. - pub fn activity(mut self, input: crate::model::PartyActivity) -> Self { - self.activity = Some(input); - self - } - /// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. - pub fn set_activity( - mut self, - input: std::option::Option, - ) -> Self { - self.activity = input; - self - } - /// External links for a party. - pub fn external(mut self, input: crate::model::PartyExternalLinks) -> Self { - self.external = Some(input); - self - } - /// External links for a party. - pub fn set_external( - mut self, - input: std::option::Option, - ) -> Self { - self.external = input; - self - } - /// Consumes the builder and constructs a [`PartyHandle`](crate::model::PartyHandle) - pub fn build(self) -> crate::model::PartyHandle { - crate::model::PartyHandle { - party_id: self.party_id, - create_ts: self.create_ts, - activity: self.activity, - external: self.external, - } - } - } -} -impl PartyHandle { - /// Creates a new builder-style object to manufacture [`PartyHandle`](crate::model::PartyHandle) - pub fn builder() -> crate::model::party_handle::Builder { - crate::model::party_handle::Builder::default() - } -} - -/// External links for a party. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PartyExternalLinks { - /// A link to the given party's chat thread. - pub chat: std::option::Option, -} -impl PartyExternalLinks { - /// A link to the given party's chat thread. - pub fn chat(&self) -> std::option::Option<&str> { - self.chat.as_deref() - } -} -impl std::fmt::Debug for PartyExternalLinks { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PartyExternalLinks"); - formatter.field("chat", &self.chat); - formatter.finish() - } -} -/// See [`PartyExternalLinks`](crate::model::PartyExternalLinks) -pub mod party_external_links { - /// A builder for [`PartyExternalLinks`](crate::model::PartyExternalLinks) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) chat: std::option::Option, - } - impl Builder { - /// A link to the given party's chat thread. - pub fn chat(mut self, input: impl Into) -> Self { - self.chat = Some(input.into()); - self - } - /// A link to the given party's chat thread. - pub fn set_chat(mut self, input: std::option::Option) -> Self { - self.chat = input; - self - } - /// Consumes the builder and constructs a [`PartyExternalLinks`](crate::model::PartyExternalLinks) - pub fn build(self) -> crate::model::PartyExternalLinks { - crate::model::PartyExternalLinks { chat: self.chat } - } - } -} -impl PartyExternalLinks { - /// Creates a new builder-style object to manufacture [`PartyExternalLinks`](crate::model::PartyExternalLinks) - pub fn builder() -> crate::model::party_external_links::Builder { - crate::model::party_external_links::Builder::default() - } -} - -/// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] -pub enum PartyActivity { - /// A party activity denoting that the party is idle. - Idle(crate::model::PartyActivityIdle), - /// A party activity denoting that the party is currently searching for a lobby. - MatchmakerFindingLobby(crate::model::PartyActivityMatchmakerFindingLobby), - /// A party activity denoting that the party is currently in a lobby. - MatchmakerLobby(crate::model::PartyActivityMatchmakerLobby), - /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version. - /// An unknown enum variant - /// - /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._ - /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized - /// by the client. This can happen when the server adds new functionality, but the client has not been updated. - /// To investigate this, consider turning on debug logging to print the raw HTTP response. - #[non_exhaustive] - Unknown, -} -impl PartyActivity { - /// Tries to convert the enum instance into [`Idle`](crate::model::PartyActivity::Idle), extracting the inner [`PartyActivityIdle`](crate::model::PartyActivityIdle). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_idle(&self) -> std::result::Result<&crate::model::PartyActivityIdle, &Self> { - if let PartyActivity::Idle(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`Idle`](crate::model::PartyActivity::Idle). - pub fn is_idle(&self) -> bool { - self.as_idle().is_ok() - } - /// Tries to convert the enum instance into [`MatchmakerFindingLobby`](crate::model::PartyActivity::MatchmakerFindingLobby), extracting the inner [`PartyActivityMatchmakerFindingLobby`](crate::model::PartyActivityMatchmakerFindingLobby). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_matchmaker_finding_lobby( - &self, - ) -> std::result::Result<&crate::model::PartyActivityMatchmakerFindingLobby, &Self> { - if let PartyActivity::MatchmakerFindingLobby(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`MatchmakerFindingLobby`](crate::model::PartyActivity::MatchmakerFindingLobby). - pub fn is_matchmaker_finding_lobby(&self) -> bool { - self.as_matchmaker_finding_lobby().is_ok() - } - /// Tries to convert the enum instance into [`MatchmakerLobby`](crate::model::PartyActivity::MatchmakerLobby), extracting the inner [`PartyActivityMatchmakerLobby`](crate::model::PartyActivityMatchmakerLobby). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_matchmaker_lobby( - &self, - ) -> std::result::Result<&crate::model::PartyActivityMatchmakerLobby, &Self> { - if let PartyActivity::MatchmakerLobby(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`MatchmakerLobby`](crate::model::PartyActivity::MatchmakerLobby). - pub fn is_matchmaker_lobby(&self) -> bool { - self.as_matchmaker_lobby().is_ok() - } - /// Returns true if the enum instance is the `Unknown` variant. - pub fn is_unknown(&self) -> bool { - matches!(self, Self::Unknown) - } -} - -/// A party activity denoting that the party is currently in a lobby. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PartyActivityMatchmakerLobby { - /// A party lobby. - pub lobby: std::option::Option, - /// A game handle. - pub game: std::option::Option, -} -impl PartyActivityMatchmakerLobby { - /// A party lobby. - pub fn lobby(&self) -> std::option::Option<&crate::model::PartyMatchmakerLobby> { - self.lobby.as_ref() - } - /// A game handle. - pub fn game(&self) -> std::option::Option<&crate::model::GameHandle> { - self.game.as_ref() - } -} -impl std::fmt::Debug for PartyActivityMatchmakerLobby { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PartyActivityMatchmakerLobby"); - formatter.field("lobby", &self.lobby); - formatter.field("game", &self.game); - formatter.finish() - } -} -/// See [`PartyActivityMatchmakerLobby`](crate::model::PartyActivityMatchmakerLobby) -pub mod party_activity_matchmaker_lobby { - /// A builder for [`PartyActivityMatchmakerLobby`](crate::model::PartyActivityMatchmakerLobby) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) lobby: std::option::Option, - pub(crate) game: std::option::Option, - } - impl Builder { - /// A party lobby. - pub fn lobby(mut self, input: crate::model::PartyMatchmakerLobby) -> Self { - self.lobby = Some(input); - self - } - /// A party lobby. - pub fn set_lobby( - mut self, - input: std::option::Option, - ) -> Self { - self.lobby = input; - self - } - /// A game handle. - pub fn game(mut self, input: crate::model::GameHandle) -> Self { - self.game = Some(input); - self - } - /// A game handle. - pub fn set_game(mut self, input: std::option::Option) -> Self { - self.game = input; - self - } - /// Consumes the builder and constructs a [`PartyActivityMatchmakerLobby`](crate::model::PartyActivityMatchmakerLobby) - pub fn build(self) -> crate::model::PartyActivityMatchmakerLobby { - crate::model::PartyActivityMatchmakerLobby { - lobby: self.lobby, - game: self.game, - } - } - } -} -impl PartyActivityMatchmakerLobby { - /// Creates a new builder-style object to manufacture [`PartyActivityMatchmakerLobby`](crate::model::PartyActivityMatchmakerLobby) - pub fn builder() -> crate::model::party_activity_matchmaker_lobby::Builder { - crate::model::party_activity_matchmaker_lobby::Builder::default() - } -} - -/// A game handle. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GameHandle { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub name_id: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// The URL of this game's logo image. - pub logo_url: std::option::Option, - /// The URL of this game's banner image. - pub banner_url: std::option::Option, -} -impl GameHandle { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn name_id(&self) -> std::option::Option<&str> { - self.name_id.as_deref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// The URL of this game's logo image. - pub fn logo_url(&self) -> std::option::Option<&str> { - self.logo_url.as_deref() - } - /// The URL of this game's banner image. - pub fn banner_url(&self) -> std::option::Option<&str> { - self.banner_url.as_deref() - } -} -impl std::fmt::Debug for GameHandle { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GameHandle"); - formatter.field("game_id", &self.game_id); - formatter.field("name_id", &self.name_id); - formatter.field("display_name", &self.display_name); - formatter.field("logo_url", &self.logo_url); - formatter.field("banner_url", &self.banner_url); - formatter.finish() - } -} -/// See [`GameHandle`](crate::model::GameHandle) -pub mod game_handle { - /// A builder for [`GameHandle`](crate::model::GameHandle) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) name_id: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) logo_url: std::option::Option, - pub(crate) banner_url: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn name_id(mut self, input: impl Into) -> Self { - self.name_id = Some(input.into()); - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn set_name_id(mut self, input: std::option::Option) -> Self { - self.name_id = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// The URL of this game's logo image. - pub fn logo_url(mut self, input: impl Into) -> Self { - self.logo_url = Some(input.into()); - self - } - /// The URL of this game's logo image. - pub fn set_logo_url(mut self, input: std::option::Option) -> Self { - self.logo_url = input; - self - } - /// The URL of this game's banner image. - pub fn banner_url(mut self, input: impl Into) -> Self { - self.banner_url = Some(input.into()); - self - } - /// The URL of this game's banner image. - pub fn set_banner_url(mut self, input: std::option::Option) -> Self { - self.banner_url = input; - self - } - /// Consumes the builder and constructs a [`GameHandle`](crate::model::GameHandle) - pub fn build(self) -> crate::model::GameHandle { - crate::model::GameHandle { - game_id: self.game_id, - name_id: self.name_id, - display_name: self.display_name, - logo_url: self.logo_url, - banner_url: self.banner_url, - } - } - } -} -impl GameHandle { - /// Creates a new builder-style object to manufacture [`GameHandle`](crate::model::GameHandle) - pub fn builder() -> crate::model::game_handle::Builder { - crate::model::game_handle::Builder::default() - } -} - -/// A party lobby. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PartyMatchmakerLobby { - /// A universally unique identifier. - pub lobby_id: std::option::Option, -} -impl PartyMatchmakerLobby { - /// A universally unique identifier. - pub fn lobby_id(&self) -> std::option::Option<&str> { - self.lobby_id.as_deref() - } -} -impl std::fmt::Debug for PartyMatchmakerLobby { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PartyMatchmakerLobby"); - formatter.field("lobby_id", &self.lobby_id); - formatter.finish() - } -} -/// See [`PartyMatchmakerLobby`](crate::model::PartyMatchmakerLobby) -pub mod party_matchmaker_lobby { - /// A builder for [`PartyMatchmakerLobby`](crate::model::PartyMatchmakerLobby) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) lobby_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn lobby_id(mut self, input: impl Into) -> Self { - self.lobby_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_lobby_id(mut self, input: std::option::Option) -> Self { - self.lobby_id = input; - self - } - /// Consumes the builder and constructs a [`PartyMatchmakerLobby`](crate::model::PartyMatchmakerLobby) - pub fn build(self) -> crate::model::PartyMatchmakerLobby { - crate::model::PartyMatchmakerLobby { - lobby_id: self.lobby_id, - } - } - } -} -impl PartyMatchmakerLobby { - /// Creates a new builder-style object to manufacture [`PartyMatchmakerLobby`](crate::model::PartyMatchmakerLobby) - pub fn builder() -> crate::model::party_matchmaker_lobby::Builder { - crate::model::party_matchmaker_lobby::Builder::default() - } -} - -/// A party activity denoting that the party is currently searching for a lobby. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PartyActivityMatchmakerFindingLobby { - /// A game handle. - pub game: std::option::Option, -} -impl PartyActivityMatchmakerFindingLobby { - /// A game handle. - pub fn game(&self) -> std::option::Option<&crate::model::GameHandle> { - self.game.as_ref() - } -} -impl std::fmt::Debug for PartyActivityMatchmakerFindingLobby { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PartyActivityMatchmakerFindingLobby"); - formatter.field("game", &self.game); - formatter.finish() - } -} -/// See [`PartyActivityMatchmakerFindingLobby`](crate::model::PartyActivityMatchmakerFindingLobby) -pub mod party_activity_matchmaker_finding_lobby { - /// A builder for [`PartyActivityMatchmakerFindingLobby`](crate::model::PartyActivityMatchmakerFindingLobby) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game: std::option::Option, - } - impl Builder { - /// A game handle. - pub fn game(mut self, input: crate::model::GameHandle) -> Self { - self.game = Some(input); - self - } - /// A game handle. - pub fn set_game(mut self, input: std::option::Option) -> Self { - self.game = input; - self - } - /// Consumes the builder and constructs a [`PartyActivityMatchmakerFindingLobby`](crate::model::PartyActivityMatchmakerFindingLobby) - pub fn build(self) -> crate::model::PartyActivityMatchmakerFindingLobby { - crate::model::PartyActivityMatchmakerFindingLobby { game: self.game } - } - } -} -impl PartyActivityMatchmakerFindingLobby { - /// Creates a new builder-style object to manufacture [`PartyActivityMatchmakerFindingLobby`](crate::model::PartyActivityMatchmakerFindingLobby) - pub fn builder() -> crate::model::party_activity_matchmaker_finding_lobby::Builder { - crate::model::party_activity_matchmaker_finding_lobby::Builder::default() - } -} - -/// A party activity denoting that the party is idle. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PartyActivityIdle {} -impl std::fmt::Debug for PartyActivityIdle { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PartyActivityIdle"); - formatter.finish() - } -} -/// See [`PartyActivityIdle`](crate::model::PartyActivityIdle) -pub mod party_activity_idle { - /// A builder for [`PartyActivityIdle`](crate::model::PartyActivityIdle) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`PartyActivityIdle`](crate::model::PartyActivityIdle) - pub fn build(self) -> crate::model::PartyActivityIdle { - crate::model::PartyActivityIdle {} - } - } -} -impl PartyActivityIdle { - /// Creates a new builder-style object to manufacture [`PartyActivityIdle`](crate::model::PartyActivityIdle) - pub fn builder() -> crate::model::party_activity_idle::Builder { - crate::model::party_activity_idle::Builder::default() - } -} - -/// Information about the identity's current status, party, and active game. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct IdentityPresence { - /// RFC3339 timestamp. - pub update_ts: std::option::Option, - /// The current status of an identity. This helps players understand if another player is currently playing or has their game in the background. - pub status: std::option::Option, - /// The game an identity is currently participating in. - pub game_activity: std::option::Option, -} -impl IdentityPresence { - /// RFC3339 timestamp. - pub fn update_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.update_ts.as_ref() - } - /// The current status of an identity. This helps players understand if another player is currently playing or has their game in the background. - pub fn status(&self) -> std::option::Option<&crate::model::IdentityStatus> { - self.status.as_ref() - } - /// The game an identity is currently participating in. - pub fn game_activity(&self) -> std::option::Option<&crate::model::IdentityGameActivity> { - self.game_activity.as_ref() - } -} -impl std::fmt::Debug for IdentityPresence { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("IdentityPresence"); - formatter.field("update_ts", &self.update_ts); - formatter.field("status", &self.status); - formatter.field("game_activity", &self.game_activity); - formatter.finish() - } -} -/// See [`IdentityPresence`](crate::model::IdentityPresence) -pub mod identity_presence { - /// A builder for [`IdentityPresence`](crate::model::IdentityPresence) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) update_ts: std::option::Option, - pub(crate) status: std::option::Option, - pub(crate) game_activity: std::option::Option, - } - impl Builder { - /// RFC3339 timestamp. - pub fn update_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.update_ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_update_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.update_ts = input; - self - } - /// The current status of an identity. This helps players understand if another player is currently playing or has their game in the background. - pub fn status(mut self, input: crate::model::IdentityStatus) -> Self { - self.status = Some(input); - self - } - /// The current status of an identity. This helps players understand if another player is currently playing or has their game in the background. - pub fn set_status( - mut self, - input: std::option::Option, - ) -> Self { - self.status = input; - self - } - /// The game an identity is currently participating in. - pub fn game_activity(mut self, input: crate::model::IdentityGameActivity) -> Self { - self.game_activity = Some(input); - self - } - /// The game an identity is currently participating in. - pub fn set_game_activity( - mut self, - input: std::option::Option, - ) -> Self { - self.game_activity = input; - self - } - /// Consumes the builder and constructs a [`IdentityPresence`](crate::model::IdentityPresence) - pub fn build(self) -> crate::model::IdentityPresence { - crate::model::IdentityPresence { - update_ts: self.update_ts, - status: self.status, - game_activity: self.game_activity, - } - } - } -} -impl IdentityPresence { - /// Creates a new builder-style object to manufacture [`IdentityPresence`](crate::model::IdentityPresence) - pub fn builder() -> crate::model::identity_presence::Builder { - crate::model::identity_presence::Builder::default() - } -} - -/// The game an identity is currently participating in. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct IdentityGameActivity { - /// A game handle. - pub game: std::option::Option, - /// A short activity message about the current game activity. - pub message: std::option::Option, - /// JSON data seen by anyone. - pub public_metadata: std::option::Option, - /// JSON data seen only by the given identity and their mutual followers. - pub mutual_metadata: std::option::Option, -} -impl IdentityGameActivity { - /// A game handle. - pub fn game(&self) -> std::option::Option<&crate::model::GameHandle> { - self.game.as_ref() - } - /// A short activity message about the current game activity. - pub fn message(&self) -> std::option::Option<&str> { - self.message.as_deref() - } - /// JSON data seen by anyone. - pub fn public_metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.public_metadata.as_ref() - } - /// JSON data seen only by the given identity and their mutual followers. - pub fn mutual_metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.mutual_metadata.as_ref() - } -} -impl std::fmt::Debug for IdentityGameActivity { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("IdentityGameActivity"); - formatter.field("game", &self.game); - formatter.field("message", &self.message); - formatter.field("public_metadata", &self.public_metadata); - formatter.field("mutual_metadata", &self.mutual_metadata); - formatter.finish() - } -} -/// See [`IdentityGameActivity`](crate::model::IdentityGameActivity) -pub mod identity_game_activity { - /// A builder for [`IdentityGameActivity`](crate::model::IdentityGameActivity) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) public_metadata: std::option::Option, - pub(crate) mutual_metadata: std::option::Option, - } - impl Builder { - /// A game handle. - pub fn game(mut self, input: crate::model::GameHandle) -> Self { - self.game = Some(input); - self - } - /// A game handle. - pub fn set_game(mut self, input: std::option::Option) -> Self { - self.game = input; - self - } - /// A short activity message about the current game activity. - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - /// A short activity message about the current game activity. - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - /// JSON data seen by anyone. - pub fn public_metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.public_metadata = Some(input); - self - } - /// JSON data seen by anyone. - pub fn set_public_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.public_metadata = input; - self - } - /// JSON data seen only by the given identity and their mutual followers. - pub fn mutual_metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.mutual_metadata = Some(input); - self - } - /// JSON data seen only by the given identity and their mutual followers. - pub fn set_mutual_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.mutual_metadata = input; - self - } - /// Consumes the builder and constructs a [`IdentityGameActivity`](crate::model::IdentityGameActivity) - pub fn build(self) -> crate::model::IdentityGameActivity { - crate::model::IdentityGameActivity { - game: self.game, - message: self.message, - public_metadata: self.public_metadata, - mutual_metadata: self.mutual_metadata, - } - } - } -} -impl IdentityGameActivity { - /// Creates a new builder-style object to manufacture [`IdentityGameActivity`](crate::model::IdentityGameActivity) - pub fn builder() -> crate::model::identity_game_activity::Builder { - crate::model::identity_game_activity::Builder::default() - } -} - -/// The current status of an identity. This helps players understand if another -/// player is currently playing or has their game in the background. -#[non_exhaustive] -#[derive( - std::clone::Clone, - std::cmp::Eq, - std::cmp::Ord, - std::cmp::PartialEq, - std::cmp::PartialOrd, - std::fmt::Debug, - std::hash::Hash, -)] -pub enum IdentityStatus { - #[allow(missing_docs)] // documentation missing in model - Away, - #[allow(missing_docs)] // documentation missing in model - Offline, - #[allow(missing_docs)] // documentation missing in model - Online, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for IdentityStatus { - fn from(s: &str) -> Self { - match s { - "away" => IdentityStatus::Away, - "offline" => IdentityStatus::Offline, - "online" => IdentityStatus::Online, - other => IdentityStatus::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for IdentityStatus { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(IdentityStatus::from(s)) - } -} -impl IdentityStatus { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - IdentityStatus::Away => "away", - IdentityStatus::Offline => "offline", - IdentityStatus::Online => "online", - IdentityStatus::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["away", "offline", "online"] - } -} -impl AsRef for IdentityStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PartyPublicity { - #[allow(missing_docs)] // documentation missing in model - pub public: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub mutual_followers: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub groups: std::option::Option, -} -impl PartyPublicity { - #[allow(missing_docs)] // documentation missing in model - pub fn public(&self) -> std::option::Option<&crate::model::PartyPublicityLevel> { - self.public.as_ref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn mutual_followers(&self) -> std::option::Option<&crate::model::PartyPublicityLevel> { - self.mutual_followers.as_ref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn groups(&self) -> std::option::Option<&crate::model::PartyPublicityLevel> { - self.groups.as_ref() - } -} -impl std::fmt::Debug for PartyPublicity { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PartyPublicity"); - formatter.field("public", &self.public); - formatter.field("mutual_followers", &self.mutual_followers); - formatter.field("groups", &self.groups); - formatter.finish() - } -} -/// See [`PartyPublicity`](crate::model::PartyPublicity) -pub mod party_publicity { - /// A builder for [`PartyPublicity`](crate::model::PartyPublicity) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) public: std::option::Option, - pub(crate) mutual_followers: std::option::Option, - pub(crate) groups: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn public(mut self, input: crate::model::PartyPublicityLevel) -> Self { - self.public = Some(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_public( - mut self, - input: std::option::Option, - ) -> Self { - self.public = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn mutual_followers(mut self, input: crate::model::PartyPublicityLevel) -> Self { - self.mutual_followers = Some(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_mutual_followers( - mut self, - input: std::option::Option, - ) -> Self { - self.mutual_followers = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn groups(mut self, input: crate::model::PartyPublicityLevel) -> Self { - self.groups = Some(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_groups( - mut self, - input: std::option::Option, - ) -> Self { - self.groups = input; - self - } - /// Consumes the builder and constructs a [`PartyPublicity`](crate::model::PartyPublicity) - pub fn build(self) -> crate::model::PartyPublicity { - crate::model::PartyPublicity { - public: self.public, - mutual_followers: self.mutual_followers, - groups: self.groups, - } - } - } -} -impl PartyPublicity { - /// Creates a new builder-style object to manufacture [`PartyPublicity`](crate::model::PartyPublicity) - pub fn builder() -> crate::model::party_publicity::Builder { - crate::model::party_publicity::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive( - std::clone::Clone, - std::cmp::Eq, - std::cmp::Ord, - std::cmp::PartialEq, - std::cmp::PartialOrd, - std::fmt::Debug, - std::hash::Hash, -)] -pub enum PartyPublicityLevel { - #[allow(missing_docs)] // documentation missing in model - Join, - #[allow(missing_docs)] // documentation missing in model - None, - #[allow(missing_docs)] // documentation missing in model - View, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for PartyPublicityLevel { - fn from(s: &str) -> Self { - match s { - "join" => PartyPublicityLevel::Join, - "none" => PartyPublicityLevel::None, - "view" => PartyPublicityLevel::View, - other => PartyPublicityLevel::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for PartyPublicityLevel { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(PartyPublicityLevel::from(s)) - } -} -impl PartyPublicityLevel { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - PartyPublicityLevel::Join => "join", - PartyPublicityLevel::None => "none", - PartyPublicityLevel::View => "view", - PartyPublicityLevel::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["join", "none", "view"] - } -} -impl AsRef for PartyPublicityLevel { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// Represents methods of joining a party. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] -pub enum JoinPartyInvite { - /// A party invite alias. See `rivet.api.party.common#CreatePartyInviteConfig$alias` and `rivet.api.party#CreatePartyInvite$alias`. - Alias(std::string::String), - /// Requires the party publicity to this identity to be `rivet.party#PartyPublicityLevel$JOIN`. - PartyId(std::string::String), - /// A party invite token. See `rivet.api.party.common#CreatedInvite$token`. - Token(std::string::String), - /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version. - /// An unknown enum variant - /// - /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._ - /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized - /// by the client. This can happen when the server adds new functionality, but the client has not been updated. - /// To investigate this, consider turning on debug logging to print the raw HTTP response. - #[non_exhaustive] - Unknown, -} -impl JoinPartyInvite { - /// Tries to convert the enum instance into [`Alias`](crate::model::JoinPartyInvite::Alias), extracting the inner [`String`](std::string::String). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_alias(&self) -> std::result::Result<&std::string::String, &Self> { - if let JoinPartyInvite::Alias(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`Alias`](crate::model::JoinPartyInvite::Alias). - pub fn is_alias(&self) -> bool { - self.as_alias().is_ok() - } - /// Tries to convert the enum instance into [`PartyId`](crate::model::JoinPartyInvite::PartyId), extracting the inner [`String`](std::string::String). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_party_id(&self) -> std::result::Result<&std::string::String, &Self> { - if let JoinPartyInvite::PartyId(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`PartyId`](crate::model::JoinPartyInvite::PartyId). - pub fn is_party_id(&self) -> bool { - self.as_party_id().is_ok() - } - /// Tries to convert the enum instance into [`Token`](crate::model::JoinPartyInvite::Token), extracting the inner [`String`](std::string::String). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_token(&self) -> std::result::Result<&std::string::String, &Self> { - if let JoinPartyInvite::Token(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`Token`](crate::model::JoinPartyInvite::Token). - pub fn is_token(&self) -> bool { - self.as_token().is_ok() - } - /// Returns true if the enum instance is the `Unknown` variant. - pub fn is_unknown(&self) -> bool { - matches!(self, Self::Unknown) - } -} - -/// Output from a created invite. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CreatedInvite { - /// An alias used to join a given party. This alias must be unique for all invites for your game. Pass this alias to `rivet.api.party.common#CreatedInvite$alias` to consume the invite. - pub alias: std::option::Option, - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub token: std::option::Option, -} -impl CreatedInvite { - /// An alias used to join a given party. This alias must be unique for all invites for your game. Pass this alias to `rivet.api.party.common#CreatedInvite$alias` to consume the invite. - pub fn alias(&self) -> std::option::Option<&str> { - self.alias.as_deref() - } - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn token(&self) -> std::option::Option<&str> { - self.token.as_deref() - } -} -impl std::fmt::Debug for CreatedInvite { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CreatedInvite"); - formatter.field("alias", &self.alias); - formatter.field("token", &"*** Sensitive Data Redacted ***"); - formatter.finish() - } -} -/// See [`CreatedInvite`](crate::model::CreatedInvite) -pub mod created_invite { - /// A builder for [`CreatedInvite`](crate::model::CreatedInvite) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) alias: std::option::Option, - pub(crate) token: std::option::Option, - } - impl Builder { - /// An alias used to join a given party. This alias must be unique for all invites for your game. Pass this alias to `rivet.api.party.common#CreatedInvite$alias` to consume the invite. - pub fn alias(mut self, input: impl Into) -> Self { - self.alias = Some(input.into()); - self - } - /// An alias used to join a given party. This alias must be unique for all invites for your game. Pass this alias to `rivet.api.party.common#CreatedInvite$alias` to consume the invite. - pub fn set_alias(mut self, input: std::option::Option) -> Self { - self.alias = input; - self - } - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn token(mut self, input: impl Into) -> Self { - self.token = Some(input.into()); - self - } - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn set_token(mut self, input: std::option::Option) -> Self { - self.token = input; - self - } - /// Consumes the builder and constructs a [`CreatedInvite`](crate::model::CreatedInvite) - pub fn build(self) -> crate::model::CreatedInvite { - crate::model::CreatedInvite { - alias: self.alias, - token: self.token, - } - } - } -} -impl CreatedInvite { - /// Creates a new builder-style object to manufacture [`CreatedInvite`](crate::model::CreatedInvite) - pub fn builder() -> crate::model::created_invite::Builder { - crate::model::created_invite::Builder::default() - } -} - -/// Configuration for creating a party invite. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CreatePartyInviteConfig { - /// An alias used to join a given party. This alias must be unique for all invites for your game. Pass this alias to `rivet.api.party.common#CreatedInvite$alias` to consume the invite. - pub alias: std::option::Option, -} -impl CreatePartyInviteConfig { - /// An alias used to join a given party. This alias must be unique for all invites for your game. Pass this alias to `rivet.api.party.common#CreatedInvite$alias` to consume the invite. - pub fn alias(&self) -> std::option::Option<&str> { - self.alias.as_deref() - } -} -impl std::fmt::Debug for CreatePartyInviteConfig { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CreatePartyInviteConfig"); - formatter.field("alias", &self.alias); - formatter.finish() - } -} -/// See [`CreatePartyInviteConfig`](crate::model::CreatePartyInviteConfig) -pub mod create_party_invite_config { - /// A builder for [`CreatePartyInviteConfig`](crate::model::CreatePartyInviteConfig) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) alias: std::option::Option, - } - impl Builder { - /// An alias used to join a given party. This alias must be unique for all invites for your game. Pass this alias to `rivet.api.party.common#CreatedInvite$alias` to consume the invite. - pub fn alias(mut self, input: impl Into) -> Self { - self.alias = Some(input.into()); - self - } - /// An alias used to join a given party. This alias must be unique for all invites for your game. Pass this alias to `rivet.api.party.common#CreatedInvite$alias` to consume the invite. - pub fn set_alias(mut self, input: std::option::Option) -> Self { - self.alias = input; - self - } - /// Consumes the builder and constructs a [`CreatePartyInviteConfig`](crate::model::CreatePartyInviteConfig) - pub fn build(self) -> crate::model::CreatePartyInviteConfig { - crate::model::CreatePartyInviteConfig { alias: self.alias } - } - } -} -impl CreatePartyInviteConfig { - /// Creates a new builder-style object to manufacture [`CreatePartyInviteConfig`](crate::model::CreatePartyInviteConfig) - pub fn builder() -> crate::model::create_party_invite_config::Builder { - crate::model::create_party_invite_config::Builder::default() - } -} - -/// Publicity configuration for creating a party. Null values will default -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CreatePartyPublicityConfig { - /// Defaults to `rivet.party#PartyPublicityLevel$VIEW`. - pub public: std::option::Option, - /// Defaults to `rivet.party#PartyPublicityLevel$JOIN`. - pub mutual_followers: std::option::Option, - /// Defaults to `rivet.party#PartyPublicityLevel$VIEW`. - pub groups: std::option::Option, -} -impl CreatePartyPublicityConfig { - /// Defaults to `rivet.party#PartyPublicityLevel$VIEW`. - pub fn public(&self) -> std::option::Option<&crate::model::PartyPublicityLevel> { - self.public.as_ref() - } - /// Defaults to `rivet.party#PartyPublicityLevel$JOIN`. - pub fn mutual_followers(&self) -> std::option::Option<&crate::model::PartyPublicityLevel> { - self.mutual_followers.as_ref() - } - /// Defaults to `rivet.party#PartyPublicityLevel$VIEW`. - pub fn groups(&self) -> std::option::Option<&crate::model::PartyPublicityLevel> { - self.groups.as_ref() - } -} -impl std::fmt::Debug for CreatePartyPublicityConfig { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CreatePartyPublicityConfig"); - formatter.field("public", &self.public); - formatter.field("mutual_followers", &self.mutual_followers); - formatter.field("groups", &self.groups); - formatter.finish() - } -} -/// See [`CreatePartyPublicityConfig`](crate::model::CreatePartyPublicityConfig) -pub mod create_party_publicity_config { - /// A builder for [`CreatePartyPublicityConfig`](crate::model::CreatePartyPublicityConfig) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) public: std::option::Option, - pub(crate) mutual_followers: std::option::Option, - pub(crate) groups: std::option::Option, - } - impl Builder { - /// Defaults to `rivet.party#PartyPublicityLevel$VIEW`. - pub fn public(mut self, input: crate::model::PartyPublicityLevel) -> Self { - self.public = Some(input); - self - } - /// Defaults to `rivet.party#PartyPublicityLevel$VIEW`. - pub fn set_public( - mut self, - input: std::option::Option, - ) -> Self { - self.public = input; - self - } - /// Defaults to `rivet.party#PartyPublicityLevel$JOIN`. - pub fn mutual_followers(mut self, input: crate::model::PartyPublicityLevel) -> Self { - self.mutual_followers = Some(input); - self - } - /// Defaults to `rivet.party#PartyPublicityLevel$JOIN`. - pub fn set_mutual_followers( - mut self, - input: std::option::Option, - ) -> Self { - self.mutual_followers = input; - self - } - /// Defaults to `rivet.party#PartyPublicityLevel$VIEW`. - pub fn groups(mut self, input: crate::model::PartyPublicityLevel) -> Self { - self.groups = Some(input); - self - } - /// Defaults to `rivet.party#PartyPublicityLevel$VIEW`. - pub fn set_groups( - mut self, - input: std::option::Option, - ) -> Self { - self.groups = input; - self - } - /// Consumes the builder and constructs a [`CreatePartyPublicityConfig`](crate::model::CreatePartyPublicityConfig) - pub fn build(self) -> crate::model::CreatePartyPublicityConfig { - crate::model::CreatePartyPublicityConfig { - public: self.public, - mutual_followers: self.mutual_followers, - groups: self.groups, - } - } - } -} -impl CreatePartyPublicityConfig { - /// Creates a new builder-style object to manufacture [`CreatePartyPublicityConfig`](crate::model::CreatePartyPublicityConfig) - pub fn builder() -> crate::model::create_party_publicity_config::Builder { - crate::model::create_party_publicity_config::Builder::default() - } -} - -/// Provided by watchable endpoints used in blocking loops. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct WatchResponse { - /// Index indicating the version of the data responded. Pas this to `rivet.common#WatchQuery` to block and wait for the next response. - pub index: std::option::Option, -} -impl WatchResponse { - /// Index indicating the version of the data responded. Pas this to `rivet.common#WatchQuery` to block and wait for the next response. - pub fn index(&self) -> std::option::Option<&str> { - self.index.as_deref() - } -} -impl std::fmt::Debug for WatchResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("WatchResponse"); - formatter.field("index", &self.index); - formatter.finish() - } -} -/// See [`WatchResponse`](crate::model::WatchResponse) -pub mod watch_response { - /// A builder for [`WatchResponse`](crate::model::WatchResponse) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) index: std::option::Option, - } - impl Builder { - /// Index indicating the version of the data responded. Pas this to `rivet.common#WatchQuery` to block and wait for the next response. - pub fn index(mut self, input: impl Into) -> Self { - self.index = Some(input.into()); - self - } - /// Index indicating the version of the data responded. Pas this to `rivet.common#WatchQuery` to block and wait for the next response. - pub fn set_index(mut self, input: std::option::Option) -> Self { - self.index = input; - self - } - /// Consumes the builder and constructs a [`WatchResponse`](crate::model::WatchResponse) - pub fn build(self) -> crate::model::WatchResponse { - crate::model::WatchResponse { index: self.index } - } - } -} -impl WatchResponse { - /// Creates a new builder-style object to manufacture [`WatchResponse`](crate::model::WatchResponse) - pub fn builder() -> crate::model::watch_response::Builder { - crate::model::watch_response::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PartyProfile { - /// A universally unique identifier. - pub party_id: std::option::Option, - /// RFC3339 timestamp. - pub create_ts: std::option::Option, - /// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. - pub activity: std::option::Option, - /// External links for a party. - pub external: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub publicity: std::option::Option, - /// Unsigned 32 bit integer. - pub party_size: std::option::Option, - /// A list of party members. - pub members: std::option::Option>, - /// A universally unique identifier. - pub thread_id: std::option::Option, - /// A list of party invites. - pub invites: std::option::Option>, -} -impl PartyProfile { - /// A universally unique identifier. - pub fn party_id(&self) -> std::option::Option<&str> { - self.party_id.as_deref() - } - /// RFC3339 timestamp. - pub fn create_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.create_ts.as_ref() - } - /// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. - pub fn activity(&self) -> std::option::Option<&crate::model::PartyActivity> { - self.activity.as_ref() - } - /// External links for a party. - pub fn external(&self) -> std::option::Option<&crate::model::PartyExternalLinks> { - self.external.as_ref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn publicity(&self) -> std::option::Option<&crate::model::PartyPublicity> { - self.publicity.as_ref() - } - /// Unsigned 32 bit integer. - pub fn party_size(&self) -> std::option::Option { - self.party_size - } - /// A list of party members. - pub fn members(&self) -> std::option::Option<&[crate::model::PartyMemberSummary]> { - self.members.as_deref() - } - /// A universally unique identifier. - pub fn thread_id(&self) -> std::option::Option<&str> { - self.thread_id.as_deref() - } - /// A list of party invites. - pub fn invites(&self) -> std::option::Option<&[crate::model::PartyInvite]> { - self.invites.as_deref() - } -} -impl std::fmt::Debug for PartyProfile { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PartyProfile"); - formatter.field("party_id", &self.party_id); - formatter.field("create_ts", &self.create_ts); - formatter.field("activity", &self.activity); - formatter.field("external", &self.external); - formatter.field("publicity", &self.publicity); - formatter.field("party_size", &self.party_size); - formatter.field("members", &self.members); - formatter.field("thread_id", &self.thread_id); - formatter.field("invites", &self.invites); - formatter.finish() - } -} -/// See [`PartyProfile`](crate::model::PartyProfile) -pub mod party_profile { - /// A builder for [`PartyProfile`](crate::model::PartyProfile) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) party_id: std::option::Option, - pub(crate) create_ts: std::option::Option, - pub(crate) activity: std::option::Option, - pub(crate) external: std::option::Option, - pub(crate) publicity: std::option::Option, - pub(crate) party_size: std::option::Option, - pub(crate) members: std::option::Option>, - pub(crate) thread_id: std::option::Option, - pub(crate) invites: std::option::Option>, - } - impl Builder { - /// A universally unique identifier. - pub fn party_id(mut self, input: impl Into) -> Self { - self.party_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_party_id(mut self, input: std::option::Option) -> Self { - self.party_id = input; - self - } - /// RFC3339 timestamp. - pub fn create_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.create_ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_create_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.create_ts = input; - self - } - /// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. - pub fn activity(mut self, input: crate::model::PartyActivity) -> Self { - self.activity = Some(input); - self - } - /// A union representing the activity of a given party. - `Idle`: The party is not doing anything. For example, the leader is sitting in the game menu or the players are hanging out on the hub. - `MatchmakerFindingLobby`: There is a find request in progress for the lobby. If the find request fails, it will go back to `Idle`. If the find request succeeds, it will go to `MatchmakerLobby`. - `MatchmakerLobby`: The party is in a lobby. This does not mean that all of the party members are in the lobby, see the member-specific states. - pub fn set_activity( - mut self, - input: std::option::Option, - ) -> Self { - self.activity = input; - self - } - /// External links for a party. - pub fn external(mut self, input: crate::model::PartyExternalLinks) -> Self { - self.external = Some(input); - self - } - /// External links for a party. - pub fn set_external( - mut self, - input: std::option::Option, - ) -> Self { - self.external = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn publicity(mut self, input: crate::model::PartyPublicity) -> Self { - self.publicity = Some(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_publicity( - mut self, - input: std::option::Option, - ) -> Self { - self.publicity = input; - self - } - /// Unsigned 32 bit integer. - pub fn party_size(mut self, input: i32) -> Self { - self.party_size = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_party_size(mut self, input: std::option::Option) -> Self { - self.party_size = input; - self - } - /// Appends an item to `members`. - /// - /// To override the contents of this collection use [`set_members`](Self::set_members). - /// - /// A list of party members. - pub fn members(mut self, input: crate::model::PartyMemberSummary) -> Self { - let mut v = self.members.unwrap_or_default(); - v.push(input); - self.members = Some(v); - self - } - /// A list of party members. - pub fn set_members( - mut self, - input: std::option::Option>, - ) -> Self { - self.members = input; - self - } - /// A universally unique identifier. - pub fn thread_id(mut self, input: impl Into) -> Self { - self.thread_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_thread_id(mut self, input: std::option::Option) -> Self { - self.thread_id = input; - self - } - /// Appends an item to `invites`. - /// - /// To override the contents of this collection use [`set_invites`](Self::set_invites). - /// - /// A list of party invites. - pub fn invites(mut self, input: crate::model::PartyInvite) -> Self { - let mut v = self.invites.unwrap_or_default(); - v.push(input); - self.invites = Some(v); - self - } - /// A list of party invites. - pub fn set_invites( - mut self, - input: std::option::Option>, - ) -> Self { - self.invites = input; - self - } - /// Consumes the builder and constructs a [`PartyProfile`](crate::model::PartyProfile) - pub fn build(self) -> crate::model::PartyProfile { - crate::model::PartyProfile { - party_id: self.party_id, - create_ts: self.create_ts, - activity: self.activity, - external: self.external, - publicity: self.publicity, - party_size: self.party_size, - members: self.members, - thread_id: self.thread_id, - invites: self.invites, - } - } - } -} -impl PartyProfile { - /// Creates a new builder-style object to manufacture [`PartyProfile`](crate::model::PartyProfile) - pub fn builder() -> crate::model::party_profile::Builder { - crate::model::party_profile::Builder::default() - } -} - -/// A party invite. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PartyInvite { - /// A universally unique identifier. - pub invite_id: std::option::Option, - /// RFC3339 timestamp. - pub create_ts: std::option::Option, - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub token: std::option::Option, - /// An alias used to join a given party. - pub alias: std::option::Option, - /// Extenral links for a party invite. - pub external: std::option::Option, -} -impl PartyInvite { - /// A universally unique identifier. - pub fn invite_id(&self) -> std::option::Option<&str> { - self.invite_id.as_deref() - } - /// RFC3339 timestamp. - pub fn create_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> { - self.create_ts.as_ref() - } - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn token(&self) -> std::option::Option<&str> { - self.token.as_deref() - } - /// An alias used to join a given party. - pub fn alias(&self) -> std::option::Option<&crate::model::PartyInviteAlias> { - self.alias.as_ref() - } - /// Extenral links for a party invite. - pub fn external(&self) -> std::option::Option<&crate::model::PartyInviteExternalLinks> { - self.external.as_ref() - } -} -impl std::fmt::Debug for PartyInvite { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PartyInvite"); - formatter.field("invite_id", &self.invite_id); - formatter.field("create_ts", &self.create_ts); - formatter.field("token", &"*** Sensitive Data Redacted ***"); - formatter.field("alias", &self.alias); - formatter.field("external", &self.external); - formatter.finish() - } -} -/// See [`PartyInvite`](crate::model::PartyInvite) -pub mod party_invite { - /// A builder for [`PartyInvite`](crate::model::PartyInvite) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) invite_id: std::option::Option, - pub(crate) create_ts: std::option::Option, - pub(crate) token: std::option::Option, - pub(crate) alias: std::option::Option, - pub(crate) external: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn invite_id(mut self, input: impl Into) -> Self { - self.invite_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_invite_id(mut self, input: std::option::Option) -> Self { - self.invite_id = input; - self - } - /// RFC3339 timestamp. - pub fn create_ts(mut self, input: aws_smithy_types::DateTime) -> Self { - self.create_ts = Some(input); - self - } - /// RFC3339 timestamp. - pub fn set_create_ts( - mut self, - input: std::option::Option, - ) -> Self { - self.create_ts = input; - self - } - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn token(mut self, input: impl Into) -> Self { - self.token = Some(input.into()); - self - } - /// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON. - pub fn set_token(mut self, input: std::option::Option) -> Self { - self.token = input; - self - } - /// An alias used to join a given party. - pub fn alias(mut self, input: crate::model::PartyInviteAlias) -> Self { - self.alias = Some(input); - self - } - /// An alias used to join a given party. - pub fn set_alias( - mut self, - input: std::option::Option, - ) -> Self { - self.alias = input; - self - } - /// Extenral links for a party invite. - pub fn external(mut self, input: crate::model::PartyInviteExternalLinks) -> Self { - self.external = Some(input); - self - } - /// Extenral links for a party invite. - pub fn set_external( - mut self, - input: std::option::Option, - ) -> Self { - self.external = input; - self - } - /// Consumes the builder and constructs a [`PartyInvite`](crate::model::PartyInvite) - pub fn build(self) -> crate::model::PartyInvite { - crate::model::PartyInvite { - invite_id: self.invite_id, - create_ts: self.create_ts, - token: self.token, - alias: self.alias, - external: self.external, - } - } - } -} -impl PartyInvite { - /// Creates a new builder-style object to manufacture [`PartyInvite`](crate::model::PartyInvite) - pub fn builder() -> crate::model::party_invite::Builder { - crate::model::party_invite::Builder::default() - } -} - -/// Extenral links for a party invite. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PartyInviteExternalLinks { - /// The invite link used to join this party from an external site. - pub invite: std::option::Option, -} -impl PartyInviteExternalLinks { - /// The invite link used to join this party from an external site. - pub fn invite(&self) -> std::option::Option<&str> { - self.invite.as_deref() - } -} -impl std::fmt::Debug for PartyInviteExternalLinks { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PartyInviteExternalLinks"); - formatter.field("invite", &self.invite); - formatter.finish() - } -} -/// See [`PartyInviteExternalLinks`](crate::model::PartyInviteExternalLinks) -pub mod party_invite_external_links { - /// A builder for [`PartyInviteExternalLinks`](crate::model::PartyInviteExternalLinks) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) invite: std::option::Option, - } - impl Builder { - /// The invite link used to join this party from an external site. - pub fn invite(mut self, input: impl Into) -> Self { - self.invite = Some(input.into()); - self - } - /// The invite link used to join this party from an external site. - pub fn set_invite(mut self, input: std::option::Option) -> Self { - self.invite = input; - self - } - /// Consumes the builder and constructs a [`PartyInviteExternalLinks`](crate::model::PartyInviteExternalLinks) - pub fn build(self) -> crate::model::PartyInviteExternalLinks { - crate::model::PartyInviteExternalLinks { - invite: self.invite, - } - } - } -} -impl PartyInviteExternalLinks { - /// Creates a new builder-style object to manufacture [`PartyInviteExternalLinks`](crate::model::PartyInviteExternalLinks) - pub fn builder() -> crate::model::party_invite_external_links::Builder { - crate::model::party_invite_external_links::Builder::default() - } -} - -/// An alias used to join a given party. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct PartyInviteAlias { - /// A universally unique identifier. - pub namespace_id: std::option::Option, - /// The alias used to join a given party. - pub alias: std::option::Option, -} -impl PartyInviteAlias { - /// A universally unique identifier. - pub fn namespace_id(&self) -> std::option::Option<&str> { - self.namespace_id.as_deref() - } - /// The alias used to join a given party. - pub fn alias(&self) -> std::option::Option<&str> { - self.alias.as_deref() - } -} -impl std::fmt::Debug for PartyInviteAlias { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("PartyInviteAlias"); - formatter.field("namespace_id", &self.namespace_id); - formatter.field("alias", &self.alias); - formatter.finish() - } -} -/// See [`PartyInviteAlias`](crate::model::PartyInviteAlias) -pub mod party_invite_alias { - /// A builder for [`PartyInviteAlias`](crate::model::PartyInviteAlias) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) namespace_id: std::option::Option, - pub(crate) alias: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn namespace_id(mut self, input: impl Into) -> Self { - self.namespace_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_namespace_id(mut self, input: std::option::Option) -> Self { - self.namespace_id = input; - self - } - /// The alias used to join a given party. - pub fn alias(mut self, input: impl Into) -> Self { - self.alias = Some(input.into()); - self - } - /// The alias used to join a given party. - pub fn set_alias(mut self, input: std::option::Option) -> Self { - self.alias = input; - self - } - /// Consumes the builder and constructs a [`PartyInviteAlias`](crate::model::PartyInviteAlias) - pub fn build(self) -> crate::model::PartyInviteAlias { - crate::model::PartyInviteAlias { - namespace_id: self.namespace_id, - alias: self.alias, - } - } - } -} -impl PartyInviteAlias { - /// Creates a new builder-style object to manufacture [`PartyInviteAlias`](crate::model::PartyInviteAlias) - pub fn builder() -> crate::model::party_invite_alias::Builder { - crate::model::party_invite_alias::Builder::default() - } -} diff --git a/lib/smithy-output/api-party/rust/rust/src/operation.rs b/lib/smithy-output/api-party/rust/rust/src/operation.rs deleted file mode 100644 index 974b63129..000000000 --- a/lib/smithy-output/api-party/rust/rust/src/operation.rs +++ /dev/null @@ -1,635 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Operation shape for `CreateParty`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`create_party`](crate::client::Client::create_party). -/// -/// See [`crate::client::fluent_builders::CreateParty`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct CreateParty { - _private: (), -} -impl CreateParty { - /// Creates a new builder-style object to manufacture [`CreatePartyInput`](crate::input::CreatePartyInput) - pub fn builder() -> crate::input::create_party_input::Builder { - crate::input::create_party_input::Builder::default() - } - /// Creates a new `CreateParty` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for CreateParty { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_create_party_error(response) - } else { - crate::operation_deser::parse_create_party_response(response) - } - } -} - -/// Operation shape for `CreatePartyInvite`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`create_party_invite`](crate::client::Client::create_party_invite). -/// -/// See [`crate::client::fluent_builders::CreatePartyInvite`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct CreatePartyInvite { - _private: (), -} -impl CreatePartyInvite { - /// Creates a new builder-style object to manufacture [`CreatePartyInviteInput`](crate::input::CreatePartyInviteInput) - pub fn builder() -> crate::input::create_party_invite_input::Builder { - crate::input::create_party_invite_input::Builder::default() - } - /// Creates a new `CreatePartyInvite` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for CreatePartyInvite { - type Output = std::result::Result< - crate::output::CreatePartyInviteOutput, - crate::error::CreatePartyInviteError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_create_party_invite_error(response) - } else { - crate::operation_deser::parse_create_party_invite_response(response) - } - } -} - -/// Operation shape for `GetPartyFromInvite`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`get_party_from_invite`](crate::client::Client::get_party_from_invite). -/// -/// See [`crate::client::fluent_builders::GetPartyFromInvite`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GetPartyFromInvite { - _private: (), -} -impl GetPartyFromInvite { - /// Creates a new builder-style object to manufacture [`GetPartyFromInviteInput`](crate::input::GetPartyFromInviteInput) - pub fn builder() -> crate::input::get_party_from_invite_input::Builder { - crate::input::get_party_from_invite_input::Builder::default() - } - /// Creates a new `GetPartyFromInvite` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GetPartyFromInvite { - type Output = std::result::Result< - crate::output::GetPartyFromInviteOutput, - crate::error::GetPartyFromInviteError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_get_party_from_invite_error(response) - } else { - crate::operation_deser::parse_get_party_from_invite_response(response) - } - } -} - -/// Operation shape for `GetPartyProfile`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`get_party_profile`](crate::client::Client::get_party_profile). -/// -/// See [`crate::client::fluent_builders::GetPartyProfile`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GetPartyProfile { - _private: (), -} -impl GetPartyProfile { - /// Creates a new builder-style object to manufacture [`GetPartyProfileInput`](crate::input::GetPartyProfileInput) - pub fn builder() -> crate::input::get_party_profile_input::Builder { - crate::input::get_party_profile_input::Builder::default() - } - /// Creates a new `GetPartyProfile` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GetPartyProfile { - type Output = std::result::Result< - crate::output::GetPartyProfileOutput, - crate::error::GetPartyProfileError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_get_party_profile_error(response) - } else { - crate::operation_deser::parse_get_party_profile_response(response) - } - } -} - -/// Operation shape for `GetPartySelfProfile`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`get_party_self_profile`](crate::client::Client::get_party_self_profile). -/// -/// See [`crate::client::fluent_builders::GetPartySelfProfile`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GetPartySelfProfile { - _private: (), -} -impl GetPartySelfProfile { - /// Creates a new builder-style object to manufacture [`GetPartySelfProfileInput`](crate::input::GetPartySelfProfileInput) - pub fn builder() -> crate::input::get_party_self_profile_input::Builder { - crate::input::get_party_self_profile_input::Builder::default() - } - /// Creates a new `GetPartySelfProfile` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GetPartySelfProfile { - type Output = std::result::Result< - crate::output::GetPartySelfProfileOutput, - crate::error::GetPartySelfProfileError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_get_party_self_profile_error(response) - } else { - crate::operation_deser::parse_get_party_self_profile_response(response) - } - } -} - -/// Operation shape for `GetPartySelfSummary`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`get_party_self_summary`](crate::client::Client::get_party_self_summary). -/// -/// See [`crate::client::fluent_builders::GetPartySelfSummary`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GetPartySelfSummary { - _private: (), -} -impl GetPartySelfSummary { - /// Creates a new builder-style object to manufacture [`GetPartySelfSummaryInput`](crate::input::GetPartySelfSummaryInput) - pub fn builder() -> crate::input::get_party_self_summary_input::Builder { - crate::input::get_party_self_summary_input::Builder::default() - } - /// Creates a new `GetPartySelfSummary` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GetPartySelfSummary { - type Output = std::result::Result< - crate::output::GetPartySelfSummaryOutput, - crate::error::GetPartySelfSummaryError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_get_party_self_summary_error(response) - } else { - crate::operation_deser::parse_get_party_self_summary_response(response) - } - } -} - -/// Operation shape for `GetPartySummary`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`get_party_summary`](crate::client::Client::get_party_summary). -/// -/// See [`crate::client::fluent_builders::GetPartySummary`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GetPartySummary { - _private: (), -} -impl GetPartySummary { - /// Creates a new builder-style object to manufacture [`GetPartySummaryInput`](crate::input::GetPartySummaryInput) - pub fn builder() -> crate::input::get_party_summary_input::Builder { - crate::input::get_party_summary_input::Builder::default() - } - /// Creates a new `GetPartySummary` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GetPartySummary { - type Output = std::result::Result< - crate::output::GetPartySummaryOutput, - crate::error::GetPartySummaryError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_get_party_summary_error(response) - } else { - crate::operation_deser::parse_get_party_summary_response(response) - } - } -} - -/// Operation shape for `JoinParty`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`join_party`](crate::client::Client::join_party). -/// -/// See [`crate::client::fluent_builders::JoinParty`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct JoinParty { - _private: (), -} -impl JoinParty { - /// Creates a new builder-style object to manufacture [`JoinPartyInput`](crate::input::JoinPartyInput) - pub fn builder() -> crate::input::join_party_input::Builder { - crate::input::join_party_input::Builder::default() - } - /// Creates a new `JoinParty` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for JoinParty { - type Output = std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_join_party_error(response) - } else { - crate::operation_deser::parse_join_party_response(response) - } - } -} - -/// Operation shape for `KickMember`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`kick_member`](crate::client::Client::kick_member). -/// -/// See [`crate::client::fluent_builders::KickMember`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct KickMember { - _private: (), -} -impl KickMember { - /// Creates a new builder-style object to manufacture [`KickMemberInput`](crate::input::KickMemberInput) - pub fn builder() -> crate::input::kick_member_input::Builder { - crate::input::kick_member_input::Builder::default() - } - /// Creates a new `KickMember` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for KickMember { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_kick_member_error(response) - } else { - crate::operation_deser::parse_kick_member_response(response) - } - } -} - -/// Operation shape for `LeaveParty`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`leave_party`](crate::client::Client::leave_party). -/// -/// See [`crate::client::fluent_builders::LeaveParty`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct LeaveParty { - _private: (), -} -impl LeaveParty { - /// Creates a new builder-style object to manufacture [`LeavePartyInput`](crate::input::LeavePartyInput) - pub fn builder() -> crate::input::leave_party_input::Builder { - crate::input::leave_party_input::Builder::default() - } - /// Creates a new `LeaveParty` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for LeaveParty { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_leave_party_error(response) - } else { - crate::operation_deser::parse_leave_party_response(response) - } - } -} - -/// Operation shape for `RevokePartyInvite`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`revoke_party_invite`](crate::client::Client::revoke_party_invite). -/// -/// See [`crate::client::fluent_builders::RevokePartyInvite`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct RevokePartyInvite { - _private: (), -} -impl RevokePartyInvite { - /// Creates a new builder-style object to manufacture [`RevokePartyInviteInput`](crate::input::RevokePartyInviteInput) - pub fn builder() -> crate::input::revoke_party_invite_input::Builder { - crate::input::revoke_party_invite_input::Builder::default() - } - /// Creates a new `RevokePartyInvite` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for RevokePartyInvite { - type Output = std::result::Result< - crate::output::RevokePartyInviteOutput, - crate::error::RevokePartyInviteError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_revoke_party_invite_error(response) - } else { - crate::operation_deser::parse_revoke_party_invite_response(response) - } - } -} - -/// Operation shape for `SendJoinRequest`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`send_join_request`](crate::client::Client::send_join_request). -/// -/// See [`crate::client::fluent_builders::SendJoinRequest`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct SendJoinRequest { - _private: (), -} -impl SendJoinRequest { - /// Creates a new builder-style object to manufacture [`SendJoinRequestInput`](crate::input::SendJoinRequestInput) - pub fn builder() -> crate::input::send_join_request_input::Builder { - crate::input::send_join_request_input::Builder::default() - } - /// Creates a new `SendJoinRequest` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for SendJoinRequest { - type Output = std::result::Result< - crate::output::SendJoinRequestOutput, - crate::error::SendJoinRequestError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_send_join_request_error(response) - } else { - crate::operation_deser::parse_send_join_request_response(response) - } - } -} - -/// Operation shape for `SetPartyPublicity`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`set_party_publicity`](crate::client::Client::set_party_publicity). -/// -/// See [`crate::client::fluent_builders::SetPartyPublicity`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct SetPartyPublicity { - _private: (), -} -impl SetPartyPublicity { - /// Creates a new builder-style object to manufacture [`SetPartyPublicityInput`](crate::input::SetPartyPublicityInput) - pub fn builder() -> crate::input::set_party_publicity_input::Builder { - crate::input::set_party_publicity_input::Builder::default() - } - /// Creates a new `SetPartyPublicity` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for SetPartyPublicity { - type Output = std::result::Result< - crate::output::SetPartyPublicityOutput, - crate::error::SetPartyPublicityError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_set_party_publicity_error(response) - } else { - crate::operation_deser::parse_set_party_publicity_response(response) - } - } -} - -/// Operation shape for `TransferPartyOwnership`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`transfer_party_ownership`](crate::client::Client::transfer_party_ownership). -/// -/// See [`crate::client::fluent_builders::TransferPartyOwnership`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct TransferPartyOwnership { - _private: (), -} -impl TransferPartyOwnership { - /// Creates a new builder-style object to manufacture [`TransferPartyOwnershipInput`](crate::input::TransferPartyOwnershipInput) - pub fn builder() -> crate::input::transfer_party_ownership_input::Builder { - crate::input::transfer_party_ownership_input::Builder::default() - } - /// Creates a new `TransferPartyOwnership` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for TransferPartyOwnership { - type Output = std::result::Result< - crate::output::TransferPartyOwnershipOutput, - crate::error::TransferPartyOwnershipError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_transfer_party_ownership_error(response) - } else { - crate::operation_deser::parse_transfer_party_ownership_response(response) - } - } -} - -/// Operation shape for `FindMatchmakerLobbyForParty`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`find_matchmaker_lobby_for_party`](crate::client::Client::find_matchmaker_lobby_for_party). -/// -/// See [`crate::client::fluent_builders::FindMatchmakerLobbyForParty`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct FindMatchmakerLobbyForParty { - _private: (), -} -impl FindMatchmakerLobbyForParty { - /// Creates a new builder-style object to manufacture [`FindMatchmakerLobbyForPartyInput`](crate::input::FindMatchmakerLobbyForPartyInput) - pub fn builder() -> crate::input::find_matchmaker_lobby_for_party_input::Builder { - crate::input::find_matchmaker_lobby_for_party_input::Builder::default() - } - /// Creates a new `FindMatchmakerLobbyForParty` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for FindMatchmakerLobbyForParty { - type Output = std::result::Result< - crate::output::FindMatchmakerLobbyForPartyOutput, - crate::error::FindMatchmakerLobbyForPartyError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_find_matchmaker_lobby_for_party_error(response) - } else { - crate::operation_deser::parse_find_matchmaker_lobby_for_party_response(response) - } - } -} - -/// Operation shape for `JoinMatchmakerLobbyForParty`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`join_matchmaker_lobby_for_party`](crate::client::Client::join_matchmaker_lobby_for_party). -/// -/// See [`crate::client::fluent_builders::JoinMatchmakerLobbyForParty`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct JoinMatchmakerLobbyForParty { - _private: (), -} -impl JoinMatchmakerLobbyForParty { - /// Creates a new builder-style object to manufacture [`JoinMatchmakerLobbyForPartyInput`](crate::input::JoinMatchmakerLobbyForPartyInput) - pub fn builder() -> crate::input::join_matchmaker_lobby_for_party_input::Builder { - crate::input::join_matchmaker_lobby_for_party_input::Builder::default() - } - /// Creates a new `JoinMatchmakerLobbyForParty` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for JoinMatchmakerLobbyForParty { - type Output = std::result::Result< - crate::output::JoinMatchmakerLobbyForPartyOutput, - crate::error::JoinMatchmakerLobbyForPartyError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_join_matchmaker_lobby_for_party_error(response) - } else { - crate::operation_deser::parse_join_matchmaker_lobby_for_party_response(response) - } - } -} - -/// Operation shape for `MatchmakerSelfReady`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`matchmaker_self_ready`](crate::client::Client::matchmaker_self_ready). -/// -/// See [`crate::client::fluent_builders::MatchmakerSelfReady`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct MatchmakerSelfReady { - _private: (), -} -impl MatchmakerSelfReady { - /// Creates a new builder-style object to manufacture [`MatchmakerSelfReadyInput`](crate::input::MatchmakerSelfReadyInput) - pub fn builder() -> crate::input::matchmaker_self_ready_input::Builder { - crate::input::matchmaker_self_ready_input::Builder::default() - } - /// Creates a new `MatchmakerSelfReady` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for MatchmakerSelfReady { - type Output = std::result::Result< - crate::output::MatchmakerSelfReadyOutput, - crate::error::MatchmakerSelfReadyError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_matchmaker_self_ready_error(response) - } else { - crate::operation_deser::parse_matchmaker_self_ready_response(response) - } - } -} - -/// Operation shape for `SetPartyToIdle`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`set_party_to_idle`](crate::client::Client::set_party_to_idle). -/// -/// See [`crate::client::fluent_builders::SetPartyToIdle`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct SetPartyToIdle { - _private: (), -} -impl SetPartyToIdle { - /// Creates a new builder-style object to manufacture [`SetPartyToIdleInput`](crate::input::SetPartyToIdleInput) - pub fn builder() -> crate::input::set_party_to_idle_input::Builder { - crate::input::set_party_to_idle_input::Builder::default() - } - /// Creates a new `SetPartyToIdle` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for SetPartyToIdle { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_set_party_to_idle_error(response) - } else { - crate::operation_deser::parse_set_party_to_idle_response(response) - } - } -} - -/// Operation shape for `SetSelfInactive`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`set_self_inactive`](crate::client::Client::set_self_inactive). -/// -/// See [`crate::client::fluent_builders::SetSelfInactive`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct SetSelfInactive { - _private: (), -} -impl SetSelfInactive { - /// Creates a new builder-style object to manufacture [`SetSelfInactiveInput`](crate::input::SetSelfInactiveInput) - pub fn builder() -> crate::input::set_self_inactive_input::Builder { - crate::input::set_self_inactive_input::Builder::default() - } - /// Creates a new `SetSelfInactive` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for SetSelfInactive { - type Output = std::result::Result< - crate::output::SetSelfInactiveOutput, - crate::error::SetSelfInactiveError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_set_self_inactive_error(response) - } else { - crate::operation_deser::parse_set_self_inactive_response(response) - } - } -} diff --git a/lib/smithy-output/api-party/rust/rust/src/operation_deser.rs b/lib/smithy-output/api-party/rust/rust/src/operation_deser.rs deleted file mode 100644 index 9aa4c7ff2..000000000 --- a/lib/smithy-output/api-party/rust/rust/src/operation_deser.rs +++ /dev/null @@ -1,2874 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[allow(clippy::unnecessary_wraps)] -pub fn parse_create_party_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::CreatePartyError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::CreatePartyError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::CreatePartyError { - meta: generic, - kind: crate::error::CreatePartyErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::CreatePartyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::CreatePartyError { - meta: generic, - kind: crate::error::CreatePartyErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreatePartyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::CreatePartyError { - meta: generic, - kind: crate::error::CreatePartyErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreatePartyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::CreatePartyError { - meta: generic, - kind: crate::error::CreatePartyErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreatePartyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::CreatePartyError { - meta: generic, - kind: crate::error::CreatePartyErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreatePartyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::CreatePartyError { - meta: generic, - kind: crate::error::CreatePartyErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreatePartyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::CreatePartyError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_create_party_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::create_party_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_create_party( - response.body().as_ref(), - output, - ) - .map_err(crate::error::CreatePartyError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_create_party_invite_error( - response: &http::Response, -) -> std::result::Result -{ - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::CreatePartyInviteError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::CreatePartyInviteError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::CreatePartyInviteError { - meta: generic, - kind: crate::error::CreatePartyInviteErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::CreatePartyInviteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::CreatePartyInviteError { - meta: generic, - kind: crate::error::CreatePartyInviteErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreatePartyInviteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::CreatePartyInviteError { - meta: generic, - kind: crate::error::CreatePartyInviteErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreatePartyInviteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::CreatePartyInviteError { - meta: generic, - kind: crate::error::CreatePartyInviteErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreatePartyInviteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::CreatePartyInviteError { - meta: generic, - kind: crate::error::CreatePartyInviteErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreatePartyInviteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::CreatePartyInviteError { - meta: generic, - kind: crate::error::CreatePartyInviteErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreatePartyInviteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::CreatePartyInviteError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_create_party_invite_response( - response: &http::Response, -) -> std::result::Result -{ - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::create_party_invite_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_create_party_invite( - response.body().as_ref(), - output, - ) - .map_err(crate::error::CreatePartyInviteError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_party_from_invite_error( - response: &http::Response, -) -> std::result::Result< - crate::output::GetPartyFromInviteOutput, - crate::error::GetPartyFromInviteError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GetPartyFromInviteError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::GetPartyFromInviteError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GetPartyFromInviteError { - meta: generic, - kind: crate::error::GetPartyFromInviteErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetPartyFromInviteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GetPartyFromInviteError { - meta: generic, - kind: crate::error::GetPartyFromInviteErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetPartyFromInviteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GetPartyFromInviteError { - meta: generic, - kind: crate::error::GetPartyFromInviteErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetPartyFromInviteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GetPartyFromInviteError { - meta: generic, - kind: crate::error::GetPartyFromInviteErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetPartyFromInviteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GetPartyFromInviteError { - meta: generic, - kind: crate::error::GetPartyFromInviteErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetPartyFromInviteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GetPartyFromInviteError { - meta: generic, - kind: crate::error::GetPartyFromInviteErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetPartyFromInviteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GetPartyFromInviteError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_party_from_invite_response( - response: &http::Response, -) -> std::result::Result< - crate::output::GetPartyFromInviteOutput, - crate::error::GetPartyFromInviteError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::get_party_from_invite_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_get_party_from_invite( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetPartyFromInviteError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_party_profile_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GetPartyProfileError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::GetPartyProfileError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GetPartyProfileError { - meta: generic, - kind: crate::error::GetPartyProfileErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetPartyProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GetPartyProfileError { - meta: generic, - kind: crate::error::GetPartyProfileErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetPartyProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GetPartyProfileError { - meta: generic, - kind: crate::error::GetPartyProfileErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetPartyProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GetPartyProfileError { - meta: generic, - kind: crate::error::GetPartyProfileErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetPartyProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GetPartyProfileError { - meta: generic, - kind: crate::error::GetPartyProfileErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetPartyProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GetPartyProfileError { - meta: generic, - kind: crate::error::GetPartyProfileErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetPartyProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GetPartyProfileError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_party_profile_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::get_party_profile_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_get_party_profile( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetPartyProfileError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_party_self_profile_error( - response: &http::Response, -) -> std::result::Result< - crate::output::GetPartySelfProfileOutput, - crate::error::GetPartySelfProfileError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GetPartySelfProfileError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::GetPartySelfProfileError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GetPartySelfProfileError { - meta: generic, - kind: crate::error::GetPartySelfProfileErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetPartySelfProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GetPartySelfProfileError { - meta: generic, - kind: crate::error::GetPartySelfProfileErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetPartySelfProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GetPartySelfProfileError { - meta: generic, - kind: crate::error::GetPartySelfProfileErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetPartySelfProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GetPartySelfProfileError { - meta: generic, - kind: crate::error::GetPartySelfProfileErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetPartySelfProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GetPartySelfProfileError { - meta: generic, - kind: crate::error::GetPartySelfProfileErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetPartySelfProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GetPartySelfProfileError { - meta: generic, - kind: crate::error::GetPartySelfProfileErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetPartySelfProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GetPartySelfProfileError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_party_self_profile_response( - response: &http::Response, -) -> std::result::Result< - crate::output::GetPartySelfProfileOutput, - crate::error::GetPartySelfProfileError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::get_party_self_profile_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_get_party_self_profile( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetPartySelfProfileError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_party_self_summary_error( - response: &http::Response, -) -> std::result::Result< - crate::output::GetPartySelfSummaryOutput, - crate::error::GetPartySelfSummaryError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GetPartySelfSummaryError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::GetPartySelfSummaryError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GetPartySelfSummaryError { - meta: generic, - kind: crate::error::GetPartySelfSummaryErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetPartySelfSummaryError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GetPartySelfSummaryError { - meta: generic, - kind: crate::error::GetPartySelfSummaryErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetPartySelfSummaryError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GetPartySelfSummaryError { - meta: generic, - kind: crate::error::GetPartySelfSummaryErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetPartySelfSummaryError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GetPartySelfSummaryError { - meta: generic, - kind: crate::error::GetPartySelfSummaryErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetPartySelfSummaryError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GetPartySelfSummaryError { - meta: generic, - kind: crate::error::GetPartySelfSummaryErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetPartySelfSummaryError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GetPartySelfSummaryError { - meta: generic, - kind: crate::error::GetPartySelfSummaryErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetPartySelfSummaryError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GetPartySelfSummaryError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_party_self_summary_response( - response: &http::Response, -) -> std::result::Result< - crate::output::GetPartySelfSummaryOutput, - crate::error::GetPartySelfSummaryError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::get_party_self_summary_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_get_party_self_summary( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetPartySelfSummaryError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_party_summary_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GetPartySummaryError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::GetPartySummaryError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GetPartySummaryError { - meta: generic, - kind: crate::error::GetPartySummaryErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetPartySummaryError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GetPartySummaryError { - meta: generic, - kind: crate::error::GetPartySummaryErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetPartySummaryError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GetPartySummaryError { - meta: generic, - kind: crate::error::GetPartySummaryErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetPartySummaryError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GetPartySummaryError { - meta: generic, - kind: crate::error::GetPartySummaryErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetPartySummaryError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GetPartySummaryError { - meta: generic, - kind: crate::error::GetPartySummaryErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetPartySummaryError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GetPartySummaryError { - meta: generic, - kind: crate::error::GetPartySummaryErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetPartySummaryError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GetPartySummaryError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_party_summary_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::get_party_summary_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_get_party_summary( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetPartySummaryError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_join_party_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::JoinPartyError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::JoinPartyError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::JoinPartyError { - meta: generic, - kind: crate::error::JoinPartyErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::JoinPartyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::JoinPartyError { - meta: generic, - kind: crate::error::JoinPartyErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::JoinPartyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::JoinPartyError { - meta: generic, - kind: crate::error::JoinPartyErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::JoinPartyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::JoinPartyError { - meta: generic, - kind: crate::error::JoinPartyErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::JoinPartyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::JoinPartyError { - meta: generic, - kind: crate::error::JoinPartyErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::JoinPartyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::JoinPartyError { - meta: generic, - kind: crate::error::JoinPartyErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::JoinPartyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::JoinPartyError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_join_party_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::join_party_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_join_party( - response.body().as_ref(), - output, - ) - .map_err(crate::error::JoinPartyError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_kick_member_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::KickMemberError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::KickMemberError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::KickMemberError { - meta: generic, - kind: crate::error::KickMemberErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::KickMemberError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::KickMemberError { - meta: generic, - kind: crate::error::KickMemberErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::KickMemberError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::KickMemberError { - meta: generic, - kind: crate::error::KickMemberErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::KickMemberError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::KickMemberError { - meta: generic, - kind: crate::error::KickMemberErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::KickMemberError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::KickMemberError { - meta: generic, - kind: crate::error::KickMemberErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::KickMemberError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::KickMemberError { - meta: generic, - kind: crate::error::KickMemberErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::KickMemberError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::KickMemberError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_kick_member_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::kick_member_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_leave_party_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::LeavePartyError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::LeavePartyError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::LeavePartyError { - meta: generic, - kind: crate::error::LeavePartyErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::LeavePartyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::LeavePartyError { - meta: generic, - kind: crate::error::LeavePartyErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::LeavePartyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::LeavePartyError { - meta: generic, - kind: crate::error::LeavePartyErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::LeavePartyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::LeavePartyError { - meta: generic, - kind: crate::error::LeavePartyErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::LeavePartyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::LeavePartyError { - meta: generic, - kind: crate::error::LeavePartyErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::LeavePartyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::LeavePartyError { - meta: generic, - kind: crate::error::LeavePartyErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::LeavePartyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::LeavePartyError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_leave_party_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::leave_party_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_revoke_party_invite_error( - response: &http::Response, -) -> std::result::Result -{ - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::RevokePartyInviteError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::RevokePartyInviteError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::RevokePartyInviteError { - meta: generic, - kind: crate::error::RevokePartyInviteErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::RevokePartyInviteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::RevokePartyInviteError { - meta: generic, - kind: crate::error::RevokePartyInviteErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::RevokePartyInviteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::RevokePartyInviteError { - meta: generic, - kind: crate::error::RevokePartyInviteErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::RevokePartyInviteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::RevokePartyInviteError { - meta: generic, - kind: crate::error::RevokePartyInviteErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::RevokePartyInviteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::RevokePartyInviteError { - meta: generic, - kind: crate::error::RevokePartyInviteErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::RevokePartyInviteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::RevokePartyInviteError { - meta: generic, - kind: crate::error::RevokePartyInviteErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::RevokePartyInviteError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::RevokePartyInviteError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_revoke_party_invite_response( - response: &http::Response, -) -> std::result::Result -{ - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::revoke_party_invite_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_send_join_request_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::SendJoinRequestError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::SendJoinRequestError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::SendJoinRequestError { - meta: generic, - kind: crate::error::SendJoinRequestErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::SendJoinRequestError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::SendJoinRequestError { - meta: generic, - kind: crate::error::SendJoinRequestErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::SendJoinRequestError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::SendJoinRequestError { - meta: generic, - kind: crate::error::SendJoinRequestErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::SendJoinRequestError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::SendJoinRequestError { - meta: generic, - kind: crate::error::SendJoinRequestErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::SendJoinRequestError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::SendJoinRequestError { - meta: generic, - kind: crate::error::SendJoinRequestErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::SendJoinRequestError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::SendJoinRequestError { - meta: generic, - kind: crate::error::SendJoinRequestErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::SendJoinRequestError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::SendJoinRequestError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_send_join_request_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::send_join_request_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_set_party_publicity_error( - response: &http::Response, -) -> std::result::Result -{ - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::SetPartyPublicityError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::SetPartyPublicityError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::SetPartyPublicityError { - meta: generic, - kind: crate::error::SetPartyPublicityErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::SetPartyPublicityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::SetPartyPublicityError { - meta: generic, - kind: crate::error::SetPartyPublicityErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetPartyPublicityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::SetPartyPublicityError { - meta: generic, - kind: crate::error::SetPartyPublicityErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetPartyPublicityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::SetPartyPublicityError { - meta: generic, - kind: crate::error::SetPartyPublicityErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetPartyPublicityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::SetPartyPublicityError { - meta: generic, - kind: crate::error::SetPartyPublicityErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetPartyPublicityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::SetPartyPublicityError { - meta: generic, - kind: crate::error::SetPartyPublicityErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetPartyPublicityError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::SetPartyPublicityError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_set_party_publicity_response( - response: &http::Response, -) -> std::result::Result -{ - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::set_party_publicity_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_transfer_party_ownership_error( - response: &http::Response, -) -> std::result::Result< - crate::output::TransferPartyOwnershipOutput, - crate::error::TransferPartyOwnershipError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::TransferPartyOwnershipError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => { - return Err(crate::error::TransferPartyOwnershipError::unhandled( - generic, - )) - } - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::TransferPartyOwnershipError { - meta: generic, - kind: crate::error::TransferPartyOwnershipErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::TransferPartyOwnershipError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::TransferPartyOwnershipError { - meta: generic, - kind: crate::error::TransferPartyOwnershipErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::TransferPartyOwnershipError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::TransferPartyOwnershipError { - meta: generic, - kind: crate::error::TransferPartyOwnershipErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::TransferPartyOwnershipError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::TransferPartyOwnershipError { - meta: generic, - kind: crate::error::TransferPartyOwnershipErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::TransferPartyOwnershipError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::TransferPartyOwnershipError { - meta: generic, - kind: crate::error::TransferPartyOwnershipErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::TransferPartyOwnershipError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::TransferPartyOwnershipError { - meta: generic, - kind: crate::error::TransferPartyOwnershipErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::TransferPartyOwnershipError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::TransferPartyOwnershipError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_transfer_party_ownership_response( - response: &http::Response, -) -> std::result::Result< - crate::output::TransferPartyOwnershipOutput, - crate::error::TransferPartyOwnershipError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::transfer_party_ownership_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_find_matchmaker_lobby_for_party_error( - response: &http::Response, -) -> std::result::Result< - crate::output::FindMatchmakerLobbyForPartyOutput, - crate::error::FindMatchmakerLobbyForPartyError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::FindMatchmakerLobbyForPartyError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => { - return Err(crate::error::FindMatchmakerLobbyForPartyError::unhandled( - generic, - )) - } - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::FindMatchmakerLobbyForPartyError { - meta: generic, - kind: crate::error::FindMatchmakerLobbyForPartyErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::FindMatchmakerLobbyForPartyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::FindMatchmakerLobbyForPartyError { - meta: generic, - kind: crate::error::FindMatchmakerLobbyForPartyErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::FindMatchmakerLobbyForPartyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::FindMatchmakerLobbyForPartyError { - meta: generic, - kind: crate::error::FindMatchmakerLobbyForPartyErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::FindMatchmakerLobbyForPartyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::FindMatchmakerLobbyForPartyError { - meta: generic, - kind: crate::error::FindMatchmakerLobbyForPartyErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::FindMatchmakerLobbyForPartyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::FindMatchmakerLobbyForPartyError { - meta: generic, - kind: crate::error::FindMatchmakerLobbyForPartyErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::FindMatchmakerLobbyForPartyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::FindMatchmakerLobbyForPartyError { - meta: generic, - kind: crate::error::FindMatchmakerLobbyForPartyErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::FindMatchmakerLobbyForPartyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::FindMatchmakerLobbyForPartyError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_find_matchmaker_lobby_for_party_response( - response: &http::Response, -) -> std::result::Result< - crate::output::FindMatchmakerLobbyForPartyOutput, - crate::error::FindMatchmakerLobbyForPartyError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::find_matchmaker_lobby_for_party_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_join_matchmaker_lobby_for_party_error( - response: &http::Response, -) -> std::result::Result< - crate::output::JoinMatchmakerLobbyForPartyOutput, - crate::error::JoinMatchmakerLobbyForPartyError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::JoinMatchmakerLobbyForPartyError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => { - return Err(crate::error::JoinMatchmakerLobbyForPartyError::unhandled( - generic, - )) - } - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::JoinMatchmakerLobbyForPartyError { - meta: generic, - kind: crate::error::JoinMatchmakerLobbyForPartyErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::JoinMatchmakerLobbyForPartyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::JoinMatchmakerLobbyForPartyError { - meta: generic, - kind: crate::error::JoinMatchmakerLobbyForPartyErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::JoinMatchmakerLobbyForPartyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::JoinMatchmakerLobbyForPartyError { - meta: generic, - kind: crate::error::JoinMatchmakerLobbyForPartyErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::JoinMatchmakerLobbyForPartyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::JoinMatchmakerLobbyForPartyError { - meta: generic, - kind: crate::error::JoinMatchmakerLobbyForPartyErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::JoinMatchmakerLobbyForPartyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::JoinMatchmakerLobbyForPartyError { - meta: generic, - kind: crate::error::JoinMatchmakerLobbyForPartyErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::JoinMatchmakerLobbyForPartyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::JoinMatchmakerLobbyForPartyError { - meta: generic, - kind: crate::error::JoinMatchmakerLobbyForPartyErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::JoinMatchmakerLobbyForPartyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::JoinMatchmakerLobbyForPartyError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_join_matchmaker_lobby_for_party_response( - response: &http::Response, -) -> std::result::Result< - crate::output::JoinMatchmakerLobbyForPartyOutput, - crate::error::JoinMatchmakerLobbyForPartyError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::join_matchmaker_lobby_for_party_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_matchmaker_self_ready_error( - response: &http::Response, -) -> std::result::Result< - crate::output::MatchmakerSelfReadyOutput, - crate::error::MatchmakerSelfReadyError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::MatchmakerSelfReadyError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::MatchmakerSelfReadyError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::MatchmakerSelfReadyError { - meta: generic, - kind: crate::error::MatchmakerSelfReadyErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::MatchmakerSelfReadyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::MatchmakerSelfReadyError { - meta: generic, - kind: crate::error::MatchmakerSelfReadyErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::MatchmakerSelfReadyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::MatchmakerSelfReadyError { - meta: generic, - kind: crate::error::MatchmakerSelfReadyErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::MatchmakerSelfReadyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::MatchmakerSelfReadyError { - meta: generic, - kind: crate::error::MatchmakerSelfReadyErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::MatchmakerSelfReadyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::MatchmakerSelfReadyError { - meta: generic, - kind: crate::error::MatchmakerSelfReadyErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::MatchmakerSelfReadyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::MatchmakerSelfReadyError { - meta: generic, - kind: crate::error::MatchmakerSelfReadyErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::MatchmakerSelfReadyError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::MatchmakerSelfReadyError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_matchmaker_self_ready_response( - response: &http::Response, -) -> std::result::Result< - crate::output::MatchmakerSelfReadyOutput, - crate::error::MatchmakerSelfReadyError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::matchmaker_self_ready_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_set_party_to_idle_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::SetPartyToIdleError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::SetPartyToIdleError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::SetPartyToIdleError { - meta: generic, - kind: crate::error::SetPartyToIdleErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::SetPartyToIdleError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::SetPartyToIdleError { - meta: generic, - kind: crate::error::SetPartyToIdleErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetPartyToIdleError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::SetPartyToIdleError { - meta: generic, - kind: crate::error::SetPartyToIdleErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetPartyToIdleError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::SetPartyToIdleError { - meta: generic, - kind: crate::error::SetPartyToIdleErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetPartyToIdleError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::SetPartyToIdleError { - meta: generic, - kind: crate::error::SetPartyToIdleErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetPartyToIdleError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::SetPartyToIdleError { - meta: generic, - kind: crate::error::SetPartyToIdleErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetPartyToIdleError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::SetPartyToIdleError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_set_party_to_idle_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::set_party_to_idle_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_set_self_inactive_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::SetSelfInactiveError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::SetSelfInactiveError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::SetSelfInactiveError { - meta: generic, - kind: crate::error::SetSelfInactiveErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::SetSelfInactiveError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::SetSelfInactiveError { - meta: generic, - kind: crate::error::SetSelfInactiveErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetSelfInactiveError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::SetSelfInactiveError { - meta: generic, - kind: crate::error::SetSelfInactiveErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetSelfInactiveError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::SetSelfInactiveError { - meta: generic, - kind: crate::error::SetSelfInactiveErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetSelfInactiveError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::SetSelfInactiveError { - meta: generic, - kind: crate::error::SetSelfInactiveErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetSelfInactiveError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::SetSelfInactiveError { - meta: generic, - kind: crate::error::SetSelfInactiveErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetSelfInactiveError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::SetSelfInactiveError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_set_self_inactive_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::set_self_inactive_output::Builder::default(); - let _ = response; - output.build() - }) -} diff --git a/lib/smithy-output/api-party/rust/rust/src/operation_ser.rs b/lib/smithy-output/api-party/rust/rust/src/operation_ser.rs deleted file mode 100644 index 69c095f5a..000000000 --- a/lib/smithy-output/api-party/rust/rust/src/operation_ser.rs +++ /dev/null @@ -1,66 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub fn serialize_operation_crate_operation_create_party( - input: &crate::input::CreatePartyInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_create_party_input(&mut object, input)?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_create_party_invite( - input: &crate::input::CreatePartyInviteInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_create_party_invite_input(&mut object, input)?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_join_party( - input: &crate::input::JoinPartyInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_join_party_input(&mut object, input)?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_set_party_publicity( - input: &crate::input::SetPartyPublicityInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_set_party_publicity_input(&mut object, input)?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_find_matchmaker_lobby_for_party( - input: &crate::input::FindMatchmakerLobbyForPartyInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_find_matchmaker_lobby_for_party_input( - &mut object, - input, - )?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_join_matchmaker_lobby_for_party( - input: &crate::input::JoinMatchmakerLobbyForPartyInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_join_matchmaker_lobby_for_party_input( - &mut object, - input, - )?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} diff --git a/lib/smithy-output/api-party/rust/rust/src/output.rs b/lib/smithy-output/api-party/rust/rust/src/output.rs deleted file mode 100644 index 1cd60ce0b..000000000 --- a/lib/smithy-output/api-party/rust/rust/src/output.rs +++ /dev/null @@ -1,878 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct MatchmakerSelfReadyOutput {} -impl std::fmt::Debug for MatchmakerSelfReadyOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("MatchmakerSelfReadyOutput"); - formatter.finish() - } -} -/// See [`MatchmakerSelfReadyOutput`](crate::output::MatchmakerSelfReadyOutput) -pub mod matchmaker_self_ready_output { - /// A builder for [`MatchmakerSelfReadyOutput`](crate::output::MatchmakerSelfReadyOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`MatchmakerSelfReadyOutput`](crate::output::MatchmakerSelfReadyOutput) - pub fn build(self) -> crate::output::MatchmakerSelfReadyOutput { - crate::output::MatchmakerSelfReadyOutput {} - } - } -} -impl MatchmakerSelfReadyOutput { - /// Creates a new builder-style object to manufacture [`MatchmakerSelfReadyOutput`](crate::output::MatchmakerSelfReadyOutput) - pub fn builder() -> crate::output::matchmaker_self_ready_output::Builder { - crate::output::matchmaker_self_ready_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct FindMatchmakerLobbyForPartyOutput {} -impl std::fmt::Debug for FindMatchmakerLobbyForPartyOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("FindMatchmakerLobbyForPartyOutput"); - formatter.finish() - } -} -/// See [`FindMatchmakerLobbyForPartyOutput`](crate::output::FindMatchmakerLobbyForPartyOutput) -pub mod find_matchmaker_lobby_for_party_output { - /// A builder for [`FindMatchmakerLobbyForPartyOutput`](crate::output::FindMatchmakerLobbyForPartyOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`FindMatchmakerLobbyForPartyOutput`](crate::output::FindMatchmakerLobbyForPartyOutput) - pub fn build(self) -> crate::output::FindMatchmakerLobbyForPartyOutput { - crate::output::FindMatchmakerLobbyForPartyOutput {} - } - } -} -impl FindMatchmakerLobbyForPartyOutput { - /// Creates a new builder-style object to manufacture [`FindMatchmakerLobbyForPartyOutput`](crate::output::FindMatchmakerLobbyForPartyOutput) - pub fn builder() -> crate::output::find_matchmaker_lobby_for_party_output::Builder { - crate::output::find_matchmaker_lobby_for_party_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct JoinMatchmakerLobbyForPartyOutput {} -impl std::fmt::Debug for JoinMatchmakerLobbyForPartyOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("JoinMatchmakerLobbyForPartyOutput"); - formatter.finish() - } -} -/// See [`JoinMatchmakerLobbyForPartyOutput`](crate::output::JoinMatchmakerLobbyForPartyOutput) -pub mod join_matchmaker_lobby_for_party_output { - /// A builder for [`JoinMatchmakerLobbyForPartyOutput`](crate::output::JoinMatchmakerLobbyForPartyOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`JoinMatchmakerLobbyForPartyOutput`](crate::output::JoinMatchmakerLobbyForPartyOutput) - pub fn build(self) -> crate::output::JoinMatchmakerLobbyForPartyOutput { - crate::output::JoinMatchmakerLobbyForPartyOutput {} - } - } -} -impl JoinMatchmakerLobbyForPartyOutput { - /// Creates a new builder-style object to manufacture [`JoinMatchmakerLobbyForPartyOutput`](crate::output::JoinMatchmakerLobbyForPartyOutput) - pub fn builder() -> crate::output::join_matchmaker_lobby_for_party_output::Builder { - crate::output::join_matchmaker_lobby_for_party_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct SetSelfInactiveOutput {} -impl std::fmt::Debug for SetSelfInactiveOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("SetSelfInactiveOutput"); - formatter.finish() - } -} -/// See [`SetSelfInactiveOutput`](crate::output::SetSelfInactiveOutput) -pub mod set_self_inactive_output { - /// A builder for [`SetSelfInactiveOutput`](crate::output::SetSelfInactiveOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`SetSelfInactiveOutput`](crate::output::SetSelfInactiveOutput) - pub fn build(self) -> crate::output::SetSelfInactiveOutput { - crate::output::SetSelfInactiveOutput {} - } - } -} -impl SetSelfInactiveOutput { - /// Creates a new builder-style object to manufacture [`SetSelfInactiveOutput`](crate::output::SetSelfInactiveOutput) - pub fn builder() -> crate::output::set_self_inactive_output::Builder { - crate::output::set_self_inactive_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct SetPartyToIdleOutput {} -impl std::fmt::Debug for SetPartyToIdleOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("SetPartyToIdleOutput"); - formatter.finish() - } -} -/// See [`SetPartyToIdleOutput`](crate::output::SetPartyToIdleOutput) -pub mod set_party_to_idle_output { - /// A builder for [`SetPartyToIdleOutput`](crate::output::SetPartyToIdleOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`SetPartyToIdleOutput`](crate::output::SetPartyToIdleOutput) - pub fn build(self) -> crate::output::SetPartyToIdleOutput { - crate::output::SetPartyToIdleOutput {} - } - } -} -impl SetPartyToIdleOutput { - /// Creates a new builder-style object to manufacture [`SetPartyToIdleOutput`](crate::output::SetPartyToIdleOutput) - pub fn builder() -> crate::output::set_party_to_idle_output::Builder { - crate::output::set_party_to_idle_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct SendJoinRequestOutput {} -impl std::fmt::Debug for SendJoinRequestOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("SendJoinRequestOutput"); - formatter.finish() - } -} -/// See [`SendJoinRequestOutput`](crate::output::SendJoinRequestOutput) -pub mod send_join_request_output { - /// A builder for [`SendJoinRequestOutput`](crate::output::SendJoinRequestOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`SendJoinRequestOutput`](crate::output::SendJoinRequestOutput) - pub fn build(self) -> crate::output::SendJoinRequestOutput { - crate::output::SendJoinRequestOutput {} - } - } -} -impl SendJoinRequestOutput { - /// Creates a new builder-style object to manufacture [`SendJoinRequestOutput`](crate::output::SendJoinRequestOutput) - pub fn builder() -> crate::output::send_join_request_output::Builder { - crate::output::send_join_request_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetPartyFromInviteOutput { - /// A party summary. - pub party: std::option::Option, -} -impl GetPartyFromInviteOutput { - /// A party summary. - pub fn party(&self) -> std::option::Option<&crate::model::PartySummary> { - self.party.as_ref() - } -} -impl std::fmt::Debug for GetPartyFromInviteOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetPartyFromInviteOutput"); - formatter.field("party", &self.party); - formatter.finish() - } -} -/// See [`GetPartyFromInviteOutput`](crate::output::GetPartyFromInviteOutput) -pub mod get_party_from_invite_output { - /// A builder for [`GetPartyFromInviteOutput`](crate::output::GetPartyFromInviteOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) party: std::option::Option, - } - impl Builder { - /// A party summary. - pub fn party(mut self, input: crate::model::PartySummary) -> Self { - self.party = Some(input); - self - } - /// A party summary. - pub fn set_party(mut self, input: std::option::Option) -> Self { - self.party = input; - self - } - /// Consumes the builder and constructs a [`GetPartyFromInviteOutput`](crate::output::GetPartyFromInviteOutput) - pub fn build(self) -> crate::output::GetPartyFromInviteOutput { - crate::output::GetPartyFromInviteOutput { party: self.party } - } - } -} -impl GetPartyFromInviteOutput { - /// Creates a new builder-style object to manufacture [`GetPartyFromInviteOutput`](crate::output::GetPartyFromInviteOutput) - pub fn builder() -> crate::output::get_party_from_invite_output::Builder { - crate::output::get_party_from_invite_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct RevokePartyInviteOutput {} -impl std::fmt::Debug for RevokePartyInviteOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("RevokePartyInviteOutput"); - formatter.finish() - } -} -/// See [`RevokePartyInviteOutput`](crate::output::RevokePartyInviteOutput) -pub mod revoke_party_invite_output { - /// A builder for [`RevokePartyInviteOutput`](crate::output::RevokePartyInviteOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`RevokePartyInviteOutput`](crate::output::RevokePartyInviteOutput) - pub fn build(self) -> crate::output::RevokePartyInviteOutput { - crate::output::RevokePartyInviteOutput {} - } - } -} -impl RevokePartyInviteOutput { - /// Creates a new builder-style object to manufacture [`RevokePartyInviteOutput`](crate::output::RevokePartyInviteOutput) - pub fn builder() -> crate::output::revoke_party_invite_output::Builder { - crate::output::revoke_party_invite_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct KickMemberOutput {} -impl std::fmt::Debug for KickMemberOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("KickMemberOutput"); - formatter.finish() - } -} -/// See [`KickMemberOutput`](crate::output::KickMemberOutput) -pub mod kick_member_output { - /// A builder for [`KickMemberOutput`](crate::output::KickMemberOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`KickMemberOutput`](crate::output::KickMemberOutput) - pub fn build(self) -> crate::output::KickMemberOutput { - crate::output::KickMemberOutput {} - } - } -} -impl KickMemberOutput { - /// Creates a new builder-style object to manufacture [`KickMemberOutput`](crate::output::KickMemberOutput) - pub fn builder() -> crate::output::kick_member_output::Builder { - crate::output::kick_member_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct TransferPartyOwnershipOutput {} -impl std::fmt::Debug for TransferPartyOwnershipOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("TransferPartyOwnershipOutput"); - formatter.finish() - } -} -/// See [`TransferPartyOwnershipOutput`](crate::output::TransferPartyOwnershipOutput) -pub mod transfer_party_ownership_output { - /// A builder for [`TransferPartyOwnershipOutput`](crate::output::TransferPartyOwnershipOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`TransferPartyOwnershipOutput`](crate::output::TransferPartyOwnershipOutput) - pub fn build(self) -> crate::output::TransferPartyOwnershipOutput { - crate::output::TransferPartyOwnershipOutput {} - } - } -} -impl TransferPartyOwnershipOutput { - /// Creates a new builder-style object to manufacture [`TransferPartyOwnershipOutput`](crate::output::TransferPartyOwnershipOutput) - pub fn builder() -> crate::output::transfer_party_ownership_output::Builder { - crate::output::transfer_party_ownership_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct SetPartyPublicityOutput {} -impl std::fmt::Debug for SetPartyPublicityOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("SetPartyPublicityOutput"); - formatter.finish() - } -} -/// See [`SetPartyPublicityOutput`](crate::output::SetPartyPublicityOutput) -pub mod set_party_publicity_output { - /// A builder for [`SetPartyPublicityOutput`](crate::output::SetPartyPublicityOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`SetPartyPublicityOutput`](crate::output::SetPartyPublicityOutput) - pub fn build(self) -> crate::output::SetPartyPublicityOutput { - crate::output::SetPartyPublicityOutput {} - } - } -} -impl SetPartyPublicityOutput { - /// Creates a new builder-style object to manufacture [`SetPartyPublicityOutput`](crate::output::SetPartyPublicityOutput) - pub fn builder() -> crate::output::set_party_publicity_output::Builder { - crate::output::set_party_publicity_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct LeavePartyOutput {} -impl std::fmt::Debug for LeavePartyOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("LeavePartyOutput"); - formatter.finish() - } -} -/// See [`LeavePartyOutput`](crate::output::LeavePartyOutput) -pub mod leave_party_output { - /// A builder for [`LeavePartyOutput`](crate::output::LeavePartyOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`LeavePartyOutput`](crate::output::LeavePartyOutput) - pub fn build(self) -> crate::output::LeavePartyOutput { - crate::output::LeavePartyOutput {} - } - } -} -impl LeavePartyOutput { - /// Creates a new builder-style object to manufacture [`LeavePartyOutput`](crate::output::LeavePartyOutput) - pub fn builder() -> crate::output::leave_party_output::Builder { - crate::output::leave_party_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct JoinPartyOutput { - /// A universally unique identifier. - pub party_id: std::option::Option, -} -impl JoinPartyOutput { - /// A universally unique identifier. - pub fn party_id(&self) -> std::option::Option<&str> { - self.party_id.as_deref() - } -} -impl std::fmt::Debug for JoinPartyOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("JoinPartyOutput"); - formatter.field("party_id", &self.party_id); - formatter.finish() - } -} -/// See [`JoinPartyOutput`](crate::output::JoinPartyOutput) -pub mod join_party_output { - /// A builder for [`JoinPartyOutput`](crate::output::JoinPartyOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) party_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn party_id(mut self, input: impl Into) -> Self { - self.party_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_party_id(mut self, input: std::option::Option) -> Self { - self.party_id = input; - self - } - /// Consumes the builder and constructs a [`JoinPartyOutput`](crate::output::JoinPartyOutput) - pub fn build(self) -> crate::output::JoinPartyOutput { - crate::output::JoinPartyOutput { - party_id: self.party_id, - } - } - } -} -impl JoinPartyOutput { - /// Creates a new builder-style object to manufacture [`JoinPartyOutput`](crate::output::JoinPartyOutput) - pub fn builder() -> crate::output::join_party_output::Builder { - crate::output::join_party_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CreatePartyInviteOutput { - /// Output from a created invite. - pub invite: std::option::Option, -} -impl CreatePartyInviteOutput { - /// Output from a created invite. - pub fn invite(&self) -> std::option::Option<&crate::model::CreatedInvite> { - self.invite.as_ref() - } -} -impl std::fmt::Debug for CreatePartyInviteOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CreatePartyInviteOutput"); - formatter.field("invite", &self.invite); - formatter.finish() - } -} -/// See [`CreatePartyInviteOutput`](crate::output::CreatePartyInviteOutput) -pub mod create_party_invite_output { - /// A builder for [`CreatePartyInviteOutput`](crate::output::CreatePartyInviteOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) invite: std::option::Option, - } - impl Builder { - /// Output from a created invite. - pub fn invite(mut self, input: crate::model::CreatedInvite) -> Self { - self.invite = Some(input); - self - } - /// Output from a created invite. - pub fn set_invite( - mut self, - input: std::option::Option, - ) -> Self { - self.invite = input; - self - } - /// Consumes the builder and constructs a [`CreatePartyInviteOutput`](crate::output::CreatePartyInviteOutput) - pub fn build(self) -> crate::output::CreatePartyInviteOutput { - crate::output::CreatePartyInviteOutput { - invite: self.invite, - } - } - } -} -impl CreatePartyInviteOutput { - /// Creates a new builder-style object to manufacture [`CreatePartyInviteOutput`](crate::output::CreatePartyInviteOutput) - pub fn builder() -> crate::output::create_party_invite_output::Builder { - crate::output::create_party_invite_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct CreatePartyOutput { - /// A universally unique identifier. - pub party_id: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub invites: std::option::Option>, -} -impl CreatePartyOutput { - /// A universally unique identifier. - pub fn party_id(&self) -> std::option::Option<&str> { - self.party_id.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn invites(&self) -> std::option::Option<&[crate::model::CreatedInvite]> { - self.invites.as_deref() - } -} -impl std::fmt::Debug for CreatePartyOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("CreatePartyOutput"); - formatter.field("party_id", &self.party_id); - formatter.field("invites", &self.invites); - formatter.finish() - } -} -/// See [`CreatePartyOutput`](crate::output::CreatePartyOutput) -pub mod create_party_output { - /// A builder for [`CreatePartyOutput`](crate::output::CreatePartyOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) party_id: std::option::Option, - pub(crate) invites: std::option::Option>, - } - impl Builder { - /// A universally unique identifier. - pub fn party_id(mut self, input: impl Into) -> Self { - self.party_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_party_id(mut self, input: std::option::Option) -> Self { - self.party_id = input; - self - } - /// Appends an item to `invites`. - /// - /// To override the contents of this collection use [`set_invites`](Self::set_invites). - /// - pub fn invites(mut self, input: crate::model::CreatedInvite) -> Self { - let mut v = self.invites.unwrap_or_default(); - v.push(input); - self.invites = Some(v); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_invites( - mut self, - input: std::option::Option>, - ) -> Self { - self.invites = input; - self - } - /// Consumes the builder and constructs a [`CreatePartyOutput`](crate::output::CreatePartyOutput) - pub fn build(self) -> crate::output::CreatePartyOutput { - crate::output::CreatePartyOutput { - party_id: self.party_id, - invites: self.invites, - } - } - } -} -impl CreatePartyOutput { - /// Creates a new builder-style object to manufacture [`CreatePartyOutput`](crate::output::CreatePartyOutput) - pub fn builder() -> crate::output::create_party_output::Builder { - crate::output::create_party_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetPartySelfProfileOutput { - #[allow(missing_docs)] // documentation missing in model - pub party: std::option::Option, - /// Provided by watchable endpoints used in blocking loops. - pub watch: std::option::Option, -} -impl GetPartySelfProfileOutput { - #[allow(missing_docs)] // documentation missing in model - pub fn party(&self) -> std::option::Option<&crate::model::PartyProfile> { - self.party.as_ref() - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(&self) -> std::option::Option<&crate::model::WatchResponse> { - self.watch.as_ref() - } -} -impl std::fmt::Debug for GetPartySelfProfileOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetPartySelfProfileOutput"); - formatter.field("party", &self.party); - formatter.field("watch", &self.watch); - formatter.finish() - } -} -/// See [`GetPartySelfProfileOutput`](crate::output::GetPartySelfProfileOutput) -pub mod get_party_self_profile_output { - /// A builder for [`GetPartySelfProfileOutput`](crate::output::GetPartySelfProfileOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) party: std::option::Option, - pub(crate) watch: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn party(mut self, input: crate::model::PartyProfile) -> Self { - self.party = Some(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_party(mut self, input: std::option::Option) -> Self { - self.party = input; - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(mut self, input: crate::model::WatchResponse) -> Self { - self.watch = Some(input); - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn set_watch( - mut self, - input: std::option::Option, - ) -> Self { - self.watch = input; - self - } - /// Consumes the builder and constructs a [`GetPartySelfProfileOutput`](crate::output::GetPartySelfProfileOutput) - pub fn build(self) -> crate::output::GetPartySelfProfileOutput { - crate::output::GetPartySelfProfileOutput { - party: self.party, - watch: self.watch, - } - } - } -} -impl GetPartySelfProfileOutput { - /// Creates a new builder-style object to manufacture [`GetPartySelfProfileOutput`](crate::output::GetPartySelfProfileOutput) - pub fn builder() -> crate::output::get_party_self_profile_output::Builder { - crate::output::get_party_self_profile_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetPartyProfileOutput { - #[allow(missing_docs)] // documentation missing in model - pub party: std::option::Option, - /// Provided by watchable endpoints used in blocking loops. - pub watch: std::option::Option, -} -impl GetPartyProfileOutput { - #[allow(missing_docs)] // documentation missing in model - pub fn party(&self) -> std::option::Option<&crate::model::PartyProfile> { - self.party.as_ref() - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(&self) -> std::option::Option<&crate::model::WatchResponse> { - self.watch.as_ref() - } -} -impl std::fmt::Debug for GetPartyProfileOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetPartyProfileOutput"); - formatter.field("party", &self.party); - formatter.field("watch", &self.watch); - formatter.finish() - } -} -/// See [`GetPartyProfileOutput`](crate::output::GetPartyProfileOutput) -pub mod get_party_profile_output { - /// A builder for [`GetPartyProfileOutput`](crate::output::GetPartyProfileOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) party: std::option::Option, - pub(crate) watch: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn party(mut self, input: crate::model::PartyProfile) -> Self { - self.party = Some(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_party(mut self, input: std::option::Option) -> Self { - self.party = input; - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(mut self, input: crate::model::WatchResponse) -> Self { - self.watch = Some(input); - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn set_watch( - mut self, - input: std::option::Option, - ) -> Self { - self.watch = input; - self - } - /// Consumes the builder and constructs a [`GetPartyProfileOutput`](crate::output::GetPartyProfileOutput) - pub fn build(self) -> crate::output::GetPartyProfileOutput { - crate::output::GetPartyProfileOutput { - party: self.party, - watch: self.watch, - } - } - } -} -impl GetPartyProfileOutput { - /// Creates a new builder-style object to manufacture [`GetPartyProfileOutput`](crate::output::GetPartyProfileOutput) - pub fn builder() -> crate::output::get_party_profile_output::Builder { - crate::output::get_party_profile_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetPartySelfSummaryOutput { - /// A party summary. - pub party: std::option::Option, - /// Provided by watchable endpoints used in blocking loops. - pub watch: std::option::Option, -} -impl GetPartySelfSummaryOutput { - /// A party summary. - pub fn party(&self) -> std::option::Option<&crate::model::PartySummary> { - self.party.as_ref() - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(&self) -> std::option::Option<&crate::model::WatchResponse> { - self.watch.as_ref() - } -} -impl std::fmt::Debug for GetPartySelfSummaryOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetPartySelfSummaryOutput"); - formatter.field("party", &self.party); - formatter.field("watch", &self.watch); - formatter.finish() - } -} -/// See [`GetPartySelfSummaryOutput`](crate::output::GetPartySelfSummaryOutput) -pub mod get_party_self_summary_output { - /// A builder for [`GetPartySelfSummaryOutput`](crate::output::GetPartySelfSummaryOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) party: std::option::Option, - pub(crate) watch: std::option::Option, - } - impl Builder { - /// A party summary. - pub fn party(mut self, input: crate::model::PartySummary) -> Self { - self.party = Some(input); - self - } - /// A party summary. - pub fn set_party(mut self, input: std::option::Option) -> Self { - self.party = input; - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(mut self, input: crate::model::WatchResponse) -> Self { - self.watch = Some(input); - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn set_watch( - mut self, - input: std::option::Option, - ) -> Self { - self.watch = input; - self - } - /// Consumes the builder and constructs a [`GetPartySelfSummaryOutput`](crate::output::GetPartySelfSummaryOutput) - pub fn build(self) -> crate::output::GetPartySelfSummaryOutput { - crate::output::GetPartySelfSummaryOutput { - party: self.party, - watch: self.watch, - } - } - } -} -impl GetPartySelfSummaryOutput { - /// Creates a new builder-style object to manufacture [`GetPartySelfSummaryOutput`](crate::output::GetPartySelfSummaryOutput) - pub fn builder() -> crate::output::get_party_self_summary_output::Builder { - crate::output::get_party_self_summary_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetPartySummaryOutput { - /// A party summary. - pub party: std::option::Option, - /// Provided by watchable endpoints used in blocking loops. - pub watch: std::option::Option, -} -impl GetPartySummaryOutput { - /// A party summary. - pub fn party(&self) -> std::option::Option<&crate::model::PartySummary> { - self.party.as_ref() - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(&self) -> std::option::Option<&crate::model::WatchResponse> { - self.watch.as_ref() - } -} -impl std::fmt::Debug for GetPartySummaryOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetPartySummaryOutput"); - formatter.field("party", &self.party); - formatter.field("watch", &self.watch); - formatter.finish() - } -} -/// See [`GetPartySummaryOutput`](crate::output::GetPartySummaryOutput) -pub mod get_party_summary_output { - /// A builder for [`GetPartySummaryOutput`](crate::output::GetPartySummaryOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) party: std::option::Option, - pub(crate) watch: std::option::Option, - } - impl Builder { - /// A party summary. - pub fn party(mut self, input: crate::model::PartySummary) -> Self { - self.party = Some(input); - self - } - /// A party summary. - pub fn set_party(mut self, input: std::option::Option) -> Self { - self.party = input; - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(mut self, input: crate::model::WatchResponse) -> Self { - self.watch = Some(input); - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn set_watch( - mut self, - input: std::option::Option, - ) -> Self { - self.watch = input; - self - } - /// Consumes the builder and constructs a [`GetPartySummaryOutput`](crate::output::GetPartySummaryOutput) - pub fn build(self) -> crate::output::GetPartySummaryOutput { - crate::output::GetPartySummaryOutput { - party: self.party, - watch: self.watch, - } - } - } -} -impl GetPartySummaryOutput { - /// Creates a new builder-style object to manufacture [`GetPartySummaryOutput`](crate::output::GetPartySummaryOutput) - pub fn builder() -> crate::output::get_party_summary_output::Builder { - crate::output::get_party_summary_output::Builder::default() - } -} diff --git a/lib/smithy-output/api-portal/rust-server/rust-server/Cargo.toml b/lib/smithy-output/api-portal/rust-server/rust-server/Cargo.toml deleted file mode 100644 index ed4f3c521..000000000 --- a/lib/smithy-output/api-portal/rust-server/rust-server/Cargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -[package] -name = "rivet-portal-server" -version = "0.0.1" -authors = ["Rivet "] -edition = "2021" -license = "Apache-2.0" - -[package.metadata.docs.rs] -all-features = true -targets = ["x86_64-unknown-linux-gnu"] - -[dependencies] -serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" -chrono = { version = "0.4", features = ["serde"] } diff --git a/lib/smithy-output/api-portal/rust-server/rust-server/src/lib.rs b/lib/smithy-output/api-portal/rust-server/rust-server/src/lib.rs deleted file mode 100644 index ff9294697..000000000 --- a/lib/smithy-output/api-portal/rust-server/rust-server/src/lib.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod models; \ No newline at end of file diff --git a/lib/smithy-output/api-portal/rust-server/rust-server/src/models.rs b/lib/smithy-output/api-portal/rust-server/rust-server/src/models.rs deleted file mode 100644 index 5f347f315..000000000 --- a/lib/smithy-output/api-portal/rust-server/rust-server/src/models.rs +++ /dev/null @@ -1,290 +0,0 @@ -#[allow(unused_imports)] -use chrono; -#[allow(unused_imports)] -use serde::{Deserialize, Serialize}; - -/// Represents a value for which notification service to unregister. -#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd, Hash, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum NotificationUnregisterService { - /// Firebase service. - Firebase, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for NotificationUnregisterService { - fn from(s: &str) -> Self { - match s { - "firebase" => NotificationUnregisterService::Firebase, - other => NotificationUnregisterService::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for NotificationUnregisterService { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(NotificationUnregisterService::from(s)) - } -} -impl NotificationUnregisterService { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - NotificationUnregisterService::Firebase => "firebase", - NotificationUnregisterService::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["firebase"] - } -} -impl AsRef for NotificationUnregisterService { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// A union representing which notification service to register. -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum NotificationRegisterService { - /// Represents push notification configuration for Firebase. - Firebase(NotificationRegisterFirebaseService), -} - -/// Represents push notification configuration for Firebase. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct NotificationRegisterFirebaseService { - #[allow(missing_docs)] // documentation missing in model - pub access_key: std::string::String, -} - -/// Provided by watchable endpoints used in blocking loops. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct WatchResponse { - /// Index indicating the version of the data responded. Pas this to `rivet.common#WatchQuery` to block and wait for the next response. - pub index: std::string::String, -} - -/// A game profile. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GameProfile { - /// A universally unique identifier. - pub game_id: std::string::String, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub name_id: std::string::String, - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// The URL of this game's logo image. - pub logo_url: std::option::Option, - /// The URL of this game's banner image. - pub banner_url: std::option::Option, - /// The URL to this game's website. - pub url: std::string::String, - /// A group summary. - pub developer: GroupSummary, - /// A list of game tags. - pub tags: std::vec::Vec, - /// A description of the given game. - pub description: std::string::String, - /// A list of platform links. - pub platforms: std::vec::Vec, - /// A list of group summaries. - pub recommended_groups: std::vec::Vec, - /// A list of game leaderboard categories. - pub identity_leaderboard_categories: std::vec::Vec, - /// A list of game leaderboard categories. - pub group_leaderboard_categories: std::vec::Vec, -} - -/// A game leaderboard category. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GameLeaderboardCategory { - /// Represent a resource's readable display name. - pub display_name: std::string::String, -} - -/// A group summary. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GroupSummary { - /// A universally unique identifier. - pub group_id: std::string::String, - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// The URL of this group's avatar image. - pub avatar_url: std::option::Option, - /// External links for this group. - pub external: GroupExternalLinks, - /// Whether or not this group is a developer. - pub is_developer: bool, - /// Detailed information about a profile. - pub bio: std::string::String, - /// Whether or not the current identity is a member of this group. - pub is_current_identity_member: bool, - /// The current publicity value for the given group. - pub publicity: GroupPublicity, - /// Unsigned 32 bit integer. - pub member_count: i32, - /// A universally unique identifier. - pub owner_identity_id: std::string::String, -} - -/// The current publicity value for the given group. -#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd, Hash, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum GroupPublicity { - #[allow(missing_docs)] // documentation missing in model - Closed, - #[allow(missing_docs)] // documentation missing in model - Open, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for GroupPublicity { - fn from(s: &str) -> Self { - match s { - "closed" => GroupPublicity::Closed, - "open" => GroupPublicity::Open, - other => GroupPublicity::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for GroupPublicity { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(GroupPublicity::from(s)) - } -} -impl GroupPublicity { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - GroupPublicity::Closed => "closed", - GroupPublicity::Open => "open", - GroupPublicity::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["closed", "open"] - } -} -impl AsRef for GroupPublicity { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// External links for this group. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GroupExternalLinks { - /// A link to this group's profile page. - pub profile: std::string::String, - /// A link to this group's chat page. - pub chat: std::string::String, -} - -/// A platform link denoting a supported platform. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GamePlatformLink { - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// The URL to the given game's method of distribution on this platform. - pub url: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GameSummary { - /// A universally unique identifier. - pub game_id: std::string::String, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub name_id: std::string::String, - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// The URL of this game's logo image. - pub logo_url: std::option::Option, - /// The URL of this game's banner image. - pub banner_url: std::option::Option, - /// The URL to this game's website. - pub url: std::string::String, - /// A group handle. - pub developer: GroupHandle, - /// A list of game tags. - pub tags: std::vec::Vec, -} - -/// A group handle. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GroupHandle { - /// A universally unique identifier. - pub group_id: std::string::String, - /// Represent a resource's readable display name. - pub display_name: std::string::String, - /// The URL of this group's avatar image. - pub avatar_url: std::option::Option, - /// External links for this group. - pub external: GroupExternalLinks, - /// Whether or not this group is a developer group. - pub is_developer: std::option::Option, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct UnregisterNotificationsRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct RegisterNotificationsRequest { - /// A union representing which notification service to register. - pub service: NotificationRegisterService, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ResolveBetaJoinRequestRequest { - /// Whether or not to accept the beta join request. - pub resolution: bool, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetGameProfileRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetSuggestedGamesRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct UnregisterNotificationsResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct RegisterNotificationsResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ResolveBetaJoinRequestResponse {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetGameProfileResponse { - /// A game profile. - pub game: GameProfile, - /// Provided by watchable endpoints used in blocking loops. - pub watch: WatchResponse, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct GetSuggestedGamesResponse { - /// A list of game summaries. - pub games: std::vec::Vec, - /// Provided by watchable endpoints used in blocking loops. - pub watch: WatchResponse, -} - diff --git a/lib/smithy-output/api-portal/rust/rust/Cargo.toml b/lib/smithy-output/api-portal/rust/rust/Cargo.toml deleted file mode 100644 index 49564b8ff..000000000 --- a/lib/smithy-output/api-portal/rust/rust/Cargo.toml +++ /dev/null @@ -1,33 +0,0 @@ -# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -[package] -name = "rivet-portal" -version = "0.0.1" -authors = ["Rivet Gaming, LLC "] -description = "" -edition = "2021" -license = "Apache-2.0" - -[package.metadata.docs.rs] -all-features = true -targets = ["x86_64-unknown-linux-gnu"] -[dependencies.aws-smithy-client] -version = "^0.41.0" -[dependencies.aws-smithy-http] -version = "^0.41.0" -[dependencies.aws-smithy-json] -version = "^0.41.0" -[dependencies.aws-smithy-types] -version = "^0.41.0" -[dependencies.bytes] -version = "1" -[dependencies.http] -version = "0.2" -[dependencies.tower] -version = "0.4" -[features] -rt-tokio = ["aws-smithy-http/rt-tokio"] -rustls = ["aws-smithy-client/rustls"] -native-tls = ["aws-smithy-client/native-tls"] -default = ["rt-tokio", "rustls"] - - diff --git a/lib/smithy-output/api-portal/rust/rust/src/client.rs b/lib/smithy-output/api-portal/rust/rust/src/client.rs deleted file mode 100644 index 016c910e1..000000000 --- a/lib/smithy-output/api-portal/rust/rust/src/client.rs +++ /dev/null @@ -1,627 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[derive(Debug)] -pub(crate) struct Handle { - pub(crate) client: aws_smithy_client::Client, - pub(crate) conf: crate::Config, -} - -/// An ergonomic service client for `PortalService`. -/// -/// This client allows ergonomic access to a `PortalService`-shaped service. -/// Each method corresponds to an endpoint defined in the service's Smithy model, -/// and the request and response shapes are auto-generated from that same model. -/// -/// # Constructing a Client -/// -/// To construct a client, you need a few different things: -/// -/// - A [`Config`](crate::Config) that specifies additional configuration -/// required by the service. -/// - A connector (`C`) that specifies how HTTP requests are translated -/// into HTTP responses. This will typically be an HTTP client (like -/// `hyper`), though you can also substitute in your own, like a mock -/// mock connector for testing. -/// - A "middleware" (`M`) that modifies requests prior to them being -/// sent to the request. Most commonly, middleware will decide what -/// endpoint the requests should be sent to, as well as perform -/// authentication and authorization of requests (such as SigV4). -/// You can also have middleware that performs request/response -/// tracing, throttling, or other middleware-like tasks. -/// - A retry policy (`R`) that dictates the behavior for requests that -/// fail and should (potentially) be retried. The default type is -/// generally what you want, as it implements a well-vetted retry -/// policy implemented in [`RetryMode::Standard`](aws_smithy_types::retry::RetryMode::Standard). -/// -/// To construct a client, you will generally want to call -/// [`Client::with_config`], which takes a [`aws_smithy_client::Client`] (a -/// Smithy client that isn't specialized to a particular service), -/// and a [`Config`](crate::Config). Both of these are constructed using -/// the [builder pattern] where you first construct a `Builder` type, -/// then configure it with the necessary parameters, and then call -/// `build` to construct the finalized output type. The -/// [`aws_smithy_client::Client`] builder is re-exported in this crate as -/// [`Builder`] for convenience. -/// -/// In _most_ circumstances, you will want to use the following pattern -/// to construct a client: -/// -/// ``` -/// use rivet_portal::{Builder, Client, Config}; -/// let raw_client = -/// Builder::dyn_https() -/// # /* -/// .middleware(/* discussed below */) -/// # */ -/// # .middleware_fn(|r| r) -/// .build(); -/// let config = Config::builder().build(); -/// let client = Client::with_config(raw_client, config); -/// ``` -/// -/// For the middleware, you'll want to use whatever matches the -/// routing, authentication and authorization required by the target -/// service. For example, for the standard AWS SDK which uses -/// [SigV4-signed requests], the middleware looks like this: -/// -// Ignored as otherwise we'd need to pull in all these dev-dependencies. -/// ```rust,ignore -/// use aws_endpoint::AwsEndpointStage; -/// use aws_http::auth::CredentialsStage; -/// use aws_http::recursion_detection::RecursionDetectionStage; -/// use aws_http::user_agent::UserAgentStage; -/// use aws_sig_auth::middleware::SigV4SigningStage; -/// use aws_sig_auth::signer::SigV4Signer; -/// use aws_smithy_client::retry::Config as RetryConfig; -/// use aws_smithy_http_tower::map_request::{AsyncMapRequestLayer, MapRequestLayer}; -/// use std::fmt::Debug; -/// use tower::layer::util::{Identity, Stack}; -/// use tower::ServiceBuilder; -/// -/// type AwsMiddlewareStack = Stack< -/// MapRequestLayer, -/// Stack< -/// MapRequestLayer, -/// Stack< -/// AsyncMapRequestLayer, -/// Stack< -/// MapRequestLayer, -/// Stack, Identity>, -/// >, -/// >, -/// >, -/// >; -/// -/// /// AWS Middleware Stack -/// /// -/// /// This implements the middleware stack for this service. It will: -/// /// 1. Load credentials asynchronously into the property bag -/// /// 2. Sign the request with SigV4 -/// /// 3. Resolve an Endpoint for the request -/// /// 4. Add a user agent to the request -/// #[derive(Debug, Default, Clone)] -/// #[non_exhaustive] -/// pub struct AwsMiddleware; -/// -/// impl AwsMiddleware { -/// /// Create a new `AwsMiddleware` stack -/// /// -/// /// Note: `AwsMiddleware` holds no state. -/// pub fn new() -> Self { -/// AwsMiddleware::default() -/// } -/// } -/// -/// // define the middleware stack in a non-generic location to reduce code bloat. -/// fn base() -> ServiceBuilder { -/// let credential_provider = AsyncMapRequestLayer::for_mapper(CredentialsStage::new()); -/// let signer = MapRequestLayer::for_mapper(SigV4SigningStage::new(SigV4Signer::new())); -/// let endpoint_resolver = MapRequestLayer::for_mapper(AwsEndpointStage); -/// let user_agent = MapRequestLayer::for_mapper(UserAgentStage::new()); -/// let recursion_detection = MapRequestLayer::for_mapper(RecursionDetectionStage::new()); -/// // These layers can be considered as occurring in order, that is: -/// // 1. Resolve an endpoint -/// // 2. Add a user agent -/// // 3. Acquire credentials -/// // 4. Sign with credentials -/// // (5. Dispatch over the wire) -/// ServiceBuilder::new() -/// .layer(endpoint_resolver) -/// .layer(user_agent) -/// .layer(credential_provider) -/// .layer(signer) -/// .layer(recursion_detection) -/// } -/// -/// impl tower::Layer for AwsMiddleware { -/// type Service = >::Service; -/// -/// fn layer(&self, inner: S) -> Self::Service { -/// base().service(inner) -/// } -/// } -/// ``` -/// -/// # Using a Client -/// -/// Once you have a client set up, you can access the service's endpoints -/// by calling the appropriate method on [`Client`]. Each such method -/// returns a request builder for that endpoint, with methods for setting -/// the various fields of the request. Once your request is complete, use -/// the `send` method to send the request. `send` returns a future, which -/// you then have to `.await` to get the service's response. -/// -/// [builder pattern]: https://rust-lang.github.io/api-guidelines/type-safety.html#c-builder -/// [SigV4-signed requests]: https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html -#[derive(std::fmt::Debug)] -pub struct Client { - handle: std::sync::Arc>, -} - -impl std::clone::Clone for Client { - fn clone(&self) -> Self { - Self { - handle: self.handle.clone(), - } - } -} - -#[doc(inline)] -pub use aws_smithy_client::Builder; - -impl From> for Client { - fn from(client: aws_smithy_client::Client) -> Self { - Self::with_config(client, crate::Config::builder().build()) - } -} - -impl Client { - /// Creates a client with the given service configuration. - pub fn with_config(client: aws_smithy_client::Client, conf: crate::Config) -> Self { - Self { - handle: std::sync::Arc::new(Handle { client, conf }), - } - } - - /// Returns the client's configuration. - pub fn conf(&self) -> &crate::Config { - &self.handle.conf - } -} -impl Client -where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, -{ - /// Constructs a fluent builder for the [`GetGameProfile`](crate::client::fluent_builders::GetGameProfile) operation. - /// - /// - The fluent builder is configurable: - /// - [`game_name_id(impl Into)`](crate::client::fluent_builders::GetGameProfile::game_name_id) / [`set_game_name_id(Option)`](crate::client::fluent_builders::GetGameProfile::set_game_name_id): A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - /// - [`watch_index(impl Into)`](crate::client::fluent_builders::GetGameProfile::watch_index) / [`set_watch_index(Option)`](crate::client::fluent_builders::GetGameProfile::set_watch_index): A query parameter denoting the requests watch index. - /// - On success, responds with [`GetGameProfileOutput`](crate::output::GetGameProfileOutput) with field(s): - /// - [`game(Option)`](crate::output::GetGameProfileOutput::game): A game profile. - /// - [`watch(Option)`](crate::output::GetGameProfileOutput::watch): Provided by watchable endpoints used in blocking loops. - /// - On failure, responds with [`SdkError`](crate::error::GetGameProfileError) - pub fn get_game_profile(&self) -> fluent_builders::GetGameProfile { - fluent_builders::GetGameProfile::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`GetSuggestedGames`](crate::client::fluent_builders::GetSuggestedGames) operation. - /// - /// - The fluent builder is configurable: - /// - [`watch_index(impl Into)`](crate::client::fluent_builders::GetSuggestedGames::watch_index) / [`set_watch_index(Option)`](crate::client::fluent_builders::GetSuggestedGames::set_watch_index): A query parameter denoting the requests watch index. - /// - On success, responds with [`GetSuggestedGamesOutput`](crate::output::GetSuggestedGamesOutput) with field(s): - /// - [`games(Option>)`](crate::output::GetSuggestedGamesOutput::games): A list of game summaries. - /// - [`watch(Option)`](crate::output::GetSuggestedGamesOutput::watch): Provided by watchable endpoints used in blocking loops. - /// - On failure, responds with [`SdkError`](crate::error::GetSuggestedGamesError) - pub fn get_suggested_games(&self) -> fluent_builders::GetSuggestedGames { - fluent_builders::GetSuggestedGames::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`RegisterNotifications`](crate::client::fluent_builders::RegisterNotifications) operation. - /// - /// - The fluent builder is configurable: - /// - [`service(NotificationRegisterService)`](crate::client::fluent_builders::RegisterNotifications::service) / [`set_service(Option)`](crate::client::fluent_builders::RegisterNotifications::set_service): A union representing which notification service to register. - /// - On success, responds with [`RegisterNotificationsOutput`](crate::output::RegisterNotificationsOutput) - - /// - On failure, responds with [`SdkError`](crate::error::RegisterNotificationsError) - pub fn register_notifications(&self) -> fluent_builders::RegisterNotifications { - fluent_builders::RegisterNotifications::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`ResolveBetaJoinRequest`](crate::client::fluent_builders::ResolveBetaJoinRequest) operation. - /// - /// - The fluent builder is configurable: - /// - [`identity_id(impl Into)`](crate::client::fluent_builders::ResolveBetaJoinRequest::identity_id) / [`set_identity_id(Option)`](crate::client::fluent_builders::ResolveBetaJoinRequest::set_identity_id): A universally unique identifier. - /// - [`resolution(bool)`](crate::client::fluent_builders::ResolveBetaJoinRequest::resolution) / [`set_resolution(Option)`](crate::client::fluent_builders::ResolveBetaJoinRequest::set_resolution): Whether or not to accept the beta join request. - /// - On success, responds with [`ResolveBetaJoinRequestOutput`](crate::output::ResolveBetaJoinRequestOutput) - - /// - On failure, responds with [`SdkError`](crate::error::ResolveBetaJoinRequestError) - pub fn resolve_beta_join_request(&self) -> fluent_builders::ResolveBetaJoinRequest { - fluent_builders::ResolveBetaJoinRequest::new(self.handle.clone()) - } - /// Constructs a fluent builder for the [`UnregisterNotifications`](crate::client::fluent_builders::UnregisterNotifications) operation. - /// - /// - The fluent builder is configurable: - /// - [`service(NotificationUnregisterService)`](crate::client::fluent_builders::UnregisterNotifications::service) / [`set_service(Option)`](crate::client::fluent_builders::UnregisterNotifications::set_service): Represents a value for which notification service to unregister. - /// - On success, responds with [`UnregisterNotificationsOutput`](crate::output::UnregisterNotificationsOutput) - - /// - On failure, responds with [`SdkError`](crate::error::UnregisterNotificationsError) - pub fn unregister_notifications(&self) -> fluent_builders::UnregisterNotifications { - fluent_builders::UnregisterNotifications::new(self.handle.clone()) - } -} -pub mod fluent_builders { - //! - //! Utilities to ergonomically construct a request to the service. - //! - //! Fluent builders are created through the [`Client`](crate::client::Client) by calling - //! one if its operation methods. After parameters are set using the builder methods, - //! the `send` method can be called to initiate the request. - //! - /// Fluent builder constructing a request to `GetGameProfile`. - /// - /// Returns a game profile. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GetGameProfile { - handle: std::sync::Arc>, - inner: crate::input::get_game_profile_input::Builder, - } - impl GetGameProfile - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GetGameProfile`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GetGameProfileOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GetGameProfileInputOperationOutputAlias, - crate::output::GetGameProfileOutput, - crate::error::GetGameProfileError, - crate::input::GetGameProfileInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn game_name_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.game_name_id(input.into()); - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn set_game_name_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_game_name_id(input); - self - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.inner = self.inner.watch_index(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_watch_index(input); - self - } - } - /// Fluent builder constructing a request to `GetSuggestedGames`. - /// - /// Returns a list of games on the arcade page. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct GetSuggestedGames { - handle: std::sync::Arc>, - inner: crate::input::get_suggested_games_input::Builder, - } - impl GetSuggestedGames - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `GetSuggestedGames`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::GetSuggestedGamesOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::GetSuggestedGamesInputOperationOutputAlias, - crate::output::GetSuggestedGamesOutput, - crate::error::GetSuggestedGamesError, - crate::input::GetSuggestedGamesInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.inner = self.inner.watch_index(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_watch_index(input); - self - } - } - /// Fluent builder constructing a request to `RegisterNotifications`. - /// - /// Registers push notifications for the current identity. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct RegisterNotifications { - handle: std::sync::Arc>, - inner: crate::input::register_notifications_input::Builder, - } - impl RegisterNotifications - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `RegisterNotifications`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::RegisterNotificationsOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::RegisterNotificationsInputOperationOutputAlias, - crate::output::RegisterNotificationsOutput, - crate::error::RegisterNotificationsError, - crate::input::RegisterNotificationsInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A union representing which notification service to register. - pub fn service(mut self, input: crate::model::NotificationRegisterService) -> Self { - self.inner = self.inner.service(input); - self - } - /// A union representing which notification service to register. - pub fn set_service( - mut self, - input: std::option::Option, - ) -> Self { - self.inner = self.inner.set_service(input); - self - } - } - /// Fluent builder constructing a request to `ResolveBetaJoinRequest`. - /// - /// Resolves a beta join request for a given identity. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct ResolveBetaJoinRequest { - handle: std::sync::Arc>, - inner: crate::input::resolve_beta_join_request_input::Builder, - } - impl ResolveBetaJoinRequest - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `ResolveBetaJoinRequest`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::ResolveBetaJoinRequestOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::ResolveBetaJoinRequestInputOperationOutputAlias, - crate::output::ResolveBetaJoinRequestOutput, - crate::error::ResolveBetaJoinRequestError, - crate::input::ResolveBetaJoinRequestInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.inner = self.inner.identity_id(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_identity_id(input); - self - } - /// Whether or not to accept the beta join request. - pub fn resolution(mut self, input: bool) -> Self { - self.inner = self.inner.resolution(input); - self - } - /// Whether or not to accept the beta join request. - pub fn set_resolution(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_resolution(input); - self - } - } - /// Fluent builder constructing a request to `UnregisterNotifications`. - /// - /// Unregister push notification for the current identity. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct UnregisterNotifications { - handle: std::sync::Arc>, - inner: crate::input::unregister_notifications_input::Builder, - } - impl UnregisterNotifications - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `UnregisterNotifications`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::UnregisterNotificationsOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::UnregisterNotificationsInputOperationOutputAlias, - crate::output::UnregisterNotificationsOutput, - crate::error::UnregisterNotificationsError, - crate::input::UnregisterNotificationsInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - /// Represents a value for which notification service to unregister. - pub fn service(mut self, input: crate::model::NotificationUnregisterService) -> Self { - self.inner = self.inner.service(input); - self - } - /// Represents a value for which notification service to unregister. - pub fn set_service( - mut self, - input: std::option::Option, - ) -> Self { - self.inner = self.inner.set_service(input); - self - } - } -} -/// A wrapper around [`Client`]. Helps reduce external imports. -pub struct ClientWrapper { - pub(crate) client: Client, -} - -impl std::ops::Deref for ClientWrapper { - type Target = Client; - - fn deref(&self) -> &Self::Target { - &self.client - } -} diff --git a/lib/smithy-output/api-portal/rust/rust/src/config.rs b/lib/smithy-output/api-portal/rust/rust/src/config.rs deleted file mode 100644 index 30d51fe18..000000000 --- a/lib/smithy-output/api-portal/rust/rust/src/config.rs +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Service config. -/// -pub struct Config { - pub(crate) auth: Option, - pub(crate) uri: String, -} -impl std::fmt::Debug for Config { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut config = f.debug_struct("Config"); - config.finish() - } -} -impl Config { - /// Constructs a config builder. - pub fn builder() -> Builder { - Builder::default() - } -} -/// Builder for creating a `Config`. -#[derive(Default)] -pub struct Builder { - pub(crate) auth: Option, - pub(crate) uri: Option, -} -impl Builder { - /// Constructs a config builder. - pub fn new() -> Self { - Self::default() - } - /// Sets the bearer token to be used with the Smithy client. - pub fn set_bearer_token(mut self, bearer_token: impl std::fmt::Display) -> Self { - self.auth = Some(format!("Bearer {}", bearer_token)); - self - } - /// Sets the base URI to be used with the Smithy client. - pub fn set_uri(mut self, uri: impl ToString) -> Self { - self.uri = Some(uri.to_string()); - self - } - /// Builds a [`Config`]. - pub fn build(self) -> Config { - Config { - auth: self - .auth - .or_else(|| std::env::var("RIVET_LOBBY_TOKEN").ok()) - .or_else(|| std::env::var("RIVET_CLIENT_TOKEN").ok()), - uri: self - .uri - .or_else(|| std::env::var("RIVET_PORTAL_API_URL").ok()) - .unwrap_or_else(|| "https://portal.api.rivet.gg/v1".to_string()), - } - } - /// Builds a default [`Client`] from the given config. - pub fn build_client(self) -> crate::client::ClientWrapper { - let raw_client = aws_smithy_client::Builder::dyn_https() - .middleware(tower::layer::util::Identity::new()) - .sleep_impl(None) - .build(); - crate::client::ClientWrapper { - client: crate::Client::with_config(raw_client, self.build()), - } - } -} diff --git a/lib/smithy-output/api-portal/rust/rust/src/error.rs b/lib/smithy-output/api-portal/rust/rust/src/error.rs deleted file mode 100644 index 778848a39..000000000 --- a/lib/smithy-output/api-portal/rust/rust/src/error.rs +++ /dev/null @@ -1,1514 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Error type for the `GetGameProfile` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GetGameProfileError { - /// Kind of error that occurred. - pub kind: GetGameProfileErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GetGameProfile` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GetGameProfileErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GetGameProfileError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GetGameProfileErrorKind::InternalError(_inner) => _inner.fmt(f), - GetGameProfileErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GetGameProfileErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GetGameProfileErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GetGameProfileErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GetGameProfileErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GetGameProfileErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GetGameProfileError { - fn code(&self) -> Option<&str> { - GetGameProfileError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GetGameProfileErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - GetGameProfileErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl GetGameProfileError { - /// Creates a new `GetGameProfileError`. - pub fn new(kind: GetGameProfileErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GetGameProfileError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GetGameProfileErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GetGameProfileError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GetGameProfileErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GetGameProfileErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, GetGameProfileErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `GetGameProfileErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, GetGameProfileErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `GetGameProfileErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, GetGameProfileErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `GetGameProfileErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, GetGameProfileErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `GetGameProfileErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, GetGameProfileErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `GetGameProfileErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, GetGameProfileErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for GetGameProfileError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GetGameProfileErrorKind::InternalError(_inner) => Some(_inner), - GetGameProfileErrorKind::RateLimitError(_inner) => Some(_inner), - GetGameProfileErrorKind::ForbiddenError(_inner) => Some(_inner), - GetGameProfileErrorKind::UnauthorizedError(_inner) => Some(_inner), - GetGameProfileErrorKind::NotFoundError(_inner) => Some(_inner), - GetGameProfileErrorKind::BadRequestError(_inner) => Some(_inner), - GetGameProfileErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `GetSuggestedGames` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct GetSuggestedGamesError { - /// Kind of error that occurred. - pub kind: GetSuggestedGamesErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `GetSuggestedGames` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum GetSuggestedGamesErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for GetSuggestedGamesError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - GetSuggestedGamesErrorKind::InternalError(_inner) => _inner.fmt(f), - GetSuggestedGamesErrorKind::RateLimitError(_inner) => _inner.fmt(f), - GetSuggestedGamesErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - GetSuggestedGamesErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - GetSuggestedGamesErrorKind::NotFoundError(_inner) => _inner.fmt(f), - GetSuggestedGamesErrorKind::BadRequestError(_inner) => _inner.fmt(f), - GetSuggestedGamesErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for GetSuggestedGamesError { - fn code(&self) -> Option<&str> { - GetSuggestedGamesError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - GetSuggestedGamesErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - GetSuggestedGamesErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl GetSuggestedGamesError { - /// Creates a new `GetSuggestedGamesError`. - pub fn new(kind: GetSuggestedGamesErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `GetSuggestedGamesError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: GetSuggestedGamesErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `GetSuggestedGamesError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: GetSuggestedGamesErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `GetSuggestedGamesErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, GetSuggestedGamesErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `GetSuggestedGamesErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, GetSuggestedGamesErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `GetSuggestedGamesErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, GetSuggestedGamesErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `GetSuggestedGamesErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, GetSuggestedGamesErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `GetSuggestedGamesErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, GetSuggestedGamesErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `GetSuggestedGamesErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, GetSuggestedGamesErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for GetSuggestedGamesError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - GetSuggestedGamesErrorKind::InternalError(_inner) => Some(_inner), - GetSuggestedGamesErrorKind::RateLimitError(_inner) => Some(_inner), - GetSuggestedGamesErrorKind::ForbiddenError(_inner) => Some(_inner), - GetSuggestedGamesErrorKind::UnauthorizedError(_inner) => Some(_inner), - GetSuggestedGamesErrorKind::NotFoundError(_inner) => Some(_inner), - GetSuggestedGamesErrorKind::BadRequestError(_inner) => Some(_inner), - GetSuggestedGamesErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `RegisterNotifications` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct RegisterNotificationsError { - /// Kind of error that occurred. - pub kind: RegisterNotificationsErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `RegisterNotifications` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum RegisterNotificationsErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for RegisterNotificationsError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - RegisterNotificationsErrorKind::InternalError(_inner) => _inner.fmt(f), - RegisterNotificationsErrorKind::RateLimitError(_inner) => _inner.fmt(f), - RegisterNotificationsErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - RegisterNotificationsErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - RegisterNotificationsErrorKind::NotFoundError(_inner) => _inner.fmt(f), - RegisterNotificationsErrorKind::BadRequestError(_inner) => _inner.fmt(f), - RegisterNotificationsErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for RegisterNotificationsError { - fn code(&self) -> Option<&str> { - RegisterNotificationsError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - RegisterNotificationsErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - RegisterNotificationsErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl RegisterNotificationsError { - /// Creates a new `RegisterNotificationsError`. - pub fn new(kind: RegisterNotificationsErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `RegisterNotificationsError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: RegisterNotificationsErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `RegisterNotificationsError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: RegisterNotificationsErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `RegisterNotificationsErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, RegisterNotificationsErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `RegisterNotificationsErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - RegisterNotificationsErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `RegisterNotificationsErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - RegisterNotificationsErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `RegisterNotificationsErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - RegisterNotificationsErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `RegisterNotificationsErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, RegisterNotificationsErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `RegisterNotificationsErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - RegisterNotificationsErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for RegisterNotificationsError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - RegisterNotificationsErrorKind::InternalError(_inner) => Some(_inner), - RegisterNotificationsErrorKind::RateLimitError(_inner) => Some(_inner), - RegisterNotificationsErrorKind::ForbiddenError(_inner) => Some(_inner), - RegisterNotificationsErrorKind::UnauthorizedError(_inner) => Some(_inner), - RegisterNotificationsErrorKind::NotFoundError(_inner) => Some(_inner), - RegisterNotificationsErrorKind::BadRequestError(_inner) => Some(_inner), - RegisterNotificationsErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `ResolveBetaJoinRequest` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct ResolveBetaJoinRequestError { - /// Kind of error that occurred. - pub kind: ResolveBetaJoinRequestErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `ResolveBetaJoinRequest` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum ResolveBetaJoinRequestErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for ResolveBetaJoinRequestError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - ResolveBetaJoinRequestErrorKind::InternalError(_inner) => _inner.fmt(f), - ResolveBetaJoinRequestErrorKind::RateLimitError(_inner) => _inner.fmt(f), - ResolveBetaJoinRequestErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - ResolveBetaJoinRequestErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - ResolveBetaJoinRequestErrorKind::NotFoundError(_inner) => _inner.fmt(f), - ResolveBetaJoinRequestErrorKind::BadRequestError(_inner) => _inner.fmt(f), - ResolveBetaJoinRequestErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for ResolveBetaJoinRequestError { - fn code(&self) -> Option<&str> { - ResolveBetaJoinRequestError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - ResolveBetaJoinRequestErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - ResolveBetaJoinRequestErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl ResolveBetaJoinRequestError { - /// Creates a new `ResolveBetaJoinRequestError`. - pub fn new(kind: ResolveBetaJoinRequestErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `ResolveBetaJoinRequestError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: ResolveBetaJoinRequestErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `ResolveBetaJoinRequestError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: ResolveBetaJoinRequestErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `ResolveBetaJoinRequestErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!( - &self.kind, - ResolveBetaJoinRequestErrorKind::InternalError(_) - ) - } - /// Returns `true` if the error kind is `ResolveBetaJoinRequestErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - ResolveBetaJoinRequestErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `ResolveBetaJoinRequestErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - ResolveBetaJoinRequestErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `ResolveBetaJoinRequestErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - ResolveBetaJoinRequestErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `ResolveBetaJoinRequestErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!( - &self.kind, - ResolveBetaJoinRequestErrorKind::NotFoundError(_) - ) - } - /// Returns `true` if the error kind is `ResolveBetaJoinRequestErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - ResolveBetaJoinRequestErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for ResolveBetaJoinRequestError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - ResolveBetaJoinRequestErrorKind::InternalError(_inner) => Some(_inner), - ResolveBetaJoinRequestErrorKind::RateLimitError(_inner) => Some(_inner), - ResolveBetaJoinRequestErrorKind::ForbiddenError(_inner) => Some(_inner), - ResolveBetaJoinRequestErrorKind::UnauthorizedError(_inner) => Some(_inner), - ResolveBetaJoinRequestErrorKind::NotFoundError(_inner) => Some(_inner), - ResolveBetaJoinRequestErrorKind::BadRequestError(_inner) => Some(_inner), - ResolveBetaJoinRequestErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// Error type for the `UnregisterNotifications` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct UnregisterNotificationsError { - /// Kind of error that occurred. - pub kind: UnregisterNotificationsErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `UnregisterNotifications` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum UnregisterNotificationsErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for UnregisterNotificationsError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - UnregisterNotificationsErrorKind::InternalError(_inner) => _inner.fmt(f), - UnregisterNotificationsErrorKind::RateLimitError(_inner) => _inner.fmt(f), - UnregisterNotificationsErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - UnregisterNotificationsErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - UnregisterNotificationsErrorKind::NotFoundError(_inner) => _inner.fmt(f), - UnregisterNotificationsErrorKind::BadRequestError(_inner) => _inner.fmt(f), - UnregisterNotificationsErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for UnregisterNotificationsError { - fn code(&self) -> Option<&str> { - UnregisterNotificationsError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - UnregisterNotificationsErrorKind::InternalError(inner) => { - Some(inner.retryable_error_kind()) - } - UnregisterNotificationsErrorKind::UnauthorizedError(inner) => { - Some(inner.retryable_error_kind()) - } - _ => None, - } - } -} -impl UnregisterNotificationsError { - /// Creates a new `UnregisterNotificationsError`. - pub fn new(kind: UnregisterNotificationsErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `UnregisterNotificationsError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: UnregisterNotificationsErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `UnregisterNotificationsError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: UnregisterNotificationsErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `UnregisterNotificationsErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!( - &self.kind, - UnregisterNotificationsErrorKind::InternalError(_) - ) - } - /// Returns `true` if the error kind is `UnregisterNotificationsErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!( - &self.kind, - UnregisterNotificationsErrorKind::RateLimitError(_) - ) - } - /// Returns `true` if the error kind is `UnregisterNotificationsErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!( - &self.kind, - UnregisterNotificationsErrorKind::ForbiddenError(_) - ) - } - /// Returns `true` if the error kind is `UnregisterNotificationsErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!( - &self.kind, - UnregisterNotificationsErrorKind::UnauthorizedError(_) - ) - } - /// Returns `true` if the error kind is `UnregisterNotificationsErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!( - &self.kind, - UnregisterNotificationsErrorKind::NotFoundError(_) - ) - } - /// Returns `true` if the error kind is `UnregisterNotificationsErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!( - &self.kind, - UnregisterNotificationsErrorKind::BadRequestError(_) - ) - } -} -impl std::error::Error for UnregisterNotificationsError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - UnregisterNotificationsErrorKind::InternalError(_inner) => Some(_inner), - UnregisterNotificationsErrorKind::RateLimitError(_inner) => Some(_inner), - UnregisterNotificationsErrorKind::ForbiddenError(_inner) => Some(_inner), - UnregisterNotificationsErrorKind::UnauthorizedError(_inner) => Some(_inner), - UnregisterNotificationsErrorKind::NotFoundError(_inner) => Some(_inner), - UnregisterNotificationsErrorKind::BadRequestError(_inner) => Some(_inner), - UnregisterNotificationsErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// An error thrown when the requestee has sent an invalid or malformed request. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct BadRequestError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl BadRequestError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for BadRequestError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("BadRequestError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl BadRequestError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for BadRequestError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "BadRequestError")?; - if let Some(inner_1) = &self.message { - write!(f, ": {}", inner_1)?; - } - Ok(()) - } -} -impl std::error::Error for BadRequestError {} -/// See [`BadRequestError`](crate::error::BadRequestError) -pub mod bad_request_error { - /// A builder for [`BadRequestError`](crate::error::BadRequestError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`BadRequestError`](crate::error::BadRequestError) - pub fn build(self) -> crate::error::BadRequestError { - crate::error::BadRequestError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl BadRequestError { - /// Creates a new builder-style object to manufacture [`BadRequestError`](crate::error::BadRequestError) - pub fn builder() -> crate::error::bad_request_error::Builder { - crate::error::bad_request_error::Builder::default() - } -} - -/// An error thrown when the requestee requests a non existent resource. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct NotFoundError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl NotFoundError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for NotFoundError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("NotFoundError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl NotFoundError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for NotFoundError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "NotFoundError")?; - if let Some(inner_2) = &self.message { - write!(f, ": {}", inner_2)?; - } - Ok(()) - } -} -impl std::error::Error for NotFoundError {} -/// See [`NotFoundError`](crate::error::NotFoundError) -pub mod not_found_error { - /// A builder for [`NotFoundError`](crate::error::NotFoundError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`NotFoundError`](crate::error::NotFoundError) - pub fn build(self) -> crate::error::NotFoundError { - crate::error::NotFoundError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl NotFoundError { - /// Creates a new builder-style object to manufacture [`NotFoundError`](crate::error::NotFoundError) - pub fn builder() -> crate::error::not_found_error::Builder { - crate::error::not_found_error::Builder::default() - } -} - -/// An error thrown when the requestee is not authenticated. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UnauthorizedError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl UnauthorizedError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for UnauthorizedError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UnauthorizedError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl UnauthorizedError { - /// Returns `Some(ErrorKind)` if the error is retryable. Otherwise, returns `None`. - pub fn retryable_error_kind(&self) -> aws_smithy_types::retry::ErrorKind { - aws_smithy_types::retry::ErrorKind::ClientError - } - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for UnauthorizedError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "UnauthorizedError")?; - if let Some(inner_3) = &self.message { - write!(f, ": {}", inner_3)?; - } - Ok(()) - } -} -impl std::error::Error for UnauthorizedError {} -/// See [`UnauthorizedError`](crate::error::UnauthorizedError) -pub mod unauthorized_error { - /// A builder for [`UnauthorizedError`](crate::error::UnauthorizedError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`UnauthorizedError`](crate::error::UnauthorizedError) - pub fn build(self) -> crate::error::UnauthorizedError { - crate::error::UnauthorizedError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl UnauthorizedError { - /// Creates a new builder-style object to manufacture [`UnauthorizedError`](crate::error::UnauthorizedError) - pub fn builder() -> crate::error::unauthorized_error::Builder { - crate::error::unauthorized_error::Builder::default() - } -} - -/// An error thrown when the requestee requests a resource they do not have access to. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ForbiddenError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl ForbiddenError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for ForbiddenError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ForbiddenError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl ForbiddenError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for ForbiddenError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "ForbiddenError")?; - if let Some(inner_4) = &self.message { - write!(f, ": {}", inner_4)?; - } - Ok(()) - } -} -impl std::error::Error for ForbiddenError {} -/// See [`ForbiddenError`](crate::error::ForbiddenError) -pub mod forbidden_error { - /// A builder for [`ForbiddenError`](crate::error::ForbiddenError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`ForbiddenError`](crate::error::ForbiddenError) - pub fn build(self) -> crate::error::ForbiddenError { - crate::error::ForbiddenError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl ForbiddenError { - /// Creates a new builder-style object to manufacture [`ForbiddenError`](crate::error::ForbiddenError) - pub fn builder() -> crate::error::forbidden_error::Builder { - crate::error::forbidden_error::Builder::default() - } -} - -/// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct RateLimitError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl RateLimitError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for RateLimitError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("RateLimitError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl RateLimitError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for RateLimitError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "RateLimitError")?; - if let Some(inner_5) = &self.message { - write!(f, ": {}", inner_5)?; - } - Ok(()) - } -} -impl std::error::Error for RateLimitError {} -/// See [`RateLimitError`](crate::error::RateLimitError) -pub mod rate_limit_error { - /// A builder for [`RateLimitError`](crate::error::RateLimitError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`RateLimitError`](crate::error::RateLimitError) - pub fn build(self) -> crate::error::RateLimitError { - crate::error::RateLimitError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl RateLimitError { - /// Creates a new builder-style object to manufacture [`RateLimitError`](crate::error::RateLimitError) - pub fn builder() -> crate::error::rate_limit_error::Builder { - crate::error::rate_limit_error::Builder::default() - } -} - -/// An error caused by internal server problems. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct InternalError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl InternalError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for InternalError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("InternalError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl InternalError { - /// Returns `Some(ErrorKind)` if the error is retryable. Otherwise, returns `None`. - pub fn retryable_error_kind(&self) -> aws_smithy_types::retry::ErrorKind { - aws_smithy_types::retry::ErrorKind::ServerError - } - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for InternalError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "InternalError")?; - if let Some(inner_6) = &self.message { - write!(f, ": {}", inner_6)?; - } - Ok(()) - } -} -impl std::error::Error for InternalError {} -/// See [`InternalError`](crate::error::InternalError) -pub mod internal_error { - /// A builder for [`InternalError`](crate::error::InternalError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`InternalError`](crate::error::InternalError) - pub fn build(self) -> crate::error::InternalError { - crate::error::InternalError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl InternalError { - /// Creates a new builder-style object to manufacture [`InternalError`](crate::error::InternalError) - pub fn builder() -> crate::error::internal_error::Builder { - crate::error::internal_error::Builder::default() - } -} diff --git a/lib/smithy-output/api-portal/rust/rust/src/error_meta.rs b/lib/smithy-output/api-portal/rust/rust/src/error_meta.rs deleted file mode 100644 index a6091e703..000000000 --- a/lib/smithy-output/api-portal/rust/rust/src/error_meta.rs +++ /dev/null @@ -1,208 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// All possible error types for this service. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum Error { - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An unhandled error occurred. - Unhandled(Box), -} -impl std::fmt::Display for Error { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Error::BadRequestError(inner) => inner.fmt(f), - Error::ForbiddenError(inner) => inner.fmt(f), - Error::InternalError(inner) => inner.fmt(f), - Error::NotFoundError(inner) => inner.fmt(f), - Error::RateLimitError(inner) => inner.fmt(f), - Error::UnauthorizedError(inner) => inner.fmt(f), - Error::Unhandled(inner) => inner.fmt(f), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GetGameProfileErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GetGameProfileErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GetGameProfileErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GetGameProfileErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GetGameProfileErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GetGameProfileErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GetGameProfileErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::GetSuggestedGamesErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::GetSuggestedGamesErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::GetSuggestedGamesErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::GetSuggestedGamesErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::GetSuggestedGamesErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::GetSuggestedGamesErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::GetSuggestedGamesErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::RegisterNotificationsErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::RegisterNotificationsErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::RegisterNotificationsErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::RegisterNotificationsErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::RegisterNotificationsErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::RegisterNotificationsErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::RegisterNotificationsErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::ResolveBetaJoinRequestErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::ResolveBetaJoinRequestErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::ResolveBetaJoinRequestErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::ResolveBetaJoinRequestErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::ResolveBetaJoinRequestErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::ResolveBetaJoinRequestErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::ResolveBetaJoinRequestErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl From> - for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from( - err: aws_smithy_http::result::SdkError, - ) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::UnregisterNotificationsErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::UnregisterNotificationsErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::UnregisterNotificationsErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::UnregisterNotificationsErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::UnregisterNotificationsErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::UnregisterNotificationsErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::UnregisterNotificationsErrorKind::Unhandled(inner) => { - Error::Unhandled(inner) - } - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl std::error::Error for Error {} diff --git a/lib/smithy-output/api-portal/rust/rust/src/input.rs b/lib/smithy-output/api-portal/rust/rust/src/input.rs deleted file mode 100644 index f1665d15b..000000000 --- a/lib/smithy-output/api-portal/rust/rust/src/input.rs +++ /dev/null @@ -1,754 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -use std::fmt::Write; -/// See [`GetGameProfileInput`](crate::input::GetGameProfileInput) -pub mod get_game_profile_input { - /// A builder for [`GetGameProfileInput`](crate::input::GetGameProfileInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_name_id: std::option::Option, - pub(crate) watch_index: std::option::Option, - } - impl Builder { - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn game_name_id(mut self, input: impl Into) -> Self { - self.game_name_id = Some(input.into()); - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn set_game_name_id(mut self, input: std::option::Option) -> Self { - self.game_name_id = input; - self - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.watch_index = Some(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.watch_index = input; - self - } - /// Consumes the builder and constructs a [`GetGameProfileInput`](crate::input::GetGameProfileInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::GetGameProfileInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::GetGameProfileInput { - game_name_id: self.game_name_id, - watch_index: self.watch_index, - }) - } - } -} -#[doc(hidden)] -pub type GetGameProfileInputOperationOutputAlias = crate::operation::GetGameProfile; -#[doc(hidden)] -pub type GetGameProfileInputOperationRetryAlias = (); -impl GetGameProfileInput { - /// Consumes the builder and constructs an Operation<[`GetGameProfile`](crate::operation::GetGameProfile)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GetGameProfileInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_1 = &_input.game_name_id; - let input_1 = input_1.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "game_name_id", - details: "cannot be empty or unset", - }, - )?; - let game_name_id = aws_smithy_http::label::fmt_string(input_1, false); - if game_name_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "game_name_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/games/{game_name_id}/profile", - game_name_id = game_name_id - ) - .expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::GetGameProfileInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_2) = &_input.watch_index { - query.push_kv("watch_index", &aws_smithy_http::query::fmt_string(&inner_2)); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GetGameProfileInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::GetGameProfile::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GetGameProfile", - "PortalService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GetGameProfileInput`](crate::input::GetGameProfileInput) - pub fn builder() -> crate::input::get_game_profile_input::Builder { - crate::input::get_game_profile_input::Builder::default() - } -} - -/// See [`GetSuggestedGamesInput`](crate::input::GetSuggestedGamesInput) -pub mod get_suggested_games_input { - /// A builder for [`GetSuggestedGamesInput`](crate::input::GetSuggestedGamesInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) watch_index: std::option::Option, - } - impl Builder { - /// A query parameter denoting the requests watch index. - pub fn watch_index(mut self, input: impl Into) -> Self { - self.watch_index = Some(input.into()); - self - } - /// A query parameter denoting the requests watch index. - pub fn set_watch_index(mut self, input: std::option::Option) -> Self { - self.watch_index = input; - self - } - /// Consumes the builder and constructs a [`GetSuggestedGamesInput`](crate::input::GetSuggestedGamesInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::GetSuggestedGamesInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::GetSuggestedGamesInput { - watch_index: self.watch_index, - }) - } - } -} -#[doc(hidden)] -pub type GetSuggestedGamesInputOperationOutputAlias = crate::operation::GetSuggestedGames; -#[doc(hidden)] -pub type GetSuggestedGamesInputOperationRetryAlias = (); -impl GetSuggestedGamesInput { - /// Consumes the builder and constructs an Operation<[`GetSuggestedGames`](crate::operation::GetSuggestedGames)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::GetSuggestedGamesInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/games").expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::GetSuggestedGamesInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_3) = &_input.watch_index { - query.push_kv("watch_index", &aws_smithy_http::query::fmt_string(&inner_3)); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::GetSuggestedGamesInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::GetSuggestedGames::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "GetSuggestedGames", - "PortalService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`GetSuggestedGamesInput`](crate::input::GetSuggestedGamesInput) - pub fn builder() -> crate::input::get_suggested_games_input::Builder { - crate::input::get_suggested_games_input::Builder::default() - } -} - -/// See [`RegisterNotificationsInput`](crate::input::RegisterNotificationsInput) -pub mod register_notifications_input { - /// A builder for [`RegisterNotificationsInput`](crate::input::RegisterNotificationsInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) service: std::option::Option, - } - impl Builder { - /// A union representing which notification service to register. - pub fn service(mut self, input: crate::model::NotificationRegisterService) -> Self { - self.service = Some(input); - self - } - /// A union representing which notification service to register. - pub fn set_service( - mut self, - input: std::option::Option, - ) -> Self { - self.service = input; - self - } - /// Consumes the builder and constructs a [`RegisterNotificationsInput`](crate::input::RegisterNotificationsInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::RegisterNotificationsInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::RegisterNotificationsInput { - service: self.service, - }) - } - } -} -#[doc(hidden)] -pub type RegisterNotificationsInputOperationOutputAlias = crate::operation::RegisterNotifications; -#[doc(hidden)] -pub type RegisterNotificationsInputOperationRetryAlias = (); -impl RegisterNotificationsInput { - /// Consumes the builder and constructs an Operation<[`RegisterNotifications`](crate::operation::RegisterNotifications)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::RegisterNotificationsInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/notifications/register").expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::RegisterNotificationsInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_register_notifications( - &self, - )?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::RegisterNotifications::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "RegisterNotifications", - "PortalService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`RegisterNotificationsInput`](crate::input::RegisterNotificationsInput) - pub fn builder() -> crate::input::register_notifications_input::Builder { - crate::input::register_notifications_input::Builder::default() - } -} - -/// See [`ResolveBetaJoinRequestInput`](crate::input::ResolveBetaJoinRequestInput) -pub mod resolve_beta_join_request_input { - /// A builder for [`ResolveBetaJoinRequestInput`](crate::input::ResolveBetaJoinRequestInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) identity_id: std::option::Option, - pub(crate) resolution: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn identity_id(mut self, input: impl Into) -> Self { - self.identity_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_identity_id(mut self, input: std::option::Option) -> Self { - self.identity_id = input; - self - } - /// Whether or not to accept the beta join request. - pub fn resolution(mut self, input: bool) -> Self { - self.resolution = Some(input); - self - } - /// Whether or not to accept the beta join request. - pub fn set_resolution(mut self, input: std::option::Option) -> Self { - self.resolution = input; - self - } - /// Consumes the builder and constructs a [`ResolveBetaJoinRequestInput`](crate::input::ResolveBetaJoinRequestInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::ResolveBetaJoinRequestInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::ResolveBetaJoinRequestInput { - identity_id: self.identity_id, - resolution: self.resolution, - }) - } - } -} -#[doc(hidden)] -pub type ResolveBetaJoinRequestInputOperationOutputAlias = crate::operation::ResolveBetaJoinRequest; -#[doc(hidden)] -pub type ResolveBetaJoinRequestInputOperationRetryAlias = (); -impl ResolveBetaJoinRequestInput { - /// Consumes the builder and constructs an Operation<[`ResolveBetaJoinRequest`](crate::operation::ResolveBetaJoinRequest)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::ResolveBetaJoinRequestInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let input_4 = &_input.identity_id; - let input_4 = input_4.as_ref().ok_or( - aws_smithy_http::operation::BuildError::MissingField { - field: "identity_id", - details: "cannot be empty or unset", - }, - )?; - let identity_id = aws_smithy_http::label::fmt_string(input_4, false); - if identity_id.is_empty() { - return Err(aws_smithy_http::operation::BuildError::MissingField { - field: "identity_id", - details: "cannot be empty or unset", - }); - } - write!( - output, - "/beta-join-request/{identity_id}", - identity_id = identity_id - ) - .expect("formatting should succeed"); - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::ResolveBetaJoinRequestInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - Ok(builder.method("POST").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder = aws_smithy_http::header::set_request_header_if_absent( - builder, - http::header::CONTENT_TYPE, - "application/json", - ); - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from( - crate::operation_ser::serialize_operation_crate_operation_resolve_beta_join_request( - &self, - )?, - ); - if let Some(content_length) = body.content_length() { - request = aws_smithy_http::header::set_request_header_if_absent( - request, - http::header::CONTENT_LENGTH, - content_length, - ); - } - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::ResolveBetaJoinRequest::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "ResolveBetaJoinRequest", - "PortalService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`ResolveBetaJoinRequestInput`](crate::input::ResolveBetaJoinRequestInput) - pub fn builder() -> crate::input::resolve_beta_join_request_input::Builder { - crate::input::resolve_beta_join_request_input::Builder::default() - } -} - -/// See [`UnregisterNotificationsInput`](crate::input::UnregisterNotificationsInput) -pub mod unregister_notifications_input { - /// A builder for [`UnregisterNotificationsInput`](crate::input::UnregisterNotificationsInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) service: std::option::Option, - } - impl Builder { - /// Represents a value for which notification service to unregister. - pub fn service(mut self, input: crate::model::NotificationUnregisterService) -> Self { - self.service = Some(input); - self - } - /// Represents a value for which notification service to unregister. - pub fn set_service( - mut self, - input: std::option::Option, - ) -> Self { - self.service = input; - self - } - /// Consumes the builder and constructs a [`UnregisterNotificationsInput`](crate::input::UnregisterNotificationsInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::UnregisterNotificationsInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::UnregisterNotificationsInput { - service: self.service, - }) - } - } -} -#[doc(hidden)] -pub type UnregisterNotificationsInputOperationOutputAlias = - crate::operation::UnregisterNotifications; -#[doc(hidden)] -pub type UnregisterNotificationsInputOperationRetryAlias = (); -impl UnregisterNotificationsInput { - /// Consumes the builder and constructs an Operation<[`UnregisterNotifications`](crate::operation::UnregisterNotifications)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::UnregisterNotificationsInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/notifications/register").expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::UnregisterNotificationsInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_5) = &_input.service { - query.push_kv("service", &aws_smithy_http::query::fmt_string(&inner_5)); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::UnregisterNotificationsInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("DELETE").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::UnregisterNotifications::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "UnregisterNotifications", - "PortalService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`UnregisterNotificationsInput`](crate::input::UnregisterNotificationsInput) - pub fn builder() -> crate::input::unregister_notifications_input::Builder { - crate::input::unregister_notifications_input::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UnregisterNotificationsInput { - /// Represents a value for which notification service to unregister. - pub service: std::option::Option, -} -impl UnregisterNotificationsInput { - /// Represents a value for which notification service to unregister. - pub fn service(&self) -> std::option::Option<&crate::model::NotificationUnregisterService> { - self.service.as_ref() - } -} -impl std::fmt::Debug for UnregisterNotificationsInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UnregisterNotificationsInput"); - formatter.field("service", &self.service); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct RegisterNotificationsInput { - /// A union representing which notification service to register. - pub service: std::option::Option, -} -impl RegisterNotificationsInput { - /// A union representing which notification service to register. - pub fn service(&self) -> std::option::Option<&crate::model::NotificationRegisterService> { - self.service.as_ref() - } -} -impl std::fmt::Debug for RegisterNotificationsInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("RegisterNotificationsInput"); - formatter.field("service", &self.service); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ResolveBetaJoinRequestInput { - /// A universally unique identifier. - pub identity_id: std::option::Option, - /// Whether or not to accept the beta join request. - pub resolution: std::option::Option, -} -impl ResolveBetaJoinRequestInput { - /// A universally unique identifier. - pub fn identity_id(&self) -> std::option::Option<&str> { - self.identity_id.as_deref() - } - /// Whether or not to accept the beta join request. - pub fn resolution(&self) -> std::option::Option { - self.resolution - } -} -impl std::fmt::Debug for ResolveBetaJoinRequestInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ResolveBetaJoinRequestInput"); - formatter.field("identity_id", &self.identity_id); - formatter.field("resolution", &self.resolution); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetGameProfileInput { - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub game_name_id: std::option::Option, - /// A query parameter denoting the requests watch index. - pub watch_index: std::option::Option, -} -impl GetGameProfileInput { - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn game_name_id(&self) -> std::option::Option<&str> { - self.game_name_id.as_deref() - } - /// A query parameter denoting the requests watch index. - pub fn watch_index(&self) -> std::option::Option<&str> { - self.watch_index.as_deref() - } -} -impl std::fmt::Debug for GetGameProfileInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetGameProfileInput"); - formatter.field("game_name_id", &self.game_name_id); - formatter.field("watch_index", &self.watch_index); - formatter.finish() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetSuggestedGamesInput { - /// A query parameter denoting the requests watch index. - pub watch_index: std::option::Option, -} -impl GetSuggestedGamesInput { - /// A query parameter denoting the requests watch index. - pub fn watch_index(&self) -> std::option::Option<&str> { - self.watch_index.as_deref() - } -} -impl std::fmt::Debug for GetSuggestedGamesInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetSuggestedGamesInput"); - formatter.field("watch_index", &self.watch_index); - formatter.finish() - } -} diff --git a/lib/smithy-output/api-portal/rust/rust/src/json_deser.rs b/lib/smithy-output/api-portal/rust/rust/src/json_deser.rs deleted file mode 100644 index 9e611dea6..000000000 --- a/lib/smithy-output/api-portal/rust/rust/src/json_deser.rs +++ /dev/null @@ -1,1321 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub fn parse_http_generic_error( - response: &http::Response, -) -> Result { - crate::json_errors::parse_generic_error(response.body(), response.headers()) -} - -pub fn deser_structure_crate_error_internal_error_json_err( - value: &[u8], - mut builder: crate::error::internal_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_rate_limit_error_json_err( - value: &[u8], - mut builder: crate::error::rate_limit_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_forbidden_error_json_err( - value: &[u8], - mut builder: crate::error::forbidden_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_unauthorized_error_json_err( - value: &[u8], - mut builder: crate::error::unauthorized_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_not_found_error_json_err( - value: &[u8], - mut builder: crate::error::not_found_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_bad_request_error_json_err( - value: &[u8], - mut builder: crate::error::bad_request_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_get_game_profile( - value: &[u8], - mut builder: crate::output::get_game_profile_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "game" => { - builder = builder.set_game( - crate::json_deser::deser_structure_crate_model_game_profile(tokens)?, - ); - } - "watch" => { - builder = builder.set_watch( - crate::json_deser::deser_structure_crate_model_watch_response(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_get_suggested_games( - value: &[u8], - mut builder: crate::output::get_suggested_games_output::Builder, -) -> Result -{ - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "games" => { - builder = builder.set_games( - crate::json_deser::deser_list_rivet_game_game_summaries(tokens)?, - ); - } - "watch" => { - builder = builder.set_watch( - crate::json_deser::deser_structure_crate_model_watch_response(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn or_empty_doc(data: &[u8]) -> &[u8] { - if data.is_empty() { - b"{}" - } else { - data - } -} - -pub fn deser_structure_crate_model_game_profile<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GameProfile::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "game_id" => { - builder = builder.set_game_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "name_id" => { - builder = builder.set_name_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "display_name" => { - builder = builder.set_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "logo_url" => { - builder = builder.set_logo_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "banner_url" => { - builder = builder.set_banner_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "url" => { - builder = builder.set_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "developer" => { - builder = builder.set_developer( - crate::json_deser::deser_structure_crate_model_group_summary( - tokens, - )?, - ); - } - "tags" => { - builder = builder.set_tags( - crate::json_deser::deser_list_rivet_game_game_tags(tokens)?, - ); - } - "description" => { - builder = builder.set_description( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "platforms" => { - builder = builder.set_platforms( - crate::json_deser::deser_list_rivet_game_game_platforms( - tokens, - )?, - ); - } - "recommended_groups" => { - builder = builder.set_recommended_groups( - crate::json_deser::deser_list_rivet_group_group_summaries( - tokens, - )?, - ); - } - "identity_leaderboard_categories" => { - builder = builder.set_identity_leaderboard_categories( - crate::json_deser::deser_list_rivet_game_game_leaderboard_categories(tokens)? - ); - } - "group_leaderboard_categories" => { - builder = builder.set_group_leaderboard_categories( - crate::json_deser::deser_list_rivet_game_game_leaderboard_categories(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_watch_response<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::WatchResponse::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "index" => { - builder = builder.set_index( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_game_game_summaries<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_game_summary(tokens)?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_structure_crate_model_group_summary<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GroupSummary::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "group_id" => { - builder = builder.set_group_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "display_name" => { - builder = builder.set_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "avatar_url" => { - builder = builder.set_avatar_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "external" => { - builder = builder.set_external( - crate::json_deser::deser_structure_crate_model_group_external_links(tokens)? - ); - } - "is_developer" => { - builder = builder.set_is_developer( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - "bio" => { - builder = builder.set_bio( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "is_current_identity_member" => { - builder = builder.set_is_current_identity_member( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - "publicity" => { - builder = builder.set_publicity( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| { - s.to_unescaped() - .map(|u| crate::model::GroupPublicity::from(u.as_ref())) - }) - .transpose()?, - ); - } - "member_count" => { - builder = builder.set_member_count( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "owner_identity_id" => { - builder = builder.set_owner_identity_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_game_game_tags<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_game_game_platforms<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option>, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_game_platform_link( - tokens, - )?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_group_group_summaries<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_group_summary(tokens)?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_game_game_leaderboard_categories<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option>, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_game_leaderboard_category(tokens)? - ; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_structure_crate_model_game_summary<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GameSummary::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "game_id" => { - builder = builder.set_game_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "name_id" => { - builder = builder.set_name_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "display_name" => { - builder = builder.set_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "logo_url" => { - builder = builder.set_logo_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "banner_url" => { - builder = builder.set_banner_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "url" => { - builder = builder.set_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "developer" => { - builder = builder.set_developer( - crate::json_deser::deser_structure_crate_model_group_handle( - tokens, - )?, - ); - } - "tags" => { - builder = builder.set_tags( - crate::json_deser::deser_list_rivet_game_game_tags(tokens)?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_group_external_links<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GroupExternalLinks::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "profile" => { - builder = builder.set_profile( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "chat" => { - builder = builder.set_chat( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_game_platform_link<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GamePlatformLink::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "display_name" => { - builder = builder.set_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "url" => { - builder = builder.set_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_game_leaderboard_category<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GameLeaderboardCategory::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "display_name" => { - builder = builder.set_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_group_handle<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::GroupHandle::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "group_id" => { - builder = builder.set_group_id( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "display_name" => { - builder = builder.set_display_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "avatar_url" => { - builder = builder.set_avatar_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "external" => { - builder = builder.set_external( - crate::json_deser::deser_structure_crate_model_group_external_links(tokens)? - ); - } - "is_developer" => { - builder = builder.set_is_developer( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} diff --git a/lib/smithy-output/api-portal/rust/rust/src/json_errors.rs b/lib/smithy-output/api-portal/rust/rust/src/json_errors.rs deleted file mode 100644 index 7b7574319..000000000 --- a/lib/smithy-output/api-portal/rust/rust/src/json_errors.rs +++ /dev/null @@ -1,220 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -use aws_smithy_json::deserialize::token::skip_value; -use aws_smithy_json::deserialize::{json_token_iter, Error as DeserializeError, Token}; -use aws_smithy_types::Error as SmithyError; -use bytes::Bytes; -use http::header::ToStrError; -use http::{HeaderMap, HeaderValue}; -use std::borrow::Cow; - -// currently only used by AwsJson -#[allow(unused)] -pub fn is_error(response: &http::Response) -> bool { - !response.status().is_success() -} - -fn sanitize_error_code(error_code: &str) -> &str { - // Trim a trailing URL from the error code, beginning with a `:` - let error_code = match error_code.find(':') { - Some(idx) => &error_code[..idx], - None => error_code, - }; - - // Trim a prefixing namespace from the error code, beginning with a `#` - match error_code.find('#') { - Some(idx) => &error_code[idx + 1..], - None => error_code, - } -} - -struct ErrorBody<'a> { - code: Option>, - message: Option>, -} - -fn parse_error_body(bytes: &[u8]) -> Result { - let mut tokens = json_token_iter(bytes).peekable(); - let (mut typ, mut code, mut message) = (None, None, None); - if let Some(Token::StartObject { .. }) = tokens.next().transpose()? { - loop { - match tokens.next().transpose()? { - Some(Token::EndObject { .. }) => break, - Some(Token::ObjectKey { key, .. }) => { - if let Some(Ok(Token::ValueString { value, .. })) = tokens.peek() { - match key.as_escaped_str() { - "code" => code = Some(value.to_unescaped()?), - "__type" => typ = Some(value.to_unescaped()?), - "message" | "Message" | "errorMessage" => { - message = Some(value.to_unescaped()?) - } - _ => {} - } - } - skip_value(&mut tokens)?; - } - _ => { - return Err(DeserializeError::custom( - "expected object key or end object", - )) - } - } - } - if tokens.next().is_some() { - return Err(DeserializeError::custom( - "found more JSON tokens after completing parsing", - )); - } - } - Ok(ErrorBody { - code: code.or(typ), - message, - }) -} - -fn error_type_from_header(headers: &HeaderMap) -> Result, ToStrError> { - headers - .get("X-Amzn-Errortype") - .map(|v| v.to_str()) - .transpose() -} - -fn request_id(headers: &HeaderMap) -> Option<&str> { - headers - .get("X-Amzn-Requestid") - .and_then(|v| v.to_str().ok()) -} - -pub fn parse_generic_error( - payload: &Bytes, - headers: &HeaderMap, -) -> Result { - let ErrorBody { code, message } = parse_error_body(payload.as_ref())?; - - let mut err_builder = SmithyError::builder(); - if let Some(code) = error_type_from_header(headers) - .map_err(|_| DeserializeError::custom("X-Amzn-Errortype header was not valid UTF-8"))? - .or_else(|| code.as_deref()) - .map(sanitize_error_code) - { - err_builder.code(code); - } - if let Some(message) = message { - err_builder.message(message); - } - if let Some(request_id) = request_id(headers) { - err_builder.request_id(request_id); - } - Ok(err_builder.build()) -} - -#[cfg(test)] -mod test { - use crate::json_errors::{parse_error_body, parse_generic_error, sanitize_error_code}; - use aws_smithy_types::Error; - use bytes::Bytes; - use std::borrow::Cow; - - #[test] - fn generic_error() { - let response = http::Response::builder() - .header("X-Amzn-Requestid", "1234") - .body(Bytes::from_static( - br#"{ "__type": "FooError", "message": "Go to foo" }"#, - )) - .unwrap(); - assert_eq!( - parse_generic_error(response.body(), response.headers()).unwrap(), - Error::builder() - .code("FooError") - .message("Go to foo") - .request_id("1234") - .build() - ) - } - - #[test] - fn error_type() { - assert_eq!( - Some(Cow::Borrowed("FooError")), - parse_error_body(br#"{ "__type": "FooError" }"#) - .unwrap() - .code - ); - } - - #[test] - fn code_takes_priority() { - assert_eq!( - Some(Cow::Borrowed("BarError")), - parse_error_body(br#"{ "code": "BarError", "__type": "FooError" }"#) - .unwrap() - .code - ); - } - - #[test] - fn ignore_unrecognized_fields() { - assert_eq!( - Some(Cow::Borrowed("FooError")), - parse_error_body(br#"{ "__type": "FooError", "asdf": 5, "fdsa": {}, "foo": "1" }"#) - .unwrap() - .code - ); - } - - #[test] - fn sanitize_namespace_and_url() { - assert_eq!( - sanitize_error_code("aws.protocoltests.restjson#FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/"), - "FooError"); - } - - #[test] - fn sanitize_noop() { - assert_eq!(sanitize_error_code("FooError"), "FooError"); - } - - #[test] - fn sanitize_url() { - assert_eq!( - sanitize_error_code( - "FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/" - ), - "FooError" - ); - } - - #[test] - fn sanitize_namespace() { - assert_eq!( - sanitize_error_code("aws.protocoltests.restjson#FooError"), - "FooError" - ); - } - - // services like lambda use an alternate `Message` instead of `message` - #[test] - fn alternative_error_message_names() { - let response = http::Response::builder() - .header("x-amzn-errortype", "ResourceNotFoundException") - .body(Bytes::from_static( - br#"{ - "Type": "User", - "Message": "Functions from 'us-west-2' are not reachable from us-east-1" - }"#, - )) - .unwrap(); - assert_eq!( - parse_generic_error(response.body(), response.headers()).unwrap(), - Error::builder() - .code("ResourceNotFoundException") - .message("Functions from 'us-west-2' are not reachable from us-east-1") - .build() - ); - } -} diff --git a/lib/smithy-output/api-portal/rust/rust/src/json_ser.rs b/lib/smithy-output/api-portal/rust/rust/src/json_ser.rs deleted file mode 100644 index 6b59036f6..000000000 --- a/lib/smithy-output/api-portal/rust/rust/src/json_ser.rs +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub fn serialize_structure_crate_input_register_notifications_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::RegisterNotificationsInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_1) = &input.service { - let mut object_2 = object.key("service").start_object(); - crate::json_ser::serialize_union_crate_model_notification_register_service( - &mut object_2, - var_1, - )?; - object_2.finish(); - } - Ok(()) -} - -pub fn serialize_structure_crate_input_resolve_beta_join_request_input( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::input::ResolveBetaJoinRequestInput, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_3) = &input.resolution { - object.key("resolution").boolean(*var_3); - } - Ok(()) -} - -pub fn serialize_union_crate_model_notification_register_service( - object_2: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::NotificationRegisterService, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - match input { - crate::model::NotificationRegisterService::Firebase(inner) => { - let mut object_4 = object_2.key("firebase").start_object(); - crate::json_ser::serialize_structure_crate_model_notification_register_firebase_service(&mut object_4, inner)?; - object_4.finish(); - } - crate::model::NotificationRegisterService::Unknown => { - return Err( - aws_smithy_http::operation::SerializationError::unknown_variant( - "NotificationRegisterService", - ), - ) - } - } - Ok(()) -} - -pub fn serialize_structure_crate_model_notification_register_firebase_service( - object: &mut aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::model::NotificationRegisterFirebaseService, -) -> Result<(), aws_smithy_http::operation::SerializationError> { - if let Some(var_5) = &input.access_key { - object.key("access_key").string(var_5.as_str()); - } - Ok(()) -} diff --git a/lib/smithy-output/api-portal/rust/rust/src/lib.rs b/lib/smithy-output/api-portal/rust/rust/src/lib.rs deleted file mode 100644 index ddfa56b57..000000000 --- a/lib/smithy-output/api-portal/rust/rust/src/lib.rs +++ /dev/null @@ -1,57 +0,0 @@ -#![allow(clippy::module_inception)] -#![allow(clippy::upper_case_acronyms)] -#![allow(clippy::large_enum_variant)] -#![allow(clippy::wrong_self_convention)] -#![allow(clippy::should_implement_trait)] -#![allow(clippy::blacklisted_name)] -#![allow(clippy::vec_init_then_push)] -#![allow(rustdoc::bare_urls)] -#![warn(missing_docs)] -//! rivet-portal -//! -//! # Crate Organization -//! -//! The entry point for most customers will be [`Client`]. [`Client`] exposes one method for each API offered -//! by the service. -//! -//! Some APIs require complex or nested arguments. These exist in [`model`](crate::model). -//! -//! Lastly, errors that can be returned by the service are contained within [`error`]. [`Error`] defines a meta -//! error encompassing all possible errors that can be returned by the service. -//! -//! The other modules within this crate are not required for normal usage. - -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use error_meta::Error; - -#[doc(inline)] -pub use config::Config; - -/// Client and fluent builders for calling the service. -pub mod client; -/// Configuration for the service. -pub mod config; -/// Errors that can occur when calling the service. -pub mod error; -mod error_meta; -/// Input structures for operations. -pub mod input; -mod json_deser; -mod json_errors; -mod json_ser; -/// Data structures used by operation inputs/outputs. -pub mod model; -/// All operations that this crate can perform. -pub mod operation; -mod operation_deser; -mod operation_ser; -/// Output structures for operations. -pub mod output; -pub use client::{Builder, Client, ClientWrapper}; -/// Crate version number. -pub static PKG_VERSION: &str = env!("CARGO_PKG_VERSION"); -/// Re-exported types from supporting crates. -pub mod types { - pub use aws_smithy_http::result::SdkError; - pub use aws_smithy_types::DateTime; -} diff --git a/lib/smithy-output/api-portal/rust/rust/src/model.rs b/lib/smithy-output/api-portal/rust/rust/src/model.rs deleted file mode 100644 index 924d4c000..000000000 --- a/lib/smithy-output/api-portal/rust/rust/src/model.rs +++ /dev/null @@ -1,1371 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Represents a value for which notification service to unregister. -#[non_exhaustive] -#[derive( - std::clone::Clone, - std::cmp::Eq, - std::cmp::Ord, - std::cmp::PartialEq, - std::cmp::PartialOrd, - std::fmt::Debug, - std::hash::Hash, -)] -pub enum NotificationUnregisterService { - /// Firebase service. - Firebase, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for NotificationUnregisterService { - fn from(s: &str) -> Self { - match s { - "firebase" => NotificationUnregisterService::Firebase, - other => NotificationUnregisterService::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for NotificationUnregisterService { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(NotificationUnregisterService::from(s)) - } -} -impl NotificationUnregisterService { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - NotificationUnregisterService::Firebase => "firebase", - NotificationUnregisterService::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["firebase"] - } -} -impl AsRef for NotificationUnregisterService { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// A union representing which notification service to register. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] -pub enum NotificationRegisterService { - /// Represents push notification configuration for Firebase. - Firebase(crate::model::NotificationRegisterFirebaseService), - /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version. - /// An unknown enum variant - /// - /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._ - /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized - /// by the client. This can happen when the server adds new functionality, but the client has not been updated. - /// To investigate this, consider turning on debug logging to print the raw HTTP response. - #[non_exhaustive] - Unknown, -} -impl NotificationRegisterService { - #[allow(irrefutable_let_patterns)] - /// Tries to convert the enum instance into [`Firebase`](crate::model::NotificationRegisterService::Firebase), extracting the inner [`NotificationRegisterFirebaseService`](crate::model::NotificationRegisterFirebaseService). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_firebase( - &self, - ) -> std::result::Result<&crate::model::NotificationRegisterFirebaseService, &Self> { - if let NotificationRegisterService::Firebase(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`Firebase`](crate::model::NotificationRegisterService::Firebase). - pub fn is_firebase(&self) -> bool { - self.as_firebase().is_ok() - } - /// Returns true if the enum instance is the `Unknown` variant. - pub fn is_unknown(&self) -> bool { - matches!(self, Self::Unknown) - } -} - -/// Represents push notification configuration for Firebase. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct NotificationRegisterFirebaseService { - #[allow(missing_docs)] // documentation missing in model - pub access_key: std::option::Option, -} -impl NotificationRegisterFirebaseService { - #[allow(missing_docs)] // documentation missing in model - pub fn access_key(&self) -> std::option::Option<&str> { - self.access_key.as_deref() - } -} -impl std::fmt::Debug for NotificationRegisterFirebaseService { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("NotificationRegisterFirebaseService"); - formatter.field("access_key", &self.access_key); - formatter.finish() - } -} -/// See [`NotificationRegisterFirebaseService`](crate::model::NotificationRegisterFirebaseService) -pub mod notification_register_firebase_service { - /// A builder for [`NotificationRegisterFirebaseService`](crate::model::NotificationRegisterFirebaseService) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) access_key: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn access_key(mut self, input: impl Into) -> Self { - self.access_key = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_access_key(mut self, input: std::option::Option) -> Self { - self.access_key = input; - self - } - /// Consumes the builder and constructs a [`NotificationRegisterFirebaseService`](crate::model::NotificationRegisterFirebaseService) - pub fn build(self) -> crate::model::NotificationRegisterFirebaseService { - crate::model::NotificationRegisterFirebaseService { - access_key: self.access_key, - } - } - } -} -impl NotificationRegisterFirebaseService { - /// Creates a new builder-style object to manufacture [`NotificationRegisterFirebaseService`](crate::model::NotificationRegisterFirebaseService) - pub fn builder() -> crate::model::notification_register_firebase_service::Builder { - crate::model::notification_register_firebase_service::Builder::default() - } -} - -/// Provided by watchable endpoints used in blocking loops. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct WatchResponse { - /// Index indicating the version of the data responded. Pas this to `rivet.common#WatchQuery` to block and wait for the next response. - pub index: std::option::Option, -} -impl WatchResponse { - /// Index indicating the version of the data responded. Pas this to `rivet.common#WatchQuery` to block and wait for the next response. - pub fn index(&self) -> std::option::Option<&str> { - self.index.as_deref() - } -} -impl std::fmt::Debug for WatchResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("WatchResponse"); - formatter.field("index", &self.index); - formatter.finish() - } -} -/// See [`WatchResponse`](crate::model::WatchResponse) -pub mod watch_response { - /// A builder for [`WatchResponse`](crate::model::WatchResponse) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) index: std::option::Option, - } - impl Builder { - /// Index indicating the version of the data responded. Pas this to `rivet.common#WatchQuery` to block and wait for the next response. - pub fn index(mut self, input: impl Into) -> Self { - self.index = Some(input.into()); - self - } - /// Index indicating the version of the data responded. Pas this to `rivet.common#WatchQuery` to block and wait for the next response. - pub fn set_index(mut self, input: std::option::Option) -> Self { - self.index = input; - self - } - /// Consumes the builder and constructs a [`WatchResponse`](crate::model::WatchResponse) - pub fn build(self) -> crate::model::WatchResponse { - crate::model::WatchResponse { index: self.index } - } - } -} -impl WatchResponse { - /// Creates a new builder-style object to manufacture [`WatchResponse`](crate::model::WatchResponse) - pub fn builder() -> crate::model::watch_response::Builder { - crate::model::watch_response::Builder::default() - } -} - -/// A game profile. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GameProfile { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub name_id: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// The URL of this game's logo image. - pub logo_url: std::option::Option, - /// The URL of this game's banner image. - pub banner_url: std::option::Option, - /// The URL to this game's website. - pub url: std::option::Option, - /// A group summary. - pub developer: std::option::Option, - /// A list of game tags. - pub tags: std::option::Option>, - /// A description of the given game. - pub description: std::option::Option, - /// A list of platform links. - pub platforms: std::option::Option>, - /// A list of group summaries. - pub recommended_groups: std::option::Option>, - /// A list of game leaderboard categories. - pub identity_leaderboard_categories: - std::option::Option>, - /// A list of game leaderboard categories. - pub group_leaderboard_categories: - std::option::Option>, -} -impl GameProfile { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn name_id(&self) -> std::option::Option<&str> { - self.name_id.as_deref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// The URL of this game's logo image. - pub fn logo_url(&self) -> std::option::Option<&str> { - self.logo_url.as_deref() - } - /// The URL of this game's banner image. - pub fn banner_url(&self) -> std::option::Option<&str> { - self.banner_url.as_deref() - } - /// The URL to this game's website. - pub fn url(&self) -> std::option::Option<&str> { - self.url.as_deref() - } - /// A group summary. - pub fn developer(&self) -> std::option::Option<&crate::model::GroupSummary> { - self.developer.as_ref() - } - /// A list of game tags. - pub fn tags(&self) -> std::option::Option<&[std::string::String]> { - self.tags.as_deref() - } - /// A description of the given game. - pub fn description(&self) -> std::option::Option<&str> { - self.description.as_deref() - } - /// A list of platform links. - pub fn platforms(&self) -> std::option::Option<&[crate::model::GamePlatformLink]> { - self.platforms.as_deref() - } - /// A list of group summaries. - pub fn recommended_groups(&self) -> std::option::Option<&[crate::model::GroupSummary]> { - self.recommended_groups.as_deref() - } - /// A list of game leaderboard categories. - pub fn identity_leaderboard_categories( - &self, - ) -> std::option::Option<&[crate::model::GameLeaderboardCategory]> { - self.identity_leaderboard_categories.as_deref() - } - /// A list of game leaderboard categories. - pub fn group_leaderboard_categories( - &self, - ) -> std::option::Option<&[crate::model::GameLeaderboardCategory]> { - self.group_leaderboard_categories.as_deref() - } -} -impl std::fmt::Debug for GameProfile { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GameProfile"); - formatter.field("game_id", &self.game_id); - formatter.field("name_id", &self.name_id); - formatter.field("display_name", &self.display_name); - formatter.field("logo_url", &self.logo_url); - formatter.field("banner_url", &self.banner_url); - formatter.field("url", &self.url); - formatter.field("developer", &self.developer); - formatter.field("tags", &self.tags); - formatter.field("description", &self.description); - formatter.field("platforms", &self.platforms); - formatter.field("recommended_groups", &self.recommended_groups); - formatter.field( - "identity_leaderboard_categories", - &self.identity_leaderboard_categories, - ); - formatter.field( - "group_leaderboard_categories", - &self.group_leaderboard_categories, - ); - formatter.finish() - } -} -/// See [`GameProfile`](crate::model::GameProfile) -pub mod game_profile { - /// A builder for [`GameProfile`](crate::model::GameProfile) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) name_id: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) logo_url: std::option::Option, - pub(crate) banner_url: std::option::Option, - pub(crate) url: std::option::Option, - pub(crate) developer: std::option::Option, - pub(crate) tags: std::option::Option>, - pub(crate) description: std::option::Option, - pub(crate) platforms: std::option::Option>, - pub(crate) recommended_groups: - std::option::Option>, - pub(crate) identity_leaderboard_categories: - std::option::Option>, - pub(crate) group_leaderboard_categories: - std::option::Option>, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn name_id(mut self, input: impl Into) -> Self { - self.name_id = Some(input.into()); - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn set_name_id(mut self, input: std::option::Option) -> Self { - self.name_id = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// The URL of this game's logo image. - pub fn logo_url(mut self, input: impl Into) -> Self { - self.logo_url = Some(input.into()); - self - } - /// The URL of this game's logo image. - pub fn set_logo_url(mut self, input: std::option::Option) -> Self { - self.logo_url = input; - self - } - /// The URL of this game's banner image. - pub fn banner_url(mut self, input: impl Into) -> Self { - self.banner_url = Some(input.into()); - self - } - /// The URL of this game's banner image. - pub fn set_banner_url(mut self, input: std::option::Option) -> Self { - self.banner_url = input; - self - } - /// The URL to this game's website. - pub fn url(mut self, input: impl Into) -> Self { - self.url = Some(input.into()); - self - } - /// The URL to this game's website. - pub fn set_url(mut self, input: std::option::Option) -> Self { - self.url = input; - self - } - /// A group summary. - pub fn developer(mut self, input: crate::model::GroupSummary) -> Self { - self.developer = Some(input); - self - } - /// A group summary. - pub fn set_developer( - mut self, - input: std::option::Option, - ) -> Self { - self.developer = input; - self - } - /// Appends an item to `tags`. - /// - /// To override the contents of this collection use [`set_tags`](Self::set_tags). - /// - /// A list of game tags. - pub fn tags(mut self, input: impl Into) -> Self { - let mut v = self.tags.unwrap_or_default(); - v.push(input.into()); - self.tags = Some(v); - self - } - /// A list of game tags. - pub fn set_tags( - mut self, - input: std::option::Option>, - ) -> Self { - self.tags = input; - self - } - /// A description of the given game. - pub fn description(mut self, input: impl Into) -> Self { - self.description = Some(input.into()); - self - } - /// A description of the given game. - pub fn set_description(mut self, input: std::option::Option) -> Self { - self.description = input; - self - } - /// Appends an item to `platforms`. - /// - /// To override the contents of this collection use [`set_platforms`](Self::set_platforms). - /// - /// A list of platform links. - pub fn platforms(mut self, input: crate::model::GamePlatformLink) -> Self { - let mut v = self.platforms.unwrap_or_default(); - v.push(input); - self.platforms = Some(v); - self - } - /// A list of platform links. - pub fn set_platforms( - mut self, - input: std::option::Option>, - ) -> Self { - self.platforms = input; - self - } - /// Appends an item to `recommended_groups`. - /// - /// To override the contents of this collection use [`set_recommended_groups`](Self::set_recommended_groups). - /// - /// A list of group summaries. - pub fn recommended_groups(mut self, input: crate::model::GroupSummary) -> Self { - let mut v = self.recommended_groups.unwrap_or_default(); - v.push(input); - self.recommended_groups = Some(v); - self - } - /// A list of group summaries. - pub fn set_recommended_groups( - mut self, - input: std::option::Option>, - ) -> Self { - self.recommended_groups = input; - self - } - /// Appends an item to `identity_leaderboard_categories`. - /// - /// To override the contents of this collection use [`set_identity_leaderboard_categories`](Self::set_identity_leaderboard_categories). - /// - /// A list of game leaderboard categories. - pub fn identity_leaderboard_categories( - mut self, - input: crate::model::GameLeaderboardCategory, - ) -> Self { - let mut v = self.identity_leaderboard_categories.unwrap_or_default(); - v.push(input); - self.identity_leaderboard_categories = Some(v); - self - } - /// A list of game leaderboard categories. - pub fn set_identity_leaderboard_categories( - mut self, - input: std::option::Option>, - ) -> Self { - self.identity_leaderboard_categories = input; - self - } - /// Appends an item to `group_leaderboard_categories`. - /// - /// To override the contents of this collection use [`set_group_leaderboard_categories`](Self::set_group_leaderboard_categories). - /// - /// A list of game leaderboard categories. - pub fn group_leaderboard_categories( - mut self, - input: crate::model::GameLeaderboardCategory, - ) -> Self { - let mut v = self.group_leaderboard_categories.unwrap_or_default(); - v.push(input); - self.group_leaderboard_categories = Some(v); - self - } - /// A list of game leaderboard categories. - pub fn set_group_leaderboard_categories( - mut self, - input: std::option::Option>, - ) -> Self { - self.group_leaderboard_categories = input; - self - } - /// Consumes the builder and constructs a [`GameProfile`](crate::model::GameProfile) - pub fn build(self) -> crate::model::GameProfile { - crate::model::GameProfile { - game_id: self.game_id, - name_id: self.name_id, - display_name: self.display_name, - logo_url: self.logo_url, - banner_url: self.banner_url, - url: self.url, - developer: self.developer, - tags: self.tags, - description: self.description, - platforms: self.platforms, - recommended_groups: self.recommended_groups, - identity_leaderboard_categories: self.identity_leaderboard_categories, - group_leaderboard_categories: self.group_leaderboard_categories, - } - } - } -} -impl GameProfile { - /// Creates a new builder-style object to manufacture [`GameProfile`](crate::model::GameProfile) - pub fn builder() -> crate::model::game_profile::Builder { - crate::model::game_profile::Builder::default() - } -} - -/// A game leaderboard category. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GameLeaderboardCategory { - /// Represent a resource's readable display name. - pub display_name: std::option::Option, -} -impl GameLeaderboardCategory { - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } -} -impl std::fmt::Debug for GameLeaderboardCategory { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GameLeaderboardCategory"); - formatter.field("display_name", &self.display_name); - formatter.finish() - } -} -/// See [`GameLeaderboardCategory`](crate::model::GameLeaderboardCategory) -pub mod game_leaderboard_category { - /// A builder for [`GameLeaderboardCategory`](crate::model::GameLeaderboardCategory) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) display_name: std::option::Option, - } - impl Builder { - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// Consumes the builder and constructs a [`GameLeaderboardCategory`](crate::model::GameLeaderboardCategory) - pub fn build(self) -> crate::model::GameLeaderboardCategory { - crate::model::GameLeaderboardCategory { - display_name: self.display_name, - } - } - } -} -impl GameLeaderboardCategory { - /// Creates a new builder-style object to manufacture [`GameLeaderboardCategory`](crate::model::GameLeaderboardCategory) - pub fn builder() -> crate::model::game_leaderboard_category::Builder { - crate::model::game_leaderboard_category::Builder::default() - } -} - -/// A group summary. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GroupSummary { - /// A universally unique identifier. - pub group_id: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// The URL of this group's avatar image. - pub avatar_url: std::option::Option, - /// External links for this group. - pub external: std::option::Option, - /// Whether or not this group is a developer. - pub is_developer: std::option::Option, - /// Detailed information about a profile. - pub bio: std::option::Option, - /// Whether or not the current identity is a member of this group. - pub is_current_identity_member: std::option::Option, - /// The current publicity value for the given group. - pub publicity: std::option::Option, - /// Unsigned 32 bit integer. - pub member_count: std::option::Option, - /// A universally unique identifier. - pub owner_identity_id: std::option::Option, -} -impl GroupSummary { - /// A universally unique identifier. - pub fn group_id(&self) -> std::option::Option<&str> { - self.group_id.as_deref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// The URL of this group's avatar image. - pub fn avatar_url(&self) -> std::option::Option<&str> { - self.avatar_url.as_deref() - } - /// External links for this group. - pub fn external(&self) -> std::option::Option<&crate::model::GroupExternalLinks> { - self.external.as_ref() - } - /// Whether or not this group is a developer. - pub fn is_developer(&self) -> std::option::Option { - self.is_developer - } - /// Detailed information about a profile. - pub fn bio(&self) -> std::option::Option<&str> { - self.bio.as_deref() - } - /// Whether or not the current identity is a member of this group. - pub fn is_current_identity_member(&self) -> std::option::Option { - self.is_current_identity_member - } - /// The current publicity value for the given group. - pub fn publicity(&self) -> std::option::Option<&crate::model::GroupPublicity> { - self.publicity.as_ref() - } - /// Unsigned 32 bit integer. - pub fn member_count(&self) -> std::option::Option { - self.member_count - } - /// A universally unique identifier. - pub fn owner_identity_id(&self) -> std::option::Option<&str> { - self.owner_identity_id.as_deref() - } -} -impl std::fmt::Debug for GroupSummary { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GroupSummary"); - formatter.field("group_id", &self.group_id); - formatter.field("display_name", &self.display_name); - formatter.field("avatar_url", &self.avatar_url); - formatter.field("external", &self.external); - formatter.field("is_developer", &self.is_developer); - formatter.field("bio", &self.bio); - formatter.field( - "is_current_identity_member", - &self.is_current_identity_member, - ); - formatter.field("publicity", &self.publicity); - formatter.field("member_count", &self.member_count); - formatter.field("owner_identity_id", &self.owner_identity_id); - formatter.finish() - } -} -/// See [`GroupSummary`](crate::model::GroupSummary) -pub mod group_summary { - /// A builder for [`GroupSummary`](crate::model::GroupSummary) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) group_id: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) avatar_url: std::option::Option, - pub(crate) external: std::option::Option, - pub(crate) is_developer: std::option::Option, - pub(crate) bio: std::option::Option, - pub(crate) is_current_identity_member: std::option::Option, - pub(crate) publicity: std::option::Option, - pub(crate) member_count: std::option::Option, - pub(crate) owner_identity_id: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.group_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.group_id = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// The URL of this group's avatar image. - pub fn avatar_url(mut self, input: impl Into) -> Self { - self.avatar_url = Some(input.into()); - self - } - /// The URL of this group's avatar image. - pub fn set_avatar_url(mut self, input: std::option::Option) -> Self { - self.avatar_url = input; - self - } - /// External links for this group. - pub fn external(mut self, input: crate::model::GroupExternalLinks) -> Self { - self.external = Some(input); - self - } - /// External links for this group. - pub fn set_external( - mut self, - input: std::option::Option, - ) -> Self { - self.external = input; - self - } - /// Whether or not this group is a developer. - pub fn is_developer(mut self, input: bool) -> Self { - self.is_developer = Some(input); - self - } - /// Whether or not this group is a developer. - pub fn set_is_developer(mut self, input: std::option::Option) -> Self { - self.is_developer = input; - self - } - /// Detailed information about a profile. - pub fn bio(mut self, input: impl Into) -> Self { - self.bio = Some(input.into()); - self - } - /// Detailed information about a profile. - pub fn set_bio(mut self, input: std::option::Option) -> Self { - self.bio = input; - self - } - /// Whether or not the current identity is a member of this group. - pub fn is_current_identity_member(mut self, input: bool) -> Self { - self.is_current_identity_member = Some(input); - self - } - /// Whether or not the current identity is a member of this group. - pub fn set_is_current_identity_member(mut self, input: std::option::Option) -> Self { - self.is_current_identity_member = input; - self - } - /// The current publicity value for the given group. - pub fn publicity(mut self, input: crate::model::GroupPublicity) -> Self { - self.publicity = Some(input); - self - } - /// The current publicity value for the given group. - pub fn set_publicity( - mut self, - input: std::option::Option, - ) -> Self { - self.publicity = input; - self - } - /// Unsigned 32 bit integer. - pub fn member_count(mut self, input: i32) -> Self { - self.member_count = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_member_count(mut self, input: std::option::Option) -> Self { - self.member_count = input; - self - } - /// A universally unique identifier. - pub fn owner_identity_id(mut self, input: impl Into) -> Self { - self.owner_identity_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_owner_identity_id( - mut self, - input: std::option::Option, - ) -> Self { - self.owner_identity_id = input; - self - } - /// Consumes the builder and constructs a [`GroupSummary`](crate::model::GroupSummary) - pub fn build(self) -> crate::model::GroupSummary { - crate::model::GroupSummary { - group_id: self.group_id, - display_name: self.display_name, - avatar_url: self.avatar_url, - external: self.external, - is_developer: self.is_developer, - bio: self.bio, - is_current_identity_member: self.is_current_identity_member, - publicity: self.publicity, - member_count: self.member_count, - owner_identity_id: self.owner_identity_id, - } - } - } -} -impl GroupSummary { - /// Creates a new builder-style object to manufacture [`GroupSummary`](crate::model::GroupSummary) - pub fn builder() -> crate::model::group_summary::Builder { - crate::model::group_summary::Builder::default() - } -} - -/// The current publicity value for the given group. -#[non_exhaustive] -#[derive( - std::clone::Clone, - std::cmp::Eq, - std::cmp::Ord, - std::cmp::PartialEq, - std::cmp::PartialOrd, - std::fmt::Debug, - std::hash::Hash, -)] -pub enum GroupPublicity { - #[allow(missing_docs)] // documentation missing in model - Closed, - #[allow(missing_docs)] // documentation missing in model - Open, - /// Unknown contains new variants that have been added since this code was generated. - Unknown(String), -} -impl std::convert::From<&str> for GroupPublicity { - fn from(s: &str) -> Self { - match s { - "closed" => GroupPublicity::Closed, - "open" => GroupPublicity::Open, - other => GroupPublicity::Unknown(other.to_owned()), - } - } -} -impl std::str::FromStr for GroupPublicity { - type Err = std::convert::Infallible; - - fn from_str(s: &str) -> std::result::Result { - Ok(GroupPublicity::from(s)) - } -} -impl GroupPublicity { - /// Returns the `&str` value of the enum member. - pub fn as_str(&self) -> &str { - match self { - GroupPublicity::Closed => "closed", - GroupPublicity::Open => "open", - GroupPublicity::Unknown(s) => s.as_ref(), - } - } - /// Returns all the `&str` values of the enum members. - pub fn values() -> &'static [&'static str] { - &["closed", "open"] - } -} -impl AsRef for GroupPublicity { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -/// External links for this group. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GroupExternalLinks { - /// A link to this group's profile page. - pub profile: std::option::Option, - /// A link to this group's chat page. - pub chat: std::option::Option, -} -impl GroupExternalLinks { - /// A link to this group's profile page. - pub fn profile(&self) -> std::option::Option<&str> { - self.profile.as_deref() - } - /// A link to this group's chat page. - pub fn chat(&self) -> std::option::Option<&str> { - self.chat.as_deref() - } -} -impl std::fmt::Debug for GroupExternalLinks { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GroupExternalLinks"); - formatter.field("profile", &self.profile); - formatter.field("chat", &self.chat); - formatter.finish() - } -} -/// See [`GroupExternalLinks`](crate::model::GroupExternalLinks) -pub mod group_external_links { - /// A builder for [`GroupExternalLinks`](crate::model::GroupExternalLinks) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) profile: std::option::Option, - pub(crate) chat: std::option::Option, - } - impl Builder { - /// A link to this group's profile page. - pub fn profile(mut self, input: impl Into) -> Self { - self.profile = Some(input.into()); - self - } - /// A link to this group's profile page. - pub fn set_profile(mut self, input: std::option::Option) -> Self { - self.profile = input; - self - } - /// A link to this group's chat page. - pub fn chat(mut self, input: impl Into) -> Self { - self.chat = Some(input.into()); - self - } - /// A link to this group's chat page. - pub fn set_chat(mut self, input: std::option::Option) -> Self { - self.chat = input; - self - } - /// Consumes the builder and constructs a [`GroupExternalLinks`](crate::model::GroupExternalLinks) - pub fn build(self) -> crate::model::GroupExternalLinks { - crate::model::GroupExternalLinks { - profile: self.profile, - chat: self.chat, - } - } - } -} -impl GroupExternalLinks { - /// Creates a new builder-style object to manufacture [`GroupExternalLinks`](crate::model::GroupExternalLinks) - pub fn builder() -> crate::model::group_external_links::Builder { - crate::model::group_external_links::Builder::default() - } -} - -/// A platform link denoting a supported platform. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GamePlatformLink { - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// The URL to the given game's method of distribution on this platform. - pub url: std::option::Option, -} -impl GamePlatformLink { - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// The URL to the given game's method of distribution on this platform. - pub fn url(&self) -> std::option::Option<&str> { - self.url.as_deref() - } -} -impl std::fmt::Debug for GamePlatformLink { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GamePlatformLink"); - formatter.field("display_name", &self.display_name); - formatter.field("url", &self.url); - formatter.finish() - } -} -/// See [`GamePlatformLink`](crate::model::GamePlatformLink) -pub mod game_platform_link { - /// A builder for [`GamePlatformLink`](crate::model::GamePlatformLink) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) display_name: std::option::Option, - pub(crate) url: std::option::Option, - } - impl Builder { - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// The URL to the given game's method of distribution on this platform. - pub fn url(mut self, input: impl Into) -> Self { - self.url = Some(input.into()); - self - } - /// The URL to the given game's method of distribution on this platform. - pub fn set_url(mut self, input: std::option::Option) -> Self { - self.url = input; - self - } - /// Consumes the builder and constructs a [`GamePlatformLink`](crate::model::GamePlatformLink) - pub fn build(self) -> crate::model::GamePlatformLink { - crate::model::GamePlatformLink { - display_name: self.display_name, - url: self.url, - } - } - } -} -impl GamePlatformLink { - /// Creates a new builder-style object to manufacture [`GamePlatformLink`](crate::model::GamePlatformLink) - pub fn builder() -> crate::model::game_platform_link::Builder { - crate::model::game_platform_link::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GameSummary { - /// A universally unique identifier. - pub game_id: std::option::Option, - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub name_id: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// The URL of this game's logo image. - pub logo_url: std::option::Option, - /// The URL of this game's banner image. - pub banner_url: std::option::Option, - /// The URL to this game's website. - pub url: std::option::Option, - /// A group handle. - pub developer: std::option::Option, - /// A list of game tags. - pub tags: std::option::Option>, -} -impl GameSummary { - /// A universally unique identifier. - pub fn game_id(&self) -> std::option::Option<&str> { - self.game_id.as_deref() - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn name_id(&self) -> std::option::Option<&str> { - self.name_id.as_deref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// The URL of this game's logo image. - pub fn logo_url(&self) -> std::option::Option<&str> { - self.logo_url.as_deref() - } - /// The URL of this game's banner image. - pub fn banner_url(&self) -> std::option::Option<&str> { - self.banner_url.as_deref() - } - /// The URL to this game's website. - pub fn url(&self) -> std::option::Option<&str> { - self.url.as_deref() - } - /// A group handle. - pub fn developer(&self) -> std::option::Option<&crate::model::GroupHandle> { - self.developer.as_ref() - } - /// A list of game tags. - pub fn tags(&self) -> std::option::Option<&[std::string::String]> { - self.tags.as_deref() - } -} -impl std::fmt::Debug for GameSummary { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GameSummary"); - formatter.field("game_id", &self.game_id); - formatter.field("name_id", &self.name_id); - formatter.field("display_name", &self.display_name); - formatter.field("logo_url", &self.logo_url); - formatter.field("banner_url", &self.banner_url); - formatter.field("url", &self.url); - formatter.field("developer", &self.developer); - formatter.field("tags", &self.tags); - formatter.finish() - } -} -/// See [`GameSummary`](crate::model::GameSummary) -pub mod game_summary { - /// A builder for [`GameSummary`](crate::model::GameSummary) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game_id: std::option::Option, - pub(crate) name_id: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) logo_url: std::option::Option, - pub(crate) banner_url: std::option::Option, - pub(crate) url: std::option::Option, - pub(crate) developer: std::option::Option, - pub(crate) tags: std::option::Option>, - } - impl Builder { - /// A universally unique identifier. - pub fn game_id(mut self, input: impl Into) -> Self { - self.game_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_game_id(mut self, input: std::option::Option) -> Self { - self.game_id = input; - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn name_id(mut self, input: impl Into) -> Self { - self.name_id = Some(input.into()); - self - } - /// A human readable short identifier used to references resources. Different than a `rivet.common#Uuid` because this is intended to be human readable. Different than `rivet.common#DisplayName` because this should not include special characters and be short. - pub fn set_name_id(mut self, input: std::option::Option) -> Self { - self.name_id = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// The URL of this game's logo image. - pub fn logo_url(mut self, input: impl Into) -> Self { - self.logo_url = Some(input.into()); - self - } - /// The URL of this game's logo image. - pub fn set_logo_url(mut self, input: std::option::Option) -> Self { - self.logo_url = input; - self - } - /// The URL of this game's banner image. - pub fn banner_url(mut self, input: impl Into) -> Self { - self.banner_url = Some(input.into()); - self - } - /// The URL of this game's banner image. - pub fn set_banner_url(mut self, input: std::option::Option) -> Self { - self.banner_url = input; - self - } - /// The URL to this game's website. - pub fn url(mut self, input: impl Into) -> Self { - self.url = Some(input.into()); - self - } - /// The URL to this game's website. - pub fn set_url(mut self, input: std::option::Option) -> Self { - self.url = input; - self - } - /// A group handle. - pub fn developer(mut self, input: crate::model::GroupHandle) -> Self { - self.developer = Some(input); - self - } - /// A group handle. - pub fn set_developer( - mut self, - input: std::option::Option, - ) -> Self { - self.developer = input; - self - } - /// Appends an item to `tags`. - /// - /// To override the contents of this collection use [`set_tags`](Self::set_tags). - /// - /// A list of game tags. - pub fn tags(mut self, input: impl Into) -> Self { - let mut v = self.tags.unwrap_or_default(); - v.push(input.into()); - self.tags = Some(v); - self - } - /// A list of game tags. - pub fn set_tags( - mut self, - input: std::option::Option>, - ) -> Self { - self.tags = input; - self - } - /// Consumes the builder and constructs a [`GameSummary`](crate::model::GameSummary) - pub fn build(self) -> crate::model::GameSummary { - crate::model::GameSummary { - game_id: self.game_id, - name_id: self.name_id, - display_name: self.display_name, - logo_url: self.logo_url, - banner_url: self.banner_url, - url: self.url, - developer: self.developer, - tags: self.tags, - } - } - } -} -impl GameSummary { - /// Creates a new builder-style object to manufacture [`GameSummary`](crate::model::GameSummary) - pub fn builder() -> crate::model::game_summary::Builder { - crate::model::game_summary::Builder::default() - } -} - -/// A group handle. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GroupHandle { - /// A universally unique identifier. - pub group_id: std::option::Option, - /// Represent a resource's readable display name. - pub display_name: std::option::Option, - /// The URL of this group's avatar image. - pub avatar_url: std::option::Option, - /// External links for this group. - pub external: std::option::Option, - /// Whether or not this group is a developer group. - pub is_developer: std::option::Option, -} -impl GroupHandle { - /// A universally unique identifier. - pub fn group_id(&self) -> std::option::Option<&str> { - self.group_id.as_deref() - } - /// Represent a resource's readable display name. - pub fn display_name(&self) -> std::option::Option<&str> { - self.display_name.as_deref() - } - /// The URL of this group's avatar image. - pub fn avatar_url(&self) -> std::option::Option<&str> { - self.avatar_url.as_deref() - } - /// External links for this group. - pub fn external(&self) -> std::option::Option<&crate::model::GroupExternalLinks> { - self.external.as_ref() - } - /// Whether or not this group is a developer group. - pub fn is_developer(&self) -> std::option::Option { - self.is_developer - } -} -impl std::fmt::Debug for GroupHandle { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GroupHandle"); - formatter.field("group_id", &self.group_id); - formatter.field("display_name", &self.display_name); - formatter.field("avatar_url", &self.avatar_url); - formatter.field("external", &self.external); - formatter.field("is_developer", &self.is_developer); - formatter.finish() - } -} -/// See [`GroupHandle`](crate::model::GroupHandle) -pub mod group_handle { - /// A builder for [`GroupHandle`](crate::model::GroupHandle) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) group_id: std::option::Option, - pub(crate) display_name: std::option::Option, - pub(crate) avatar_url: std::option::Option, - pub(crate) external: std::option::Option, - pub(crate) is_developer: std::option::Option, - } - impl Builder { - /// A universally unique identifier. - pub fn group_id(mut self, input: impl Into) -> Self { - self.group_id = Some(input.into()); - self - } - /// A universally unique identifier. - pub fn set_group_id(mut self, input: std::option::Option) -> Self { - self.group_id = input; - self - } - /// Represent a resource's readable display name. - pub fn display_name(mut self, input: impl Into) -> Self { - self.display_name = Some(input.into()); - self - } - /// Represent a resource's readable display name. - pub fn set_display_name(mut self, input: std::option::Option) -> Self { - self.display_name = input; - self - } - /// The URL of this group's avatar image. - pub fn avatar_url(mut self, input: impl Into) -> Self { - self.avatar_url = Some(input.into()); - self - } - /// The URL of this group's avatar image. - pub fn set_avatar_url(mut self, input: std::option::Option) -> Self { - self.avatar_url = input; - self - } - /// External links for this group. - pub fn external(mut self, input: crate::model::GroupExternalLinks) -> Self { - self.external = Some(input); - self - } - /// External links for this group. - pub fn set_external( - mut self, - input: std::option::Option, - ) -> Self { - self.external = input; - self - } - /// Whether or not this group is a developer group. - pub fn is_developer(mut self, input: bool) -> Self { - self.is_developer = Some(input); - self - } - /// Whether or not this group is a developer group. - pub fn set_is_developer(mut self, input: std::option::Option) -> Self { - self.is_developer = input; - self - } - /// Consumes the builder and constructs a [`GroupHandle`](crate::model::GroupHandle) - pub fn build(self) -> crate::model::GroupHandle { - crate::model::GroupHandle { - group_id: self.group_id, - display_name: self.display_name, - avatar_url: self.avatar_url, - external: self.external, - is_developer: self.is_developer, - } - } - } -} -impl GroupHandle { - /// Creates a new builder-style object to manufacture [`GroupHandle`](crate::model::GroupHandle) - pub fn builder() -> crate::model::group_handle::Builder { - crate::model::group_handle::Builder::default() - } -} diff --git a/lib/smithy-output/api-portal/rust/rust/src/operation.rs b/lib/smithy-output/api-portal/rust/rust/src/operation.rs deleted file mode 100644 index 1371e7913..000000000 --- a/lib/smithy-output/api-portal/rust/rust/src/operation.rs +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Operation shape for `GetGameProfile`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`get_game_profile`](crate::client::Client::get_game_profile). -/// -/// See [`crate::client::fluent_builders::GetGameProfile`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GetGameProfile { - _private: (), -} -impl GetGameProfile { - /// Creates a new builder-style object to manufacture [`GetGameProfileInput`](crate::input::GetGameProfileInput) - pub fn builder() -> crate::input::get_game_profile_input::Builder { - crate::input::get_game_profile_input::Builder::default() - } - /// Creates a new `GetGameProfile` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GetGameProfile { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_get_game_profile_error(response) - } else { - crate::operation_deser::parse_get_game_profile_response(response) - } - } -} - -/// Operation shape for `GetSuggestedGames`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`get_suggested_games`](crate::client::Client::get_suggested_games). -/// -/// See [`crate::client::fluent_builders::GetSuggestedGames`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct GetSuggestedGames { - _private: (), -} -impl GetSuggestedGames { - /// Creates a new builder-style object to manufacture [`GetSuggestedGamesInput`](crate::input::GetSuggestedGamesInput) - pub fn builder() -> crate::input::get_suggested_games_input::Builder { - crate::input::get_suggested_games_input::Builder::default() - } - /// Creates a new `GetSuggestedGames` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for GetSuggestedGames { - type Output = std::result::Result< - crate::output::GetSuggestedGamesOutput, - crate::error::GetSuggestedGamesError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_get_suggested_games_error(response) - } else { - crate::operation_deser::parse_get_suggested_games_response(response) - } - } -} - -/// Operation shape for `RegisterNotifications`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`register_notifications`](crate::client::Client::register_notifications). -/// -/// See [`crate::client::fluent_builders::RegisterNotifications`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct RegisterNotifications { - _private: (), -} -impl RegisterNotifications { - /// Creates a new builder-style object to manufacture [`RegisterNotificationsInput`](crate::input::RegisterNotificationsInput) - pub fn builder() -> crate::input::register_notifications_input::Builder { - crate::input::register_notifications_input::Builder::default() - } - /// Creates a new `RegisterNotifications` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for RegisterNotifications { - type Output = std::result::Result< - crate::output::RegisterNotificationsOutput, - crate::error::RegisterNotificationsError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_register_notifications_error(response) - } else { - crate::operation_deser::parse_register_notifications_response(response) - } - } -} - -/// Operation shape for `ResolveBetaJoinRequest`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`resolve_beta_join_request`](crate::client::Client::resolve_beta_join_request). -/// -/// See [`crate::client::fluent_builders::ResolveBetaJoinRequest`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct ResolveBetaJoinRequest { - _private: (), -} -impl ResolveBetaJoinRequest { - /// Creates a new builder-style object to manufacture [`ResolveBetaJoinRequestInput`](crate::input::ResolveBetaJoinRequestInput) - pub fn builder() -> crate::input::resolve_beta_join_request_input::Builder { - crate::input::resolve_beta_join_request_input::Builder::default() - } - /// Creates a new `ResolveBetaJoinRequest` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for ResolveBetaJoinRequest { - type Output = std::result::Result< - crate::output::ResolveBetaJoinRequestOutput, - crate::error::ResolveBetaJoinRequestError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_resolve_beta_join_request_error(response) - } else { - crate::operation_deser::parse_resolve_beta_join_request_response(response) - } - } -} - -/// Operation shape for `UnregisterNotifications`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`unregister_notifications`](crate::client::Client::unregister_notifications). -/// -/// See [`crate::client::fluent_builders::UnregisterNotifications`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct UnregisterNotifications { - _private: (), -} -impl UnregisterNotifications { - /// Creates a new builder-style object to manufacture [`UnregisterNotificationsInput`](crate::input::UnregisterNotificationsInput) - pub fn builder() -> crate::input::unregister_notifications_input::Builder { - crate::input::unregister_notifications_input::Builder::default() - } - /// Creates a new `UnregisterNotifications` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for UnregisterNotifications { - type Output = std::result::Result< - crate::output::UnregisterNotificationsOutput, - crate::error::UnregisterNotificationsError, - >; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_unregister_notifications_error(response) - } else { - crate::operation_deser::parse_unregister_notifications_response(response) - } - } -} diff --git a/lib/smithy-output/api-portal/rust/rust/src/operation_deser.rs b/lib/smithy-output/api-portal/rust/rust/src/operation_deser.rs deleted file mode 100644 index 81e2d4702..000000000 --- a/lib/smithy-output/api-portal/rust/rust/src/operation_deser.rs +++ /dev/null @@ -1,768 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_game_profile_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GetGameProfileError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::GetGameProfileError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GetGameProfileError { - meta: generic, - kind: crate::error::GetGameProfileErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetGameProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GetGameProfileError { - meta: generic, - kind: crate::error::GetGameProfileErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GetGameProfileError { - meta: generic, - kind: crate::error::GetGameProfileErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GetGameProfileError { - meta: generic, - kind: crate::error::GetGameProfileErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GetGameProfileError { - meta: generic, - kind: crate::error::GetGameProfileErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GetGameProfileError { - meta: generic, - kind: crate::error::GetGameProfileErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetGameProfileError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GetGameProfileError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_game_profile_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::get_game_profile_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_get_game_profile( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetGameProfileError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_suggested_games_error( - response: &http::Response, -) -> std::result::Result -{ - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::GetSuggestedGamesError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::GetSuggestedGamesError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::GetSuggestedGamesError { - meta: generic, - kind: crate::error::GetSuggestedGamesErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetSuggestedGamesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::GetSuggestedGamesError { - meta: generic, - kind: crate::error::GetSuggestedGamesErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetSuggestedGamesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::GetSuggestedGamesError { - meta: generic, - kind: crate::error::GetSuggestedGamesErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetSuggestedGamesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::GetSuggestedGamesError { - meta: generic, - kind: crate::error::GetSuggestedGamesErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetSuggestedGamesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::GetSuggestedGamesError { - meta: generic, - kind: crate::error::GetSuggestedGamesErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetSuggestedGamesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::GetSuggestedGamesError { - meta: generic, - kind: crate::error::GetSuggestedGamesErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetSuggestedGamesError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::GetSuggestedGamesError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_get_suggested_games_response( - response: &http::Response, -) -> std::result::Result -{ - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::get_suggested_games_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_get_suggested_games( - response.body().as_ref(), - output, - ) - .map_err(crate::error::GetSuggestedGamesError::unhandled)?; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_register_notifications_error( - response: &http::Response, -) -> std::result::Result< - crate::output::RegisterNotificationsOutput, - crate::error::RegisterNotificationsError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::RegisterNotificationsError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::RegisterNotificationsError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::RegisterNotificationsError { - meta: generic, - kind: crate::error::RegisterNotificationsErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::RegisterNotificationsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::RegisterNotificationsError { - meta: generic, - kind: crate::error::RegisterNotificationsErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::RegisterNotificationsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::RegisterNotificationsError { - meta: generic, - kind: crate::error::RegisterNotificationsErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::RegisterNotificationsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::RegisterNotificationsError { - meta: generic, - kind: crate::error::RegisterNotificationsErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::RegisterNotificationsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::RegisterNotificationsError { - meta: generic, - kind: crate::error::RegisterNotificationsErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::RegisterNotificationsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::RegisterNotificationsError { - meta: generic, - kind: crate::error::RegisterNotificationsErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::RegisterNotificationsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::RegisterNotificationsError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_register_notifications_response( - response: &http::Response, -) -> std::result::Result< - crate::output::RegisterNotificationsOutput, - crate::error::RegisterNotificationsError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::register_notifications_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_resolve_beta_join_request_error( - response: &http::Response, -) -> std::result::Result< - crate::output::ResolveBetaJoinRequestOutput, - crate::error::ResolveBetaJoinRequestError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::ResolveBetaJoinRequestError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => { - return Err(crate::error::ResolveBetaJoinRequestError::unhandled( - generic, - )) - } - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::ResolveBetaJoinRequestError { - meta: generic, - kind: crate::error::ResolveBetaJoinRequestErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::ResolveBetaJoinRequestError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::ResolveBetaJoinRequestError { - meta: generic, - kind: crate::error::ResolveBetaJoinRequestErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::ResolveBetaJoinRequestError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::ResolveBetaJoinRequestError { - meta: generic, - kind: crate::error::ResolveBetaJoinRequestErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::ResolveBetaJoinRequestError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::ResolveBetaJoinRequestError { - meta: generic, - kind: crate::error::ResolveBetaJoinRequestErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::ResolveBetaJoinRequestError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::ResolveBetaJoinRequestError { - meta: generic, - kind: crate::error::ResolveBetaJoinRequestErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::ResolveBetaJoinRequestError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::ResolveBetaJoinRequestError { - meta: generic, - kind: crate::error::ResolveBetaJoinRequestErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::ResolveBetaJoinRequestError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::ResolveBetaJoinRequestError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_resolve_beta_join_request_response( - response: &http::Response, -) -> std::result::Result< - crate::output::ResolveBetaJoinRequestOutput, - crate::error::ResolveBetaJoinRequestError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::resolve_beta_join_request_output::Builder::default(); - let _ = response; - output.build() - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_unregister_notifications_error( - response: &http::Response, -) -> std::result::Result< - crate::output::UnregisterNotificationsOutput, - crate::error::UnregisterNotificationsError, -> { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::UnregisterNotificationsError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => { - return Err(crate::error::UnregisterNotificationsError::unhandled( - generic, - )) - } - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::UnregisterNotificationsError { - meta: generic, - kind: crate::error::UnregisterNotificationsErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::UnregisterNotificationsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::UnregisterNotificationsError { - meta: generic, - kind: crate::error::UnregisterNotificationsErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::UnregisterNotificationsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::UnregisterNotificationsError { - meta: generic, - kind: crate::error::UnregisterNotificationsErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::UnregisterNotificationsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::UnregisterNotificationsError { - meta: generic, - kind: crate::error::UnregisterNotificationsErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::UnregisterNotificationsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::UnregisterNotificationsError { - meta: generic, - kind: crate::error::UnregisterNotificationsErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::UnregisterNotificationsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::UnregisterNotificationsError { - meta: generic, - kind: crate::error::UnregisterNotificationsErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::UnregisterNotificationsError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::UnregisterNotificationsError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_unregister_notifications_response( - response: &http::Response, -) -> std::result::Result< - crate::output::UnregisterNotificationsOutput, - crate::error::UnregisterNotificationsError, -> { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::unregister_notifications_output::Builder::default(); - let _ = response; - output.build() - }) -} diff --git a/lib/smithy-output/api-portal/rust/rust/src/operation_ser.rs b/lib/smithy-output/api-portal/rust/rust/src/operation_ser.rs deleted file mode 100644 index dbb286324..000000000 --- a/lib/smithy-output/api-portal/rust/rust/src/operation_ser.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub fn serialize_operation_crate_operation_register_notifications( - input: &crate::input::RegisterNotificationsInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_register_notifications_input( - &mut object, - input, - )?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} - -pub fn serialize_operation_crate_operation_resolve_beta_join_request( - input: &crate::input::ResolveBetaJoinRequestInput, -) -> Result { - let mut out = String::new(); - let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); - crate::json_ser::serialize_structure_crate_input_resolve_beta_join_request_input( - &mut object, - input, - )?; - object.finish(); - Ok(aws_smithy_http::body::SdkBody::from(out)) -} diff --git a/lib/smithy-output/api-portal/rust/rust/src/output.rs b/lib/smithy-output/api-portal/rust/rust/src/output.rs deleted file mode 100644 index dda44270f..000000000 --- a/lib/smithy-output/api-portal/rust/rust/src/output.rs +++ /dev/null @@ -1,251 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UnregisterNotificationsOutput {} -impl std::fmt::Debug for UnregisterNotificationsOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UnregisterNotificationsOutput"); - formatter.finish() - } -} -/// See [`UnregisterNotificationsOutput`](crate::output::UnregisterNotificationsOutput) -pub mod unregister_notifications_output { - /// A builder for [`UnregisterNotificationsOutput`](crate::output::UnregisterNotificationsOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`UnregisterNotificationsOutput`](crate::output::UnregisterNotificationsOutput) - pub fn build(self) -> crate::output::UnregisterNotificationsOutput { - crate::output::UnregisterNotificationsOutput {} - } - } -} -impl UnregisterNotificationsOutput { - /// Creates a new builder-style object to manufacture [`UnregisterNotificationsOutput`](crate::output::UnregisterNotificationsOutput) - pub fn builder() -> crate::output::unregister_notifications_output::Builder { - crate::output::unregister_notifications_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct RegisterNotificationsOutput {} -impl std::fmt::Debug for RegisterNotificationsOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("RegisterNotificationsOutput"); - formatter.finish() - } -} -/// See [`RegisterNotificationsOutput`](crate::output::RegisterNotificationsOutput) -pub mod register_notifications_output { - /// A builder for [`RegisterNotificationsOutput`](crate::output::RegisterNotificationsOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`RegisterNotificationsOutput`](crate::output::RegisterNotificationsOutput) - pub fn build(self) -> crate::output::RegisterNotificationsOutput { - crate::output::RegisterNotificationsOutput {} - } - } -} -impl RegisterNotificationsOutput { - /// Creates a new builder-style object to manufacture [`RegisterNotificationsOutput`](crate::output::RegisterNotificationsOutput) - pub fn builder() -> crate::output::register_notifications_output::Builder { - crate::output::register_notifications_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ResolveBetaJoinRequestOutput {} -impl std::fmt::Debug for ResolveBetaJoinRequestOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ResolveBetaJoinRequestOutput"); - formatter.finish() - } -} -/// See [`ResolveBetaJoinRequestOutput`](crate::output::ResolveBetaJoinRequestOutput) -pub mod resolve_beta_join_request_output { - /// A builder for [`ResolveBetaJoinRequestOutput`](crate::output::ResolveBetaJoinRequestOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`ResolveBetaJoinRequestOutput`](crate::output::ResolveBetaJoinRequestOutput) - pub fn build(self) -> crate::output::ResolveBetaJoinRequestOutput { - crate::output::ResolveBetaJoinRequestOutput {} - } - } -} -impl ResolveBetaJoinRequestOutput { - /// Creates a new builder-style object to manufacture [`ResolveBetaJoinRequestOutput`](crate::output::ResolveBetaJoinRequestOutput) - pub fn builder() -> crate::output::resolve_beta_join_request_output::Builder { - crate::output::resolve_beta_join_request_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetGameProfileOutput { - /// A game profile. - pub game: std::option::Option, - /// Provided by watchable endpoints used in blocking loops. - pub watch: std::option::Option, -} -impl GetGameProfileOutput { - /// A game profile. - pub fn game(&self) -> std::option::Option<&crate::model::GameProfile> { - self.game.as_ref() - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(&self) -> std::option::Option<&crate::model::WatchResponse> { - self.watch.as_ref() - } -} -impl std::fmt::Debug for GetGameProfileOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetGameProfileOutput"); - formatter.field("game", &self.game); - formatter.field("watch", &self.watch); - formatter.finish() - } -} -/// See [`GetGameProfileOutput`](crate::output::GetGameProfileOutput) -pub mod get_game_profile_output { - /// A builder for [`GetGameProfileOutput`](crate::output::GetGameProfileOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) game: std::option::Option, - pub(crate) watch: std::option::Option, - } - impl Builder { - /// A game profile. - pub fn game(mut self, input: crate::model::GameProfile) -> Self { - self.game = Some(input); - self - } - /// A game profile. - pub fn set_game(mut self, input: std::option::Option) -> Self { - self.game = input; - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(mut self, input: crate::model::WatchResponse) -> Self { - self.watch = Some(input); - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn set_watch( - mut self, - input: std::option::Option, - ) -> Self { - self.watch = input; - self - } - /// Consumes the builder and constructs a [`GetGameProfileOutput`](crate::output::GetGameProfileOutput) - pub fn build(self) -> crate::output::GetGameProfileOutput { - crate::output::GetGameProfileOutput { - game: self.game, - watch: self.watch, - } - } - } -} -impl GetGameProfileOutput { - /// Creates a new builder-style object to manufacture [`GetGameProfileOutput`](crate::output::GetGameProfileOutput) - pub fn builder() -> crate::output::get_game_profile_output::Builder { - crate::output::get_game_profile_output::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct GetSuggestedGamesOutput { - /// A list of game summaries. - pub games: std::option::Option>, - /// Provided by watchable endpoints used in blocking loops. - pub watch: std::option::Option, -} -impl GetSuggestedGamesOutput { - /// A list of game summaries. - pub fn games(&self) -> std::option::Option<&[crate::model::GameSummary]> { - self.games.as_deref() - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(&self) -> std::option::Option<&crate::model::WatchResponse> { - self.watch.as_ref() - } -} -impl std::fmt::Debug for GetSuggestedGamesOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("GetSuggestedGamesOutput"); - formatter.field("games", &self.games); - formatter.field("watch", &self.watch); - formatter.finish() - } -} -/// See [`GetSuggestedGamesOutput`](crate::output::GetSuggestedGamesOutput) -pub mod get_suggested_games_output { - /// A builder for [`GetSuggestedGamesOutput`](crate::output::GetSuggestedGamesOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) games: std::option::Option>, - pub(crate) watch: std::option::Option, - } - impl Builder { - /// Appends an item to `games`. - /// - /// To override the contents of this collection use [`set_games`](Self::set_games). - /// - /// A list of game summaries. - pub fn games(mut self, input: crate::model::GameSummary) -> Self { - let mut v = self.games.unwrap_or_default(); - v.push(input); - self.games = Some(v); - self - } - /// A list of game summaries. - pub fn set_games( - mut self, - input: std::option::Option>, - ) -> Self { - self.games = input; - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn watch(mut self, input: crate::model::WatchResponse) -> Self { - self.watch = Some(input); - self - } - /// Provided by watchable endpoints used in blocking loops. - pub fn set_watch( - mut self, - input: std::option::Option, - ) -> Self { - self.watch = input; - self - } - /// Consumes the builder and constructs a [`GetSuggestedGamesOutput`](crate::output::GetSuggestedGamesOutput) - pub fn build(self) -> crate::output::GetSuggestedGamesOutput { - crate::output::GetSuggestedGamesOutput { - games: self.games, - watch: self.watch, - } - } - } -} -impl GetSuggestedGamesOutput { - /// Creates a new builder-style object to manufacture [`GetSuggestedGamesOutput`](crate::output::GetSuggestedGamesOutput) - pub fn builder() -> crate::output::get_suggested_games_output::Builder { - crate::output::get_suggested_games_output::Builder::default() - } -} diff --git a/lib/smithy-output/api-status/rust-server/rust-server/Cargo.toml b/lib/smithy-output/api-status/rust-server/rust-server/Cargo.toml deleted file mode 100644 index 778681644..000000000 --- a/lib/smithy-output/api-status/rust-server/rust-server/Cargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -[package] -name = "rivet-status-server" -version = "0.0.1" -authors = ["Rivet "] -edition = "2021" -license = "Apache-2.0" - -[package.metadata.docs.rs] -all-features = true -targets = ["x86_64-unknown-linux-gnu"] - -[dependencies] -serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" -chrono = { version = "0.4", features = ["serde"] } diff --git a/lib/smithy-output/api-status/rust-server/rust-server/src/lib.rs b/lib/smithy-output/api-status/rust-server/rust-server/src/lib.rs deleted file mode 100644 index ff9294697..000000000 --- a/lib/smithy-output/api-status/rust-server/rust-server/src/lib.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod models; \ No newline at end of file diff --git a/lib/smithy-output/api-status/rust-server/rust-server/src/models.rs b/lib/smithy-output/api-status/rust-server/rust-server/src/models.rs deleted file mode 100644 index 647bcb346..000000000 --- a/lib/smithy-output/api-status/rust-server/rust-server/src/models.rs +++ /dev/null @@ -1,13 +0,0 @@ -#[allow(unused_imports)] -use chrono; -#[allow(unused_imports)] -use serde::{Deserialize, Serialize}; - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct MatchmakerRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct MatchmakerResponse {} - diff --git a/lib/smithy-output/api-status/rust/rust/Cargo.toml b/lib/smithy-output/api-status/rust/rust/Cargo.toml deleted file mode 100644 index 58c1e938e..000000000 --- a/lib/smithy-output/api-status/rust/rust/Cargo.toml +++ /dev/null @@ -1,33 +0,0 @@ -# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -[package] -name = "rivet-status" -version = "0.0.1" -authors = ["Rivet Gaming, LLC "] -description = "" -edition = "2021" -license = "Apache-2.0" - -[package.metadata.docs.rs] -all-features = true -targets = ["x86_64-unknown-linux-gnu"] -[dependencies.aws-smithy-client] -version = "^0.41.0" -[dependencies.aws-smithy-http] -version = "^0.41.0" -[dependencies.aws-smithy-json] -version = "^0.41.0" -[dependencies.aws-smithy-types] -version = "^0.41.0" -[dependencies.bytes] -version = "1" -[dependencies.http] -version = "0.2" -[dependencies.tower] -version = "0.4" -[features] -rt-tokio = ["aws-smithy-http/rt-tokio"] -rustls = ["aws-smithy-client/rustls"] -native-tls = ["aws-smithy-client/native-tls"] -default = ["rt-tokio", "rustls"] - - diff --git a/lib/smithy-output/api-status/rust/rust/src/client.rs b/lib/smithy-output/api-status/rust/rust/src/client.rs deleted file mode 100644 index 43f878914..000000000 --- a/lib/smithy-output/api-status/rust/rust/src/client.rs +++ /dev/null @@ -1,293 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[derive(Debug)] -pub(crate) struct Handle { - pub(crate) client: aws_smithy_client::Client, - pub(crate) conf: crate::Config, -} - -/// An ergonomic service client for `StatusService`. -/// -/// This client allows ergonomic access to a `StatusService`-shaped service. -/// Each method corresponds to an endpoint defined in the service's Smithy model, -/// and the request and response shapes are auto-generated from that same model. -/// -/// # Constructing a Client -/// -/// To construct a client, you need a few different things: -/// -/// - A [`Config`](crate::Config) that specifies additional configuration -/// required by the service. -/// - A connector (`C`) that specifies how HTTP requests are translated -/// into HTTP responses. This will typically be an HTTP client (like -/// `hyper`), though you can also substitute in your own, like a mock -/// mock connector for testing. -/// - A "middleware" (`M`) that modifies requests prior to them being -/// sent to the request. Most commonly, middleware will decide what -/// endpoint the requests should be sent to, as well as perform -/// authentication and authorization of requests (such as SigV4). -/// You can also have middleware that performs request/response -/// tracing, throttling, or other middleware-like tasks. -/// - A retry policy (`R`) that dictates the behavior for requests that -/// fail and should (potentially) be retried. The default type is -/// generally what you want, as it implements a well-vetted retry -/// policy implemented in [`RetryMode::Standard`](aws_smithy_types::retry::RetryMode::Standard). -/// -/// To construct a client, you will generally want to call -/// [`Client::with_config`], which takes a [`aws_smithy_client::Client`] (a -/// Smithy client that isn't specialized to a particular service), -/// and a [`Config`](crate::Config). Both of these are constructed using -/// the [builder pattern] where you first construct a `Builder` type, -/// then configure it with the necessary parameters, and then call -/// `build` to construct the finalized output type. The -/// [`aws_smithy_client::Client`] builder is re-exported in this crate as -/// [`Builder`] for convenience. -/// -/// In _most_ circumstances, you will want to use the following pattern -/// to construct a client: -/// -/// ``` -/// use rivet_status::{Builder, Client, Config}; -/// let raw_client = -/// Builder::dyn_https() -/// # /* -/// .middleware(/* discussed below */) -/// # */ -/// # .middleware_fn(|r| r) -/// .build(); -/// let config = Config::builder().build(); -/// let client = Client::with_config(raw_client, config); -/// ``` -/// -/// For the middleware, you'll want to use whatever matches the -/// routing, authentication and authorization required by the target -/// service. For example, for the standard AWS SDK which uses -/// [SigV4-signed requests], the middleware looks like this: -/// -// Ignored as otherwise we'd need to pull in all these dev-dependencies. -/// ```rust,ignore -/// use aws_endpoint::AwsEndpointStage; -/// use aws_http::auth::CredentialsStage; -/// use aws_http::recursion_detection::RecursionDetectionStage; -/// use aws_http::user_agent::UserAgentStage; -/// use aws_sig_auth::middleware::SigV4SigningStage; -/// use aws_sig_auth::signer::SigV4Signer; -/// use aws_smithy_client::retry::Config as RetryConfig; -/// use aws_smithy_http_tower::map_request::{AsyncMapRequestLayer, MapRequestLayer}; -/// use std::fmt::Debug; -/// use tower::layer::util::{Identity, Stack}; -/// use tower::ServiceBuilder; -/// -/// type AwsMiddlewareStack = Stack< -/// MapRequestLayer, -/// Stack< -/// MapRequestLayer, -/// Stack< -/// AsyncMapRequestLayer, -/// Stack< -/// MapRequestLayer, -/// Stack, Identity>, -/// >, -/// >, -/// >, -/// >; -/// -/// /// AWS Middleware Stack -/// /// -/// /// This implements the middleware stack for this service. It will: -/// /// 1. Load credentials asynchronously into the property bag -/// /// 2. Sign the request with SigV4 -/// /// 3. Resolve an Endpoint for the request -/// /// 4. Add a user agent to the request -/// #[derive(Debug, Default, Clone)] -/// #[non_exhaustive] -/// pub struct AwsMiddleware; -/// -/// impl AwsMiddleware { -/// /// Create a new `AwsMiddleware` stack -/// /// -/// /// Note: `AwsMiddleware` holds no state. -/// pub fn new() -> Self { -/// AwsMiddleware::default() -/// } -/// } -/// -/// // define the middleware stack in a non-generic location to reduce code bloat. -/// fn base() -> ServiceBuilder { -/// let credential_provider = AsyncMapRequestLayer::for_mapper(CredentialsStage::new()); -/// let signer = MapRequestLayer::for_mapper(SigV4SigningStage::new(SigV4Signer::new())); -/// let endpoint_resolver = MapRequestLayer::for_mapper(AwsEndpointStage); -/// let user_agent = MapRequestLayer::for_mapper(UserAgentStage::new()); -/// let recursion_detection = MapRequestLayer::for_mapper(RecursionDetectionStage::new()); -/// // These layers can be considered as occurring in order, that is: -/// // 1. Resolve an endpoint -/// // 2. Add a user agent -/// // 3. Acquire credentials -/// // 4. Sign with credentials -/// // (5. Dispatch over the wire) -/// ServiceBuilder::new() -/// .layer(endpoint_resolver) -/// .layer(user_agent) -/// .layer(credential_provider) -/// .layer(signer) -/// .layer(recursion_detection) -/// } -/// -/// impl tower::Layer for AwsMiddleware { -/// type Service = >::Service; -/// -/// fn layer(&self, inner: S) -> Self::Service { -/// base().service(inner) -/// } -/// } -/// ``` -/// -/// # Using a Client -/// -/// Once you have a client set up, you can access the service's endpoints -/// by calling the appropriate method on [`Client`]. Each such method -/// returns a request builder for that endpoint, with methods for setting -/// the various fields of the request. Once your request is complete, use -/// the `send` method to send the request. `send` returns a future, which -/// you then have to `.await` to get the service's response. -/// -/// [builder pattern]: https://rust-lang.github.io/api-guidelines/type-safety.html#c-builder -/// [SigV4-signed requests]: https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html -#[derive(std::fmt::Debug)] -pub struct Client { - handle: std::sync::Arc>, -} - -impl std::clone::Clone for Client { - fn clone(&self) -> Self { - Self { - handle: self.handle.clone(), - } - } -} - -#[doc(inline)] -pub use aws_smithy_client::Builder; - -impl From> for Client { - fn from(client: aws_smithy_client::Client) -> Self { - Self::with_config(client, crate::Config::builder().build()) - } -} - -impl Client { - /// Creates a client with the given service configuration. - pub fn with_config(client: aws_smithy_client::Client, conf: crate::Config) -> Self { - Self { - handle: std::sync::Arc::new(Handle { client, conf }), - } - } - - /// Returns the client's configuration. - pub fn conf(&self) -> &crate::Config { - &self.handle.conf - } -} -impl Client -where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, -{ - /// Constructs a fluent builder for the [`Matchmaker`](crate::client::fluent_builders::Matchmaker) operation. - /// - /// - The fluent builder is configurable: - /// - [`region(impl Into)`](crate::client::fluent_builders::Matchmaker::region) / [`set_region(Option)`](crate::client::fluent_builders::Matchmaker::set_region): (undocumented) - /// - On success, responds with [`MatchmakerOutput`](crate::output::MatchmakerOutput) - - /// - On failure, responds with [`SdkError`](crate::error::MatchmakerError) - pub fn matchmaker(&self) -> fluent_builders::Matchmaker { - fluent_builders::Matchmaker::new(self.handle.clone()) - } -} -pub mod fluent_builders { - //! - //! Utilities to ergonomically construct a request to the service. - //! - //! Fluent builders are created through the [`Client`](crate::client::Client) by calling - //! one if its operation methods. After parameters are set using the builder methods, - //! the `send` method can be called to initiate the request. - //! - /// Fluent builder constructing a request to `Matchmaker`. - /// - /// Returns the resolved matchmaker region. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct Matchmaker { - handle: std::sync::Arc>, - inner: crate::input::matchmaker_input::Builder, - } - impl Matchmaker - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `Matchmaker`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::MatchmakerOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::MatchmakerInputOperationOutputAlias, - crate::output::MatchmakerOutput, - crate::error::MatchmakerError, - crate::input::MatchmakerInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - #[allow(missing_docs)] // documentation missing in model - pub fn region(mut self, input: impl Into) -> Self { - self.inner = self.inner.region(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_region(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_region(input); - self - } - } -} -/// A wrapper around [`Client`]. Helps reduce external imports. -pub struct ClientWrapper { - pub(crate) client: Client, -} - -impl std::ops::Deref for ClientWrapper { - type Target = Client; - - fn deref(&self) -> &Self::Target { - &self.client - } -} diff --git a/lib/smithy-output/api-status/rust/rust/src/config.rs b/lib/smithy-output/api-status/rust/rust/src/config.rs deleted file mode 100644 index f0a9e5036..000000000 --- a/lib/smithy-output/api-status/rust/rust/src/config.rs +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Service config. -/// -pub struct Config { - pub(crate) auth: Option, - pub(crate) uri: String, -} -impl std::fmt::Debug for Config { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut config = f.debug_struct("Config"); - config.finish() - } -} -impl Config { - /// Constructs a config builder. - pub fn builder() -> Builder { - Builder::default() - } -} -/// Builder for creating a `Config`. -#[derive(Default)] -pub struct Builder { - pub(crate) auth: Option, - pub(crate) uri: Option, -} -impl Builder { - /// Constructs a config builder. - pub fn new() -> Self { - Self::default() - } - /// Sets the bearer token to be used with the Smithy client. - pub fn set_bearer_token(mut self, bearer_token: impl std::fmt::Display) -> Self { - self.auth = Some(format!("Bearer {}", bearer_token)); - self - } - /// Sets the base URI to be used with the Smithy client. - pub fn set_uri(mut self, uri: impl ToString) -> Self { - self.uri = Some(uri.to_string()); - self - } - /// Builds a [`Config`]. - pub fn build(self) -> Config { - Config { - auth: self - .auth - .or_else(|| std::env::var("RIVET_LOBBY_TOKEN").ok()) - .or_else(|| std::env::var("RIVET_CLIENT_TOKEN").ok()), - uri: self - .uri - .or_else(|| std::env::var("RIVET_STATUS_API_URL").ok()) - .unwrap_or_else(|| "https://status.api.rivet.gg/v1".to_string()), - } - } - /// Builds a default [`Client`] from the given config. - pub fn build_client(self) -> crate::client::ClientWrapper { - let raw_client = aws_smithy_client::Builder::dyn_https() - .middleware(tower::layer::util::Identity::new()) - .sleep_impl(None) - .build(); - crate::client::ClientWrapper { - client: crate::Client::with_config(raw_client, self.build()), - } - } -} diff --git a/lib/smithy-output/api-status/rust/rust/src/error.rs b/lib/smithy-output/api-status/rust/rust/src/error.rs deleted file mode 100644 index faf07d3b6..000000000 --- a/lib/smithy-output/api-status/rust/rust/src/error.rs +++ /dev/null @@ -1,916 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Error type for the `Matchmaker` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct MatchmakerError { - /// Kind of error that occurred. - pub kind: MatchmakerErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `Matchmaker` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum MatchmakerErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for MatchmakerError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - MatchmakerErrorKind::InternalError(_inner) => _inner.fmt(f), - MatchmakerErrorKind::RateLimitError(_inner) => _inner.fmt(f), - MatchmakerErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - MatchmakerErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - MatchmakerErrorKind::NotFoundError(_inner) => _inner.fmt(f), - MatchmakerErrorKind::BadRequestError(_inner) => _inner.fmt(f), - MatchmakerErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for MatchmakerError { - fn code(&self) -> Option<&str> { - MatchmakerError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - MatchmakerErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - MatchmakerErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl MatchmakerError { - /// Creates a new `MatchmakerError`. - pub fn new(kind: MatchmakerErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `MatchmakerError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: MatchmakerErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `MatchmakerError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: MatchmakerErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `MatchmakerErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, MatchmakerErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `MatchmakerErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, MatchmakerErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `MatchmakerErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, MatchmakerErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `MatchmakerErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, MatchmakerErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `MatchmakerErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, MatchmakerErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `MatchmakerErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, MatchmakerErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for MatchmakerError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - MatchmakerErrorKind::InternalError(_inner) => Some(_inner), - MatchmakerErrorKind::RateLimitError(_inner) => Some(_inner), - MatchmakerErrorKind::ForbiddenError(_inner) => Some(_inner), - MatchmakerErrorKind::UnauthorizedError(_inner) => Some(_inner), - MatchmakerErrorKind::NotFoundError(_inner) => Some(_inner), - MatchmakerErrorKind::BadRequestError(_inner) => Some(_inner), - MatchmakerErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// An error thrown when the requestee has sent an invalid or malformed request. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct BadRequestError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl BadRequestError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for BadRequestError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("BadRequestError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl BadRequestError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for BadRequestError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "BadRequestError")?; - if let Some(inner_1) = &self.message { - write!(f, ": {}", inner_1)?; - } - Ok(()) - } -} -impl std::error::Error for BadRequestError {} -/// See [`BadRequestError`](crate::error::BadRequestError) -pub mod bad_request_error { - /// A builder for [`BadRequestError`](crate::error::BadRequestError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`BadRequestError`](crate::error::BadRequestError) - pub fn build(self) -> crate::error::BadRequestError { - crate::error::BadRequestError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl BadRequestError { - /// Creates a new builder-style object to manufacture [`BadRequestError`](crate::error::BadRequestError) - pub fn builder() -> crate::error::bad_request_error::Builder { - crate::error::bad_request_error::Builder::default() - } -} - -/// An error thrown when the requestee requests a non existent resource. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct NotFoundError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl NotFoundError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for NotFoundError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("NotFoundError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl NotFoundError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for NotFoundError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "NotFoundError")?; - if let Some(inner_2) = &self.message { - write!(f, ": {}", inner_2)?; - } - Ok(()) - } -} -impl std::error::Error for NotFoundError {} -/// See [`NotFoundError`](crate::error::NotFoundError) -pub mod not_found_error { - /// A builder for [`NotFoundError`](crate::error::NotFoundError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`NotFoundError`](crate::error::NotFoundError) - pub fn build(self) -> crate::error::NotFoundError { - crate::error::NotFoundError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl NotFoundError { - /// Creates a new builder-style object to manufacture [`NotFoundError`](crate::error::NotFoundError) - pub fn builder() -> crate::error::not_found_error::Builder { - crate::error::not_found_error::Builder::default() - } -} - -/// An error thrown when the requestee is not authenticated. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UnauthorizedError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl UnauthorizedError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for UnauthorizedError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UnauthorizedError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl UnauthorizedError { - /// Returns `Some(ErrorKind)` if the error is retryable. Otherwise, returns `None`. - pub fn retryable_error_kind(&self) -> aws_smithy_types::retry::ErrorKind { - aws_smithy_types::retry::ErrorKind::ClientError - } - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for UnauthorizedError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "UnauthorizedError")?; - if let Some(inner_3) = &self.message { - write!(f, ": {}", inner_3)?; - } - Ok(()) - } -} -impl std::error::Error for UnauthorizedError {} -/// See [`UnauthorizedError`](crate::error::UnauthorizedError) -pub mod unauthorized_error { - /// A builder for [`UnauthorizedError`](crate::error::UnauthorizedError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`UnauthorizedError`](crate::error::UnauthorizedError) - pub fn build(self) -> crate::error::UnauthorizedError { - crate::error::UnauthorizedError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl UnauthorizedError { - /// Creates a new builder-style object to manufacture [`UnauthorizedError`](crate::error::UnauthorizedError) - pub fn builder() -> crate::error::unauthorized_error::Builder { - crate::error::unauthorized_error::Builder::default() - } -} - -/// An error thrown when the requestee requests a resource they do not have access to. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ForbiddenError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl ForbiddenError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for ForbiddenError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ForbiddenError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl ForbiddenError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for ForbiddenError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "ForbiddenError")?; - if let Some(inner_4) = &self.message { - write!(f, ": {}", inner_4)?; - } - Ok(()) - } -} -impl std::error::Error for ForbiddenError {} -/// See [`ForbiddenError`](crate::error::ForbiddenError) -pub mod forbidden_error { - /// A builder for [`ForbiddenError`](crate::error::ForbiddenError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`ForbiddenError`](crate::error::ForbiddenError) - pub fn build(self) -> crate::error::ForbiddenError { - crate::error::ForbiddenError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl ForbiddenError { - /// Creates a new builder-style object to manufacture [`ForbiddenError`](crate::error::ForbiddenError) - pub fn builder() -> crate::error::forbidden_error::Builder { - crate::error::forbidden_error::Builder::default() - } -} - -/// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct RateLimitError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl RateLimitError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for RateLimitError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("RateLimitError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl RateLimitError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for RateLimitError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "RateLimitError")?; - if let Some(inner_5) = &self.message { - write!(f, ": {}", inner_5)?; - } - Ok(()) - } -} -impl std::error::Error for RateLimitError {} -/// See [`RateLimitError`](crate::error::RateLimitError) -pub mod rate_limit_error { - /// A builder for [`RateLimitError`](crate::error::RateLimitError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`RateLimitError`](crate::error::RateLimitError) - pub fn build(self) -> crate::error::RateLimitError { - crate::error::RateLimitError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl RateLimitError { - /// Creates a new builder-style object to manufacture [`RateLimitError`](crate::error::RateLimitError) - pub fn builder() -> crate::error::rate_limit_error::Builder { - crate::error::rate_limit_error::Builder::default() - } -} - -/// An error caused by internal server problems. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct InternalError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl InternalError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for InternalError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("InternalError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl InternalError { - /// Returns `Some(ErrorKind)` if the error is retryable. Otherwise, returns `None`. - pub fn retryable_error_kind(&self) -> aws_smithy_types::retry::ErrorKind { - aws_smithy_types::retry::ErrorKind::ServerError - } - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for InternalError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "InternalError")?; - if let Some(inner_6) = &self.message { - write!(f, ": {}", inner_6)?; - } - Ok(()) - } -} -impl std::error::Error for InternalError {} -/// See [`InternalError`](crate::error::InternalError) -pub mod internal_error { - /// A builder for [`InternalError`](crate::error::InternalError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`InternalError`](crate::error::InternalError) - pub fn build(self) -> crate::error::InternalError { - crate::error::InternalError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl InternalError { - /// Creates a new builder-style object to manufacture [`InternalError`](crate::error::InternalError) - pub fn builder() -> crate::error::internal_error::Builder { - crate::error::internal_error::Builder::default() - } -} diff --git a/lib/smithy-output/api-status/rust/rust/src/error_meta.rs b/lib/smithy-output/api-status/rust/rust/src/error_meta.rs deleted file mode 100644 index 3a052a0d9..000000000 --- a/lib/smithy-output/api-status/rust/rust/src/error_meta.rs +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// All possible error types for this service. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum Error { - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An unhandled error occurred. - Unhandled(Box), -} -impl std::fmt::Display for Error { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Error::BadRequestError(inner) => inner.fmt(f), - Error::ForbiddenError(inner) => inner.fmt(f), - Error::InternalError(inner) => inner.fmt(f), - Error::NotFoundError(inner) => inner.fmt(f), - Error::RateLimitError(inner) => inner.fmt(f), - Error::UnauthorizedError(inner) => inner.fmt(f), - Error::Unhandled(inner) => inner.fmt(f), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::MatchmakerErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::MatchmakerErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::MatchmakerErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::MatchmakerErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::MatchmakerErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::MatchmakerErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::MatchmakerErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl std::error::Error for Error {} diff --git a/lib/smithy-output/api-status/rust/rust/src/input.rs b/lib/smithy-output/api-status/rust/rust/src/input.rs deleted file mode 100644 index db8a9554b..000000000 --- a/lib/smithy-output/api-status/rust/rust/src/input.rs +++ /dev/null @@ -1,133 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -use std::fmt::Write; -/// See [`MatchmakerInput`](crate::input::MatchmakerInput) -pub mod matchmaker_input { - /// A builder for [`MatchmakerInput`](crate::input::MatchmakerInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) region: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn region(mut self, input: impl Into) -> Self { - self.region = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_region(mut self, input: std::option::Option) -> Self { - self.region = input; - self - } - /// Consumes the builder and constructs a [`MatchmakerInput`](crate::input::MatchmakerInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::MatchmakerInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::MatchmakerInput { - region: self.region, - }) - } - } -} -#[doc(hidden)] -pub type MatchmakerInputOperationOutputAlias = crate::operation::Matchmaker; -#[doc(hidden)] -pub type MatchmakerInputOperationRetryAlias = (); -impl MatchmakerInput { - /// Consumes the builder and constructs an Operation<[`Matchmaker`](crate::operation::Matchmaker)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::MatchmakerInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/matchmaker").expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::MatchmakerInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_1) = &_input.region { - query.push_kv("region", &aws_smithy_http::query::fmt_string(&inner_1)); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::MatchmakerInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::Matchmaker::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "Matchmaker", - "StatusService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`MatchmakerInput`](crate::input::MatchmakerInput) - pub fn builder() -> crate::input::matchmaker_input::Builder { - crate::input::matchmaker_input::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct MatchmakerInput { - #[allow(missing_docs)] // documentation missing in model - pub region: std::option::Option, -} -impl MatchmakerInput { - #[allow(missing_docs)] // documentation missing in model - pub fn region(&self) -> std::option::Option<&str> { - self.region.as_deref() - } -} -impl std::fmt::Debug for MatchmakerInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("MatchmakerInput"); - formatter.field("region", &self.region); - formatter.finish() - } -} diff --git a/lib/smithy-output/api-status/rust/rust/src/json_deser.rs b/lib/smithy-output/api-status/rust/rust/src/json_deser.rs deleted file mode 100644 index 570bfab5f..000000000 --- a/lib/smithy-output/api-status/rust/rust/src/json_deser.rs +++ /dev/null @@ -1,404 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub fn parse_http_generic_error( - response: &http::Response, -) -> Result { - crate::json_errors::parse_generic_error(response.body(), response.headers()) -} - -pub fn deser_structure_crate_error_internal_error_json_err( - value: &[u8], - mut builder: crate::error::internal_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_rate_limit_error_json_err( - value: &[u8], - mut builder: crate::error::rate_limit_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_forbidden_error_json_err( - value: &[u8], - mut builder: crate::error::forbidden_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_unauthorized_error_json_err( - value: &[u8], - mut builder: crate::error::unauthorized_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_not_found_error_json_err( - value: &[u8], - mut builder: crate::error::not_found_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_bad_request_error_json_err( - value: &[u8], - mut builder: crate::error::bad_request_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn or_empty_doc(data: &[u8]) -> &[u8] { - if data.is_empty() { - b"{}" - } else { - data - } -} diff --git a/lib/smithy-output/api-status/rust/rust/src/json_errors.rs b/lib/smithy-output/api-status/rust/rust/src/json_errors.rs deleted file mode 100644 index 7b7574319..000000000 --- a/lib/smithy-output/api-status/rust/rust/src/json_errors.rs +++ /dev/null @@ -1,220 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -use aws_smithy_json::deserialize::token::skip_value; -use aws_smithy_json::deserialize::{json_token_iter, Error as DeserializeError, Token}; -use aws_smithy_types::Error as SmithyError; -use bytes::Bytes; -use http::header::ToStrError; -use http::{HeaderMap, HeaderValue}; -use std::borrow::Cow; - -// currently only used by AwsJson -#[allow(unused)] -pub fn is_error(response: &http::Response) -> bool { - !response.status().is_success() -} - -fn sanitize_error_code(error_code: &str) -> &str { - // Trim a trailing URL from the error code, beginning with a `:` - let error_code = match error_code.find(':') { - Some(idx) => &error_code[..idx], - None => error_code, - }; - - // Trim a prefixing namespace from the error code, beginning with a `#` - match error_code.find('#') { - Some(idx) => &error_code[idx + 1..], - None => error_code, - } -} - -struct ErrorBody<'a> { - code: Option>, - message: Option>, -} - -fn parse_error_body(bytes: &[u8]) -> Result { - let mut tokens = json_token_iter(bytes).peekable(); - let (mut typ, mut code, mut message) = (None, None, None); - if let Some(Token::StartObject { .. }) = tokens.next().transpose()? { - loop { - match tokens.next().transpose()? { - Some(Token::EndObject { .. }) => break, - Some(Token::ObjectKey { key, .. }) => { - if let Some(Ok(Token::ValueString { value, .. })) = tokens.peek() { - match key.as_escaped_str() { - "code" => code = Some(value.to_unescaped()?), - "__type" => typ = Some(value.to_unescaped()?), - "message" | "Message" | "errorMessage" => { - message = Some(value.to_unescaped()?) - } - _ => {} - } - } - skip_value(&mut tokens)?; - } - _ => { - return Err(DeserializeError::custom( - "expected object key or end object", - )) - } - } - } - if tokens.next().is_some() { - return Err(DeserializeError::custom( - "found more JSON tokens after completing parsing", - )); - } - } - Ok(ErrorBody { - code: code.or(typ), - message, - }) -} - -fn error_type_from_header(headers: &HeaderMap) -> Result, ToStrError> { - headers - .get("X-Amzn-Errortype") - .map(|v| v.to_str()) - .transpose() -} - -fn request_id(headers: &HeaderMap) -> Option<&str> { - headers - .get("X-Amzn-Requestid") - .and_then(|v| v.to_str().ok()) -} - -pub fn parse_generic_error( - payload: &Bytes, - headers: &HeaderMap, -) -> Result { - let ErrorBody { code, message } = parse_error_body(payload.as_ref())?; - - let mut err_builder = SmithyError::builder(); - if let Some(code) = error_type_from_header(headers) - .map_err(|_| DeserializeError::custom("X-Amzn-Errortype header was not valid UTF-8"))? - .or_else(|| code.as_deref()) - .map(sanitize_error_code) - { - err_builder.code(code); - } - if let Some(message) = message { - err_builder.message(message); - } - if let Some(request_id) = request_id(headers) { - err_builder.request_id(request_id); - } - Ok(err_builder.build()) -} - -#[cfg(test)] -mod test { - use crate::json_errors::{parse_error_body, parse_generic_error, sanitize_error_code}; - use aws_smithy_types::Error; - use bytes::Bytes; - use std::borrow::Cow; - - #[test] - fn generic_error() { - let response = http::Response::builder() - .header("X-Amzn-Requestid", "1234") - .body(Bytes::from_static( - br#"{ "__type": "FooError", "message": "Go to foo" }"#, - )) - .unwrap(); - assert_eq!( - parse_generic_error(response.body(), response.headers()).unwrap(), - Error::builder() - .code("FooError") - .message("Go to foo") - .request_id("1234") - .build() - ) - } - - #[test] - fn error_type() { - assert_eq!( - Some(Cow::Borrowed("FooError")), - parse_error_body(br#"{ "__type": "FooError" }"#) - .unwrap() - .code - ); - } - - #[test] - fn code_takes_priority() { - assert_eq!( - Some(Cow::Borrowed("BarError")), - parse_error_body(br#"{ "code": "BarError", "__type": "FooError" }"#) - .unwrap() - .code - ); - } - - #[test] - fn ignore_unrecognized_fields() { - assert_eq!( - Some(Cow::Borrowed("FooError")), - parse_error_body(br#"{ "__type": "FooError", "asdf": 5, "fdsa": {}, "foo": "1" }"#) - .unwrap() - .code - ); - } - - #[test] - fn sanitize_namespace_and_url() { - assert_eq!( - sanitize_error_code("aws.protocoltests.restjson#FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/"), - "FooError"); - } - - #[test] - fn sanitize_noop() { - assert_eq!(sanitize_error_code("FooError"), "FooError"); - } - - #[test] - fn sanitize_url() { - assert_eq!( - sanitize_error_code( - "FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/" - ), - "FooError" - ); - } - - #[test] - fn sanitize_namespace() { - assert_eq!( - sanitize_error_code("aws.protocoltests.restjson#FooError"), - "FooError" - ); - } - - // services like lambda use an alternate `Message` instead of `message` - #[test] - fn alternative_error_message_names() { - let response = http::Response::builder() - .header("x-amzn-errortype", "ResourceNotFoundException") - .body(Bytes::from_static( - br#"{ - "Type": "User", - "Message": "Functions from 'us-west-2' are not reachable from us-east-1" - }"#, - )) - .unwrap(); - assert_eq!( - parse_generic_error(response.body(), response.headers()).unwrap(), - Error::builder() - .code("ResourceNotFoundException") - .message("Functions from 'us-west-2' are not reachable from us-east-1") - .build() - ); - } -} diff --git a/lib/smithy-output/api-status/rust/rust/src/lib.rs b/lib/smithy-output/api-status/rust/rust/src/lib.rs deleted file mode 100644 index 6d5fc3b44..000000000 --- a/lib/smithy-output/api-status/rust/rust/src/lib.rs +++ /dev/null @@ -1,53 +0,0 @@ -#![allow(clippy::module_inception)] -#![allow(clippy::upper_case_acronyms)] -#![allow(clippy::large_enum_variant)] -#![allow(clippy::wrong_self_convention)] -#![allow(clippy::should_implement_trait)] -#![allow(clippy::blacklisted_name)] -#![allow(clippy::vec_init_then_push)] -#![allow(rustdoc::bare_urls)] -#![warn(missing_docs)] -//! rivet-status -//! -//! # Crate Organization -//! -//! The entry point for most customers will be [`Client`]. [`Client`] exposes one method for each API offered -//! by the service. -//! -//! Some APIs require complex or nested arguments. These exist in [`model`](crate::model). -//! -//! Lastly, errors that can be returned by the service are contained within [`error`]. [`Error`] defines a meta -//! error encompassing all possible errors that can be returned by the service. -//! -//! The other modules within this crate are not required for normal usage. - -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use error_meta::Error; - -#[doc(inline)] -pub use config::Config; - -/// Client and fluent builders for calling the service. -pub mod client; -/// Configuration for the service. -pub mod config; -/// Errors that can occur when calling the service. -pub mod error; -mod error_meta; -/// Input structures for operations. -pub mod input; -mod json_deser; -mod json_errors; -/// All operations that this crate can perform. -pub mod operation; -mod operation_deser; -/// Output structures for operations. -pub mod output; -pub use client::{Builder, Client, ClientWrapper}; -/// Crate version number. -pub static PKG_VERSION: &str = env!("CARGO_PKG_VERSION"); -/// Re-exported types from supporting crates. -pub mod types { - pub use aws_smithy_http::result::SdkError; - pub use aws_smithy_types::DateTime; -} diff --git a/lib/smithy-output/api-status/rust/rust/src/operation.rs b/lib/smithy-output/api-status/rust/rust/src/operation.rs deleted file mode 100644 index 7c85b5859..000000000 --- a/lib/smithy-output/api-status/rust/rust/src/operation.rs +++ /dev/null @@ -1,32 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Operation shape for `Matchmaker`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`matchmaker`](crate::client::Client::matchmaker). -/// -/// See [`crate::client::fluent_builders::Matchmaker`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct Matchmaker { - _private: (), -} -impl Matchmaker { - /// Creates a new builder-style object to manufacture [`MatchmakerInput`](crate::input::MatchmakerInput) - pub fn builder() -> crate::input::matchmaker_input::Builder { - crate::input::matchmaker_input::Builder::default() - } - /// Creates a new `Matchmaker` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for Matchmaker { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_matchmaker_error(response) - } else { - crate::operation_deser::parse_matchmaker_response(response) - } - } -} diff --git a/lib/smithy-output/api-status/rust/rust/src/operation_deser.rs b/lib/smithy-output/api-status/rust/rust/src/operation_deser.rs deleted file mode 100644 index 9fafc7a8b..000000000 --- a/lib/smithy-output/api-status/rust/rust/src/operation_deser.rs +++ /dev/null @@ -1,146 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[allow(clippy::unnecessary_wraps)] -pub fn parse_matchmaker_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::MatchmakerError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::MatchmakerError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::MatchmakerError { - meta: generic, - kind: crate::error::MatchmakerErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::MatchmakerError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::MatchmakerError { - meta: generic, - kind: crate::error::MatchmakerErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::MatchmakerError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::MatchmakerError { - meta: generic, - kind: crate::error::MatchmakerErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::MatchmakerError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::MatchmakerError { - meta: generic, - kind: crate::error::MatchmakerErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::MatchmakerError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::MatchmakerError { - meta: generic, - kind: crate::error::MatchmakerErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::MatchmakerError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::MatchmakerError { - meta: generic, - kind: crate::error::MatchmakerErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::MatchmakerError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::MatchmakerError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_matchmaker_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::matchmaker_output::Builder::default(); - let _ = response; - output.build() - }) -} diff --git a/lib/smithy-output/api-status/rust/rust/src/output.rs b/lib/smithy-output/api-status/rust/rust/src/output.rs deleted file mode 100644 index cdab2dde7..000000000 --- a/lib/smithy-output/api-status/rust/rust/src/output.rs +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct MatchmakerOutput {} -impl std::fmt::Debug for MatchmakerOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("MatchmakerOutput"); - formatter.finish() - } -} -/// See [`MatchmakerOutput`](crate::output::MatchmakerOutput) -pub mod matchmaker_output { - /// A builder for [`MatchmakerOutput`](crate::output::MatchmakerOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`MatchmakerOutput`](crate::output::MatchmakerOutput) - pub fn build(self) -> crate::output::MatchmakerOutput { - crate::output::MatchmakerOutput {} - } - } -} -impl MatchmakerOutput { - /// Creates a new builder-style object to manufacture [`MatchmakerOutput`](crate::output::MatchmakerOutput) - pub fn builder() -> crate::output::matchmaker_output::Builder { - crate::output::matchmaker_output::Builder::default() - } -} diff --git a/lib/smithy-output/api-traefik-provider/rust-server/rust-server/Cargo.toml b/lib/smithy-output/api-traefik-provider/rust-server/rust-server/Cargo.toml deleted file mode 100644 index 0200ba87a..000000000 --- a/lib/smithy-output/api-traefik-provider/rust-server/rust-server/Cargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -[package] -name = "rivet-traefik-provider-server" -version = "0.0.1" -authors = ["Rivet "] -edition = "2021" -license = "Apache-2.0" - -[package.metadata.docs.rs] -all-features = true -targets = ["x86_64-unknown-linux-gnu"] - -[dependencies] -serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" -chrono = { version = "0.4", features = ["serde"] } diff --git a/lib/smithy-output/api-traefik-provider/rust-server/rust-server/src/lib.rs b/lib/smithy-output/api-traefik-provider/rust-server/rust-server/src/lib.rs deleted file mode 100644 index ff9294697..000000000 --- a/lib/smithy-output/api-traefik-provider/rust-server/rust-server/src/lib.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod models; \ No newline at end of file diff --git a/lib/smithy-output/api-traefik-provider/rust-server/rust-server/src/models.rs b/lib/smithy-output/api-traefik-provider/rust-server/rust-server/src/models.rs deleted file mode 100644 index eea284437..000000000 --- a/lib/smithy-output/api-traefik-provider/rust-server/rust-server/src/models.rs +++ /dev/null @@ -1,267 +0,0 @@ -#[allow(unused_imports)] -use chrono; -#[allow(unused_imports)] -use serde::{Deserialize, Serialize}; - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TraefikHttpNullified { - #[allow(missing_docs)] // documentation missing in model - pub services: std::option::Option< - std::collections::HashMap, - >, - #[allow(missing_docs)] // documentation missing in model - pub routers: std::option::Option< - std::collections::HashMap, - >, - #[allow(missing_docs)] // documentation missing in model - pub middlewares: std::option::Option< - std::collections::HashMap, - >, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum TraefikMiddleware { - #[allow(missing_docs)] // documentation missing in model - AddPrefix(TraefikMiddlewareAddPrefix), - #[allow(missing_docs)] // documentation missing in model - BasicAuth(TraefikMiddlewareBasicAuth), - #[allow(missing_docs)] // documentation missing in model - Chain(TraefikMiddlewareChain), - #[allow(missing_docs)] // documentation missing in model - Compress(Unit), - #[allow(missing_docs)] // documentation missing in model - Headers(TraefikMiddlewareHeaders), - #[allow(missing_docs)] // documentation missing in model - InFlightReq(TraefikMiddlewareInFlightReq), - #[allow(missing_docs)] // documentation missing in model - IpWhiteList(TraefikMiddlewareIpWhiteList), - #[allow(missing_docs)] // documentation missing in model - RateLimit(TraefikMiddlewareRateLimit), - #[allow(missing_docs)] // documentation missing in model - RedirectRegex(TraefikMiddlewareRedirectRegex), - #[allow(missing_docs)] // documentation missing in model - ReplacePathRegex(TraefikMiddlewareReplacePathRegex), - #[allow(missing_docs)] // documentation missing in model - Retry(TraefikMiddlewareRetry), - #[allow(missing_docs)] // documentation missing in model - StripPrefix(TraefikMiddlewareStripPrefix), -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TraefikMiddlewareBasicAuth { - #[allow(missing_docs)] // documentation missing in model - pub users: std::vec::Vec, - #[allow(missing_docs)] // documentation missing in model - pub remove_header: bool, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TraefikMiddlewareRedirectRegex { - #[allow(missing_docs)] // documentation missing in model - pub permanent: bool, - #[allow(missing_docs)] // documentation missing in model - pub regex: std::string::String, - #[allow(missing_docs)] // documentation missing in model - pub replacement: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TraefikMiddlewareHeaders { - #[allow(missing_docs)] // documentation missing in model - pub access_control_allow_methods: std::option::Option>, - #[allow(missing_docs)] // documentation missing in model - pub access_control_allow_origin_list: std::option::Option>, - /// Unsigned 32 bit integer. - pub access_control_max_age: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub custom_response_headers: - std::option::Option>, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct Unit {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TraefikMiddlewareRetry { - /// Unsigned 32 bit integer. - pub attempts: i32, - #[allow(missing_docs)] // documentation missing in model - pub initial_interval: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TraefikMiddlewareInFlightReq { - /// Unsigned 32 bit integer. - pub amount: i32, - #[allow(missing_docs)] // documentation missing in model - pub source_criterion: std::option::Option, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum TraefikInFlightReqSourceCriterion { - #[allow(missing_docs)] // documentation missing in model - IpStrategy(TraefikIpStrategy), - #[allow(missing_docs)] // documentation missing in model - RequestHeaderName(TraefikInFlightReqSourceCriterionRequestHeaderName), - #[allow(missing_docs)] // documentation missing in model - RequestHost(Unit), -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TraefikInFlightReqSourceCriterionRequestHeaderName { - #[allow(missing_docs)] // documentation missing in model - pub request_header_name: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TraefikIpStrategy { - /// Unsigned 32 bit integer. - pub depth: i32, - #[allow(missing_docs)] // documentation missing in model - pub exclude_i_ps: std::option::Option>, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TraefikMiddlewareRateLimit { - /// Unsigned 32 bit integer. - pub average: i32, - #[allow(missing_docs)] // documentation missing in model - pub period: std::string::String, - /// Unsigned 32 bit integer. - pub burst: i32, - #[allow(missing_docs)] // documentation missing in model - pub source_criterion: TraefikInFlightReqSourceCriterion, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TraefikMiddlewareAddPrefix { - #[allow(missing_docs)] // documentation missing in model - pub prefix: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TraefikMiddlewareStripPrefix { - #[allow(missing_docs)] // documentation missing in model - pub prefixes: std::vec::Vec, - #[allow(missing_docs)] // documentation missing in model - pub force_slash: bool, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TraefikMiddlewareReplacePathRegex { - #[allow(missing_docs)] // documentation missing in model - pub regex: std::string::String, - #[allow(missing_docs)] // documentation missing in model - pub replacement: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TraefikMiddlewareIpWhiteList { - #[allow(missing_docs)] // documentation missing in model - pub source_range: std::vec::Vec, - #[allow(missing_docs)] // documentation missing in model - pub ip_strategy: std::option::Option, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TraefikMiddlewareChain { - #[allow(missing_docs)] // documentation missing in model - pub middlewares: std::vec::Vec, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TraefikRouter { - #[allow(missing_docs)] // documentation missing in model - pub entry_points: std::vec::Vec, - #[allow(missing_docs)] // documentation missing in model - pub rule: std::string::String, - /// Unsigned 32 bit integer. - pub priority: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub service: std::string::String, - #[allow(missing_docs)] // documentation missing in model - pub middlewares: std::vec::Vec, - #[allow(missing_docs)] // documentation missing in model - pub tls: std::option::Option, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TraefikTls { - #[allow(missing_docs)] // documentation missing in model - pub cert_resolver: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub domains: std::option::Option>, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TraefikTlsDomain { - #[allow(missing_docs)] // documentation missing in model - pub main: std::string::String, - #[allow(missing_docs)] // documentation missing in model - pub sans: std::vec::Vec, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TraefikService { - #[allow(missing_docs)] // documentation missing in model - pub load_balancer: TraefikLoadBalancer, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TraefikLoadBalancer { - #[allow(missing_docs)] // documentation missing in model - pub servers: std::vec::Vec, - #[allow(missing_docs)] // documentation missing in model - pub sticky: std::option::Option, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -pub enum TraefikLoadBalancerSticky { - #[allow(missing_docs)] // documentation missing in model - Cookie(Unit), -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TraefikServer { - #[allow(missing_docs)] // documentation missing in model - pub url: std::string::String, -} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TraefikConfigRequest {} - -#[allow(missing_docs)] // documentation missing in model -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TraefikConfigResponse { - #[allow(missing_docs)] // documentation missing in model - pub http: TraefikHttpNullified, -} - diff --git a/lib/smithy-output/api-traefik-provider/rust/rust/Cargo.toml b/lib/smithy-output/api-traefik-provider/rust/rust/Cargo.toml deleted file mode 100644 index ec4a50254..000000000 --- a/lib/smithy-output/api-traefik-provider/rust/rust/Cargo.toml +++ /dev/null @@ -1,33 +0,0 @@ -# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -[package] -name = "rivet-route" -version = "0.0.1" -authors = ["Rivet Gaming, LLC "] -description = "" -edition = "2021" -license = "Apache-2.0" - -[package.metadata.docs.rs] -all-features = true -targets = ["x86_64-unknown-linux-gnu"] -[dependencies.aws-smithy-client] -version = "^0.41.0" -[dependencies.aws-smithy-http] -version = "^0.41.0" -[dependencies.aws-smithy-json] -version = "^0.41.0" -[dependencies.aws-smithy-types] -version = "^0.41.0" -[dependencies.bytes] -version = "1" -[dependencies.http] -version = "0.2" -[dependencies.tower] -version = "0.4" -[features] -rt-tokio = ["aws-smithy-http/rt-tokio"] -rustls = ["aws-smithy-client/rustls"] -native-tls = ["aws-smithy-client/native-tls"] -default = ["rt-tokio", "rustls"] - - diff --git a/lib/smithy-output/api-traefik-provider/rust/rust/src/client.rs b/lib/smithy-output/api-traefik-provider/rust/rust/src/client.rs deleted file mode 100644 index 19b05661e..000000000 --- a/lib/smithy-output/api-traefik-provider/rust/rust/src/client.rs +++ /dev/null @@ -1,315 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[derive(Debug)] -pub(crate) struct Handle { - pub(crate) client: aws_smithy_client::Client, - pub(crate) conf: crate::Config, -} - -/// An ergonomic service client for `RouteService`. -/// -/// This client allows ergonomic access to a `RouteService`-shaped service. -/// Each method corresponds to an endpoint defined in the service's Smithy model, -/// and the request and response shapes are auto-generated from that same model. -/// -/// # Constructing a Client -/// -/// To construct a client, you need a few different things: -/// -/// - A [`Config`](crate::Config) that specifies additional configuration -/// required by the service. -/// - A connector (`C`) that specifies how HTTP requests are translated -/// into HTTP responses. This will typically be an HTTP client (like -/// `hyper`), though you can also substitute in your own, like a mock -/// mock connector for testing. -/// - A "middleware" (`M`) that modifies requests prior to them being -/// sent to the request. Most commonly, middleware will decide what -/// endpoint the requests should be sent to, as well as perform -/// authentication and authorization of requests (such as SigV4). -/// You can also have middleware that performs request/response -/// tracing, throttling, or other middleware-like tasks. -/// - A retry policy (`R`) that dictates the behavior for requests that -/// fail and should (potentially) be retried. The default type is -/// generally what you want, as it implements a well-vetted retry -/// policy implemented in [`RetryMode::Standard`](aws_smithy_types::retry::RetryMode::Standard). -/// -/// To construct a client, you will generally want to call -/// [`Client::with_config`], which takes a [`aws_smithy_client::Client`] (a -/// Smithy client that isn't specialized to a particular service), -/// and a [`Config`](crate::Config). Both of these are constructed using -/// the [builder pattern] where you first construct a `Builder` type, -/// then configure it with the necessary parameters, and then call -/// `build` to construct the finalized output type. The -/// [`aws_smithy_client::Client`] builder is re-exported in this crate as -/// [`Builder`] for convenience. -/// -/// In _most_ circumstances, you will want to use the following pattern -/// to construct a client: -/// -/// ``` -/// use rivet_route::{Builder, Client, Config}; -/// let raw_client = -/// Builder::dyn_https() -/// # /* -/// .middleware(/* discussed below */) -/// # */ -/// # .middleware_fn(|r| r) -/// .build(); -/// let config = Config::builder().build(); -/// let client = Client::with_config(raw_client, config); -/// ``` -/// -/// For the middleware, you'll want to use whatever matches the -/// routing, authentication and authorization required by the target -/// service. For example, for the standard AWS SDK which uses -/// [SigV4-signed requests], the middleware looks like this: -/// -// Ignored as otherwise we'd need to pull in all these dev-dependencies. -/// ```rust,ignore -/// use aws_endpoint::AwsEndpointStage; -/// use aws_http::auth::CredentialsStage; -/// use aws_http::recursion_detection::RecursionDetectionStage; -/// use aws_http::user_agent::UserAgentStage; -/// use aws_sig_auth::middleware::SigV4SigningStage; -/// use aws_sig_auth::signer::SigV4Signer; -/// use aws_smithy_client::retry::Config as RetryConfig; -/// use aws_smithy_http_tower::map_request::{AsyncMapRequestLayer, MapRequestLayer}; -/// use std::fmt::Debug; -/// use tower::layer::util::{Identity, Stack}; -/// use tower::ServiceBuilder; -/// -/// type AwsMiddlewareStack = Stack< -/// MapRequestLayer, -/// Stack< -/// MapRequestLayer, -/// Stack< -/// AsyncMapRequestLayer, -/// Stack< -/// MapRequestLayer, -/// Stack, Identity>, -/// >, -/// >, -/// >, -/// >; -/// -/// /// AWS Middleware Stack -/// /// -/// /// This implements the middleware stack for this service. It will: -/// /// 1. Load credentials asynchronously into the property bag -/// /// 2. Sign the request with SigV4 -/// /// 3. Resolve an Endpoint for the request -/// /// 4. Add a user agent to the request -/// #[derive(Debug, Default, Clone)] -/// #[non_exhaustive] -/// pub struct AwsMiddleware; -/// -/// impl AwsMiddleware { -/// /// Create a new `AwsMiddleware` stack -/// /// -/// /// Note: `AwsMiddleware` holds no state. -/// pub fn new() -> Self { -/// AwsMiddleware::default() -/// } -/// } -/// -/// // define the middleware stack in a non-generic location to reduce code bloat. -/// fn base() -> ServiceBuilder { -/// let credential_provider = AsyncMapRequestLayer::for_mapper(CredentialsStage::new()); -/// let signer = MapRequestLayer::for_mapper(SigV4SigningStage::new(SigV4Signer::new())); -/// let endpoint_resolver = MapRequestLayer::for_mapper(AwsEndpointStage); -/// let user_agent = MapRequestLayer::for_mapper(UserAgentStage::new()); -/// let recursion_detection = MapRequestLayer::for_mapper(RecursionDetectionStage::new()); -/// // These layers can be considered as occurring in order, that is: -/// // 1. Resolve an endpoint -/// // 2. Add a user agent -/// // 3. Acquire credentials -/// // 4. Sign with credentials -/// // (5. Dispatch over the wire) -/// ServiceBuilder::new() -/// .layer(endpoint_resolver) -/// .layer(user_agent) -/// .layer(credential_provider) -/// .layer(signer) -/// .layer(recursion_detection) -/// } -/// -/// impl tower::Layer for AwsMiddleware { -/// type Service = >::Service; -/// -/// fn layer(&self, inner: S) -> Self::Service { -/// base().service(inner) -/// } -/// } -/// ``` -/// -/// # Using a Client -/// -/// Once you have a client set up, you can access the service's endpoints -/// by calling the appropriate method on [`Client`]. Each such method -/// returns a request builder for that endpoint, with methods for setting -/// the various fields of the request. Once your request is complete, use -/// the `send` method to send the request. `send` returns a future, which -/// you then have to `.await` to get the service's response. -/// -/// [builder pattern]: https://rust-lang.github.io/api-guidelines/type-safety.html#c-builder -/// [SigV4-signed requests]: https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html -#[derive(std::fmt::Debug)] -pub struct Client { - handle: std::sync::Arc>, -} - -impl std::clone::Clone for Client { - fn clone(&self) -> Self { - Self { - handle: self.handle.clone(), - } - } -} - -#[doc(inline)] -pub use aws_smithy_client::Builder; - -impl From> for Client { - fn from(client: aws_smithy_client::Client) -> Self { - Self::with_config(client, crate::Config::builder().build()) - } -} - -impl Client { - /// Creates a client with the given service configuration. - pub fn with_config(client: aws_smithy_client::Client, conf: crate::Config) -> Self { - Self { - handle: std::sync::Arc::new(Handle { client, conf }), - } - } - - /// Returns the client's configuration. - pub fn conf(&self) -> &crate::Config { - &self.handle.conf - } -} -impl Client -where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, -{ - /// Constructs a fluent builder for the [`TraefikConfig`](crate::client::fluent_builders::TraefikConfig) operation. - /// - /// - The fluent builder is configurable: - /// - [`token(impl Into)`](crate::client::fluent_builders::TraefikConfig::token) / [`set_token(Option)`](crate::client::fluent_builders::TraefikConfig::set_token): (undocumented) - /// - [`pool(impl Into)`](crate::client::fluent_builders::TraefikConfig::pool) / [`set_pool(Option)`](crate::client::fluent_builders::TraefikConfig::set_pool): (undocumented) - /// - [`region(impl Into)`](crate::client::fluent_builders::TraefikConfig::region) / [`set_region(Option)`](crate::client::fluent_builders::TraefikConfig::set_region): (undocumented) - /// - On success, responds with [`TraefikConfigOutput`](crate::output::TraefikConfigOutput) with field(s): - /// - [`http(Option)`](crate::output::TraefikConfigOutput::http): (undocumented) - /// - On failure, responds with [`SdkError`](crate::error::TraefikConfigError) - pub fn traefik_config(&self) -> fluent_builders::TraefikConfig { - fluent_builders::TraefikConfig::new(self.handle.clone()) - } -} -pub mod fluent_builders { - //! - //! Utilities to ergonomically construct a request to the service. - //! - //! Fluent builders are created through the [`Client`](crate::client::Client) by calling - //! one if its operation methods. After parameters are set using the builder methods, - //! the `send` method can be called to initiate the request. - //! - /// Fluent builder constructing a request to `TraefikConfig`. - /// - /// Returns the current routing Traefik configuration. - #[derive(std::clone::Clone, std::fmt::Debug)] - pub struct TraefikConfig { - handle: std::sync::Arc>, - inner: crate::input::traefik_config_input::Builder, - } - impl TraefikConfig - where - C: aws_smithy_client::bounds::SmithyConnector, - M: aws_smithy_client::bounds::SmithyMiddleware, - R: aws_smithy_client::retry::NewRequestPolicy, - { - /// Creates a new `TraefikConfig`. - pub(crate) fn new(handle: std::sync::Arc>) -> Self { - Self { - handle, - inner: Default::default(), - } - } - - /// Sends the request and returns the response. - /// - /// If an error occurs, an `SdkError` will be returned with additional details that - /// can be matched against. - /// - /// By default, any retryable failures will be retried twice. Retry behavior - /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be - /// set when configuring the client. - pub async fn send( - self, - ) -> std::result::Result< - crate::output::TraefikConfigOutput, - aws_smithy_http::result::SdkError, - > - where - R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy< - crate::input::TraefikConfigInputOperationOutputAlias, - crate::output::TraefikConfigOutput, - crate::error::TraefikConfigError, - crate::input::TraefikConfigInputOperationRetryAlias, - >, - { - let op = self - .inner - .build() - .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))? - .make_operation(&self.handle.conf) - .await - .map_err(|err| { - aws_smithy_http::result::SdkError::ConstructionFailure(err.into()) - })?; - self.handle.client.call(op).await - } - #[allow(missing_docs)] // documentation missing in model - pub fn token(mut self, input: impl Into) -> Self { - self.inner = self.inner.token(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_token(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_token(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn pool(mut self, input: impl Into) -> Self { - self.inner = self.inner.pool(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_pool(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_pool(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn region(mut self, input: impl Into) -> Self { - self.inner = self.inner.region(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_region(mut self, input: std::option::Option) -> Self { - self.inner = self.inner.set_region(input); - self - } - } -} -/// A wrapper around [`Client`]. Helps reduce external imports. -pub struct ClientWrapper { - pub(crate) client: Client, -} - -impl std::ops::Deref for ClientWrapper { - type Target = Client; - - fn deref(&self) -> &Self::Target { - &self.client - } -} diff --git a/lib/smithy-output/api-traefik-provider/rust/rust/src/config.rs b/lib/smithy-output/api-traefik-provider/rust/rust/src/config.rs deleted file mode 100644 index eeb06683d..000000000 --- a/lib/smithy-output/api-traefik-provider/rust/rust/src/config.rs +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Service config. -/// -pub struct Config { - pub(crate) auth: Option, - pub(crate) uri: String, -} -impl std::fmt::Debug for Config { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut config = f.debug_struct("Config"); - config.finish() - } -} -impl Config { - /// Constructs a config builder. - pub fn builder() -> Builder { - Builder::default() - } -} -/// Builder for creating a `Config`. -#[derive(Default)] -pub struct Builder { - pub(crate) auth: Option, - pub(crate) uri: Option, -} -impl Builder { - /// Constructs a config builder. - pub fn new() -> Self { - Self::default() - } - /// Sets the bearer token to be used with the Smithy client. - pub fn set_bearer_token(mut self, bearer_token: impl std::fmt::Display) -> Self { - self.auth = Some(format!("Bearer {}", bearer_token)); - self - } - /// Sets the base URI to be used with the Smithy client. - pub fn set_uri(mut self, uri: impl ToString) -> Self { - self.uri = Some(uri.to_string()); - self - } - /// Builds a [`Config`]. - pub fn build(self) -> Config { - Config { - auth: self - .auth - .or_else(|| std::env::var("RIVET_LOBBY_TOKEN").ok()) - .or_else(|| std::env::var("RIVET_CLIENT_TOKEN").ok()), - uri: self - .uri - .or_else(|| std::env::var("RIVET_ROUTE_API_URL").ok()) - .unwrap_or_else(|| "https://route.api.rivet.gg/v1".to_string()), - } - } - /// Builds a default [`Client`] from the given config. - pub fn build_client(self) -> crate::client::ClientWrapper { - let raw_client = aws_smithy_client::Builder::dyn_https() - .middleware(tower::layer::util::Identity::new()) - .sleep_impl(None) - .build(); - crate::client::ClientWrapper { - client: crate::Client::with_config(raw_client, self.build()), - } - } -} diff --git a/lib/smithy-output/api-traefik-provider/rust/rust/src/error.rs b/lib/smithy-output/api-traefik-provider/rust/rust/src/error.rs deleted file mode 100644 index a524a2a34..000000000 --- a/lib/smithy-output/api-traefik-provider/rust/rust/src/error.rs +++ /dev/null @@ -1,916 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Error type for the `TraefikConfig` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub struct TraefikConfigError { - /// Kind of error that occurred. - pub kind: TraefikConfigErrorKind, - /// Additional metadata about the error, including error code, message, and request ID. - pub(crate) meta: aws_smithy_types::Error, -} -/// Types of errors that can occur for the `TraefikConfig` operation. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum TraefikConfigErrorKind { - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code - Unhandled(Box), -} -impl std::fmt::Display for TraefikConfigError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.kind { - TraefikConfigErrorKind::InternalError(_inner) => _inner.fmt(f), - TraefikConfigErrorKind::RateLimitError(_inner) => _inner.fmt(f), - TraefikConfigErrorKind::ForbiddenError(_inner) => _inner.fmt(f), - TraefikConfigErrorKind::UnauthorizedError(_inner) => _inner.fmt(f), - TraefikConfigErrorKind::NotFoundError(_inner) => _inner.fmt(f), - TraefikConfigErrorKind::BadRequestError(_inner) => _inner.fmt(f), - TraefikConfigErrorKind::Unhandled(_inner) => _inner.fmt(f), - } - } -} -impl aws_smithy_types::retry::ProvideErrorKind for TraefikConfigError { - fn code(&self) -> Option<&str> { - TraefikConfigError::code(self) - } - fn retryable_error_kind(&self) -> Option { - match &self.kind { - TraefikConfigErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()), - TraefikConfigErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()), - _ => None, - } - } -} -impl TraefikConfigError { - /// Creates a new `TraefikConfigError`. - pub fn new(kind: TraefikConfigErrorKind, meta: aws_smithy_types::Error) -> Self { - Self { kind, meta } - } - - /// Creates the `TraefikConfigError::Unhandled` variant from any error type. - pub fn unhandled(err: impl Into>) -> Self { - Self { - kind: TraefikConfigErrorKind::Unhandled(err.into()), - meta: Default::default(), - } - } - - /// Creates the `TraefikConfigError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { - Self { - meta: err.clone(), - kind: TraefikConfigErrorKind::Unhandled(err.into()), - } - } - - /// Returns the error message if one is available. - pub fn message(&self) -> Option<&str> { - self.meta.message() - } - - /// Returns error metadata, which includes the error code, message, - /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { - &self.meta - } - - /// Returns the request ID if it's available. - pub fn request_id(&self) -> Option<&str> { - self.meta.request_id() - } - - /// Returns the error code if it's available. - pub fn code(&self) -> Option<&str> { - self.meta.code() - } - /// Returns `true` if the error kind is `TraefikConfigErrorKind::InternalError`. - pub fn is_internal_error(&self) -> bool { - matches!(&self.kind, TraefikConfigErrorKind::InternalError(_)) - } - /// Returns `true` if the error kind is `TraefikConfigErrorKind::RateLimitError`. - pub fn is_rate_limit_error(&self) -> bool { - matches!(&self.kind, TraefikConfigErrorKind::RateLimitError(_)) - } - /// Returns `true` if the error kind is `TraefikConfigErrorKind::ForbiddenError`. - pub fn is_forbidden_error(&self) -> bool { - matches!(&self.kind, TraefikConfigErrorKind::ForbiddenError(_)) - } - /// Returns `true` if the error kind is `TraefikConfigErrorKind::UnauthorizedError`. - pub fn is_unauthorized_error(&self) -> bool { - matches!(&self.kind, TraefikConfigErrorKind::UnauthorizedError(_)) - } - /// Returns `true` if the error kind is `TraefikConfigErrorKind::NotFoundError`. - pub fn is_not_found_error(&self) -> bool { - matches!(&self.kind, TraefikConfigErrorKind::NotFoundError(_)) - } - /// Returns `true` if the error kind is `TraefikConfigErrorKind::BadRequestError`. - pub fn is_bad_request_error(&self) -> bool { - matches!(&self.kind, TraefikConfigErrorKind::BadRequestError(_)) - } -} -impl std::error::Error for TraefikConfigError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match &self.kind { - TraefikConfigErrorKind::InternalError(_inner) => Some(_inner), - TraefikConfigErrorKind::RateLimitError(_inner) => Some(_inner), - TraefikConfigErrorKind::ForbiddenError(_inner) => Some(_inner), - TraefikConfigErrorKind::UnauthorizedError(_inner) => Some(_inner), - TraefikConfigErrorKind::NotFoundError(_inner) => Some(_inner), - TraefikConfigErrorKind::BadRequestError(_inner) => Some(_inner), - TraefikConfigErrorKind::Unhandled(_inner) => Some(_inner.as_ref()), - } - } -} - -/// An error thrown when the requestee has sent an invalid or malformed request. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct BadRequestError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl BadRequestError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for BadRequestError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("BadRequestError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl BadRequestError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for BadRequestError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "BadRequestError")?; - if let Some(inner_1) = &self.message { - write!(f, ": {}", inner_1)?; - } - Ok(()) - } -} -impl std::error::Error for BadRequestError {} -/// See [`BadRequestError`](crate::error::BadRequestError) -pub mod bad_request_error { - /// A builder for [`BadRequestError`](crate::error::BadRequestError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`BadRequestError`](crate::error::BadRequestError) - pub fn build(self) -> crate::error::BadRequestError { - crate::error::BadRequestError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl BadRequestError { - /// Creates a new builder-style object to manufacture [`BadRequestError`](crate::error::BadRequestError) - pub fn builder() -> crate::error::bad_request_error::Builder { - crate::error::bad_request_error::Builder::default() - } -} - -/// An error thrown when the requestee requests a non existent resource. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct NotFoundError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl NotFoundError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for NotFoundError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("NotFoundError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl NotFoundError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for NotFoundError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "NotFoundError")?; - if let Some(inner_2) = &self.message { - write!(f, ": {}", inner_2)?; - } - Ok(()) - } -} -impl std::error::Error for NotFoundError {} -/// See [`NotFoundError`](crate::error::NotFoundError) -pub mod not_found_error { - /// A builder for [`NotFoundError`](crate::error::NotFoundError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`NotFoundError`](crate::error::NotFoundError) - pub fn build(self) -> crate::error::NotFoundError { - crate::error::NotFoundError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl NotFoundError { - /// Creates a new builder-style object to manufacture [`NotFoundError`](crate::error::NotFoundError) - pub fn builder() -> crate::error::not_found_error::Builder { - crate::error::not_found_error::Builder::default() - } -} - -/// An error thrown when the requestee is not authenticated. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct UnauthorizedError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl UnauthorizedError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for UnauthorizedError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("UnauthorizedError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl UnauthorizedError { - /// Returns `Some(ErrorKind)` if the error is retryable. Otherwise, returns `None`. - pub fn retryable_error_kind(&self) -> aws_smithy_types::retry::ErrorKind { - aws_smithy_types::retry::ErrorKind::ClientError - } - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for UnauthorizedError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "UnauthorizedError")?; - if let Some(inner_3) = &self.message { - write!(f, ": {}", inner_3)?; - } - Ok(()) - } -} -impl std::error::Error for UnauthorizedError {} -/// See [`UnauthorizedError`](crate::error::UnauthorizedError) -pub mod unauthorized_error { - /// A builder for [`UnauthorizedError`](crate::error::UnauthorizedError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`UnauthorizedError`](crate::error::UnauthorizedError) - pub fn build(self) -> crate::error::UnauthorizedError { - crate::error::UnauthorizedError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl UnauthorizedError { - /// Creates a new builder-style object to manufacture [`UnauthorizedError`](crate::error::UnauthorizedError) - pub fn builder() -> crate::error::unauthorized_error::Builder { - crate::error::unauthorized_error::Builder::default() - } -} - -/// An error thrown when the requestee requests a resource they do not have access to. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct ForbiddenError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl ForbiddenError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for ForbiddenError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("ForbiddenError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl ForbiddenError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for ForbiddenError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "ForbiddenError")?; - if let Some(inner_4) = &self.message { - write!(f, ": {}", inner_4)?; - } - Ok(()) - } -} -impl std::error::Error for ForbiddenError {} -/// See [`ForbiddenError`](crate::error::ForbiddenError) -pub mod forbidden_error { - /// A builder for [`ForbiddenError`](crate::error::ForbiddenError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`ForbiddenError`](crate::error::ForbiddenError) - pub fn build(self) -> crate::error::ForbiddenError { - crate::error::ForbiddenError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl ForbiddenError { - /// Creates a new builder-style object to manufacture [`ForbiddenError`](crate::error::ForbiddenError) - pub fn builder() -> crate::error::forbidden_error::Builder { - crate::error::forbidden_error::Builder::default() - } -} - -/// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct RateLimitError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl RateLimitError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for RateLimitError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("RateLimitError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl RateLimitError { - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for RateLimitError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "RateLimitError")?; - if let Some(inner_5) = &self.message { - write!(f, ": {}", inner_5)?; - } - Ok(()) - } -} -impl std::error::Error for RateLimitError {} -/// See [`RateLimitError`](crate::error::RateLimitError) -pub mod rate_limit_error { - /// A builder for [`RateLimitError`](crate::error::RateLimitError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`RateLimitError`](crate::error::RateLimitError) - pub fn build(self) -> crate::error::RateLimitError { - crate::error::RateLimitError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl RateLimitError { - /// Creates a new builder-style object to manufacture [`RateLimitError`](crate::error::RateLimitError) - pub fn builder() -> crate::error::rate_limit_error::Builder { - crate::error::rate_limit_error::Builder::default() - } -} - -/// An error caused by internal server problems. -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct InternalError { - #[allow(missing_docs)] // documentation missing in model - pub code: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub message: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub documentation: std::option::Option, - /// Unstructured metadata relating to an error. Must be manually parsed. - pub metadata: std::option::Option, -} -impl InternalError { - #[allow(missing_docs)] // documentation missing in model - pub fn code(&self) -> std::option::Option<&str> { - self.code.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(&self) -> std::option::Option<&str> { - self.documentation.as_deref() - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> { - self.metadata.as_ref() - } -} -impl std::fmt::Debug for InternalError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("InternalError"); - formatter.field("code", &self.code); - formatter.field("message", &self.message); - formatter.field("documentation", &self.documentation); - formatter.field("metadata", &self.metadata); - formatter.finish() - } -} -impl InternalError { - /// Returns `Some(ErrorKind)` if the error is retryable. Otherwise, returns `None`. - pub fn retryable_error_kind(&self) -> aws_smithy_types::retry::ErrorKind { - aws_smithy_types::retry::ErrorKind::ServerError - } - /// Returns the error message. - pub fn message(&self) -> Option<&str> { - self.message.as_deref() - } -} -impl std::fmt::Display for InternalError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "InternalError")?; - if let Some(inner_6) = &self.message { - write!(f, ": {}", inner_6)?; - } - Ok(()) - } -} -impl std::error::Error for InternalError {} -/// See [`InternalError`](crate::error::InternalError) -pub mod internal_error { - /// A builder for [`InternalError`](crate::error::InternalError) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) code: std::option::Option, - pub(crate) message: std::option::Option, - pub(crate) documentation: std::option::Option, - pub(crate) metadata: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn code(mut self, input: impl Into) -> Self { - self.code = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_code(mut self, input: std::option::Option) -> Self { - self.code = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn message(mut self, input: impl Into) -> Self { - self.message = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_message(mut self, input: std::option::Option) -> Self { - self.message = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn documentation(mut self, input: impl Into) -> Self { - self.documentation = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_documentation( - mut self, - input: std::option::Option, - ) -> Self { - self.documentation = input; - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self { - self.metadata = Some(input); - self - } - /// Unstructured metadata relating to an error. Must be manually parsed. - pub fn set_metadata( - mut self, - input: std::option::Option, - ) -> Self { - self.metadata = input; - self - } - /// Consumes the builder and constructs a [`InternalError`](crate::error::InternalError) - pub fn build(self) -> crate::error::InternalError { - crate::error::InternalError { - code: self.code, - message: self.message, - documentation: self.documentation, - metadata: self.metadata, - } - } - } -} -impl InternalError { - /// Creates a new builder-style object to manufacture [`InternalError`](crate::error::InternalError) - pub fn builder() -> crate::error::internal_error::Builder { - crate::error::internal_error::Builder::default() - } -} diff --git a/lib/smithy-output/api-traefik-provider/rust/rust/src/error_meta.rs b/lib/smithy-output/api-traefik-provider/rust/rust/src/error_meta.rs deleted file mode 100644 index 80e8d278f..000000000 --- a/lib/smithy-output/api-traefik-provider/rust/rust/src/error_meta.rs +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// All possible error types for this service. -#[non_exhaustive] -#[derive(std::fmt::Debug)] -pub enum Error { - /// An error thrown when the requestee has sent an invalid or malformed request. - BadRequestError(crate::error::BadRequestError), - /// An error thrown when the requestee requests a resource they do not have access to. - ForbiddenError(crate::error::ForbiddenError), - /// An error caused by internal server problems. - InternalError(crate::error::InternalError), - /// An error thrown when the requestee requests a non existent resource. - NotFoundError(crate::error::NotFoundError), - /// An error thrown when the requestee has hit a rate limit. You are sending too many requests too quickly. - RateLimitError(crate::error::RateLimitError), - /// An error thrown when the requestee is not authenticated. - UnauthorizedError(crate::error::UnauthorizedError), - /// An unhandled error occurred. - Unhandled(Box), -} -impl std::fmt::Display for Error { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Error::BadRequestError(inner) => inner.fmt(f), - Error::ForbiddenError(inner) => inner.fmt(f), - Error::InternalError(inner) => inner.fmt(f), - Error::NotFoundError(inner) => inner.fmt(f), - Error::RateLimitError(inner) => inner.fmt(f), - Error::UnauthorizedError(inner) => inner.fmt(f), - Error::Unhandled(inner) => inner.fmt(f), - } - } -} -impl From> for Error -where - R: Send + Sync + std::fmt::Debug + 'static, -{ - fn from(err: aws_smithy_http::result::SdkError) -> Self { - match err { - aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind { - crate::error::TraefikConfigErrorKind::InternalError(inner) => { - Error::InternalError(inner) - } - crate::error::TraefikConfigErrorKind::RateLimitError(inner) => { - Error::RateLimitError(inner) - } - crate::error::TraefikConfigErrorKind::ForbiddenError(inner) => { - Error::ForbiddenError(inner) - } - crate::error::TraefikConfigErrorKind::UnauthorizedError(inner) => { - Error::UnauthorizedError(inner) - } - crate::error::TraefikConfigErrorKind::NotFoundError(inner) => { - Error::NotFoundError(inner) - } - crate::error::TraefikConfigErrorKind::BadRequestError(inner) => { - Error::BadRequestError(inner) - } - crate::error::TraefikConfigErrorKind::Unhandled(inner) => Error::Unhandled(inner), - }, - _ => Error::Unhandled(err.into()), - } - } -} -impl std::error::Error for Error {} diff --git a/lib/smithy-output/api-traefik-provider/rust/rust/src/input.rs b/lib/smithy-output/api-traefik-provider/rust/rust/src/input.rs deleted file mode 100644 index d7fc34bbc..000000000 --- a/lib/smithy-output/api-traefik-provider/rust/rust/src/input.rs +++ /dev/null @@ -1,177 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -use std::fmt::Write; -/// See [`TraefikConfigInput`](crate::input::TraefikConfigInput) -pub mod traefik_config_input { - /// A builder for [`TraefikConfigInput`](crate::input::TraefikConfigInput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) token: std::option::Option, - pub(crate) pool: std::option::Option, - pub(crate) region: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn token(mut self, input: impl Into) -> Self { - self.token = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_token(mut self, input: std::option::Option) -> Self { - self.token = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn pool(mut self, input: impl Into) -> Self { - self.pool = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_pool(mut self, input: std::option::Option) -> Self { - self.pool = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn region(mut self, input: impl Into) -> Self { - self.region = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_region(mut self, input: std::option::Option) -> Self { - self.region = input; - self - } - /// Consumes the builder and constructs a [`TraefikConfigInput`](crate::input::TraefikConfigInput) - pub fn build( - self, - ) -> std::result::Result< - crate::input::TraefikConfigInput, - aws_smithy_http::operation::BuildError, - > { - Ok(crate::input::TraefikConfigInput { - token: self.token, - pool: self.pool, - region: self.region, - }) - } - } -} -#[doc(hidden)] -pub type TraefikConfigInputOperationOutputAlias = crate::operation::TraefikConfig; -#[doc(hidden)] -pub type TraefikConfigInputOperationRetryAlias = (); -impl TraefikConfigInput { - /// Consumes the builder and constructs an Operation<[`TraefikConfig`](crate::operation::TraefikConfig)> - #[allow(unused_mut)] - #[allow(clippy::let_and_return)] - #[allow(clippy::needless_borrow)] - pub async fn make_operation( - &self, - _config: &crate::config::Config, - ) -> std::result::Result< - aws_smithy_http::operation::Operation, - aws_smithy_http::operation::BuildError, - > { - let mut request = { - fn uri_base( - _input: &crate::input::TraefikConfigInput, - output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - write!(output, "/traefik/config").expect("formatting should succeed"); - Ok(()) - } - fn uri_query( - _input: &crate::input::TraefikConfigInput, - mut output: &mut String, - ) -> Result<(), aws_smithy_http::operation::BuildError> { - let mut query = aws_smithy_http::query::Writer::new(&mut output); - if let Some(inner_1) = &_input.token { - query.push_kv("token", &aws_smithy_http::query::fmt_string(&inner_1)); - } - if let Some(inner_2) = &_input.pool { - query.push_kv("pool", &aws_smithy_http::query::fmt_string(&inner_2)); - } - if let Some(inner_3) = &_input.region { - query.push_kv("region", &aws_smithy_http::query::fmt_string(&inner_3)); - } - Ok(()) - } - #[allow(clippy::unnecessary_wraps)] - fn update_http_builder( - input: &crate::input::TraefikConfigInput, - _config: &crate::config::Config, - builder: http::request::Builder, - ) -> std::result::Result - { - let mut _uri = String::new(); - _uri = format!("{}{}", _config.uri.clone(), _uri); - uri_base(input, &mut _uri)?; - uri_query(input, &mut _uri)?; - Ok(builder.method("GET").uri(_uri)) - } - let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?; - let mut builder = if let Some(auth) = &_config.auth { - builder.header(http::header::AUTHORIZATION, auth.clone()) - } else { - builder - }; - builder - }; - let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new(); - #[allow(clippy::useless_conversion)] - let body = aws_smithy_http::body::SdkBody::from(""); - let request = request.body(body).expect("should be valid request"); - let mut request = aws_smithy_http::operation::Request::from_parts(request, properties); - request - .properties_mut() - .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone()); - let op = aws_smithy_http::operation::Operation::new( - request, - crate::operation::TraefikConfig::new(), - ) - .with_metadata(aws_smithy_http::operation::Metadata::new( - "TraefikConfig", - "RouteService", - )); - Ok(op) - } - /// Creates a new builder-style object to manufacture [`TraefikConfigInput`](crate::input::TraefikConfigInput) - pub fn builder() -> crate::input::traefik_config_input::Builder { - crate::input::traefik_config_input::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct TraefikConfigInput { - #[allow(missing_docs)] // documentation missing in model - pub token: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub pool: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub region: std::option::Option, -} -impl TraefikConfigInput { - #[allow(missing_docs)] // documentation missing in model - pub fn token(&self) -> std::option::Option<&str> { - self.token.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn pool(&self) -> std::option::Option<&str> { - self.pool.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn region(&self) -> std::option::Option<&str> { - self.region.as_deref() - } -} -impl std::fmt::Debug for TraefikConfigInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("TraefikConfigInput"); - formatter.field("token", &self.token); - formatter.field("pool", &self.pool); - formatter.field("region", &self.region); - formatter.finish() - } -} diff --git a/lib/smithy-output/api-traefik-provider/rust/rust/src/json_deser.rs b/lib/smithy-output/api-traefik-provider/rust/rust/src/json_deser.rs deleted file mode 100644 index 8e4d3008f..000000000 --- a/lib/smithy-output/api-traefik-provider/rust/rust/src/json_deser.rs +++ /dev/null @@ -1,2318 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub fn parse_http_generic_error( - response: &http::Response, -) -> Result { - crate::json_errors::parse_generic_error(response.body(), response.headers()) -} - -pub fn deser_structure_crate_error_internal_error_json_err( - value: &[u8], - mut builder: crate::error::internal_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_rate_limit_error_json_err( - value: &[u8], - mut builder: crate::error::rate_limit_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_forbidden_error_json_err( - value: &[u8], - mut builder: crate::error::forbidden_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_unauthorized_error_json_err( - value: &[u8], - mut builder: crate::error::unauthorized_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_not_found_error_json_err( - value: &[u8], - mut builder: crate::error::not_found_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_structure_crate_error_bad_request_error_json_err( - value: &[u8], - mut builder: crate::error::bad_request_error::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "code" => { - builder = builder.set_code( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "message" => { - builder = builder.set_message( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "documentation" => { - builder = builder.set_documentation( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "metadata" => { - builder = builder.set_metadata(Some( - aws_smithy_json::deserialize::token::expect_document(tokens)?, - )); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn deser_operation_crate_operation_traefik_config( - value: &[u8], - mut builder: crate::output::traefik_config_output::Builder, -) -> Result { - let mut tokens_owned = - aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) - .peekable(); - let tokens = &mut tokens_owned; - aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "http" => { - builder = builder.set_http( - crate::json_deser::deser_structure_crate_model_traefik_http_nullified( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - if tokens.next().is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "found more JSON tokens after completing parsing", - )); - } - Ok(builder) -} - -pub fn or_empty_doc(data: &[u8]) -> &[u8] { - if data.is_empty() { - b"{}" - } else { - data - } -} - -pub fn deser_structure_crate_model_traefik_http_nullified<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::TraefikHttpNullified::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "services" => { - builder = builder.set_services( - crate::json_deser::deser_map_rivet_api_route_common_traefik_services(tokens)? - ); - } - "routers" => { - builder = builder.set_routers( - crate::json_deser::deser_map_rivet_api_route_common_traefik_routers(tokens)? - ); - } - "middlewares" => { - builder = builder.set_middlewares( - crate::json_deser::deser_map_rivet_api_route_common_traefik_middlewares(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_map_rivet_api_route_common_traefik_services<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option>, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - let mut map = std::collections::HashMap::new(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - let key = key.to_unescaped().map(|u| u.into_owned())?; - let value = - crate::json_deser::deser_structure_crate_model_traefik_service(tokens)?; - if let Some(value) = value { - map.insert(key, value); - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(map)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_map_rivet_api_route_common_traefik_routers<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option>, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - let mut map = std::collections::HashMap::new(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - let key = key.to_unescaped().map(|u| u.into_owned())?; - let value = - crate::json_deser::deser_structure_crate_model_traefik_router(tokens)?; - if let Some(value) = value { - map.insert(key, value); - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(map)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_map_rivet_api_route_common_traefik_middlewares<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option>, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - let mut map = std::collections::HashMap::new(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - let key = key.to_unescaped().map(|u| u.into_owned())?; - let value = - crate::json_deser::deser_union_crate_model_traefik_middleware(tokens)?; - if let Some(value) = value { - map.insert(key, value); - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(map)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_traefik_service<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::TraefikService::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "loadBalancer" => { - builder = builder.set_load_balancer( - crate::json_deser::deser_structure_crate_model_traefik_load_balancer(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_traefik_router<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::TraefikRouter::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "entryPoints" => { - builder = builder.set_entry_points( - crate::json_deser::deser_list_rivet_api_route_common_traefik_entry_points(tokens)? - ); - } - "rule" => { - builder = builder.set_rule( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "priority" => { - builder = builder.set_priority( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "service" => { - builder = builder.set_service( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "middlewares" => { - builder = builder.set_middlewares( - crate::json_deser::deser_list_rivet_api_route_common_traefik_middleware_list(tokens)? - ); - } - "tls" => { - builder = builder.set_tls( - crate::json_deser::deser_structure_crate_model_traefik_tls( - tokens, - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_union_crate_model_traefik_middleware<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - let mut variant = None; - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - if variant.is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "encountered mixed variants in union", - )); - } - variant = match key.to_unescaped()?.as_ref() { - "chain" => { - Some(crate::model::TraefikMiddleware::Chain( - crate::json_deser::deser_structure_crate_model_traefik_middleware_chain(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'chain' cannot be null"))? - )) - } - "ipWhiteList" => { - Some(crate::model::TraefikMiddleware::IpWhiteList( - crate::json_deser::deser_structure_crate_model_traefik_middleware_ip_white_list(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'ipWhiteList' cannot be null"))? - )) - } - "replacePathRegex" => { - Some(crate::model::TraefikMiddleware::ReplacePathRegex( - crate::json_deser::deser_structure_crate_model_traefik_middleware_replace_path_regex(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'replacePathRegex' cannot be null"))? - )) - } - "stripPrefix" => { - Some(crate::model::TraefikMiddleware::StripPrefix( - crate::json_deser::deser_structure_crate_model_traefik_middleware_strip_prefix(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'stripPrefix' cannot be null"))? - )) - } - "addPrefix" => { - Some(crate::model::TraefikMiddleware::AddPrefix( - crate::json_deser::deser_structure_crate_model_traefik_middleware_add_prefix(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'addPrefix' cannot be null"))? - )) - } - "rateLimit" => { - Some(crate::model::TraefikMiddleware::RateLimit( - crate::json_deser::deser_structure_crate_model_traefik_middleware_rate_limit(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'rateLimit' cannot be null"))? - )) - } - "inFlightReq" => { - Some(crate::model::TraefikMiddleware::InFlightReq( - crate::json_deser::deser_structure_crate_model_traefik_middleware_in_flight_req(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'inFlightReq' cannot be null"))? - )) - } - "retry" => { - Some(crate::model::TraefikMiddleware::Retry( - crate::json_deser::deser_structure_crate_model_traefik_middleware_retry(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'retry' cannot be null"))? - )) - } - "compress" => { - Some(crate::model::TraefikMiddleware::Compress( - crate::json_deser::deser_structure_crate_model_unit(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'compress' cannot be null"))? - )) - } - "headers" => { - Some(crate::model::TraefikMiddleware::Headers( - crate::json_deser::deser_structure_crate_model_traefik_middleware_headers(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'headers' cannot be null"))? - )) - } - "redirectRegex" => { - Some(crate::model::TraefikMiddleware::RedirectRegex( - crate::json_deser::deser_structure_crate_model_traefik_middleware_redirect_regex(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'redirectRegex' cannot be null"))? - )) - } - "basicAuth" => { - Some(crate::model::TraefikMiddleware::BasicAuth( - crate::json_deser::deser_structure_crate_model_traefik_middleware_basic_auth(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'basicAuth' cannot be null"))? - )) - } - _ => { - aws_smithy_json::deserialize::token::skip_value(tokens)?; - Some(crate::model::TraefikMiddleware::Unknown) - } - }; - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - }, - _ => { - return Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )) - } - } - Ok(variant) -} - -pub fn deser_structure_crate_model_traefik_load_balancer<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::TraefikLoadBalancer::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "servers" => { - builder = builder.set_servers( - crate::json_deser::deser_list_rivet_api_route_common_traefik_servers(tokens)? - ); - } - "sticky" => { - builder = builder.set_sticky( - crate::json_deser::deser_union_crate_model_traefik_load_balancer_sticky(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_api_route_common_traefik_entry_points<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_api_route_common_traefik_middleware_list<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_structure_crate_model_traefik_tls<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::TraefikTls::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "certResolver" => { - builder = builder.set_cert_resolver( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "domains" => { - builder = builder.set_domains( - crate::json_deser::deser_list_rivet_api_route_common_traefik_tls_domains(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_traefik_middleware_chain<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::TraefikMiddlewareChain::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "middlewares" => { - builder = builder.set_middlewares( - crate::json_deser::deser_list_rivet_api_route_common_traefik_middleware_list(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_traefik_middleware_ip_white_list<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::TraefikMiddlewareIpWhiteList::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "sourceRange" => { - builder = builder.set_source_range( - crate::json_deser::deser_list_rivet_api_route_common_traefik_source_range(tokens)? - ); - } - "ipStrategy" => { - builder = builder.set_ip_strategy( - crate::json_deser::deser_structure_crate_model_traefik_ip_strategy(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_traefik_middleware_replace_path_regex<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::TraefikMiddlewareReplacePathRegex::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "regex" => { - builder = builder.set_regex( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "replacement" => { - builder = builder.set_replacement( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_traefik_middleware_strip_prefix<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::TraefikMiddlewareStripPrefix::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "prefixes" => { - builder = builder.set_prefixes( - crate::json_deser::deser_list_rivet_api_route_common_traefik_prefixes(tokens)? - ); - } - "forceSlash" => { - builder = builder.set_force_slash( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_traefik_middleware_add_prefix<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::TraefikMiddlewareAddPrefix::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "prefix" => { - builder = builder.set_prefix( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_traefik_middleware_rate_limit<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::TraefikMiddlewareRateLimit::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "average" => { - builder = builder.set_average( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "period" => { - builder = builder.set_period( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "burst" => { - builder = builder.set_burst( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "sourceCriterion" => { - builder = builder.set_source_criterion( - crate::json_deser::deser_union_crate_model_traefik_in_flight_req_source_criterion(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_traefik_middleware_in_flight_req<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::TraefikMiddlewareInFlightReq::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "amount" => { - builder = builder.set_amount( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "sourceCriterion" => { - builder = builder.set_source_criterion( - crate::json_deser::deser_union_crate_model_traefik_in_flight_req_source_criterion(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_traefik_middleware_retry<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::TraefikMiddlewareRetry::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "attempts" => { - builder = builder.set_attempts( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "initialInterval" => { - builder = builder.set_initial_interval( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_unit<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::Unit::builder(); - aws_smithy_json::deserialize::token::skip_to_end(tokens)?; - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_traefik_middleware_headers<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::TraefikMiddlewareHeaders::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "accessControlAllowMethods" => { - builder = builder.set_access_control_allow_methods( - crate::json_deser::deser_list_rivet_api_route_common_traefik_middleware_header_values(tokens)? - ); - } - "accessControlAllowOriginList" => { - builder = builder.set_access_control_allow_origin_list( - crate::json_deser::deser_list_rivet_api_route_common_traefik_middleware_header_values(tokens)? - ); - } - "accessControlMaxAge" => { - builder = builder.set_access_control_max_age( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "customResponseHeaders" => { - builder = builder.set_custom_response_headers( - crate::json_deser::deser_map_rivet_api_route_common_traefik_middleware_header_map(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_traefik_middleware_redirect_regex<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::TraefikMiddlewareRedirectRegex::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "permanent" => { - builder = builder.set_permanent( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - "regex" => { - builder = builder.set_regex( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "replacement" => { - builder = builder.set_replacement( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_traefik_middleware_basic_auth<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::TraefikMiddlewareBasicAuth::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "users" => { - builder = builder.set_users( - crate::json_deser::deser_list_rivet_api_route_common_traefik_user_list(tokens)? - ); - } - "removeHeader" => { - builder = builder.set_remove_header( - aws_smithy_json::deserialize::token::expect_bool_or_null( - tokens.next(), - )?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_api_route_common_traefik_servers<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_traefik_server(tokens)?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_union_crate_model_traefik_load_balancer_sticky<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - let mut variant = None; - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - if variant.is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "encountered mixed variants in union", - )); - } - variant = match key.to_unescaped()?.as_ref() { - "cookie" => Some(crate::model::TraefikLoadBalancerSticky::Cookie( - crate::json_deser::deser_structure_crate_model_unit(tokens)? - .ok_or_else(|| { - aws_smithy_json::deserialize::Error::custom( - "value for 'cookie' cannot be null", - ) - })?, - )), - _ => { - aws_smithy_json::deserialize::token::skip_value(tokens)?; - Some(crate::model::TraefikLoadBalancerSticky::Unknown) - } - }; - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - }, - _ => { - return Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )) - } - } - Ok(variant) -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_api_route_common_traefik_tls_domains<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option>, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = - crate::json_deser::deser_structure_crate_model_traefik_tls_domain( - tokens, - )?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_api_route_common_traefik_source_range<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_structure_crate_model_traefik_ip_strategy<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::TraefikIpStrategy::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "depth" => { - builder = builder.set_depth( - aws_smithy_json::deserialize::token::expect_number_or_null( - tokens.next(), - )? - .map(|v| v.to_i32()), - ); - } - "excludeIPs" => { - builder = builder.set_exclude_i_ps( - crate::json_deser::deser_list_rivet_api_route_common_traefik_ip_list(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_api_route_common_traefik_prefixes<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_union_crate_model_traefik_in_flight_req_source_criterion<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - let mut variant = None; - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - if variant.is_some() { - return Err(aws_smithy_json::deserialize::Error::custom( - "encountered mixed variants in union", - )); - } - variant = match key.to_unescaped()?.as_ref() { - "ipStrategy" => { - Some(crate::model::TraefikInFlightReqSourceCriterion::IpStrategy( - crate::json_deser::deser_structure_crate_model_traefik_ip_strategy(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'ipStrategy' cannot be null"))? - )) - } - "requestHeaderName" => { - Some(crate::model::TraefikInFlightReqSourceCriterion::RequestHeaderName( - crate::json_deser::deser_structure_crate_model_traefik_in_flight_req_source_criterion_request_header_name(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'requestHeaderName' cannot be null"))? - )) - } - "requestHost" => { - Some(crate::model::TraefikInFlightReqSourceCriterion::RequestHost( - crate::json_deser::deser_structure_crate_model_unit(tokens)? - .ok_or_else(|| aws_smithy_json::deserialize::Error::custom("value for 'requestHost' cannot be null"))? - )) - } - _ => { - aws_smithy_json::deserialize::token::skip_value(tokens)?; - Some(crate::model::TraefikInFlightReqSourceCriterion::Unknown) - } - }; - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - }, - _ => { - return Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )) - } - } - Ok(variant) -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_api_route_common_traefik_middleware_header_values<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_map_rivet_api_route_common_traefik_middleware_header_map<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result< - Option>, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - let mut map = std::collections::HashMap::new(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - let key = key.to_unescaped().map(|u| u.into_owned())?; - let value = aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?; - if let Some(value) = value { - map.insert(key, value); - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(map)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_api_route_common_traefik_user_list<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_structure_crate_model_traefik_server<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::TraefikServer::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "url" => { - builder = builder.set_url( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -pub fn deser_structure_crate_model_traefik_tls_domain<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::TraefikTlsDomain::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "main" => { - builder = builder.set_main( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - "sans" => { - builder = builder.set_sans( - crate::json_deser::deser_list_rivet_api_route_common_traefik_sans_list(tokens)? - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_api_route_common_traefik_ip_list<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} - -pub fn deser_structure_crate_model_traefik_in_flight_req_source_criterion_request_header_name< - 'a, - I, ->( - tokens: &mut std::iter::Peekable, -) -> Result< - Option, - aws_smithy_json::deserialize::Error, -> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { - #[allow(unused_mut)] - let mut builder = crate::model::TraefikInFlightReqSourceCriterionRequestHeaderName::builder(); - loop { - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, - Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { - match key.to_unescaped()?.as_ref() { - "requestHeaderName" => { - builder = builder.set_request_header_name( - aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?, - ); - } - _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, - } - } - other => { - return Err(aws_smithy_json::deserialize::Error::custom(format!( - "expected object key or end object, found: {:?}", - other - ))) - } - } - } - Ok(Some(builder.build())) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start object or null", - )), - } -} - -#[allow(clippy::type_complexity, non_snake_case)] -pub fn deser_list_rivet_api_route_common_traefik_sans_list<'a, I>( - tokens: &mut std::iter::Peekable, -) -> Result>, aws_smithy_json::deserialize::Error> -where - I: Iterator< - Item = Result, aws_smithy_json::deserialize::Error>, - >, -{ - match tokens.next().transpose()? { - Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), - Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { - let mut items = Vec::new(); - loop { - match tokens.peek() { - Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { - tokens.next().transpose().unwrap(); - break; - } - _ => { - let value = aws_smithy_json::deserialize::token::expect_string_or_null( - tokens.next(), - )? - .map(|s| s.to_unescaped().map(|u| u.into_owned())) - .transpose()?; - if let Some(value) = value { - items.push(value); - } - } - } - } - Ok(Some(items)) - } - _ => Err(aws_smithy_json::deserialize::Error::custom( - "expected start array or null", - )), - } -} diff --git a/lib/smithy-output/api-traefik-provider/rust/rust/src/json_errors.rs b/lib/smithy-output/api-traefik-provider/rust/rust/src/json_errors.rs deleted file mode 100644 index 7b7574319..000000000 --- a/lib/smithy-output/api-traefik-provider/rust/rust/src/json_errors.rs +++ /dev/null @@ -1,220 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -use aws_smithy_json::deserialize::token::skip_value; -use aws_smithy_json::deserialize::{json_token_iter, Error as DeserializeError, Token}; -use aws_smithy_types::Error as SmithyError; -use bytes::Bytes; -use http::header::ToStrError; -use http::{HeaderMap, HeaderValue}; -use std::borrow::Cow; - -// currently only used by AwsJson -#[allow(unused)] -pub fn is_error(response: &http::Response) -> bool { - !response.status().is_success() -} - -fn sanitize_error_code(error_code: &str) -> &str { - // Trim a trailing URL from the error code, beginning with a `:` - let error_code = match error_code.find(':') { - Some(idx) => &error_code[..idx], - None => error_code, - }; - - // Trim a prefixing namespace from the error code, beginning with a `#` - match error_code.find('#') { - Some(idx) => &error_code[idx + 1..], - None => error_code, - } -} - -struct ErrorBody<'a> { - code: Option>, - message: Option>, -} - -fn parse_error_body(bytes: &[u8]) -> Result { - let mut tokens = json_token_iter(bytes).peekable(); - let (mut typ, mut code, mut message) = (None, None, None); - if let Some(Token::StartObject { .. }) = tokens.next().transpose()? { - loop { - match tokens.next().transpose()? { - Some(Token::EndObject { .. }) => break, - Some(Token::ObjectKey { key, .. }) => { - if let Some(Ok(Token::ValueString { value, .. })) = tokens.peek() { - match key.as_escaped_str() { - "code" => code = Some(value.to_unescaped()?), - "__type" => typ = Some(value.to_unescaped()?), - "message" | "Message" | "errorMessage" => { - message = Some(value.to_unescaped()?) - } - _ => {} - } - } - skip_value(&mut tokens)?; - } - _ => { - return Err(DeserializeError::custom( - "expected object key or end object", - )) - } - } - } - if tokens.next().is_some() { - return Err(DeserializeError::custom( - "found more JSON tokens after completing parsing", - )); - } - } - Ok(ErrorBody { - code: code.or(typ), - message, - }) -} - -fn error_type_from_header(headers: &HeaderMap) -> Result, ToStrError> { - headers - .get("X-Amzn-Errortype") - .map(|v| v.to_str()) - .transpose() -} - -fn request_id(headers: &HeaderMap) -> Option<&str> { - headers - .get("X-Amzn-Requestid") - .and_then(|v| v.to_str().ok()) -} - -pub fn parse_generic_error( - payload: &Bytes, - headers: &HeaderMap, -) -> Result { - let ErrorBody { code, message } = parse_error_body(payload.as_ref())?; - - let mut err_builder = SmithyError::builder(); - if let Some(code) = error_type_from_header(headers) - .map_err(|_| DeserializeError::custom("X-Amzn-Errortype header was not valid UTF-8"))? - .or_else(|| code.as_deref()) - .map(sanitize_error_code) - { - err_builder.code(code); - } - if let Some(message) = message { - err_builder.message(message); - } - if let Some(request_id) = request_id(headers) { - err_builder.request_id(request_id); - } - Ok(err_builder.build()) -} - -#[cfg(test)] -mod test { - use crate::json_errors::{parse_error_body, parse_generic_error, sanitize_error_code}; - use aws_smithy_types::Error; - use bytes::Bytes; - use std::borrow::Cow; - - #[test] - fn generic_error() { - let response = http::Response::builder() - .header("X-Amzn-Requestid", "1234") - .body(Bytes::from_static( - br#"{ "__type": "FooError", "message": "Go to foo" }"#, - )) - .unwrap(); - assert_eq!( - parse_generic_error(response.body(), response.headers()).unwrap(), - Error::builder() - .code("FooError") - .message("Go to foo") - .request_id("1234") - .build() - ) - } - - #[test] - fn error_type() { - assert_eq!( - Some(Cow::Borrowed("FooError")), - parse_error_body(br#"{ "__type": "FooError" }"#) - .unwrap() - .code - ); - } - - #[test] - fn code_takes_priority() { - assert_eq!( - Some(Cow::Borrowed("BarError")), - parse_error_body(br#"{ "code": "BarError", "__type": "FooError" }"#) - .unwrap() - .code - ); - } - - #[test] - fn ignore_unrecognized_fields() { - assert_eq!( - Some(Cow::Borrowed("FooError")), - parse_error_body(br#"{ "__type": "FooError", "asdf": 5, "fdsa": {}, "foo": "1" }"#) - .unwrap() - .code - ); - } - - #[test] - fn sanitize_namespace_and_url() { - assert_eq!( - sanitize_error_code("aws.protocoltests.restjson#FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/"), - "FooError"); - } - - #[test] - fn sanitize_noop() { - assert_eq!(sanitize_error_code("FooError"), "FooError"); - } - - #[test] - fn sanitize_url() { - assert_eq!( - sanitize_error_code( - "FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/" - ), - "FooError" - ); - } - - #[test] - fn sanitize_namespace() { - assert_eq!( - sanitize_error_code("aws.protocoltests.restjson#FooError"), - "FooError" - ); - } - - // services like lambda use an alternate `Message` instead of `message` - #[test] - fn alternative_error_message_names() { - let response = http::Response::builder() - .header("x-amzn-errortype", "ResourceNotFoundException") - .body(Bytes::from_static( - br#"{ - "Type": "User", - "Message": "Functions from 'us-west-2' are not reachable from us-east-1" - }"#, - )) - .unwrap(); - assert_eq!( - parse_generic_error(response.body(), response.headers()).unwrap(), - Error::builder() - .code("ResourceNotFoundException") - .message("Functions from 'us-west-2' are not reachable from us-east-1") - .build() - ); - } -} diff --git a/lib/smithy-output/api-traefik-provider/rust/rust/src/lib.rs b/lib/smithy-output/api-traefik-provider/rust/rust/src/lib.rs deleted file mode 100644 index 3d0312193..000000000 --- a/lib/smithy-output/api-traefik-provider/rust/rust/src/lib.rs +++ /dev/null @@ -1,55 +0,0 @@ -#![allow(clippy::module_inception)] -#![allow(clippy::upper_case_acronyms)] -#![allow(clippy::large_enum_variant)] -#![allow(clippy::wrong_self_convention)] -#![allow(clippy::should_implement_trait)] -#![allow(clippy::blacklisted_name)] -#![allow(clippy::vec_init_then_push)] -#![allow(rustdoc::bare_urls)] -#![warn(missing_docs)] -//! rivet-route -//! -//! # Crate Organization -//! -//! The entry point for most customers will be [`Client`]. [`Client`] exposes one method for each API offered -//! by the service. -//! -//! Some APIs require complex or nested arguments. These exist in [`model`](crate::model). -//! -//! Lastly, errors that can be returned by the service are contained within [`error`]. [`Error`] defines a meta -//! error encompassing all possible errors that can be returned by the service. -//! -//! The other modules within this crate are not required for normal usage. - -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use error_meta::Error; - -#[doc(inline)] -pub use config::Config; - -/// Client and fluent builders for calling the service. -pub mod client; -/// Configuration for the service. -pub mod config; -/// Errors that can occur when calling the service. -pub mod error; -mod error_meta; -/// Input structures for operations. -pub mod input; -mod json_deser; -mod json_errors; -/// Data structures used by operation inputs/outputs. -pub mod model; -/// All operations that this crate can perform. -pub mod operation; -mod operation_deser; -/// Output structures for operations. -pub mod output; -pub use client::{Builder, Client, ClientWrapper}; -/// Crate version number. -pub static PKG_VERSION: &str = env!("CARGO_PKG_VERSION"); -/// Re-exported types from supporting crates. -pub mod types { - pub use aws_smithy_http::result::SdkError; - pub use aws_smithy_types::DateTime; -} diff --git a/lib/smithy-output/api-traefik-provider/rust/rust/src/model.rs b/lib/smithy-output/api-traefik-provider/rust/rust/src/model.rs deleted file mode 100644 index 4156a1783..000000000 --- a/lib/smithy-output/api-traefik-provider/rust/rust/src/model.rs +++ /dev/null @@ -1,2140 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct TraefikHttpNullified { - #[allow(missing_docs)] // documentation missing in model - pub services: std::option::Option< - std::collections::HashMap, - >, - #[allow(missing_docs)] // documentation missing in model - pub routers: std::option::Option< - std::collections::HashMap, - >, - #[allow(missing_docs)] // documentation missing in model - pub middlewares: std::option::Option< - std::collections::HashMap, - >, -} -impl TraefikHttpNullified { - #[allow(missing_docs)] // documentation missing in model - pub fn services( - &self, - ) -> std::option::Option< - &std::collections::HashMap, - > { - self.services.as_ref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn routers( - &self, - ) -> std::option::Option< - &std::collections::HashMap, - > { - self.routers.as_ref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn middlewares( - &self, - ) -> std::option::Option< - &std::collections::HashMap, - > { - self.middlewares.as_ref() - } -} -impl std::fmt::Debug for TraefikHttpNullified { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("TraefikHttpNullified"); - formatter.field("services", &self.services); - formatter.field("routers", &self.routers); - formatter.field("middlewares", &self.middlewares); - formatter.finish() - } -} -/// See [`TraefikHttpNullified`](crate::model::TraefikHttpNullified) -pub mod traefik_http_nullified { - /// A builder for [`TraefikHttpNullified`](crate::model::TraefikHttpNullified) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) services: std::option::Option< - std::collections::HashMap, - >, - pub(crate) routers: std::option::Option< - std::collections::HashMap, - >, - pub(crate) middlewares: std::option::Option< - std::collections::HashMap, - >, - } - impl Builder { - /// Adds a key-value pair to `services`. - /// - /// To override the contents of this collection use [`set_services`](Self::set_services). - /// - pub fn services( - mut self, - k: impl Into, - v: crate::model::TraefikService, - ) -> Self { - let mut hash_map = self.services.unwrap_or_default(); - hash_map.insert(k.into(), v); - self.services = Some(hash_map); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_services( - mut self, - input: std::option::Option< - std::collections::HashMap, - >, - ) -> Self { - self.services = input; - self - } - /// Adds a key-value pair to `routers`. - /// - /// To override the contents of this collection use [`set_routers`](Self::set_routers). - /// - pub fn routers( - mut self, - k: impl Into, - v: crate::model::TraefikRouter, - ) -> Self { - let mut hash_map = self.routers.unwrap_or_default(); - hash_map.insert(k.into(), v); - self.routers = Some(hash_map); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_routers( - mut self, - input: std::option::Option< - std::collections::HashMap, - >, - ) -> Self { - self.routers = input; - self - } - /// Adds a key-value pair to `middlewares`. - /// - /// To override the contents of this collection use [`set_middlewares`](Self::set_middlewares). - /// - pub fn middlewares( - mut self, - k: impl Into, - v: crate::model::TraefikMiddleware, - ) -> Self { - let mut hash_map = self.middlewares.unwrap_or_default(); - hash_map.insert(k.into(), v); - self.middlewares = Some(hash_map); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_middlewares( - mut self, - input: std::option::Option< - std::collections::HashMap, - >, - ) -> Self { - self.middlewares = input; - self - } - /// Consumes the builder and constructs a [`TraefikHttpNullified`](crate::model::TraefikHttpNullified) - pub fn build(self) -> crate::model::TraefikHttpNullified { - crate::model::TraefikHttpNullified { - services: self.services, - routers: self.routers, - middlewares: self.middlewares, - } - } - } -} -impl TraefikHttpNullified { - /// Creates a new builder-style object to manufacture [`TraefikHttpNullified`](crate::model::TraefikHttpNullified) - pub fn builder() -> crate::model::traefik_http_nullified::Builder { - crate::model::traefik_http_nullified::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] -pub enum TraefikMiddleware { - #[allow(missing_docs)] // documentation missing in model - AddPrefix(crate::model::TraefikMiddlewareAddPrefix), - #[allow(missing_docs)] // documentation missing in model - BasicAuth(crate::model::TraefikMiddlewareBasicAuth), - #[allow(missing_docs)] // documentation missing in model - Chain(crate::model::TraefikMiddlewareChain), - #[allow(missing_docs)] // documentation missing in model - Compress(crate::model::Unit), - #[allow(missing_docs)] // documentation missing in model - Headers(crate::model::TraefikMiddlewareHeaders), - #[allow(missing_docs)] // documentation missing in model - InFlightReq(crate::model::TraefikMiddlewareInFlightReq), - #[allow(missing_docs)] // documentation missing in model - IpWhiteList(crate::model::TraefikMiddlewareIpWhiteList), - #[allow(missing_docs)] // documentation missing in model - RateLimit(crate::model::TraefikMiddlewareRateLimit), - #[allow(missing_docs)] // documentation missing in model - RedirectRegex(crate::model::TraefikMiddlewareRedirectRegex), - #[allow(missing_docs)] // documentation missing in model - ReplacePathRegex(crate::model::TraefikMiddlewareReplacePathRegex), - #[allow(missing_docs)] // documentation missing in model - Retry(crate::model::TraefikMiddlewareRetry), - #[allow(missing_docs)] // documentation missing in model - StripPrefix(crate::model::TraefikMiddlewareStripPrefix), - /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version. - /// An unknown enum variant - /// - /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._ - /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized - /// by the client. This can happen when the server adds new functionality, but the client has not been updated. - /// To investigate this, consider turning on debug logging to print the raw HTTP response. - #[non_exhaustive] - Unknown, -} -impl TraefikMiddleware { - /// Tries to convert the enum instance into [`AddPrefix`](crate::model::TraefikMiddleware::AddPrefix), extracting the inner [`TraefikMiddlewareAddPrefix`](crate::model::TraefikMiddlewareAddPrefix). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_add_prefix( - &self, - ) -> std::result::Result<&crate::model::TraefikMiddlewareAddPrefix, &Self> { - if let TraefikMiddleware::AddPrefix(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`AddPrefix`](crate::model::TraefikMiddleware::AddPrefix). - pub fn is_add_prefix(&self) -> bool { - self.as_add_prefix().is_ok() - } - /// Tries to convert the enum instance into [`BasicAuth`](crate::model::TraefikMiddleware::BasicAuth), extracting the inner [`TraefikMiddlewareBasicAuth`](crate::model::TraefikMiddlewareBasicAuth). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_basic_auth( - &self, - ) -> std::result::Result<&crate::model::TraefikMiddlewareBasicAuth, &Self> { - if let TraefikMiddleware::BasicAuth(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`BasicAuth`](crate::model::TraefikMiddleware::BasicAuth). - pub fn is_basic_auth(&self) -> bool { - self.as_basic_auth().is_ok() - } - /// Tries to convert the enum instance into [`Chain`](crate::model::TraefikMiddleware::Chain), extracting the inner [`TraefikMiddlewareChain`](crate::model::TraefikMiddlewareChain). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_chain(&self) -> std::result::Result<&crate::model::TraefikMiddlewareChain, &Self> { - if let TraefikMiddleware::Chain(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`Chain`](crate::model::TraefikMiddleware::Chain). - pub fn is_chain(&self) -> bool { - self.as_chain().is_ok() - } - /// Tries to convert the enum instance into [`Compress`](crate::model::TraefikMiddleware::Compress), extracting the inner [`Unit`](crate::model::Unit). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_compress(&self) -> std::result::Result<&crate::model::Unit, &Self> { - if let TraefikMiddleware::Compress(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`Compress`](crate::model::TraefikMiddleware::Compress). - pub fn is_compress(&self) -> bool { - self.as_compress().is_ok() - } - /// Tries to convert the enum instance into [`Headers`](crate::model::TraefikMiddleware::Headers), extracting the inner [`TraefikMiddlewareHeaders`](crate::model::TraefikMiddlewareHeaders). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_headers( - &self, - ) -> std::result::Result<&crate::model::TraefikMiddlewareHeaders, &Self> { - if let TraefikMiddleware::Headers(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`Headers`](crate::model::TraefikMiddleware::Headers). - pub fn is_headers(&self) -> bool { - self.as_headers().is_ok() - } - /// Tries to convert the enum instance into [`InFlightReq`](crate::model::TraefikMiddleware::InFlightReq), extracting the inner [`TraefikMiddlewareInFlightReq`](crate::model::TraefikMiddlewareInFlightReq). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_in_flight_req( - &self, - ) -> std::result::Result<&crate::model::TraefikMiddlewareInFlightReq, &Self> { - if let TraefikMiddleware::InFlightReq(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`InFlightReq`](crate::model::TraefikMiddleware::InFlightReq). - pub fn is_in_flight_req(&self) -> bool { - self.as_in_flight_req().is_ok() - } - /// Tries to convert the enum instance into [`IpWhiteList`](crate::model::TraefikMiddleware::IpWhiteList), extracting the inner [`TraefikMiddlewareIpWhiteList`](crate::model::TraefikMiddlewareIpWhiteList). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_ip_white_list( - &self, - ) -> std::result::Result<&crate::model::TraefikMiddlewareIpWhiteList, &Self> { - if let TraefikMiddleware::IpWhiteList(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`IpWhiteList`](crate::model::TraefikMiddleware::IpWhiteList). - pub fn is_ip_white_list(&self) -> bool { - self.as_ip_white_list().is_ok() - } - /// Tries to convert the enum instance into [`RateLimit`](crate::model::TraefikMiddleware::RateLimit), extracting the inner [`TraefikMiddlewareRateLimit`](crate::model::TraefikMiddlewareRateLimit). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_rate_limit( - &self, - ) -> std::result::Result<&crate::model::TraefikMiddlewareRateLimit, &Self> { - if let TraefikMiddleware::RateLimit(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`RateLimit`](crate::model::TraefikMiddleware::RateLimit). - pub fn is_rate_limit(&self) -> bool { - self.as_rate_limit().is_ok() - } - /// Tries to convert the enum instance into [`RedirectRegex`](crate::model::TraefikMiddleware::RedirectRegex), extracting the inner [`TraefikMiddlewareRedirectRegex`](crate::model::TraefikMiddlewareRedirectRegex). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_redirect_regex( - &self, - ) -> std::result::Result<&crate::model::TraefikMiddlewareRedirectRegex, &Self> { - if let TraefikMiddleware::RedirectRegex(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`RedirectRegex`](crate::model::TraefikMiddleware::RedirectRegex). - pub fn is_redirect_regex(&self) -> bool { - self.as_redirect_regex().is_ok() - } - /// Tries to convert the enum instance into [`ReplacePathRegex`](crate::model::TraefikMiddleware::ReplacePathRegex), extracting the inner [`TraefikMiddlewareReplacePathRegex`](crate::model::TraefikMiddlewareReplacePathRegex). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_replace_path_regex( - &self, - ) -> std::result::Result<&crate::model::TraefikMiddlewareReplacePathRegex, &Self> { - if let TraefikMiddleware::ReplacePathRegex(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`ReplacePathRegex`](crate::model::TraefikMiddleware::ReplacePathRegex). - pub fn is_replace_path_regex(&self) -> bool { - self.as_replace_path_regex().is_ok() - } - /// Tries to convert the enum instance into [`Retry`](crate::model::TraefikMiddleware::Retry), extracting the inner [`TraefikMiddlewareRetry`](crate::model::TraefikMiddlewareRetry). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_retry(&self) -> std::result::Result<&crate::model::TraefikMiddlewareRetry, &Self> { - if let TraefikMiddleware::Retry(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`Retry`](crate::model::TraefikMiddleware::Retry). - pub fn is_retry(&self) -> bool { - self.as_retry().is_ok() - } - /// Tries to convert the enum instance into [`StripPrefix`](crate::model::TraefikMiddleware::StripPrefix), extracting the inner [`TraefikMiddlewareStripPrefix`](crate::model::TraefikMiddlewareStripPrefix). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_strip_prefix( - &self, - ) -> std::result::Result<&crate::model::TraefikMiddlewareStripPrefix, &Self> { - if let TraefikMiddleware::StripPrefix(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`StripPrefix`](crate::model::TraefikMiddleware::StripPrefix). - pub fn is_strip_prefix(&self) -> bool { - self.as_strip_prefix().is_ok() - } - /// Returns true if the enum instance is the `Unknown` variant. - pub fn is_unknown(&self) -> bool { - matches!(self, Self::Unknown) - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct TraefikMiddlewareBasicAuth { - #[allow(missing_docs)] // documentation missing in model - pub users: std::option::Option>, - #[allow(missing_docs)] // documentation missing in model - pub remove_header: std::option::Option, -} -impl TraefikMiddlewareBasicAuth { - #[allow(missing_docs)] // documentation missing in model - pub fn users(&self) -> std::option::Option<&[std::string::String]> { - self.users.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn remove_header(&self) -> std::option::Option { - self.remove_header - } -} -impl std::fmt::Debug for TraefikMiddlewareBasicAuth { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("TraefikMiddlewareBasicAuth"); - formatter.field("users", &self.users); - formatter.field("remove_header", &self.remove_header); - formatter.finish() - } -} -/// See [`TraefikMiddlewareBasicAuth`](crate::model::TraefikMiddlewareBasicAuth) -pub mod traefik_middleware_basic_auth { - /// A builder for [`TraefikMiddlewareBasicAuth`](crate::model::TraefikMiddlewareBasicAuth) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) users: std::option::Option>, - pub(crate) remove_header: std::option::Option, - } - impl Builder { - /// Appends an item to `users`. - /// - /// To override the contents of this collection use [`set_users`](Self::set_users). - /// - pub fn users(mut self, input: impl Into) -> Self { - let mut v = self.users.unwrap_or_default(); - v.push(input.into()); - self.users = Some(v); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_users( - mut self, - input: std::option::Option>, - ) -> Self { - self.users = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn remove_header(mut self, input: bool) -> Self { - self.remove_header = Some(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_remove_header(mut self, input: std::option::Option) -> Self { - self.remove_header = input; - self - } - /// Consumes the builder and constructs a [`TraefikMiddlewareBasicAuth`](crate::model::TraefikMiddlewareBasicAuth) - pub fn build(self) -> crate::model::TraefikMiddlewareBasicAuth { - crate::model::TraefikMiddlewareBasicAuth { - users: self.users, - remove_header: self.remove_header, - } - } - } -} -impl TraefikMiddlewareBasicAuth { - /// Creates a new builder-style object to manufacture [`TraefikMiddlewareBasicAuth`](crate::model::TraefikMiddlewareBasicAuth) - pub fn builder() -> crate::model::traefik_middleware_basic_auth::Builder { - crate::model::traefik_middleware_basic_auth::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct TraefikMiddlewareRedirectRegex { - #[allow(missing_docs)] // documentation missing in model - pub permanent: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub regex: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub replacement: std::option::Option, -} -impl TraefikMiddlewareRedirectRegex { - #[allow(missing_docs)] // documentation missing in model - pub fn permanent(&self) -> std::option::Option { - self.permanent - } - #[allow(missing_docs)] // documentation missing in model - pub fn regex(&self) -> std::option::Option<&str> { - self.regex.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn replacement(&self) -> std::option::Option<&str> { - self.replacement.as_deref() - } -} -impl std::fmt::Debug for TraefikMiddlewareRedirectRegex { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("TraefikMiddlewareRedirectRegex"); - formatter.field("permanent", &self.permanent); - formatter.field("regex", &self.regex); - formatter.field("replacement", &self.replacement); - formatter.finish() - } -} -/// See [`TraefikMiddlewareRedirectRegex`](crate::model::TraefikMiddlewareRedirectRegex) -pub mod traefik_middleware_redirect_regex { - /// A builder for [`TraefikMiddlewareRedirectRegex`](crate::model::TraefikMiddlewareRedirectRegex) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) permanent: std::option::Option, - pub(crate) regex: std::option::Option, - pub(crate) replacement: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn permanent(mut self, input: bool) -> Self { - self.permanent = Some(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_permanent(mut self, input: std::option::Option) -> Self { - self.permanent = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn regex(mut self, input: impl Into) -> Self { - self.regex = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_regex(mut self, input: std::option::Option) -> Self { - self.regex = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn replacement(mut self, input: impl Into) -> Self { - self.replacement = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_replacement(mut self, input: std::option::Option) -> Self { - self.replacement = input; - self - } - /// Consumes the builder and constructs a [`TraefikMiddlewareRedirectRegex`](crate::model::TraefikMiddlewareRedirectRegex) - pub fn build(self) -> crate::model::TraefikMiddlewareRedirectRegex { - crate::model::TraefikMiddlewareRedirectRegex { - permanent: self.permanent, - regex: self.regex, - replacement: self.replacement, - } - } - } -} -impl TraefikMiddlewareRedirectRegex { - /// Creates a new builder-style object to manufacture [`TraefikMiddlewareRedirectRegex`](crate::model::TraefikMiddlewareRedirectRegex) - pub fn builder() -> crate::model::traefik_middleware_redirect_regex::Builder { - crate::model::traefik_middleware_redirect_regex::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct TraefikMiddlewareHeaders { - #[allow(missing_docs)] // documentation missing in model - pub access_control_allow_methods: std::option::Option>, - #[allow(missing_docs)] // documentation missing in model - pub access_control_allow_origin_list: std::option::Option>, - /// Unsigned 32 bit integer. - pub access_control_max_age: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub custom_response_headers: - std::option::Option>, -} -impl TraefikMiddlewareHeaders { - #[allow(missing_docs)] // documentation missing in model - pub fn access_control_allow_methods(&self) -> std::option::Option<&[std::string::String]> { - self.access_control_allow_methods.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn access_control_allow_origin_list(&self) -> std::option::Option<&[std::string::String]> { - self.access_control_allow_origin_list.as_deref() - } - /// Unsigned 32 bit integer. - pub fn access_control_max_age(&self) -> std::option::Option { - self.access_control_max_age - } - #[allow(missing_docs)] // documentation missing in model - pub fn custom_response_headers( - &self, - ) -> std::option::Option<&std::collections::HashMap> { - self.custom_response_headers.as_ref() - } -} -impl std::fmt::Debug for TraefikMiddlewareHeaders { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("TraefikMiddlewareHeaders"); - formatter.field( - "access_control_allow_methods", - &self.access_control_allow_methods, - ); - formatter.field( - "access_control_allow_origin_list", - &self.access_control_allow_origin_list, - ); - formatter.field("access_control_max_age", &self.access_control_max_age); - formatter.field("custom_response_headers", &self.custom_response_headers); - formatter.finish() - } -} -/// See [`TraefikMiddlewareHeaders`](crate::model::TraefikMiddlewareHeaders) -pub mod traefik_middleware_headers { - /// A builder for [`TraefikMiddlewareHeaders`](crate::model::TraefikMiddlewareHeaders) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) access_control_allow_methods: - std::option::Option>, - pub(crate) access_control_allow_origin_list: - std::option::Option>, - pub(crate) access_control_max_age: std::option::Option, - pub(crate) custom_response_headers: std::option::Option< - std::collections::HashMap, - >, - } - impl Builder { - /// Appends an item to `access_control_allow_methods`. - /// - /// To override the contents of this collection use [`set_access_control_allow_methods`](Self::set_access_control_allow_methods). - /// - pub fn access_control_allow_methods( - mut self, - input: impl Into, - ) -> Self { - let mut v = self.access_control_allow_methods.unwrap_or_default(); - v.push(input.into()); - self.access_control_allow_methods = Some(v); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_access_control_allow_methods( - mut self, - input: std::option::Option>, - ) -> Self { - self.access_control_allow_methods = input; - self - } - /// Appends an item to `access_control_allow_origin_list`. - /// - /// To override the contents of this collection use [`set_access_control_allow_origin_list`](Self::set_access_control_allow_origin_list). - /// - pub fn access_control_allow_origin_list( - mut self, - input: impl Into, - ) -> Self { - let mut v = self.access_control_allow_origin_list.unwrap_or_default(); - v.push(input.into()); - self.access_control_allow_origin_list = Some(v); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_access_control_allow_origin_list( - mut self, - input: std::option::Option>, - ) -> Self { - self.access_control_allow_origin_list = input; - self - } - /// Unsigned 32 bit integer. - pub fn access_control_max_age(mut self, input: i32) -> Self { - self.access_control_max_age = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_access_control_max_age(mut self, input: std::option::Option) -> Self { - self.access_control_max_age = input; - self - } - /// Adds a key-value pair to `custom_response_headers`. - /// - /// To override the contents of this collection use [`set_custom_response_headers`](Self::set_custom_response_headers). - /// - pub fn custom_response_headers( - mut self, - k: impl Into, - v: impl Into, - ) -> Self { - let mut hash_map = self.custom_response_headers.unwrap_or_default(); - hash_map.insert(k.into(), v.into()); - self.custom_response_headers = Some(hash_map); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_custom_response_headers( - mut self, - input: std::option::Option< - std::collections::HashMap, - >, - ) -> Self { - self.custom_response_headers = input; - self - } - /// Consumes the builder and constructs a [`TraefikMiddlewareHeaders`](crate::model::TraefikMiddlewareHeaders) - pub fn build(self) -> crate::model::TraefikMiddlewareHeaders { - crate::model::TraefikMiddlewareHeaders { - access_control_allow_methods: self.access_control_allow_methods, - access_control_allow_origin_list: self.access_control_allow_origin_list, - access_control_max_age: self.access_control_max_age, - custom_response_headers: self.custom_response_headers, - } - } - } -} -impl TraefikMiddlewareHeaders { - /// Creates a new builder-style object to manufacture [`TraefikMiddlewareHeaders`](crate::model::TraefikMiddlewareHeaders) - pub fn builder() -> crate::model::traefik_middleware_headers::Builder { - crate::model::traefik_middleware_headers::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct Unit {} -impl std::fmt::Debug for Unit { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("Unit"); - formatter.finish() - } -} -/// See [`Unit`](crate::model::Unit) -pub mod unit { - /// A builder for [`Unit`](crate::model::Unit) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder {} - impl Builder { - /// Consumes the builder and constructs a [`Unit`](crate::model::Unit) - pub fn build(self) -> crate::model::Unit { - crate::model::Unit {} - } - } -} -impl Unit { - /// Creates a new builder-style object to manufacture [`Unit`](crate::model::Unit) - pub fn builder() -> crate::model::unit::Builder { - crate::model::unit::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct TraefikMiddlewareRetry { - /// Unsigned 32 bit integer. - pub attempts: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub initial_interval: std::option::Option, -} -impl TraefikMiddlewareRetry { - /// Unsigned 32 bit integer. - pub fn attempts(&self) -> std::option::Option { - self.attempts - } - #[allow(missing_docs)] // documentation missing in model - pub fn initial_interval(&self) -> std::option::Option<&str> { - self.initial_interval.as_deref() - } -} -impl std::fmt::Debug for TraefikMiddlewareRetry { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("TraefikMiddlewareRetry"); - formatter.field("attempts", &self.attempts); - formatter.field("initial_interval", &self.initial_interval); - formatter.finish() - } -} -/// See [`TraefikMiddlewareRetry`](crate::model::TraefikMiddlewareRetry) -pub mod traefik_middleware_retry { - /// A builder for [`TraefikMiddlewareRetry`](crate::model::TraefikMiddlewareRetry) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) attempts: std::option::Option, - pub(crate) initial_interval: std::option::Option, - } - impl Builder { - /// Unsigned 32 bit integer. - pub fn attempts(mut self, input: i32) -> Self { - self.attempts = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_attempts(mut self, input: std::option::Option) -> Self { - self.attempts = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn initial_interval(mut self, input: impl Into) -> Self { - self.initial_interval = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_initial_interval( - mut self, - input: std::option::Option, - ) -> Self { - self.initial_interval = input; - self - } - /// Consumes the builder and constructs a [`TraefikMiddlewareRetry`](crate::model::TraefikMiddlewareRetry) - pub fn build(self) -> crate::model::TraefikMiddlewareRetry { - crate::model::TraefikMiddlewareRetry { - attempts: self.attempts, - initial_interval: self.initial_interval, - } - } - } -} -impl TraefikMiddlewareRetry { - /// Creates a new builder-style object to manufacture [`TraefikMiddlewareRetry`](crate::model::TraefikMiddlewareRetry) - pub fn builder() -> crate::model::traefik_middleware_retry::Builder { - crate::model::traefik_middleware_retry::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct TraefikMiddlewareInFlightReq { - /// Unsigned 32 bit integer. - pub amount: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub source_criterion: std::option::Option, -} -impl TraefikMiddlewareInFlightReq { - /// Unsigned 32 bit integer. - pub fn amount(&self) -> std::option::Option { - self.amount - } - #[allow(missing_docs)] // documentation missing in model - pub fn source_criterion( - &self, - ) -> std::option::Option<&crate::model::TraefikInFlightReqSourceCriterion> { - self.source_criterion.as_ref() - } -} -impl std::fmt::Debug for TraefikMiddlewareInFlightReq { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("TraefikMiddlewareInFlightReq"); - formatter.field("amount", &self.amount); - formatter.field("source_criterion", &self.source_criterion); - formatter.finish() - } -} -/// See [`TraefikMiddlewareInFlightReq`](crate::model::TraefikMiddlewareInFlightReq) -pub mod traefik_middleware_in_flight_req { - /// A builder for [`TraefikMiddlewareInFlightReq`](crate::model::TraefikMiddlewareInFlightReq) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) amount: std::option::Option, - pub(crate) source_criterion: - std::option::Option, - } - impl Builder { - /// Unsigned 32 bit integer. - pub fn amount(mut self, input: i32) -> Self { - self.amount = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_amount(mut self, input: std::option::Option) -> Self { - self.amount = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn source_criterion( - mut self, - input: crate::model::TraefikInFlightReqSourceCriterion, - ) -> Self { - self.source_criterion = Some(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_source_criterion( - mut self, - input: std::option::Option, - ) -> Self { - self.source_criterion = input; - self - } - /// Consumes the builder and constructs a [`TraefikMiddlewareInFlightReq`](crate::model::TraefikMiddlewareInFlightReq) - pub fn build(self) -> crate::model::TraefikMiddlewareInFlightReq { - crate::model::TraefikMiddlewareInFlightReq { - amount: self.amount, - source_criterion: self.source_criterion, - } - } - } -} -impl TraefikMiddlewareInFlightReq { - /// Creates a new builder-style object to manufacture [`TraefikMiddlewareInFlightReq`](crate::model::TraefikMiddlewareInFlightReq) - pub fn builder() -> crate::model::traefik_middleware_in_flight_req::Builder { - crate::model::traefik_middleware_in_flight_req::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] -pub enum TraefikInFlightReqSourceCriterion { - #[allow(missing_docs)] // documentation missing in model - IpStrategy(crate::model::TraefikIpStrategy), - #[allow(missing_docs)] // documentation missing in model - RequestHeaderName(crate::model::TraefikInFlightReqSourceCriterionRequestHeaderName), - #[allow(missing_docs)] // documentation missing in model - RequestHost(crate::model::Unit), - /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version. - /// An unknown enum variant - /// - /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._ - /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized - /// by the client. This can happen when the server adds new functionality, but the client has not been updated. - /// To investigate this, consider turning on debug logging to print the raw HTTP response. - #[non_exhaustive] - Unknown, -} -impl TraefikInFlightReqSourceCriterion { - /// Tries to convert the enum instance into [`IpStrategy`](crate::model::TraefikInFlightReqSourceCriterion::IpStrategy), extracting the inner [`TraefikIpStrategy`](crate::model::TraefikIpStrategy). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_ip_strategy(&self) -> std::result::Result<&crate::model::TraefikIpStrategy, &Self> { - if let TraefikInFlightReqSourceCriterion::IpStrategy(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`IpStrategy`](crate::model::TraefikInFlightReqSourceCriterion::IpStrategy). - pub fn is_ip_strategy(&self) -> bool { - self.as_ip_strategy().is_ok() - } - /// Tries to convert the enum instance into [`RequestHeaderName`](crate::model::TraefikInFlightReqSourceCriterion::RequestHeaderName), extracting the inner [`TraefikInFlightReqSourceCriterionRequestHeaderName`](crate::model::TraefikInFlightReqSourceCriterionRequestHeaderName). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_request_header_name( - &self, - ) -> std::result::Result<&crate::model::TraefikInFlightReqSourceCriterionRequestHeaderName, &Self> - { - if let TraefikInFlightReqSourceCriterion::RequestHeaderName(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`RequestHeaderName`](crate::model::TraefikInFlightReqSourceCriterion::RequestHeaderName). - pub fn is_request_header_name(&self) -> bool { - self.as_request_header_name().is_ok() - } - /// Tries to convert the enum instance into [`RequestHost`](crate::model::TraefikInFlightReqSourceCriterion::RequestHost), extracting the inner [`Unit`](crate::model::Unit). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_request_host(&self) -> std::result::Result<&crate::model::Unit, &Self> { - if let TraefikInFlightReqSourceCriterion::RequestHost(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`RequestHost`](crate::model::TraefikInFlightReqSourceCriterion::RequestHost). - pub fn is_request_host(&self) -> bool { - self.as_request_host().is_ok() - } - /// Returns true if the enum instance is the `Unknown` variant. - pub fn is_unknown(&self) -> bool { - matches!(self, Self::Unknown) - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct TraefikInFlightReqSourceCriterionRequestHeaderName { - #[allow(missing_docs)] // documentation missing in model - pub request_header_name: std::option::Option, -} -impl TraefikInFlightReqSourceCriterionRequestHeaderName { - #[allow(missing_docs)] // documentation missing in model - pub fn request_header_name(&self) -> std::option::Option<&str> { - self.request_header_name.as_deref() - } -} -impl std::fmt::Debug for TraefikInFlightReqSourceCriterionRequestHeaderName { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("TraefikInFlightReqSourceCriterionRequestHeaderName"); - formatter.field("request_header_name", &self.request_header_name); - formatter.finish() - } -} -/// See [`TraefikInFlightReqSourceCriterionRequestHeaderName`](crate::model::TraefikInFlightReqSourceCriterionRequestHeaderName) -pub mod traefik_in_flight_req_source_criterion_request_header_name { - /// A builder for [`TraefikInFlightReqSourceCriterionRequestHeaderName`](crate::model::TraefikInFlightReqSourceCriterionRequestHeaderName) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) request_header_name: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn request_header_name(mut self, input: impl Into) -> Self { - self.request_header_name = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_request_header_name( - mut self, - input: std::option::Option, - ) -> Self { - self.request_header_name = input; - self - } - /// Consumes the builder and constructs a [`TraefikInFlightReqSourceCriterionRequestHeaderName`](crate::model::TraefikInFlightReqSourceCriterionRequestHeaderName) - pub fn build(self) -> crate::model::TraefikInFlightReqSourceCriterionRequestHeaderName { - crate::model::TraefikInFlightReqSourceCriterionRequestHeaderName { - request_header_name: self.request_header_name, - } - } - } -} -impl TraefikInFlightReqSourceCriterionRequestHeaderName { - /// Creates a new builder-style object to manufacture [`TraefikInFlightReqSourceCriterionRequestHeaderName`](crate::model::TraefikInFlightReqSourceCriterionRequestHeaderName) - pub fn builder( - ) -> crate::model::traefik_in_flight_req_source_criterion_request_header_name::Builder { - crate::model::traefik_in_flight_req_source_criterion_request_header_name::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct TraefikIpStrategy { - /// Unsigned 32 bit integer. - pub depth: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub exclude_i_ps: std::option::Option>, -} -impl TraefikIpStrategy { - /// Unsigned 32 bit integer. - pub fn depth(&self) -> std::option::Option { - self.depth - } - #[allow(missing_docs)] // documentation missing in model - pub fn exclude_i_ps(&self) -> std::option::Option<&[std::string::String]> { - self.exclude_i_ps.as_deref() - } -} -impl std::fmt::Debug for TraefikIpStrategy { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("TraefikIpStrategy"); - formatter.field("depth", &self.depth); - formatter.field("exclude_i_ps", &self.exclude_i_ps); - formatter.finish() - } -} -/// See [`TraefikIpStrategy`](crate::model::TraefikIpStrategy) -pub mod traefik_ip_strategy { - /// A builder for [`TraefikIpStrategy`](crate::model::TraefikIpStrategy) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) depth: std::option::Option, - pub(crate) exclude_i_ps: std::option::Option>, - } - impl Builder { - /// Unsigned 32 bit integer. - pub fn depth(mut self, input: i32) -> Self { - self.depth = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_depth(mut self, input: std::option::Option) -> Self { - self.depth = input; - self - } - /// Appends an item to `exclude_i_ps`. - /// - /// To override the contents of this collection use [`set_exclude_i_ps`](Self::set_exclude_i_ps). - /// - pub fn exclude_i_ps(mut self, input: impl Into) -> Self { - let mut v = self.exclude_i_ps.unwrap_or_default(); - v.push(input.into()); - self.exclude_i_ps = Some(v); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_exclude_i_ps( - mut self, - input: std::option::Option>, - ) -> Self { - self.exclude_i_ps = input; - self - } - /// Consumes the builder and constructs a [`TraefikIpStrategy`](crate::model::TraefikIpStrategy) - pub fn build(self) -> crate::model::TraefikIpStrategy { - crate::model::TraefikIpStrategy { - depth: self.depth, - exclude_i_ps: self.exclude_i_ps, - } - } - } -} -impl TraefikIpStrategy { - /// Creates a new builder-style object to manufacture [`TraefikIpStrategy`](crate::model::TraefikIpStrategy) - pub fn builder() -> crate::model::traefik_ip_strategy::Builder { - crate::model::traefik_ip_strategy::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct TraefikMiddlewareRateLimit { - /// Unsigned 32 bit integer. - pub average: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub period: std::option::Option, - /// Unsigned 32 bit integer. - pub burst: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub source_criterion: std::option::Option, -} -impl TraefikMiddlewareRateLimit { - /// Unsigned 32 bit integer. - pub fn average(&self) -> std::option::Option { - self.average - } - #[allow(missing_docs)] // documentation missing in model - pub fn period(&self) -> std::option::Option<&str> { - self.period.as_deref() - } - /// Unsigned 32 bit integer. - pub fn burst(&self) -> std::option::Option { - self.burst - } - #[allow(missing_docs)] // documentation missing in model - pub fn source_criterion( - &self, - ) -> std::option::Option<&crate::model::TraefikInFlightReqSourceCriterion> { - self.source_criterion.as_ref() - } -} -impl std::fmt::Debug for TraefikMiddlewareRateLimit { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("TraefikMiddlewareRateLimit"); - formatter.field("average", &self.average); - formatter.field("period", &self.period); - formatter.field("burst", &self.burst); - formatter.field("source_criterion", &self.source_criterion); - formatter.finish() - } -} -/// See [`TraefikMiddlewareRateLimit`](crate::model::TraefikMiddlewareRateLimit) -pub mod traefik_middleware_rate_limit { - /// A builder for [`TraefikMiddlewareRateLimit`](crate::model::TraefikMiddlewareRateLimit) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) average: std::option::Option, - pub(crate) period: std::option::Option, - pub(crate) burst: std::option::Option, - pub(crate) source_criterion: - std::option::Option, - } - impl Builder { - /// Unsigned 32 bit integer. - pub fn average(mut self, input: i32) -> Self { - self.average = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_average(mut self, input: std::option::Option) -> Self { - self.average = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn period(mut self, input: impl Into) -> Self { - self.period = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_period(mut self, input: std::option::Option) -> Self { - self.period = input; - self - } - /// Unsigned 32 bit integer. - pub fn burst(mut self, input: i32) -> Self { - self.burst = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_burst(mut self, input: std::option::Option) -> Self { - self.burst = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn source_criterion( - mut self, - input: crate::model::TraefikInFlightReqSourceCriterion, - ) -> Self { - self.source_criterion = Some(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_source_criterion( - mut self, - input: std::option::Option, - ) -> Self { - self.source_criterion = input; - self - } - /// Consumes the builder and constructs a [`TraefikMiddlewareRateLimit`](crate::model::TraefikMiddlewareRateLimit) - pub fn build(self) -> crate::model::TraefikMiddlewareRateLimit { - crate::model::TraefikMiddlewareRateLimit { - average: self.average, - period: self.period, - burst: self.burst, - source_criterion: self.source_criterion, - } - } - } -} -impl TraefikMiddlewareRateLimit { - /// Creates a new builder-style object to manufacture [`TraefikMiddlewareRateLimit`](crate::model::TraefikMiddlewareRateLimit) - pub fn builder() -> crate::model::traefik_middleware_rate_limit::Builder { - crate::model::traefik_middleware_rate_limit::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct TraefikMiddlewareAddPrefix { - #[allow(missing_docs)] // documentation missing in model - pub prefix: std::option::Option, -} -impl TraefikMiddlewareAddPrefix { - #[allow(missing_docs)] // documentation missing in model - pub fn prefix(&self) -> std::option::Option<&str> { - self.prefix.as_deref() - } -} -impl std::fmt::Debug for TraefikMiddlewareAddPrefix { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("TraefikMiddlewareAddPrefix"); - formatter.field("prefix", &self.prefix); - formatter.finish() - } -} -/// See [`TraefikMiddlewareAddPrefix`](crate::model::TraefikMiddlewareAddPrefix) -pub mod traefik_middleware_add_prefix { - /// A builder for [`TraefikMiddlewareAddPrefix`](crate::model::TraefikMiddlewareAddPrefix) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) prefix: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn prefix(mut self, input: impl Into) -> Self { - self.prefix = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_prefix(mut self, input: std::option::Option) -> Self { - self.prefix = input; - self - } - /// Consumes the builder and constructs a [`TraefikMiddlewareAddPrefix`](crate::model::TraefikMiddlewareAddPrefix) - pub fn build(self) -> crate::model::TraefikMiddlewareAddPrefix { - crate::model::TraefikMiddlewareAddPrefix { - prefix: self.prefix, - } - } - } -} -impl TraefikMiddlewareAddPrefix { - /// Creates a new builder-style object to manufacture [`TraefikMiddlewareAddPrefix`](crate::model::TraefikMiddlewareAddPrefix) - pub fn builder() -> crate::model::traefik_middleware_add_prefix::Builder { - crate::model::traefik_middleware_add_prefix::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct TraefikMiddlewareStripPrefix { - #[allow(missing_docs)] // documentation missing in model - pub prefixes: std::option::Option>, - #[allow(missing_docs)] // documentation missing in model - pub force_slash: std::option::Option, -} -impl TraefikMiddlewareStripPrefix { - #[allow(missing_docs)] // documentation missing in model - pub fn prefixes(&self) -> std::option::Option<&[std::string::String]> { - self.prefixes.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn force_slash(&self) -> std::option::Option { - self.force_slash - } -} -impl std::fmt::Debug for TraefikMiddlewareStripPrefix { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("TraefikMiddlewareStripPrefix"); - formatter.field("prefixes", &self.prefixes); - formatter.field("force_slash", &self.force_slash); - formatter.finish() - } -} -/// See [`TraefikMiddlewareStripPrefix`](crate::model::TraefikMiddlewareStripPrefix) -pub mod traefik_middleware_strip_prefix { - /// A builder for [`TraefikMiddlewareStripPrefix`](crate::model::TraefikMiddlewareStripPrefix) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) prefixes: std::option::Option>, - pub(crate) force_slash: std::option::Option, - } - impl Builder { - /// Appends an item to `prefixes`. - /// - /// To override the contents of this collection use [`set_prefixes`](Self::set_prefixes). - /// - pub fn prefixes(mut self, input: impl Into) -> Self { - let mut v = self.prefixes.unwrap_or_default(); - v.push(input.into()); - self.prefixes = Some(v); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_prefixes( - mut self, - input: std::option::Option>, - ) -> Self { - self.prefixes = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn force_slash(mut self, input: bool) -> Self { - self.force_slash = Some(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_force_slash(mut self, input: std::option::Option) -> Self { - self.force_slash = input; - self - } - /// Consumes the builder and constructs a [`TraefikMiddlewareStripPrefix`](crate::model::TraefikMiddlewareStripPrefix) - pub fn build(self) -> crate::model::TraefikMiddlewareStripPrefix { - crate::model::TraefikMiddlewareStripPrefix { - prefixes: self.prefixes, - force_slash: self.force_slash, - } - } - } -} -impl TraefikMiddlewareStripPrefix { - /// Creates a new builder-style object to manufacture [`TraefikMiddlewareStripPrefix`](crate::model::TraefikMiddlewareStripPrefix) - pub fn builder() -> crate::model::traefik_middleware_strip_prefix::Builder { - crate::model::traefik_middleware_strip_prefix::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct TraefikMiddlewareReplacePathRegex { - #[allow(missing_docs)] // documentation missing in model - pub regex: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub replacement: std::option::Option, -} -impl TraefikMiddlewareReplacePathRegex { - #[allow(missing_docs)] // documentation missing in model - pub fn regex(&self) -> std::option::Option<&str> { - self.regex.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn replacement(&self) -> std::option::Option<&str> { - self.replacement.as_deref() - } -} -impl std::fmt::Debug for TraefikMiddlewareReplacePathRegex { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("TraefikMiddlewareReplacePathRegex"); - formatter.field("regex", &self.regex); - formatter.field("replacement", &self.replacement); - formatter.finish() - } -} -/// See [`TraefikMiddlewareReplacePathRegex`](crate::model::TraefikMiddlewareReplacePathRegex) -pub mod traefik_middleware_replace_path_regex { - /// A builder for [`TraefikMiddlewareReplacePathRegex`](crate::model::TraefikMiddlewareReplacePathRegex) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) regex: std::option::Option, - pub(crate) replacement: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn regex(mut self, input: impl Into) -> Self { - self.regex = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_regex(mut self, input: std::option::Option) -> Self { - self.regex = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn replacement(mut self, input: impl Into) -> Self { - self.replacement = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_replacement(mut self, input: std::option::Option) -> Self { - self.replacement = input; - self - } - /// Consumes the builder and constructs a [`TraefikMiddlewareReplacePathRegex`](crate::model::TraefikMiddlewareReplacePathRegex) - pub fn build(self) -> crate::model::TraefikMiddlewareReplacePathRegex { - crate::model::TraefikMiddlewareReplacePathRegex { - regex: self.regex, - replacement: self.replacement, - } - } - } -} -impl TraefikMiddlewareReplacePathRegex { - /// Creates a new builder-style object to manufacture [`TraefikMiddlewareReplacePathRegex`](crate::model::TraefikMiddlewareReplacePathRegex) - pub fn builder() -> crate::model::traefik_middleware_replace_path_regex::Builder { - crate::model::traefik_middleware_replace_path_regex::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct TraefikMiddlewareIpWhiteList { - #[allow(missing_docs)] // documentation missing in model - pub source_range: std::option::Option>, - #[allow(missing_docs)] // documentation missing in model - pub ip_strategy: std::option::Option, -} -impl TraefikMiddlewareIpWhiteList { - #[allow(missing_docs)] // documentation missing in model - pub fn source_range(&self) -> std::option::Option<&[std::string::String]> { - self.source_range.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn ip_strategy(&self) -> std::option::Option<&crate::model::TraefikIpStrategy> { - self.ip_strategy.as_ref() - } -} -impl std::fmt::Debug for TraefikMiddlewareIpWhiteList { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("TraefikMiddlewareIpWhiteList"); - formatter.field("source_range", &self.source_range); - formatter.field("ip_strategy", &self.ip_strategy); - formatter.finish() - } -} -/// See [`TraefikMiddlewareIpWhiteList`](crate::model::TraefikMiddlewareIpWhiteList) -pub mod traefik_middleware_ip_white_list { - /// A builder for [`TraefikMiddlewareIpWhiteList`](crate::model::TraefikMiddlewareIpWhiteList) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) source_range: std::option::Option>, - pub(crate) ip_strategy: std::option::Option, - } - impl Builder { - /// Appends an item to `source_range`. - /// - /// To override the contents of this collection use [`set_source_range`](Self::set_source_range). - /// - pub fn source_range(mut self, input: impl Into) -> Self { - let mut v = self.source_range.unwrap_or_default(); - v.push(input.into()); - self.source_range = Some(v); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_source_range( - mut self, - input: std::option::Option>, - ) -> Self { - self.source_range = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn ip_strategy(mut self, input: crate::model::TraefikIpStrategy) -> Self { - self.ip_strategy = Some(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_ip_strategy( - mut self, - input: std::option::Option, - ) -> Self { - self.ip_strategy = input; - self - } - /// Consumes the builder and constructs a [`TraefikMiddlewareIpWhiteList`](crate::model::TraefikMiddlewareIpWhiteList) - pub fn build(self) -> crate::model::TraefikMiddlewareIpWhiteList { - crate::model::TraefikMiddlewareIpWhiteList { - source_range: self.source_range, - ip_strategy: self.ip_strategy, - } - } - } -} -impl TraefikMiddlewareIpWhiteList { - /// Creates a new builder-style object to manufacture [`TraefikMiddlewareIpWhiteList`](crate::model::TraefikMiddlewareIpWhiteList) - pub fn builder() -> crate::model::traefik_middleware_ip_white_list::Builder { - crate::model::traefik_middleware_ip_white_list::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct TraefikMiddlewareChain { - #[allow(missing_docs)] // documentation missing in model - pub middlewares: std::option::Option>, -} -impl TraefikMiddlewareChain { - #[allow(missing_docs)] // documentation missing in model - pub fn middlewares(&self) -> std::option::Option<&[std::string::String]> { - self.middlewares.as_deref() - } -} -impl std::fmt::Debug for TraefikMiddlewareChain { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("TraefikMiddlewareChain"); - formatter.field("middlewares", &self.middlewares); - formatter.finish() - } -} -/// See [`TraefikMiddlewareChain`](crate::model::TraefikMiddlewareChain) -pub mod traefik_middleware_chain { - /// A builder for [`TraefikMiddlewareChain`](crate::model::TraefikMiddlewareChain) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) middlewares: std::option::Option>, - } - impl Builder { - /// Appends an item to `middlewares`. - /// - /// To override the contents of this collection use [`set_middlewares`](Self::set_middlewares). - /// - pub fn middlewares(mut self, input: impl Into) -> Self { - let mut v = self.middlewares.unwrap_or_default(); - v.push(input.into()); - self.middlewares = Some(v); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_middlewares( - mut self, - input: std::option::Option>, - ) -> Self { - self.middlewares = input; - self - } - /// Consumes the builder and constructs a [`TraefikMiddlewareChain`](crate::model::TraefikMiddlewareChain) - pub fn build(self) -> crate::model::TraefikMiddlewareChain { - crate::model::TraefikMiddlewareChain { - middlewares: self.middlewares, - } - } - } -} -impl TraefikMiddlewareChain { - /// Creates a new builder-style object to manufacture [`TraefikMiddlewareChain`](crate::model::TraefikMiddlewareChain) - pub fn builder() -> crate::model::traefik_middleware_chain::Builder { - crate::model::traefik_middleware_chain::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct TraefikRouter { - #[allow(missing_docs)] // documentation missing in model - pub entry_points: std::option::Option>, - #[allow(missing_docs)] // documentation missing in model - pub rule: std::option::Option, - /// Unsigned 32 bit integer. - pub priority: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub service: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub middlewares: std::option::Option>, - #[allow(missing_docs)] // documentation missing in model - pub tls: std::option::Option, -} -impl TraefikRouter { - #[allow(missing_docs)] // documentation missing in model - pub fn entry_points(&self) -> std::option::Option<&[std::string::String]> { - self.entry_points.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn rule(&self) -> std::option::Option<&str> { - self.rule.as_deref() - } - /// Unsigned 32 bit integer. - pub fn priority(&self) -> std::option::Option { - self.priority - } - #[allow(missing_docs)] // documentation missing in model - pub fn service(&self) -> std::option::Option<&str> { - self.service.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn middlewares(&self) -> std::option::Option<&[std::string::String]> { - self.middlewares.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn tls(&self) -> std::option::Option<&crate::model::TraefikTls> { - self.tls.as_ref() - } -} -impl std::fmt::Debug for TraefikRouter { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("TraefikRouter"); - formatter.field("entry_points", &self.entry_points); - formatter.field("rule", &self.rule); - formatter.field("priority", &self.priority); - formatter.field("service", &self.service); - formatter.field("middlewares", &self.middlewares); - formatter.field("tls", &self.tls); - formatter.finish() - } -} -/// See [`TraefikRouter`](crate::model::TraefikRouter) -pub mod traefik_router { - /// A builder for [`TraefikRouter`](crate::model::TraefikRouter) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) entry_points: std::option::Option>, - pub(crate) rule: std::option::Option, - pub(crate) priority: std::option::Option, - pub(crate) service: std::option::Option, - pub(crate) middlewares: std::option::Option>, - pub(crate) tls: std::option::Option, - } - impl Builder { - /// Appends an item to `entry_points`. - /// - /// To override the contents of this collection use [`set_entry_points`](Self::set_entry_points). - /// - pub fn entry_points(mut self, input: impl Into) -> Self { - let mut v = self.entry_points.unwrap_or_default(); - v.push(input.into()); - self.entry_points = Some(v); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_entry_points( - mut self, - input: std::option::Option>, - ) -> Self { - self.entry_points = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn rule(mut self, input: impl Into) -> Self { - self.rule = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_rule(mut self, input: std::option::Option) -> Self { - self.rule = input; - self - } - /// Unsigned 32 bit integer. - pub fn priority(mut self, input: i32) -> Self { - self.priority = Some(input); - self - } - /// Unsigned 32 bit integer. - pub fn set_priority(mut self, input: std::option::Option) -> Self { - self.priority = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn service(mut self, input: impl Into) -> Self { - self.service = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_service(mut self, input: std::option::Option) -> Self { - self.service = input; - self - } - /// Appends an item to `middlewares`. - /// - /// To override the contents of this collection use [`set_middlewares`](Self::set_middlewares). - /// - pub fn middlewares(mut self, input: impl Into) -> Self { - let mut v = self.middlewares.unwrap_or_default(); - v.push(input.into()); - self.middlewares = Some(v); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_middlewares( - mut self, - input: std::option::Option>, - ) -> Self { - self.middlewares = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn tls(mut self, input: crate::model::TraefikTls) -> Self { - self.tls = Some(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_tls(mut self, input: std::option::Option) -> Self { - self.tls = input; - self - } - /// Consumes the builder and constructs a [`TraefikRouter`](crate::model::TraefikRouter) - pub fn build(self) -> crate::model::TraefikRouter { - crate::model::TraefikRouter { - entry_points: self.entry_points, - rule: self.rule, - priority: self.priority, - service: self.service, - middlewares: self.middlewares, - tls: self.tls, - } - } - } -} -impl TraefikRouter { - /// Creates a new builder-style object to manufacture [`TraefikRouter`](crate::model::TraefikRouter) - pub fn builder() -> crate::model::traefik_router::Builder { - crate::model::traefik_router::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct TraefikTls { - #[allow(missing_docs)] // documentation missing in model - pub cert_resolver: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub domains: std::option::Option>, -} -impl TraefikTls { - #[allow(missing_docs)] // documentation missing in model - pub fn cert_resolver(&self) -> std::option::Option<&str> { - self.cert_resolver.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn domains(&self) -> std::option::Option<&[crate::model::TraefikTlsDomain]> { - self.domains.as_deref() - } -} -impl std::fmt::Debug for TraefikTls { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("TraefikTls"); - formatter.field("cert_resolver", &self.cert_resolver); - formatter.field("domains", &self.domains); - formatter.finish() - } -} -/// See [`TraefikTls`](crate::model::TraefikTls) -pub mod traefik_tls { - /// A builder for [`TraefikTls`](crate::model::TraefikTls) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) cert_resolver: std::option::Option, - pub(crate) domains: std::option::Option>, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn cert_resolver(mut self, input: impl Into) -> Self { - self.cert_resolver = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_cert_resolver( - mut self, - input: std::option::Option, - ) -> Self { - self.cert_resolver = input; - self - } - /// Appends an item to `domains`. - /// - /// To override the contents of this collection use [`set_domains`](Self::set_domains). - /// - pub fn domains(mut self, input: crate::model::TraefikTlsDomain) -> Self { - let mut v = self.domains.unwrap_or_default(); - v.push(input); - self.domains = Some(v); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_domains( - mut self, - input: std::option::Option>, - ) -> Self { - self.domains = input; - self - } - /// Consumes the builder and constructs a [`TraefikTls`](crate::model::TraefikTls) - pub fn build(self) -> crate::model::TraefikTls { - crate::model::TraefikTls { - cert_resolver: self.cert_resolver, - domains: self.domains, - } - } - } -} -impl TraefikTls { - /// Creates a new builder-style object to manufacture [`TraefikTls`](crate::model::TraefikTls) - pub fn builder() -> crate::model::traefik_tls::Builder { - crate::model::traefik_tls::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct TraefikTlsDomain { - #[allow(missing_docs)] // documentation missing in model - pub main: std::option::Option, - #[allow(missing_docs)] // documentation missing in model - pub sans: std::option::Option>, -} -impl TraefikTlsDomain { - #[allow(missing_docs)] // documentation missing in model - pub fn main(&self) -> std::option::Option<&str> { - self.main.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn sans(&self) -> std::option::Option<&[std::string::String]> { - self.sans.as_deref() - } -} -impl std::fmt::Debug for TraefikTlsDomain { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("TraefikTlsDomain"); - formatter.field("main", &self.main); - formatter.field("sans", &self.sans); - formatter.finish() - } -} -/// See [`TraefikTlsDomain`](crate::model::TraefikTlsDomain) -pub mod traefik_tls_domain { - /// A builder for [`TraefikTlsDomain`](crate::model::TraefikTlsDomain) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) main: std::option::Option, - pub(crate) sans: std::option::Option>, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn main(mut self, input: impl Into) -> Self { - self.main = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_main(mut self, input: std::option::Option) -> Self { - self.main = input; - self - } - /// Appends an item to `sans`. - /// - /// To override the contents of this collection use [`set_sans`](Self::set_sans). - /// - pub fn sans(mut self, input: impl Into) -> Self { - let mut v = self.sans.unwrap_or_default(); - v.push(input.into()); - self.sans = Some(v); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_sans( - mut self, - input: std::option::Option>, - ) -> Self { - self.sans = input; - self - } - /// Consumes the builder and constructs a [`TraefikTlsDomain`](crate::model::TraefikTlsDomain) - pub fn build(self) -> crate::model::TraefikTlsDomain { - crate::model::TraefikTlsDomain { - main: self.main, - sans: self.sans, - } - } - } -} -impl TraefikTlsDomain { - /// Creates a new builder-style object to manufacture [`TraefikTlsDomain`](crate::model::TraefikTlsDomain) - pub fn builder() -> crate::model::traefik_tls_domain::Builder { - crate::model::traefik_tls_domain::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct TraefikService { - #[allow(missing_docs)] // documentation missing in model - pub load_balancer: std::option::Option, -} -impl TraefikService { - #[allow(missing_docs)] // documentation missing in model - pub fn load_balancer(&self) -> std::option::Option<&crate::model::TraefikLoadBalancer> { - self.load_balancer.as_ref() - } -} -impl std::fmt::Debug for TraefikService { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("TraefikService"); - formatter.field("load_balancer", &self.load_balancer); - formatter.finish() - } -} -/// See [`TraefikService`](crate::model::TraefikService) -pub mod traefik_service { - /// A builder for [`TraefikService`](crate::model::TraefikService) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) load_balancer: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn load_balancer(mut self, input: crate::model::TraefikLoadBalancer) -> Self { - self.load_balancer = Some(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_load_balancer( - mut self, - input: std::option::Option, - ) -> Self { - self.load_balancer = input; - self - } - /// Consumes the builder and constructs a [`TraefikService`](crate::model::TraefikService) - pub fn build(self) -> crate::model::TraefikService { - crate::model::TraefikService { - load_balancer: self.load_balancer, - } - } - } -} -impl TraefikService { - /// Creates a new builder-style object to manufacture [`TraefikService`](crate::model::TraefikService) - pub fn builder() -> crate::model::traefik_service::Builder { - crate::model::traefik_service::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct TraefikLoadBalancer { - #[allow(missing_docs)] // documentation missing in model - pub servers: std::option::Option>, - #[allow(missing_docs)] // documentation missing in model - pub sticky: std::option::Option, -} -impl TraefikLoadBalancer { - #[allow(missing_docs)] // documentation missing in model - pub fn servers(&self) -> std::option::Option<&[crate::model::TraefikServer]> { - self.servers.as_deref() - } - #[allow(missing_docs)] // documentation missing in model - pub fn sticky(&self) -> std::option::Option<&crate::model::TraefikLoadBalancerSticky> { - self.sticky.as_ref() - } -} -impl std::fmt::Debug for TraefikLoadBalancer { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("TraefikLoadBalancer"); - formatter.field("servers", &self.servers); - formatter.field("sticky", &self.sticky); - formatter.finish() - } -} -/// See [`TraefikLoadBalancer`](crate::model::TraefikLoadBalancer) -pub mod traefik_load_balancer { - /// A builder for [`TraefikLoadBalancer`](crate::model::TraefikLoadBalancer) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) servers: std::option::Option>, - pub(crate) sticky: std::option::Option, - } - impl Builder { - /// Appends an item to `servers`. - /// - /// To override the contents of this collection use [`set_servers`](Self::set_servers). - /// - pub fn servers(mut self, input: crate::model::TraefikServer) -> Self { - let mut v = self.servers.unwrap_or_default(); - v.push(input); - self.servers = Some(v); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_servers( - mut self, - input: std::option::Option>, - ) -> Self { - self.servers = input; - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn sticky(mut self, input: crate::model::TraefikLoadBalancerSticky) -> Self { - self.sticky = Some(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_sticky( - mut self, - input: std::option::Option, - ) -> Self { - self.sticky = input; - self - } - /// Consumes the builder and constructs a [`TraefikLoadBalancer`](crate::model::TraefikLoadBalancer) - pub fn build(self) -> crate::model::TraefikLoadBalancer { - crate::model::TraefikLoadBalancer { - servers: self.servers, - sticky: self.sticky, - } - } - } -} -impl TraefikLoadBalancer { - /// Creates a new builder-style object to manufacture [`TraefikLoadBalancer`](crate::model::TraefikLoadBalancer) - pub fn builder() -> crate::model::traefik_load_balancer::Builder { - crate::model::traefik_load_balancer::Builder::default() - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] -pub enum TraefikLoadBalancerSticky { - #[allow(missing_docs)] // documentation missing in model - Cookie(crate::model::Unit), - /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version. - /// An unknown enum variant - /// - /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._ - /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized - /// by the client. This can happen when the server adds new functionality, but the client has not been updated. - /// To investigate this, consider turning on debug logging to print the raw HTTP response. - #[non_exhaustive] - Unknown, -} -impl TraefikLoadBalancerSticky { - #[allow(irrefutable_let_patterns)] - /// Tries to convert the enum instance into [`Cookie`](crate::model::TraefikLoadBalancerSticky::Cookie), extracting the inner [`Unit`](crate::model::Unit). - /// Returns `Err(&Self)` if it can't be converted. - pub fn as_cookie(&self) -> std::result::Result<&crate::model::Unit, &Self> { - if let TraefikLoadBalancerSticky::Cookie(val) = &self { - Ok(val) - } else { - Err(self) - } - } - /// Returns true if this is a [`Cookie`](crate::model::TraefikLoadBalancerSticky::Cookie). - pub fn is_cookie(&self) -> bool { - self.as_cookie().is_ok() - } - /// Returns true if the enum instance is the `Unknown` variant. - pub fn is_unknown(&self) -> bool { - matches!(self, Self::Unknown) - } -} - -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct TraefikServer { - #[allow(missing_docs)] // documentation missing in model - pub url: std::option::Option, -} -impl TraefikServer { - #[allow(missing_docs)] // documentation missing in model - pub fn url(&self) -> std::option::Option<&str> { - self.url.as_deref() - } -} -impl std::fmt::Debug for TraefikServer { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("TraefikServer"); - formatter.field("url", &self.url); - formatter.finish() - } -} -/// See [`TraefikServer`](crate::model::TraefikServer) -pub mod traefik_server { - /// A builder for [`TraefikServer`](crate::model::TraefikServer) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) url: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn url(mut self, input: impl Into) -> Self { - self.url = Some(input.into()); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_url(mut self, input: std::option::Option) -> Self { - self.url = input; - self - } - /// Consumes the builder and constructs a [`TraefikServer`](crate::model::TraefikServer) - pub fn build(self) -> crate::model::TraefikServer { - crate::model::TraefikServer { url: self.url } - } - } -} -impl TraefikServer { - /// Creates a new builder-style object to manufacture [`TraefikServer`](crate::model::TraefikServer) - pub fn builder() -> crate::model::traefik_server::Builder { - crate::model::traefik_server::Builder::default() - } -} diff --git a/lib/smithy-output/api-traefik-provider/rust/rust/src/operation.rs b/lib/smithy-output/api-traefik-provider/rust/rust/src/operation.rs deleted file mode 100644 index cc2aa1c13..000000000 --- a/lib/smithy-output/api-traefik-provider/rust/rust/src/operation.rs +++ /dev/null @@ -1,32 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/// Operation shape for `TraefikConfig`. -/// -/// This is usually constructed for you using the the fluent builder returned by -/// [`traefik_config`](crate::client::Client::traefik_config). -/// -/// See [`crate::client::fluent_builders::TraefikConfig`] for more details about the operation. -#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)] -pub struct TraefikConfig { - _private: (), -} -impl TraefikConfig { - /// Creates a new builder-style object to manufacture [`TraefikConfigInput`](crate::input::TraefikConfigInput) - pub fn builder() -> crate::input::traefik_config_input::Builder { - crate::input::traefik_config_input::Builder::default() - } - /// Creates a new `TraefikConfig` operation. - pub fn new() -> Self { - Self { _private: () } - } -} -impl aws_smithy_http::response::ParseStrictResponse for TraefikConfig { - type Output = - std::result::Result; - fn parse(&self, response: &http::Response) -> Self::Output { - if !response.status().is_success() && response.status().as_u16() != 200 { - crate::operation_deser::parse_traefik_config_error(response) - } else { - crate::operation_deser::parse_traefik_config_response(response) - } - } -} diff --git a/lib/smithy-output/api-traefik-provider/rust/rust/src/operation_deser.rs b/lib/smithy-output/api-traefik-provider/rust/rust/src/operation_deser.rs deleted file mode 100644 index 294f02f8f..000000000 --- a/lib/smithy-output/api-traefik-provider/rust/rust/src/operation_deser.rs +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[allow(clippy::unnecessary_wraps)] -pub fn parse_traefik_config_error( - response: &http::Response, -) -> std::result::Result { - let generic = crate::json_deser::parse_http_generic_error(response) - .map_err(crate::error::TraefikConfigError::unhandled)?; - let error_code = match generic.code() { - Some(code) => code, - None => return Err(crate::error::TraefikConfigError::unhandled(generic)), - }; - - let _error_message = generic.message().map(|msg| msg.to_owned()); - Err(match error_code { - "InternalError" => crate::error::TraefikConfigError { - meta: generic, - kind: crate::error::TraefikConfigErrorKind::InternalError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::internal_error::Builder::default(); - let _ = response; - output = - crate::json_deser::deser_structure_crate_error_internal_error_json_err( - response.body().as_ref(), - output, - ) - .map_err(crate::error::TraefikConfigError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - }, - "RateLimitError" => { - crate::error::TraefikConfigError { - meta: generic, - kind: crate::error::TraefikConfigErrorKind::RateLimitError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::rate_limit_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_rate_limit_error_json_err(response.body().as_ref(), output).map_err(crate::error::TraefikConfigError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "ForbiddenError" => { - crate::error::TraefikConfigError { - meta: generic, - kind: crate::error::TraefikConfigErrorKind::ForbiddenError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::forbidden_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_forbidden_error_json_err(response.body().as_ref(), output).map_err(crate::error::TraefikConfigError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "UnauthorizedError" => { - crate::error::TraefikConfigError { - meta: generic, - kind: crate::error::TraefikConfigErrorKind::UnauthorizedError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::unauthorized_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::TraefikConfigError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "NotFoundError" => { - crate::error::TraefikConfigError { - meta: generic, - kind: crate::error::TraefikConfigErrorKind::NotFoundError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::not_found_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::TraefikConfigError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - "BadRequestError" => { - crate::error::TraefikConfigError { - meta: generic, - kind: crate::error::TraefikConfigErrorKind::BadRequestError({ - #[allow(unused_mut)] - let mut tmp = { - #[allow(unused_mut)] - let mut output = crate::error::bad_request_error::Builder::default(); - let _ = response; - output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::TraefikConfigError::unhandled)?; - output.build() - }; - if (&tmp.message).is_none() { - tmp.message = _error_message; - } - tmp - }), - } - } - _ => crate::error::TraefikConfigError::generic(generic), - }) -} - -#[allow(clippy::unnecessary_wraps)] -pub fn parse_traefik_config_response( - response: &http::Response, -) -> std::result::Result { - Ok({ - #[allow(unused_mut)] - let mut output = crate::output::traefik_config_output::Builder::default(); - let _ = response; - output = crate::json_deser::deser_operation_crate_operation_traefik_config( - response.body().as_ref(), - output, - ) - .map_err(crate::error::TraefikConfigError::unhandled)?; - output.build() - }) -} diff --git a/lib/smithy-output/api-traefik-provider/rust/rust/src/output.rs b/lib/smithy-output/api-traefik-provider/rust/rust/src/output.rs deleted file mode 100644 index 3b4412b3b..000000000 --- a/lib/smithy-output/api-traefik-provider/rust/rust/src/output.rs +++ /dev/null @@ -1,55 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -#[allow(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(std::clone::Clone, std::cmp::PartialEq)] -pub struct TraefikConfigOutput { - #[allow(missing_docs)] // documentation missing in model - pub http: std::option::Option, -} -impl TraefikConfigOutput { - #[allow(missing_docs)] // documentation missing in model - pub fn http(&self) -> std::option::Option<&crate::model::TraefikHttpNullified> { - self.http.as_ref() - } -} -impl std::fmt::Debug for TraefikConfigOutput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut formatter = f.debug_struct("TraefikConfigOutput"); - formatter.field("http", &self.http); - formatter.finish() - } -} -/// See [`TraefikConfigOutput`](crate::output::TraefikConfigOutput) -pub mod traefik_config_output { - /// A builder for [`TraefikConfigOutput`](crate::output::TraefikConfigOutput) - #[non_exhaustive] - #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] - pub struct Builder { - pub(crate) http: std::option::Option, - } - impl Builder { - #[allow(missing_docs)] // documentation missing in model - pub fn http(mut self, input: crate::model::TraefikHttpNullified) -> Self { - self.http = Some(input); - self - } - #[allow(missing_docs)] // documentation missing in model - pub fn set_http( - mut self, - input: std::option::Option, - ) -> Self { - self.http = input; - self - } - /// Consumes the builder and constructs a [`TraefikConfigOutput`](crate::output::TraefikConfigOutput) - pub fn build(self) -> crate::output::TraefikConfigOutput { - crate::output::TraefikConfigOutput { http: self.http } - } - } -} -impl TraefikConfigOutput { - /// Creates a new builder-style object to manufacture [`TraefikConfigOutput`](crate::output::TraefikConfigOutput) - pub fn builder() -> crate::output::traefik_config_output::Builder { - crate::output::traefik_config_output::Builder::default() - } -}