diff --git a/Cargo.lock b/Cargo.lock index 9b4cda2bbf..5ab1b4468d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -87,7 +87,7 @@ checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "amzn-codewhisperer-client" -version = "0.1.8646" +version = "0.1.8702" dependencies = [ "aws-credential-types", "aws-runtime", @@ -106,7 +106,7 @@ dependencies = [ [[package]] name = "amzn-codewhisperer-streaming-client" -version = "0.1.8200" +version = "0.1.8702" dependencies = [ "aws-credential-types", "aws-runtime", @@ -125,7 +125,7 @@ dependencies = [ [[package]] name = "amzn-consolas-client" -version = "0.1.8200" +version = "0.1.8702" dependencies = [ "aws-credential-types", "aws-runtime", @@ -144,7 +144,7 @@ dependencies = [ [[package]] name = "amzn-qdeveloper-streaming-client" -version = "0.1.8200" +version = "0.1.8702" dependencies = [ "aws-credential-types", "aws-runtime", @@ -201,24 +201,6 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" -[[package]] -name = "anndists" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4747593401c8d692fb589ac2a208a27ef968b95f9392af837728933348fc199c" -dependencies = [ - "anyhow", - "cfg-if", - "cpu-time", - "env_logger 0.10.2", - "lazy_static", - "log", - "num-traits", - "num_cpus", - "rand 0.8.5", - "rayon", -] - [[package]] name = "anstream" version = "0.6.18" @@ -1136,12 +1118,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - [[package]] name = "base64" version = "0.21.7" @@ -1240,30 +1216,15 @@ dependencies = [ "syn 2.0.101", ] -[[package]] -name = "bit-set" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec 0.6.3", -] - [[package]] name = "bit-set" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" dependencies = [ - "bit-vec 0.8.0", + "bit-vec", ] -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - [[package]] name = "bit-vec" version = "0.8.0" @@ -1343,21 +1304,6 @@ dependencies = [ "piper", ] -[[package]] -name = "bm25" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9874599901ae2aaa19b1485145be2fa4e9af42d1b127672a03a7099ab6350bac" -dependencies = [ - "cached", - "deunicode", - "fxhash", - "rust-stemmers", - "stop-words", - "unicode-segmentation", - "whichlang", -] - [[package]] name = "bs58" version = "0.5.1" @@ -1395,20 +1341,6 @@ name = "bytemuck" version = "1.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9134a6ef01ce4b366b50689c94f82c14bc72bc5d0386829828a2e2752ef7958c" -dependencies = [ - "bytemuck_derive", -] - -[[package]] -name = "bytemuck_derive" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ecc273b49b3205b83d648f0690daa588925572cc5063745bfe547fe7ec8e1a1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.101", -] [[package]] name = "byteorder" @@ -1438,39 +1370,6 @@ dependencies = [ "either", ] -[[package]] -name = "cached" -version = "0.55.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0839c297f8783316fcca9d90344424e968395413f0662a5481f79c6648bbc14" -dependencies = [ - "ahash", - "cached_proc_macro", - "cached_proc_macro_types", - "hashbrown 0.14.5", - "once_cell", - "thiserror 2.0.12", - "web-time", -] - -[[package]] -name = "cached_proc_macro" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "673992d934f0711b68ebb3e1b79cdc4be31634b37c98f26867ced0438ca5c603" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 2.0.101", -] - -[[package]] -name = "cached_proc_macro_types" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade8366b8bd5ba243f0a58f036cc0ca8a2f069cff1a2351ef1cac6b083e16fc0" - [[package]] name = "cairo-rs" version = "0.18.5" @@ -1505,62 +1404,6 @@ dependencies = [ "serde", ] -[[package]] -name = "candle-core" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9f51e2ecf6efe9737af8f993433c839f956d2b6ed4fd2dd4a7c6d8b0fa667ff" -dependencies = [ - "byteorder", - "gemm 0.17.1", - "half", - "memmap2", - "num-traits", - "num_cpus", - "rand 0.9.1", - "rand_distr", - "rayon", - "safetensors", - "thiserror 1.0.69", - "ug", - "yoke 0.7.5", - "zip", -] - -[[package]] -name = "candle-nn" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1980d53280c8f9e2c6cbe1785855d7ff8010208b46e21252b978badf13ad69d" -dependencies = [ - "candle-core", - "half", - "num-traits", - "rayon", - "safetensors", - "serde", - "thiserror 1.0.69", -] - -[[package]] -name = "candle-transformers" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "186cb80045dbe47e0b387ea6d3e906f02fb3056297080d9922984c90e90a72b0" -dependencies = [ - "byteorder", - "candle-core", - "candle-nn", - "fancy-regex 0.13.0", - "num-traits", - "rand 0.9.1", - "rayon", - "serde", - "serde_json", - "serde_plain", - "tracing", -] - [[package]] name = "cast" version = "0.3.0" @@ -2152,16 +1995,6 @@ dependencies = [ "libc", ] -[[package]] -name = "cpu-time" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9e393a7668fe1fad3075085b86c781883000b4ede868f43627b34a87c8b7ded" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "cpufeatures" version = "0.2.17" @@ -2499,12 +2332,6 @@ dependencies = [ "syn 2.0.101", ] -[[package]] -name = "deunicode" -version = "1.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abd57806937c9cc163efc8ea3910e00a62e2aeb0b8119f1793a978088f8f6b04" - [[package]] name = "dialoguer" version = "0.11.0" @@ -2727,25 +2554,6 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" -[[package]] -name = "dyn-stack" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e53799688f5632f364f8fb387488dd05db9fe45db7011be066fc20e7027f8b" -dependencies = [ - "bytemuck", - "reborrow", -] - -[[package]] -name = "dyn-stack" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "490bd48eb68fffcfed519b4edbfd82c69cbe741d175b84f0e0cbe8c57cbe0bdd" -dependencies = [ - "bytemuck", -] - [[package]] name = "either" version = "1.15.0" @@ -2779,18 +2587,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" -[[package]] -name = "enum-as-inner" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" -dependencies = [ - "heck 0.5.0", - "proc-macro2", - "quote", - "syn 2.0.101", -] - [[package]] name = "enumflags2" version = "0.7.11" @@ -2828,19 +2624,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7f84e12ccf0a7ddc17a6c41c93326024c42920d7ee630d04950e6926645c0fe" -[[package]] -name = "env_logger" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" -dependencies = [ - "humantime", - "is-terminal", - "log", - "regex", - "termcolor", -] - [[package]] name = "env_logger" version = "0.11.8" @@ -2886,15 +2669,6 @@ version = "3.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dea2df4cf52843e0452895c455a1a2cfbb842a1e7329671acf418fdc53ed4c59" -[[package]] -name = "esaxx-rs" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d817e038c30374a4bcb22f94d0a8a0e216958d4c3dcde369b1439fec4bdda6e6" -dependencies = [ - "cc", -] - [[package]] name = "event-listener" version = "5.4.0" @@ -2965,24 +2739,13 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" -[[package]] -name = "fancy-regex" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531e46835a22af56d1e3b66f04844bed63158bc094a628bec1d321d9b4c44bf2" -dependencies = [ - "bit-set 0.5.3", - "regex-automata 0.4.9", - "regex-syntax 0.8.5", -] - [[package]] name = "fancy-regex" version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e24cb5a94bcae1e5408b0effca5cd7172ea3c5755049c5f3af4cd283a165298" dependencies = [ - "bit-set 0.8.0", + "bit-set", "regex-automata 0.4.9", "regex-syntax 0.8.5", ] @@ -4070,243 +3833,6 @@ dependencies = [ "x11", ] -[[package]] -name = "gemm" -version = "0.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ab24cc62135b40090e31a76a9b2766a501979f3070fa27f689c27ec04377d32" -dependencies = [ - "dyn-stack 0.10.0", - "gemm-c32 0.17.1", - "gemm-c64 0.17.1", - "gemm-common 0.17.1", - "gemm-f16 0.17.1", - "gemm-f32 0.17.1", - "gemm-f64 0.17.1", - "num-complex", - "num-traits", - "paste", - "raw-cpuid 10.7.0", - "seq-macro", -] - -[[package]] -name = "gemm" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab96b703d31950f1aeddded248bc95543c9efc7ac9c4a21fda8703a83ee35451" -dependencies = [ - "dyn-stack 0.13.0", - "gemm-c32 0.18.2", - "gemm-c64 0.18.2", - "gemm-common 0.18.2", - "gemm-f16 0.18.2", - "gemm-f32 0.18.2", - "gemm-f64 0.18.2", - "num-complex", - "num-traits", - "paste", - "raw-cpuid 11.5.0", - "seq-macro", -] - -[[package]] -name = "gemm-c32" -version = "0.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9c030d0b983d1e34a546b86e08f600c11696fde16199f971cd46c12e67512c0" -dependencies = [ - "dyn-stack 0.10.0", - "gemm-common 0.17.1", - "num-complex", - "num-traits", - "paste", - "raw-cpuid 10.7.0", - "seq-macro", -] - -[[package]] -name = "gemm-c32" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6db9fd9f40421d00eea9dd0770045a5603b8d684654816637732463f4073847" -dependencies = [ - "dyn-stack 0.13.0", - "gemm-common 0.18.2", - "num-complex", - "num-traits", - "paste", - "raw-cpuid 11.5.0", - "seq-macro", -] - -[[package]] -name = "gemm-c64" -version = "0.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbb5f2e79fefb9693d18e1066a557b4546cd334b226beadc68b11a8f9431852a" -dependencies = [ - "dyn-stack 0.10.0", - "gemm-common 0.17.1", - "num-complex", - "num-traits", - "paste", - "raw-cpuid 10.7.0", - "seq-macro", -] - -[[package]] -name = "gemm-c64" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfcad8a3d35a43758330b635d02edad980c1e143dc2f21e6fd25f9e4eada8edf" -dependencies = [ - "dyn-stack 0.13.0", - "gemm-common 0.18.2", - "num-complex", - "num-traits", - "paste", - "raw-cpuid 11.5.0", - "seq-macro", -] - -[[package]] -name = "gemm-common" -version = "0.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2e7ea062c987abcd8db95db917b4ffb4ecdfd0668471d8dc54734fdff2354e8" -dependencies = [ - "bytemuck", - "dyn-stack 0.10.0", - "half", - "num-complex", - "num-traits", - "once_cell", - "paste", - "pulp 0.18.22", - "raw-cpuid 10.7.0", - "rayon", - "seq-macro", - "sysctl 0.5.5", -] - -[[package]] -name = "gemm-common" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a352d4a69cbe938b9e2a9cb7a3a63b7e72f9349174a2752a558a8a563510d0f3" -dependencies = [ - "bytemuck", - "dyn-stack 0.13.0", - "half", - "libm", - "num-complex", - "num-traits", - "once_cell", - "paste", - "pulp 0.21.5", - "raw-cpuid 11.5.0", - "rayon", - "seq-macro", - "sysctl 0.6.0", -] - -[[package]] -name = "gemm-f16" -version = "0.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ca4c06b9b11952071d317604acb332e924e817bd891bec8dfb494168c7cedd4" -dependencies = [ - "dyn-stack 0.10.0", - "gemm-common 0.17.1", - "gemm-f32 0.17.1", - "half", - "num-complex", - "num-traits", - "paste", - "raw-cpuid 10.7.0", - "rayon", - "seq-macro", -] - -[[package]] -name = "gemm-f16" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff95ae3259432f3c3410eaa919033cd03791d81cebd18018393dc147952e109" -dependencies = [ - "dyn-stack 0.13.0", - "gemm-common 0.18.2", - "gemm-f32 0.18.2", - "half", - "num-complex", - "num-traits", - "paste", - "raw-cpuid 11.5.0", - "rayon", - "seq-macro", -] - -[[package]] -name = "gemm-f32" -version = "0.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9a69f51aaefbd9cf12d18faf273d3e982d9d711f60775645ed5c8047b4ae113" -dependencies = [ - "dyn-stack 0.10.0", - "gemm-common 0.17.1", - "num-complex", - "num-traits", - "paste", - "raw-cpuid 10.7.0", - "seq-macro", -] - -[[package]] -name = "gemm-f32" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc8d3d4385393304f407392f754cd2dc4b315d05063f62cf09f47b58de276864" -dependencies = [ - "dyn-stack 0.13.0", - "gemm-common 0.18.2", - "num-complex", - "num-traits", - "paste", - "raw-cpuid 11.5.0", - "seq-macro", -] - -[[package]] -name = "gemm-f64" -version = "0.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa397a48544fadf0b81ec8741e5c0fba0043008113f71f2034def1935645d2b0" -dependencies = [ - "dyn-stack 0.10.0", - "gemm-common 0.17.1", - "num-complex", - "num-traits", - "paste", - "raw-cpuid 10.7.0", - "seq-macro", -] - -[[package]] -name = "gemm-f64" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35b2a4f76ce4b8b16eadc11ccf2e083252d8237c1b589558a49b0183545015bd" -dependencies = [ - "dyn-stack 0.13.0", - "gemm-common 0.18.2", - "num-complex", - "num-traits", - "paste", - "raw-cpuid 11.5.0", - "seq-macro", -] - [[package]] name = "generator" version = "0.8.5" @@ -4600,12 +4126,8 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "459196ed295495a68f7d7fe1d84f6c4b7ff0e21fe3017b2f283c6fac3ad803c9" dependencies = [ - "bytemuck", "cfg-if", "crunchy", - "num-traits", - "rand 0.9.1", - "rand_distr", ] [[package]] @@ -4630,7 +4152,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", - "allocator-api2", ] [[package]] @@ -4676,12 +4197,6 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - [[package]] name = "hermit-abi" version = "0.4.0" @@ -4700,29 +4215,6 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" -[[package]] -name = "hf-hub" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc03dcb0b0a83ae3f3363ec811014ae669f083e4e499c66602f447c4828737a1" -dependencies = [ - "dirs 5.0.1", - "futures", - "http 1.3.1", - "indicatif", - "libc", - "log", - "num_cpus", - "rand 0.8.5", - "reqwest", - "serde", - "serde_json", - "thiserror 2.0.12", - "tokio", - "ureq", - "windows-sys 0.59.0", -] - [[package]] name = "hmac" version = "0.12.1" @@ -4732,31 +4224,6 @@ dependencies = [ "digest", ] -[[package]] -name = "hnsw_rs" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87e59cf4d04a56c67454ad104938ae4c785bc5db7ac17d27b93e3cb5a9abe6a5" -dependencies = [ - "anndists", - "anyhow", - "bincode", - "cfg-if", - "cpu-time", - "env_logger 0.10.2", - "hashbrown 0.14.5", - "indexmap 2.9.0", - "lazy_static", - "log", - "mmap-rs", - "num-traits", - "num_cpus", - "parking_lot", - "rand 0.8.5", - "rayon", - "serde", -] - [[package]] name = "home" version = "0.5.11" @@ -4848,12 +4315,6 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" -[[package]] -name = "humantime" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b112acc8b3adf4b107a8ec20977da0273a8c386765a3ec0229bd500a1443f9f" - [[package]] name = "hyper" version = "0.14.32" @@ -4986,7 +4447,7 @@ checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" dependencies = [ "displaydoc", "potential_utf", - "yoke 0.8.0", + "yoke", "zerofrom", "zerovec", ] @@ -5058,7 +4519,7 @@ dependencies = [ "stable_deref_trait", "tinystr", "writeable", - "yoke 0.8.0", + "yoke", "zerofrom", "zerotrie", "zerovec", @@ -5283,15 +4744,6 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.12.1" @@ -5558,12 +5010,6 @@ dependencies = [ "windows-targets 0.53.0", ] -[[package]] -name = "libm" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" - [[package]] name = "libmimalloc-sys" version = "0.1.42" @@ -5742,22 +5188,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "macro_rules_attribute" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a82271f7bc033d84bbca59a3ce3e4159938cb08a9c3aebbe54d215131518a13" -dependencies = [ - "macro_rules_attribute-proc_macro", - "paste", -] - -[[package]] -name = "macro_rules_attribute-proc_macro" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8dd856d451cc0da70e2ef2ce95a18e39a93b7558bedf10201ad28503f918568" - [[package]] name = "malloc_buf" version = "0.0.6" @@ -5818,16 +5248,6 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "memmap2" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f" -dependencies = [ - "libc", - "stable_deref_trait", -] - [[package]] name = "memmem" version = "0.1.1" @@ -5843,15 +5263,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "memoffset" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" -dependencies = [ - "autocfg", -] - [[package]] name = "memoffset" version = "0.9.1" @@ -5932,23 +5343,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "mmap-rs" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86968d85441db75203c34deefd0c88032f275aaa85cee19a1dcfff6ae9df56da" -dependencies = [ - "bitflags 1.3.2", - "combine", - "libc", - "mach2", - "nix 0.26.4", - "sysctl 0.5.5", - "thiserror 1.0.69", - "widestring", - "windows 0.48.0", -] - [[package]] name = "mockito" version = "1.7.0" @@ -5995,27 +5389,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "monostate" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aafe1be9d0c75642e3e50fedc7ecadf1ef1cbce6eb66462153fc44245343fbee" -dependencies = [ - "monostate-impl", - "serde", -] - -[[package]] -name = "monostate-impl" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c402a4092d5e204f32c9e155431046831fa712637043c58cb73bc6bc6c9663b5" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.101", -] - [[package]] name = "muda" version = "0.15.3" @@ -6120,19 +5493,6 @@ dependencies = [ "pin-utils", ] -[[package]] -name = "nix" -version = "0.26.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" -dependencies = [ - "bitflags 1.3.2", - "cfg-if", - "libc", - "memoffset 0.7.1", - "pin-utils", -] - [[package]] name = "nix" version = "0.29.0" @@ -6353,7 +5713,7 @@ dependencies = [ "chrono-humanize", "dirs 5.0.1", "dirs-sys 0.4.1", - "fancy-regex 0.14.0", + "fancy-regex", "heck 0.5.0", "indexmap 2.9.0", "log", @@ -6404,7 +5764,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327999b774d78b301a6b68c33d312a1a8047c59fb8971b6552ebf823251f1481" dependencies = [ "crossterm_winapi", - "fancy-regex 0.14.0", + "fancy-regex", "log", "lscolors", "nix 0.29.0", @@ -6416,20 +5776,6 @@ dependencies = [ "unicase", ] -[[package]] -name = "num" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" -dependencies = [ - "num-bigint", - "num-complex", - "num-integer", - "num-iter", - "num-rational", - "num-traits", -] - [[package]] name = "num-bigint" version = "0.4.6" @@ -6440,16 +5786,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-complex" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" -dependencies = [ - "bytemuck", - "num-traits", -] - [[package]] name = "num-conv" version = "0.1.0" @@ -6486,17 +5822,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-iter" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - [[package]] name = "num-rational" version = "0.4.2" @@ -6515,17 +5840,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", - "libm", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi 0.3.9", - "libc", ] [[package]] @@ -7659,45 +6973,19 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f42ea446cab60335f76979ec15e12619a2165b5ae2c12166bef27d283a9fadf" dependencies = [ - "idna", - "psl-types", -] - -[[package]] -name = "pulldown-cmark" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e8bbe1a966bd2f362681a44f6edce3c2310ac21e4d5067a6e7ec396297a6ea0" -dependencies = [ - "bitflags 2.9.1", - "memchr", - "unicase", -] - -[[package]] -name = "pulp" -version = "0.18.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0a01a0dc67cf4558d279f0c25b0962bd08fc6dec0137699eae304103e882fe6" -dependencies = [ - "bytemuck", - "libm", - "num-complex", - "reborrow", + "idna", + "psl-types", ] [[package]] -name = "pulp" -version = "0.21.5" +name = "pulldown-cmark" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b86df24f0a7ddd5e4b95c94fc9ed8a98f1ca94d3b01bdce2824097e7835907" +checksum = "1e8bbe1a966bd2f362681a44f6edce3c2310ac21e4d5067a6e7ec396297a6ea0" dependencies = [ - "bytemuck", - "cfg-if", - "libm", - "num-complex", - "reborrow", - "version_check", + "bitflags 2.9.1", + "memchr", + "unicase", ] [[package]] @@ -8037,16 +7325,6 @@ dependencies = [ "getrandom 0.3.3", ] -[[package]] -name = "rand_distr" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8615d50dcf34fa31f7ab52692afec947c4dd0ab803cc87cb3b0b4570ff7463" -dependencies = [ - "num-traits", - "rand 0.9.1", -] - [[package]] name = "rand_hc" version = "0.2.0" @@ -8115,24 +7393,6 @@ dependencies = [ "rgb", ] -[[package]] -name = "raw-cpuid" -version = "10.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c297679cb867470fa8c9f67dbba74a78d78e3e98d7cf2b08d6d71540f797332" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "raw-cpuid" -version = "11.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6df7ab838ed27997ba19a4664507e6f82b41fe6e20be42929332156e5e85146" -dependencies = [ - "bitflags 2.9.1", -] - [[package]] name = "raw-window-handle" version = "0.6.2" @@ -8149,17 +7409,6 @@ dependencies = [ "rayon-core", ] -[[package]] -name = "rayon-cond" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "059f538b55efd2309c9794130bc149c6a553db90e9d99c2030785c82f0bd7df9" -dependencies = [ - "either", - "itertools 0.11.0", - "rayon", -] - [[package]] name = "rayon-core" version = "1.12.1" @@ -8170,12 +7419,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "reborrow" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03251193000f4bd3b042892be858ee50e8b3719f2b08e5833ac4353724632430" - [[package]] name = "redox_syscall" version = "0.5.12" @@ -8314,7 +7557,6 @@ dependencies = [ "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", "tokio-rustls 0.26.2", "tokio-socks", @@ -8324,7 +7566,6 @@ dependencies = [ "url", "wasm-bindgen", "wasm-bindgen-futures", - "wasm-streams", "web-sys", "webpki-roots", "windows-registry", @@ -8442,16 +7683,6 @@ dependencies = [ "ordered-multimap", ] -[[package]] -name = "rust-stemmers" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e46a2036019fdb888131db7a4c847a1063a7493f971ed94ea82c67eada63ca54" -dependencies = [ - "serde", - "serde_derive", -] - [[package]] name = "rustc-demangle" version = "0.1.24" @@ -8652,16 +7883,6 @@ version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" -[[package]] -name = "safetensors" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44560c11236a6130a46ce36c836a62936dc81ebf8c36a37947423571be0e55b6" -dependencies = [ - "serde", - "serde_json", -] - [[package]] name = "same-file" version = "1.0.6" @@ -8767,33 +7988,6 @@ dependencies = [ "thin-slice", ] -[[package]] -name = "semantic_search_client" -version = "1.10.1" -dependencies = [ - "anyhow", - "bm25", - "candle-core", - "candle-nn", - "candle-transformers", - "chrono", - "dirs 5.0.1", - "hf-hub", - "hnsw_rs", - "indicatif", - "once_cell", - "rayon", - "serde", - "serde_json", - "tempfile", - "thiserror 2.0.12", - "tokenizers", - "tokio", - "tracing", - "uuid", - "walkdir", -] - [[package]] name = "semver" version = "1.0.26" @@ -8809,12 +8003,6 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f97841a747eef040fcd2e7b3b9a220a7205926e60488e673d9e4926d27772ce5" -[[package]] -name = "seq-macro" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc711410fbe7399f390ca1c3b60ad0f53f80e95c5eb935e52268a0e2cd49acc" - [[package]] name = "serde" version = "1.0.219" @@ -9132,7 +8320,7 @@ dependencies = [ "crossbeam", "defer-drop", "derive_builder", - "env_logger 0.11.8", + "env_logger", "fuzzy-matcher", "indexmap 2.9.0", "log", @@ -9175,17 +8363,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "socks" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c3dbbd9ae980613c6dd8e28a9407b50509d3803b57624d5dfe8315218cd58b" -dependencies = [ - "byteorder", - "libc", - "winapi", -] - [[package]] name = "soup3" version = "0.5.0" @@ -9232,18 +8409,6 @@ dependencies = [ "strum 0.24.1", ] -[[package]] -name = "spm_precompiled" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5851699c4033c63636f7ea4cf7b7c1f1bf06d0cc03cfb42e711de5a5c46cf326" -dependencies = [ - "base64 0.13.1", - "nom", - "serde", - "unicode-segmentation", -] - [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -9256,15 +8421,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "stop-words" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c6a86be9f7fa4559b7339669e72026eb437f5e9c5a85c207fe1033079033a17" -dependencies = [ - "serde_json", -] - [[package]] name = "string_cache" version = "0.8.9" @@ -9468,34 +8624,6 @@ dependencies = [ "libc", ] -[[package]] -name = "sysctl" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec7dddc5f0fee506baf8b9fdb989e242f17e4b11c61dfbb0635b705217199eea" -dependencies = [ - "bitflags 2.9.1", - "byteorder", - "enum-as-inner", - "libc", - "thiserror 1.0.69", - "walkdir", -] - -[[package]] -name = "sysctl" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01198a2debb237c62b6826ec7081082d951f46dbb64b0e8c7649a452230d1dfc" -dependencies = [ - "bitflags 2.9.1", - "byteorder", - "enum-as-inner", - "libc", - "thiserror 1.0.69", - "walkdir", -] - [[package]] name = "sysinfo" version = "0.33.1" @@ -9652,15 +8780,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "termcolor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" -dependencies = [ - "winapi-util", -] - [[package]] name = "terminal_size" version = "0.4.2" @@ -9870,38 +8989,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" -[[package]] -name = "tokenizers" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3169b3195f925496c895caee7978a335d49218488ef22375267fba5a46a40bd7" -dependencies = [ - "aho-corasick", - "derive_builder", - "esaxx-rs", - "getrandom 0.2.16", - "indicatif", - "itertools 0.13.0", - "lazy_static", - "log", - "macro_rules_attribute", - "monostate", - "onig", - "paste", - "rand 0.8.5", - "rayon", - "rayon-cond", - "regex", - "regex-syntax 0.8.5", - "serde", - "serde_json", - "spm_precompiled", - "thiserror 2.0.12", - "unicode-normalization-alignments", - "unicode-segmentation", - "unicode_categories", -] - [[package]] name = "tokio" version = "1.45.0" @@ -10331,27 +9418,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "ug" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90b70b37e9074642bc5f60bb23247fd072a84314ca9e71cdf8527593406a0dd3" -dependencies = [ - "gemm 0.18.2", - "half", - "libloading 0.8.7", - "memmap2", - "num", - "num-traits", - "num_cpus", - "rayon", - "safetensors", - "serde", - "thiserror 1.0.69", - "tracing", - "yoke 0.7.5", -] - [[package]] name = "unicase" version = "2.8.1" @@ -10370,15 +9436,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" -[[package]] -name = "unicode-normalization-alignments" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f613e4fa046e69818dd287fdc4bc78175ff20331479dab6e1b0f98d57062de" -dependencies = [ - "smallvec", -] - [[package]] name = "unicode-segmentation" version = "1.12.0" @@ -10397,12 +9454,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" -[[package]] -name = "unicode_categories" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" - [[package]] name = "unsafe-libyaml" version = "0.2.11" @@ -10415,25 +9466,6 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" -[[package]] -name = "ureq" -version = "2.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02d1a66277ed75f640d608235660df48c8e3c19f3b4edb6a263315626cc3c01d" -dependencies = [ - "base64 0.22.1", - "flate2", - "log", - "once_cell", - "rustls 0.23.27", - "rustls-pki-types", - "serde", - "serde_json", - "socks", - "url", - "webpki-roots", -] - [[package]] name = "url" version = "2.5.4" @@ -10677,19 +9709,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "wasm-streams" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" -dependencies = [ - "futures-util", - "js-sys", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - [[package]] name = "wayland-backend" version = "0.3.10" @@ -10911,12 +9930,6 @@ dependencies = [ "winsafe", ] -[[package]] -name = "whichlang" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9aa3ad29c3d08283ac6b769e3ec15ad1ddb88af7d2e9bc402c574973b937e7" - [[package]] name = "whoami" version = "1.6.0" @@ -10928,12 +9941,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "widestring" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd7cf3379ca1aac9eea11fba24fd7e315d621f8dfe35c8d7d2be8b793726e07d" - [[package]] name = "winapi" version = "0.3.9" @@ -10965,15 +9972,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" -dependencies = [ - "windows-targets 0.48.5", -] - [[package]] name = "windows" version = "0.56.0" @@ -11767,18 +10765,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" -[[package]] -name = "yoke" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" -dependencies = [ - "serde", - "stable_deref_trait", - "yoke-derive 0.7.5", - "zerofrom", -] - [[package]] name = "yoke" version = "0.8.0" @@ -11787,22 +10773,10 @@ checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" dependencies = [ "serde", "stable_deref_trait", - "yoke-derive 0.8.0", + "yoke-derive", "zerofrom", ] -[[package]] -name = "yoke-derive" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.101", - "synstructure", -] - [[package]] name = "yoke-derive" version = "0.8.0" @@ -12020,7 +10994,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" dependencies = [ "displaydoc", - "yoke 0.8.0", + "yoke", "zerofrom", ] @@ -12030,7 +11004,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428" dependencies = [ - "yoke 0.8.0", + "yoke", "zerofrom", "zerovec-derive", ] @@ -12046,21 +11020,6 @@ dependencies = [ "syn 2.0.101", ] -[[package]] -name = "zip" -version = "1.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cc23c04387f4da0374be4533ad1208cbb091d5c11d070dfef13676ad6497164" -dependencies = [ - "arbitrary", - "crc32fast", - "crossbeam-utils", - "displaydoc", - "indexmap 2.9.0", - "num_enum", - "thiserror 1.0.69", -] - [[package]] name = "zstd" version = "0.13.3" diff --git a/Cargo.toml b/Cargo.toml index ca543ccfdf..d1d00816f3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,6 +9,7 @@ members = [ "tests/fig-api/fig-api-mock", "tests/figterm2", ] +exclude = ["crates/semantic_search_client"] [workspace.package] authors = [ diff --git a/crates/amzn-codewhisperer-client/Cargo.toml b/crates/amzn-codewhisperer-client/Cargo.toml index 53d65d69a9..4fdd3cbc6f 100644 --- a/crates/amzn-codewhisperer-client/Cargo.toml +++ b/crates/amzn-codewhisperer-client/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2021" name = "amzn-codewhisperer-client" -version = "0.1.8646" +version = "0.1.8702" authors = ["Grant Gurvis "] build = false exclude = [ diff --git a/crates/amzn-codewhisperer-client/src/client.rs b/crates/amzn-codewhisperer-client/src/client.rs index a04b724dcb..75b77f97e7 100644 --- a/crates/amzn-codewhisperer-client/src/client.rs +++ b/crates/amzn-codewhisperer-client/src/client.rs @@ -78,6 +78,8 @@ impl Client { mod create_artifact_upload_url; +mod create_subscription_token; + mod create_task_assist_conversation; mod create_upload_url; @@ -109,6 +111,8 @@ mod get_transformation; mod get_transformation_plan; +mod get_usage_limits; + mod list_available_customizations; mod list_available_profiles; @@ -140,3 +144,5 @@ mod start_test_generation; mod start_transformation; mod stop_transformation; + +mod update_usage_limits; diff --git a/crates/amzn-codewhisperer-client/src/client/create_subscription_token.rs b/crates/amzn-codewhisperer-client/src/client/create_subscription_token.rs new file mode 100644 index 0000000000..c2d7a8ee56 --- /dev/null +++ b/crates/amzn-codewhisperer-client/src/client/create_subscription_token.rs @@ -0,0 +1,25 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the + /// [`CreateSubscriptionToken`](crate::operation::create_subscription_token::builders::CreateSubscriptionTokenFluentBuilder) + /// operation. + /// + /// - The fluent builder is configurable: + /// - [`account_id(impl Into)`](crate::operation::create_subscription_token::builders::CreateSubscriptionTokenFluentBuilder::account_id) / [`set_account_id(Option)`](crate::operation::create_subscription_token::builders::CreateSubscriptionTokenFluentBuilder::set_account_id):
required: **true**
Represents the AWS account ID of the customer
+ /// - [`client_token(impl Into)`](crate::operation::create_subscription_token::builders::CreateSubscriptionTokenFluentBuilder::client_token) / [`set_client_token(Option)`](crate::operation::create_subscription_token::builders::CreateSubscriptionTokenFluentBuilder::set_client_token):
required: **false**
(undocumented)
+ /// - On success, responds with + /// [`CreateSubscriptionTokenOutput`](crate::operation::create_subscription_token::CreateSubscriptionTokenOutput) + /// with field(s): + /// - [`encoded_verification_url(String)`](crate::operation::create_subscription_token::CreateSubscriptionTokenOutput::encoded_verification_url): (undocumented) + /// - [`token(String)`](crate::operation::create_subscription_token::CreateSubscriptionTokenOutput::token): (undocumented) + /// - [`status(SubscriptionStatus)`](crate::operation::create_subscription_token::CreateSubscriptionTokenOutput::status): (undocumented) + /// - On failure, responds with + /// [`SdkError`](crate::operation::create_subscription_token::CreateSubscriptionTokenError) + pub fn create_subscription_token( + &self, + ) -> crate::operation::create_subscription_token::builders::CreateSubscriptionTokenFluentBuilder { + crate::operation::create_subscription_token::builders::CreateSubscriptionTokenFluentBuilder::new( + self.handle.clone(), + ) + } +} diff --git a/crates/amzn-codewhisperer-client/src/client/generate_completions.rs b/crates/amzn-codewhisperer-client/src/client/generate_completions.rs index 57910e361e..5710309005 100644 --- a/crates/amzn-codewhisperer-client/src/client/generate_completions.rs +++ b/crates/amzn-codewhisperer-client/src/client/generate_completions.rs @@ -19,12 +19,14 @@ impl super::Client { /// - [`user_context(UserContext)`](crate::operation::generate_completions::builders::GenerateCompletionsFluentBuilder::user_context) / [`set_user_context(Option)`](crate::operation::generate_completions::builders::GenerateCompletionsFluentBuilder::set_user_context):
required: **false**
(undocumented)
/// - [`profile_arn(impl Into)`](crate::operation::generate_completions::builders::GenerateCompletionsFluentBuilder::profile_arn) / [`set_profile_arn(Option)`](crate::operation::generate_completions::builders::GenerateCompletionsFluentBuilder::set_profile_arn):
required: **false**
(undocumented)
/// - [`workspace_id(impl Into)`](crate::operation::generate_completions::builders::GenerateCompletionsFluentBuilder::workspace_id) / [`set_workspace_id(Option)`](crate::operation::generate_completions::builders::GenerateCompletionsFluentBuilder::set_workspace_id):
required: **false**
(undocumented)
+ /// - [`model_id(impl Into)`](crate::operation::generate_completions::builders::GenerateCompletionsFluentBuilder::model_id) / [`set_model_id(Option)`](crate::operation::generate_completions::builders::GenerateCompletionsFluentBuilder::set_model_id):
required: **false**
Unique identifier for the model
/// - On success, responds with /// [`GenerateCompletionsOutput`](crate::operation::generate_completions::GenerateCompletionsOutput) /// with field(s): /// - [`predictions(Option>)`](crate::operation::generate_completions::GenerateCompletionsOutput::predictions): (undocumented) /// - [`completions(Option>)`](crate::operation::generate_completions::GenerateCompletionsOutput::completions): (undocumented) /// - [`next_token(Option)`](crate::operation::generate_completions::GenerateCompletionsOutput::next_token): (undocumented) + /// - [`model_id(Option)`](crate::operation::generate_completions::GenerateCompletionsOutput::model_id): Unique identifier for the model /// - On failure, responds with /// [`SdkError`](crate::operation::generate_completions::GenerateCompletionsError) pub fn generate_completions( diff --git a/crates/amzn-codewhisperer-client/src/client/get_usage_limits.rs b/crates/amzn-codewhisperer-client/src/client/get_usage_limits.rs new file mode 100644 index 0000000000..56c9b0be4c --- /dev/null +++ b/crates/amzn-codewhisperer-client/src/client/get_usage_limits.rs @@ -0,0 +1,19 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the + /// [`GetUsageLimits`](crate::operation::get_usage_limits::builders::GetUsageLimitsFluentBuilder) + /// operation. + /// + /// - The fluent builder is configurable: + /// - [`profile_arn(impl Into)`](crate::operation::get_usage_limits::builders::GetUsageLimitsFluentBuilder::profile_arn) / [`set_profile_arn(Option)`](crate::operation::get_usage_limits::builders::GetUsageLimitsFluentBuilder::set_profile_arn):
required: **false**
The ARN of the Q Developer profile. Required for enterprise customers, optional for Builder ID users.
+ /// - On success, responds with + /// [`GetUsageLimitsOutput`](crate::operation::get_usage_limits::GetUsageLimitsOutput) with + /// field(s): + /// - [`limits(Vec::)`](crate::operation::get_usage_limits::GetUsageLimitsOutput::limits): (undocumented) + /// - [`days_until_reset(i32)`](crate::operation::get_usage_limits::GetUsageLimitsOutput::days_until_reset): Number of days remaining until the usage metrics reset + /// - On failure, responds with + /// [`SdkError`](crate::operation::get_usage_limits::GetUsageLimitsError) + pub fn get_usage_limits(&self) -> crate::operation::get_usage_limits::builders::GetUsageLimitsFluentBuilder { + crate::operation::get_usage_limits::builders::GetUsageLimitsFluentBuilder::new(self.handle.clone()) + } +} diff --git a/crates/amzn-codewhisperer-client/src/client/push_telemetry_event.rs b/crates/amzn-codewhisperer-client/src/client/push_telemetry_event.rs index 0e5278f91a..28d237f1f1 100644 --- a/crates/amzn-codewhisperer-client/src/client/push_telemetry_event.rs +++ b/crates/amzn-codewhisperer-client/src/client/push_telemetry_event.rs @@ -6,8 +6,7 @@ impl super::Client { /// /// - The fluent builder is configurable: /// - [`client_token(impl Into)`](crate::operation::push_telemetry_event::builders::PushTelemetryEventFluentBuilder::client_token) / [`set_client_token(Option)`](crate::operation::push_telemetry_event::builders::PushTelemetryEventFluentBuilder::set_client_token):
required: **false**
(undocumented)
- /// - [`timestamp(DateTime)`](crate::operation::push_telemetry_event::builders::PushTelemetryEventFluentBuilder::timestamp) / [`set_timestamp(Option)`](crate::operation::push_telemetry_event::builders::PushTelemetryEventFluentBuilder::set_timestamp):
required: **true**
(undocumented)
- /// - [`event_id(impl Into)`](crate::operation::push_telemetry_event::builders::PushTelemetryEventFluentBuilder::event_id) / [`set_event_id(Option)`](crate::operation::push_telemetry_event::builders::PushTelemetryEventFluentBuilder::set_event_id):
required: **true**
(undocumented)
+ /// - [`event_type(impl Into)`](crate::operation::push_telemetry_event::builders::PushTelemetryEventFluentBuilder::event_type) / [`set_event_type(Option)`](crate::operation::push_telemetry_event::builders::PushTelemetryEventFluentBuilder::set_event_type):
required: **true**
(undocumented)
/// - [`event(Document)`](crate::operation::push_telemetry_event::builders::PushTelemetryEventFluentBuilder::event) / [`set_event(Option)`](crate::operation::push_telemetry_event::builders::PushTelemetryEventFluentBuilder::set_event):
required: **true**
(undocumented)
/// - On success, responds with /// [`PushTelemetryEventOutput`](crate::operation::push_telemetry_event::PushTelemetryEventOutput) diff --git a/crates/amzn-codewhisperer-client/src/client/send_telemetry_event.rs b/crates/amzn-codewhisperer-client/src/client/send_telemetry_event.rs index 4bd3a694bf..f0d9aedeff 100644 --- a/crates/amzn-codewhisperer-client/src/client/send_telemetry_event.rs +++ b/crates/amzn-codewhisperer-client/src/client/send_telemetry_event.rs @@ -10,6 +10,7 @@ impl super::Client { /// - [`opt_out_preference(OptOutPreference)`](crate::operation::send_telemetry_event::builders::SendTelemetryEventFluentBuilder::opt_out_preference) / [`set_opt_out_preference(Option)`](crate::operation::send_telemetry_event::builders::SendTelemetryEventFluentBuilder::set_opt_out_preference):
required: **false**
(undocumented)
/// - [`user_context(UserContext)`](crate::operation::send_telemetry_event::builders::SendTelemetryEventFluentBuilder::user_context) / [`set_user_context(Option)`](crate::operation::send_telemetry_event::builders::SendTelemetryEventFluentBuilder::set_user_context):
required: **false**
(undocumented)
/// - [`profile_arn(impl Into)`](crate::operation::send_telemetry_event::builders::SendTelemetryEventFluentBuilder::profile_arn) / [`set_profile_arn(Option)`](crate::operation::send_telemetry_event::builders::SendTelemetryEventFluentBuilder::set_profile_arn):
required: **false**
(undocumented)
+ /// - [`model_id(impl Into)`](crate::operation::send_telemetry_event::builders::SendTelemetryEventFluentBuilder::model_id) / [`set_model_id(Option)`](crate::operation::send_telemetry_event::builders::SendTelemetryEventFluentBuilder::set_model_id):
required: **false**
Unique identifier for the model
/// - On success, responds with /// [`SendTelemetryEventOutput`](crate::operation::send_telemetry_event::SendTelemetryEventOutput) /// - On failure, responds with diff --git a/crates/amzn-codewhisperer-client/src/client/update_usage_limits.rs b/crates/amzn-codewhisperer-client/src/client/update_usage_limits.rs new file mode 100644 index 0000000000..007c838aeb --- /dev/null +++ b/crates/amzn-codewhisperer-client/src/client/update_usage_limits.rs @@ -0,0 +1,26 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the + /// [`UpdateUsageLimits`](crate::operation::update_usage_limits::builders::UpdateUsageLimitsFluentBuilder) + /// operation. + /// + /// - The fluent builder is configurable: + /// - [`account_id(impl Into)`](crate::operation::update_usage_limits::builders::UpdateUsageLimitsFluentBuilder::account_id) / [`set_account_id(Option)`](crate::operation::update_usage_limits::builders::UpdateUsageLimitsFluentBuilder::set_account_id):
required: **true**
(undocumented)
+ /// - [`accountless_user_id(impl Into)`](crate::operation::update_usage_limits::builders::UpdateUsageLimitsFluentBuilder::accountless_user_id) / [`set_accountless_user_id(Option)`](crate::operation::update_usage_limits::builders::UpdateUsageLimitsFluentBuilder::set_accountless_user_id):
required: **false**
(undocumented)
+ /// - [`feature_type(UsageLimitType)`](crate::operation::update_usage_limits::builders::UpdateUsageLimitsFluentBuilder::feature_type) / [`set_feature_type(Option)`](crate::operation::update_usage_limits::builders::UpdateUsageLimitsFluentBuilder::set_feature_type):
required: **true**
(undocumented)
+ /// - [`requested_limit(i64)`](crate::operation::update_usage_limits::builders::UpdateUsageLimitsFluentBuilder::requested_limit) / [`set_requested_limit(Option)`](crate::operation::update_usage_limits::builders::UpdateUsageLimitsFluentBuilder::set_requested_limit):
required: **true**
(undocumented)
+ /// - [`justification(impl Into)`](crate::operation::update_usage_limits::builders::UpdateUsageLimitsFluentBuilder::justification) / [`set_justification(Option)`](crate::operation::update_usage_limits::builders::UpdateUsageLimitsFluentBuilder::set_justification):
required: **false**
(undocumented)
+ /// - On success, responds with + /// [`UpdateUsageLimitsOutput`](crate::operation::update_usage_limits::UpdateUsageLimitsOutput) + /// with field(s): + /// - [`status(UsageLimitUpdateRequestStatus)`](crate::operation::update_usage_limits::UpdateUsageLimitsOutput::status): (undocumented) + /// - [`approved_limit(Option)`](crate::operation::update_usage_limits::UpdateUsageLimitsOutput::approved_limit): (undocumented) + /// - [`remaining_requests_this_month(Option)`](crate::operation::update_usage_limits::UpdateUsageLimitsOutput::remaining_requests_this_month): (undocumented) + /// - On failure, responds with + /// [`SdkError`](crate::operation::update_usage_limits::UpdateUsageLimitsError) + pub fn update_usage_limits( + &self, + ) -> crate::operation::update_usage_limits::builders::UpdateUsageLimitsFluentBuilder { + crate::operation::update_usage_limits::builders::UpdateUsageLimitsFluentBuilder::new(self.handle.clone()) + } +} diff --git a/crates/amzn-codewhisperer-client/src/error_meta.rs b/crates/amzn-codewhisperer-client/src/error_meta.rs index ec83656d1a..478e302ab1 100644 --- a/crates/amzn-codewhisperer-client/src/error_meta.rs +++ b/crates/amzn-codewhisperer-client/src/error_meta.rs @@ -18,6 +18,9 @@ pub enum Error { ServiceQuotaExceededError(crate::types::error::ServiceQuotaExceededError), /// This exception is thrown when request was denied due to request throttling. ThrottlingError(crate::types::error::ThrottlingError), + /// Exception thrown when the number of usage limit update requests exceeds the monthly quota + /// (default 3 requests per month) + UpdateUsageLimitQuotaExceededError(crate::types::error::UpdateUsageLimitQuotaExceededError), /// This exception is thrown when the input fails to satisfy the constraints specified by the /// service. ValidationError(crate::types::error::ValidationError), @@ -42,6 +45,7 @@ impl ::std::fmt::Display for Error { Error::ResourceNotFoundError(inner) => inner.fmt(f), Error::ServiceQuotaExceededError(inner) => inner.fmt(f), Error::ThrottlingError(inner) => inner.fmt(f), + Error::UpdateUsageLimitQuotaExceededError(inner) => inner.fmt(f), Error::ValidationError(inner) => inner.fmt(f), Error::Unhandled(_) => { if let ::std::option::Option::Some(code) = @@ -72,6 +76,7 @@ impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error { Self::ResourceNotFoundError(inner) => inner.meta(), Self::ServiceQuotaExceededError(inner) => inner.meta(), Self::ThrottlingError(inner) => inner.meta(), + Self::UpdateUsageLimitQuotaExceededError(inner) => inner.meta(), Self::ValidationError(inner) => inner.meta(), Self::Unhandled(inner) => &inner.meta, } @@ -123,6 +128,55 @@ impl From + From< + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::create_subscription_token::CreateSubscriptionTokenError, + R, + >, + > for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from( + err: ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::create_subscription_token::CreateSubscriptionTokenError, + R, + >, + ) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::create_subscription_token::CreateSubscriptionTokenError) -> Self { + match err { + crate::operation::create_subscription_token::CreateSubscriptionTokenError::ValidationError(inner) => { + Error::ValidationError(inner) + }, + crate::operation::create_subscription_token::CreateSubscriptionTokenError::AccessDeniedError(inner) => { + Error::AccessDeniedError(inner) + }, + crate::operation::create_subscription_token::CreateSubscriptionTokenError::InternalServerError(inner) => { + Error::InternalServerError(inner) + }, + crate::operation::create_subscription_token::CreateSubscriptionTokenError::ThrottlingError(inner) => { + Error::ThrottlingError(inner) + }, + crate::operation::create_subscription_token::CreateSubscriptionTokenError::ConflictError(inner) => { + Error::ConflictError(inner) + }, + crate::operation::create_subscription_token::CreateSubscriptionTokenError::Unhandled(inner) => { + Error::Unhandled(inner) + }, + } + } +} impl From< ::aws_smithy_runtime_api::client::result::SdkError< @@ -783,6 +837,46 @@ impl From } } } +impl + From<::aws_smithy_runtime_api::client::result::SdkError> + for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from( + err: ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::get_usage_limits::GetUsageLimitsError, + R, + >, + ) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::get_usage_limits::GetUsageLimitsError) -> Self { + match err { + crate::operation::get_usage_limits::GetUsageLimitsError::ValidationError(inner) => { + Error::ValidationError(inner) + }, + crate::operation::get_usage_limits::GetUsageLimitsError::AccessDeniedError(inner) => { + Error::AccessDeniedError(inner) + }, + crate::operation::get_usage_limits::GetUsageLimitsError::ThrottlingError(inner) => { + Error::ThrottlingError(inner) + }, + crate::operation::get_usage_limits::GetUsageLimitsError::InternalServerError(inner) => { + Error::InternalServerError(inner) + }, + crate::operation::get_usage_limits::GetUsageLimitsError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} impl From< ::aws_smithy_runtime_api::client::result::SdkError< @@ -1528,6 +1622,53 @@ impl From for Er } } } +impl + From< + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::update_usage_limits::UpdateUsageLimitsError, + R, + >, + > for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from( + err: ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::update_usage_limits::UpdateUsageLimitsError, + R, + >, + ) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::update_usage_limits::UpdateUsageLimitsError) -> Self { + match err { + crate::operation::update_usage_limits::UpdateUsageLimitsError::ValidationError(inner) => { + Error::ValidationError(inner) + }, + crate::operation::update_usage_limits::UpdateUsageLimitsError::AccessDeniedError(inner) => { + Error::AccessDeniedError(inner) + }, + crate::operation::update_usage_limits::UpdateUsageLimitsError::ThrottlingError(inner) => { + Error::ThrottlingError(inner) + }, + crate::operation::update_usage_limits::UpdateUsageLimitsError::InternalServerError(inner) => { + Error::InternalServerError(inner) + }, + crate::operation::update_usage_limits::UpdateUsageLimitsError::UpdateUsageLimitQuotaExceededError( + inner, + ) => Error::UpdateUsageLimitQuotaExceededError(inner), + crate::operation::update_usage_limits::UpdateUsageLimitsError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} impl ::std::error::Error for Error { fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> { match self { @@ -1537,6 +1678,7 @@ impl ::std::error::Error for Error { Error::ResourceNotFoundError(inner) => inner.source(), Error::ServiceQuotaExceededError(inner) => inner.source(), Error::ThrottlingError(inner) => inner.source(), + Error::UpdateUsageLimitQuotaExceededError(inner) => inner.source(), Error::ValidationError(inner) => inner.source(), Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source), } @@ -1551,6 +1693,7 @@ impl ::aws_types::request_id::RequestId for Error { Self::ResourceNotFoundError(e) => e.request_id(), Self::ServiceQuotaExceededError(e) => e.request_id(), Self::ThrottlingError(e) => e.request_id(), + Self::UpdateUsageLimitQuotaExceededError(e) => e.request_id(), Self::ValidationError(e) => e.request_id(), Self::Unhandled(e) => e.meta.request_id(), } diff --git a/crates/amzn-codewhisperer-client/src/operation.rs b/crates/amzn-codewhisperer-client/src/operation.rs index f6a83c7578..032d7340ea 100644 --- a/crates/amzn-codewhisperer-client/src/operation.rs +++ b/crates/amzn-codewhisperer-client/src/operation.rs @@ -4,6 +4,9 @@ pub use ::aws_types::request_id::RequestId; /// Types for the `CreateArtifactUploadUrl` operation. pub mod create_artifact_upload_url; +/// Types for the `CreateSubscriptionToken` operation. +pub mod create_subscription_token; + /// Types for the `CreateTaskAssistConversation` operation. pub mod create_task_assist_conversation; @@ -46,6 +49,9 @@ pub mod get_transformation; /// Types for the `GetTransformationPlan` operation. pub mod get_transformation_plan; +/// Types for the `GetUsageLimits` operation. +pub mod get_usage_limits; + /// Types for the `ListAvailableCustomizations` operation. pub mod list_available_customizations; @@ -93,3 +99,6 @@ pub mod start_transformation; /// Types for the `StopTransformation` operation. pub mod stop_transformation; + +/// Types for the `UpdateUsageLimits` operation. +pub mod update_usage_limits; diff --git a/crates/amzn-codewhisperer-client/src/operation/create_subscription_token.rs b/crates/amzn-codewhisperer-client/src/operation/create_subscription_token.rs new file mode 100644 index 0000000000..2d66c13f71 --- /dev/null +++ b/crates/amzn-codewhisperer-client/src/operation/create_subscription_token.rs @@ -0,0 +1,466 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `CreateSubscriptionToken`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct CreateSubscriptionToken; +impl CreateSubscriptionToken { + /// Creates a new `CreateSubscriptionToken` + pub fn new() -> Self { + Self + } + + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::create_subscription_token::CreateSubscriptionTokenInput, + ) -> ::std::result::Result< + crate::operation::create_subscription_token::CreateSubscriptionTokenOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::create_subscription_token::CreateSubscriptionTokenError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point( + runtime_plugins, + input, + ::aws_smithy_runtime::client::orchestrator::StopPoint::None, + ) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::create_subscription_token::CreateSubscriptionTokenInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point( + "codewhispererruntime", + "CreateSubscriptionToken", + input, + runtime_plugins, + stop_point, + ) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins + .with_operation_plugin(crate::client_idempotency_token::IdempotencyTokenRuntimePlugin::new( + |token_provider, input| { + let input: &mut crate::operation::create_subscription_token::CreateSubscriptionTokenInput = + input.downcast_mut().expect("correct type"); + if input.client_token.is_none() { + input.client_token = ::std::option::Option::Some(token_provider.make_idempotency_token()); + } + }, + )) + .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateSubscriptionToken { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("CreateSubscriptionToken"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + CreateSubscriptionTokenRequestSerializer, + )); + cfg.store_put( + ::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + CreateSubscriptionTokenResponseDeserializer, + ), + ); + + cfg.store_put( + ::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + ), + ); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "CreateSubscriptionToken", + "codewhispererruntime", + )); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new( + "CreateSubscriptionToken", + ) + .with_interceptor( + ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(), + ) + .with_interceptor(CreateSubscriptionTokenEndpointParamsInterceptor) + .with_retry_classifier( + ::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::create_subscription_token::CreateSubscriptionTokenError, + >::new(), + ) + .with_retry_classifier( + ::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::create_subscription_token::CreateSubscriptionTokenError, + >::new(), + ) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::create_subscription_token::CreateSubscriptionTokenError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct CreateSubscriptionTokenResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateSubscriptionTokenResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_create_subscription_token::de_create_subscription_token_http_error( + status, headers, body, + ) + } else { + crate::protocol_serde::shape_create_subscription_token::de_create_subscription_token_http_response( + status, headers, body, + ) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct CreateSubscriptionTokenRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CreateSubscriptionTokenRequestSerializer { + #[allow( + unused_mut, + clippy::let_and_return, + clippy::needless_borrow, + clippy::useless_conversion + )] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::orchestrator::HttpRequest, + ::aws_smithy_runtime_api::box_error::BoxError, + > { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::create_subscription_token::CreateSubscriptionTokenInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::create_subscription_token::CreateSubscriptionTokenInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> + { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header( + builder, + ::http::header::CONTENT_TYPE, + "application/x-amz-json-1.0", + ); + builder = _header_serialization_settings.set_default_header( + builder, + ::http::header::HeaderName::from_static("x-amz-target"), + "AmazonCodeWhispererService.CreateSubscriptionToken", + ); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from( + crate::protocol_serde::shape_create_subscription_token::ser_create_subscription_token_input(&input)?, + ); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header( + request_builder, + ::http::header::CONTENT_LENGTH, + &content_length, + ); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct CreateSubscriptionTokenEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateSubscriptionTokenEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "CreateSubscriptionTokenEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to CreateSubscriptionTokenInput")?; + + let params = crate::config::endpoint::Params::builder().build().map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new( + "endpoint params could not be built", + err, + ) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new( + params, + )); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `CreateSubscriptionTokenError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum CreateSubscriptionTokenError { + /// This exception is thrown when the input fails to satisfy the constraints specified by the + /// service. + ValidationError(crate::types::error::ValidationError), + /// This exception is thrown when the user does not have sufficient access to perform this + /// action. + AccessDeniedError(crate::types::error::AccessDeniedError), + /// This exception is thrown when an unexpected error occurred during the processing of a + /// request. + InternalServerError(crate::types::error::InternalServerError), + /// This exception is thrown when request was denied due to request throttling. + ThrottlingError(crate::types::error::ThrottlingError), + /// This exception is thrown when the action to perform could not be completed because the + /// resource is in a conflicting state. + ConflictError(crate::types::error::ConflictError), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error + /// code). + #[deprecated( + note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-CreateSubscriptionTokenError) for what information is available for the error." + )] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl CreateSubscriptionTokenError { + /// Creates the `CreateSubscriptionTokenError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into< + ::std::boxed::Box, + >, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `CreateSubscriptionTokenError::Unhandled` variant from an + /// [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ValidationError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::AccessDeniedError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ThrottlingError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ConflictError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + + /// Returns `true` if the error kind is `CreateSubscriptionTokenError::ValidationError`. + pub fn is_validation_error(&self) -> bool { + matches!(self, Self::ValidationError(_)) + } + + /// Returns `true` if the error kind is `CreateSubscriptionTokenError::AccessDeniedError`. + pub fn is_access_denied_error(&self) -> bool { + matches!(self, Self::AccessDeniedError(_)) + } + + /// Returns `true` if the error kind is `CreateSubscriptionTokenError::InternalServerError`. + pub fn is_internal_server_error(&self) -> bool { + matches!(self, Self::InternalServerError(_)) + } + + /// Returns `true` if the error kind is `CreateSubscriptionTokenError::ThrottlingError`. + pub fn is_throttling_error(&self) -> bool { + matches!(self, Self::ThrottlingError(_)) + } + + /// Returns `true` if the error kind is `CreateSubscriptionTokenError::ConflictError`. + pub fn is_conflict_error(&self) -> bool { + matches!(self, Self::ConflictError(_)) + } +} +impl ::std::error::Error for CreateSubscriptionTokenError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::ValidationError(_inner) => ::std::option::Option::Some(_inner), + Self::AccessDeniedError(_inner) => ::std::option::Option::Some(_inner), + Self::InternalServerError(_inner) => ::std::option::Option::Some(_inner), + Self::ThrottlingError(_inner) => ::std::option::Option::Some(_inner), + Self::ConflictError(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for CreateSubscriptionTokenError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::ValidationError(_inner) => _inner.fmt(f), + Self::AccessDeniedError(_inner) => _inner.fmt(f), + Self::InternalServerError(_inner) => _inner.fmt(f), + Self::ThrottlingError(_inner) => _inner.fmt(f), + Self::ConflictError(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + }, + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for CreateSubscriptionTokenError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + match self { + Self::InternalServerError(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::ThrottlingError(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + _ => ::std::option::Option::None, + } + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for CreateSubscriptionTokenError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ValidationError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::AccessDeniedError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::InternalServerError(_inner) => { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner) + }, + Self::ThrottlingError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ConflictError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CreateSubscriptionTokenError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::create_subscription_token::CreateSubscriptionTokenError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::create_subscription_token::_create_subscription_token_input::CreateSubscriptionTokenInput; +pub use crate::operation::create_subscription_token::_create_subscription_token_output::CreateSubscriptionTokenOutput; + +mod _create_subscription_token_input; + +mod _create_subscription_token_output; + +/// Builders +pub mod builders; diff --git a/crates/amzn-codewhisperer-client/src/operation/create_subscription_token/_create_subscription_token_input.rs b/crates/amzn-codewhisperer-client/src/operation/create_subscription_token/_create_subscription_token_input.rs new file mode 100644 index 0000000000..d519220b93 --- /dev/null +++ b/crates/amzn-codewhisperer-client/src/operation/create_subscription_token/_create_subscription_token_input.rs @@ -0,0 +1,89 @@ +// 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, ::std::fmt::Debug)] +pub struct CreateSubscriptionTokenInput { + /// Represents the AWS account ID of the customer + pub account_id: ::std::option::Option<::std::string::String>, + #[allow(missing_docs)] // documentation missing in model + pub client_token: ::std::option::Option<::std::string::String>, +} +impl CreateSubscriptionTokenInput { + /// Represents the AWS account ID of the customer + pub fn account_id(&self) -> ::std::option::Option<&str> { + self.account_id.as_deref() + } + + #[allow(missing_docs)] // documentation missing in model + pub fn client_token(&self) -> ::std::option::Option<&str> { + self.client_token.as_deref() + } +} +impl CreateSubscriptionTokenInput { + /// Creates a new builder-style object to manufacture + /// [`CreateSubscriptionTokenInput`](crate::operation::create_subscription_token::CreateSubscriptionTokenInput). + pub fn builder() -> crate::operation::create_subscription_token::builders::CreateSubscriptionTokenInputBuilder { + crate::operation::create_subscription_token::builders::CreateSubscriptionTokenInputBuilder::default() + } +} + +/// A builder for +/// [`CreateSubscriptionTokenInput`](crate::operation::create_subscription_token::CreateSubscriptionTokenInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct CreateSubscriptionTokenInputBuilder { + pub(crate) account_id: ::std::option::Option<::std::string::String>, + pub(crate) client_token: ::std::option::Option<::std::string::String>, +} +impl CreateSubscriptionTokenInputBuilder { + /// Represents the AWS account ID of the customer + /// This field is required. + pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.account_id = ::std::option::Option::Some(input.into()); + self + } + + /// Represents the AWS account ID of the customer + pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.account_id = input; + self + } + + /// Represents the AWS account ID of the customer + pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> { + &self.account_id + } + + #[allow(missing_docs)] // documentation missing in model + pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.client_token = ::std::option::Option::Some(input.into()); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.client_token = input; + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> { + &self.client_token + } + + /// Consumes the builder and constructs a + /// [`CreateSubscriptionTokenInput`](crate::operation::create_subscription_token::CreateSubscriptionTokenInput). + pub fn build( + self, + ) -> ::std::result::Result< + crate::operation::create_subscription_token::CreateSubscriptionTokenInput, + ::aws_smithy_types::error::operation::BuildError, + > { + ::std::result::Result::Ok( + crate::operation::create_subscription_token::CreateSubscriptionTokenInput { + account_id: self.account_id, + client_token: self.client_token, + }, + ) + } +} diff --git a/crates/amzn-codewhisperer-client/src/operation/create_subscription_token/_create_subscription_token_output.rs b/crates/amzn-codewhisperer-client/src/operation/create_subscription_token/_create_subscription_token_output.rs new file mode 100644 index 0000000000..1b232fe03b --- /dev/null +++ b/crates/amzn-codewhisperer-client/src/operation/create_subscription_token/_create_subscription_token_output.rs @@ -0,0 +1,154 @@ +// 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, ::std::fmt::Debug)] +pub struct CreateSubscriptionTokenOutput { + #[allow(missing_docs)] // documentation missing in model + pub encoded_verification_url: ::std::string::String, + #[allow(missing_docs)] // documentation missing in model + pub token: ::std::string::String, + #[allow(missing_docs)] // documentation missing in model + pub status: crate::types::SubscriptionStatus, + _request_id: Option, +} +impl CreateSubscriptionTokenOutput { + #[allow(missing_docs)] // documentation missing in model + pub fn encoded_verification_url(&self) -> &str { + use std::ops::Deref; + self.encoded_verification_url.deref() + } + + #[allow(missing_docs)] // documentation missing in model + pub fn token(&self) -> &str { + use std::ops::Deref; + self.token.deref() + } + + #[allow(missing_docs)] // documentation missing in model + pub fn status(&self) -> &crate::types::SubscriptionStatus { + &self.status + } +} +impl ::aws_types::request_id::RequestId for CreateSubscriptionTokenOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl CreateSubscriptionTokenOutput { + /// Creates a new builder-style object to manufacture + /// [`CreateSubscriptionTokenOutput`](crate::operation::create_subscription_token::CreateSubscriptionTokenOutput). + pub fn builder() -> crate::operation::create_subscription_token::builders::CreateSubscriptionTokenOutputBuilder { + crate::operation::create_subscription_token::builders::CreateSubscriptionTokenOutputBuilder::default() + } +} + +/// A builder for +/// [`CreateSubscriptionTokenOutput`](crate::operation::create_subscription_token::CreateSubscriptionTokenOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct CreateSubscriptionTokenOutputBuilder { + pub(crate) encoded_verification_url: ::std::option::Option<::std::string::String>, + pub(crate) token: ::std::option::Option<::std::string::String>, + pub(crate) status: ::std::option::Option, + _request_id: Option, +} +impl CreateSubscriptionTokenOutputBuilder { + #[allow(missing_docs)] // documentation missing in model + /// This field is required. + pub fn encoded_verification_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.encoded_verification_url = ::std::option::Option::Some(input.into()); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn set_encoded_verification_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.encoded_verification_url = input; + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn get_encoded_verification_url(&self) -> &::std::option::Option<::std::string::String> { + &self.encoded_verification_url + } + + #[allow(missing_docs)] // documentation missing in model + /// This field is required. + pub fn token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.token = ::std::option::Option::Some(input.into()); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn set_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.token = input; + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn get_token(&self) -> &::std::option::Option<::std::string::String> { + &self.token + } + + #[allow(missing_docs)] // documentation missing in model + /// This field is required. + pub fn status(mut self, input: crate::types::SubscriptionStatus) -> Self { + self.status = ::std::option::Option::Some(input); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn set_status(mut self, input: ::std::option::Option) -> Self { + self.status = input; + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn get_status(&self) -> &::std::option::Option { + &self.status + } + + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + + /// Consumes the builder and constructs a + /// [`CreateSubscriptionTokenOutput`](crate::operation::create_subscription_token::CreateSubscriptionTokenOutput). + /// This method will fail if any of the following fields are not set: + /// - [`encoded_verification_url`](crate::operation::create_subscription_token::builders::CreateSubscriptionTokenOutputBuilder::encoded_verification_url) + /// - [`token`](crate::operation::create_subscription_token::builders::CreateSubscriptionTokenOutputBuilder::token) + /// - [`status`](crate::operation::create_subscription_token::builders::CreateSubscriptionTokenOutputBuilder::status) + pub fn build( + self, + ) -> ::std::result::Result< + crate::operation::create_subscription_token::CreateSubscriptionTokenOutput, + ::aws_smithy_types::error::operation::BuildError, + > { + ::std::result::Result::Ok(crate::operation::create_subscription_token::CreateSubscriptionTokenOutput { + encoded_verification_url: self.encoded_verification_url.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "encoded_verification_url", + "encoded_verification_url was not specified but it is required when building CreateSubscriptionTokenOutput", + ) + })?, + token: self.token.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "token", + "token was not specified but it is required when building CreateSubscriptionTokenOutput", + ) + })?, + status: self.status.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "status", + "status was not specified but it is required when building CreateSubscriptionTokenOutput", + ) + })?, + _request_id: self._request_id, + }) + } +} diff --git a/crates/amzn-codewhisperer-client/src/operation/create_subscription_token/builders.rs b/crates/amzn-codewhisperer-client/src/operation/create_subscription_token/builders.rs new file mode 100644 index 0000000000..0c5bb0690f --- /dev/null +++ b/crates/amzn-codewhisperer-client/src/operation/create_subscription_token/builders.rs @@ -0,0 +1,155 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::create_subscription_token::_create_subscription_token_input::CreateSubscriptionTokenInputBuilder; +pub use crate::operation::create_subscription_token::_create_subscription_token_output::CreateSubscriptionTokenOutputBuilder; + +impl crate::operation::create_subscription_token::builders::CreateSubscriptionTokenInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::create_subscription_token::CreateSubscriptionTokenOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::create_subscription_token::CreateSubscriptionTokenError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.create_subscription_token(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `CreateSubscriptionToken`. +#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct CreateSubscriptionTokenFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::create_subscription_token::builders::CreateSubscriptionTokenInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::create_subscription_token::CreateSubscriptionTokenOutput, + crate::operation::create_subscription_token::CreateSubscriptionTokenError, + > for CreateSubscriptionTokenFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::create_subscription_token::CreateSubscriptionTokenOutput, + crate::operation::create_subscription_token::CreateSubscriptionTokenError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl CreateSubscriptionTokenFluentBuilder { + /// Creates a new `CreateSubscriptionTokenFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + + /// Access the CreateSubscriptionToken as a reference. + pub fn as_input( + &self, + ) -> &crate::operation::create_subscription_token::builders::CreateSubscriptionTokenInputBuilder { + &self.inner + } + + /// 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::operation::create_subscription_token::CreateSubscriptionTokenOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::create_subscription_token::CreateSubscriptionTokenError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = + crate::operation::create_subscription_token::CreateSubscriptionToken::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::create_subscription_token::CreateSubscriptionToken::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being + /// sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::create_subscription_token::CreateSubscriptionTokenOutput, + crate::operation::create_subscription_token::CreateSubscriptionTokenError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + + pub(crate) fn config_override( + mut self, + config_override: impl ::std::convert::Into, + ) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override( + &mut self, + config_override: ::std::option::Option, + ) -> &mut Self { + self.config_override = config_override; + self + } + + /// Represents the AWS account ID of the customer + pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.account_id(input.into()); + self + } + + /// Represents the AWS account ID of the customer + pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_account_id(input); + self + } + + /// Represents the AWS account ID of the customer + pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_account_id() + } + + #[allow(missing_docs)] // documentation missing in model + pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.client_token(input.into()); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_client_token(input); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_client_token() + } +} diff --git a/crates/amzn-codewhisperer-client/src/operation/generate_completions/_generate_completions_input.rs b/crates/amzn-codewhisperer-client/src/operation/generate_completions/_generate_completions_input.rs index b53a954829..03dad1b55a 100644 --- a/crates/amzn-codewhisperer-client/src/operation/generate_completions/_generate_completions_input.rs +++ b/crates/amzn-codewhisperer-client/src/operation/generate_completions/_generate_completions_input.rs @@ -27,6 +27,8 @@ pub struct GenerateCompletionsInput { pub profile_arn: ::std::option::Option<::std::string::String>, #[allow(missing_docs)] // documentation missing in model pub workspace_id: ::std::option::Option<::std::string::String>, + /// Unique identifier for the model + pub model_id: ::std::option::Option<::std::string::String>, } impl GenerateCompletionsInput { #[allow(missing_docs)] // documentation missing in model @@ -94,6 +96,11 @@ impl GenerateCompletionsInput { pub fn workspace_id(&self) -> ::std::option::Option<&str> { self.workspace_id.as_deref() } + + /// Unique identifier for the model + pub fn model_id(&self) -> ::std::option::Option<&str> { + self.model_id.as_deref() + } } impl ::std::fmt::Debug for GenerateCompletionsInput { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { @@ -110,6 +117,7 @@ impl ::std::fmt::Debug for GenerateCompletionsInput { formatter.field("user_context", &self.user_context); formatter.field("profile_arn", &self.profile_arn); formatter.field("workspace_id", &self.workspace_id); + formatter.field("model_id", &self.model_id); formatter.finish() } } @@ -138,6 +146,7 @@ pub struct GenerateCompletionsInputBuilder { pub(crate) user_context: ::std::option::Option, pub(crate) profile_arn: ::std::option::Option<::std::string::String>, pub(crate) workspace_id: ::std::option::Option<::std::string::String>, + pub(crate) model_id: ::std::option::Option<::std::string::String>, } impl GenerateCompletionsInputBuilder { #[allow(missing_docs)] // documentation missing in model @@ -368,6 +377,23 @@ impl GenerateCompletionsInputBuilder { &self.workspace_id } + /// Unique identifier for the model + pub fn model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.model_id = ::std::option::Option::Some(input.into()); + self + } + + /// Unique identifier for the model + pub fn set_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.model_id = input; + self + } + + /// Unique identifier for the model + pub fn get_model_id(&self) -> &::std::option::Option<::std::string::String> { + &self.model_id + } + /// Consumes the builder and constructs a /// [`GenerateCompletionsInput`](crate::operation::generate_completions::GenerateCompletionsInput). pub fn build( @@ -389,6 +415,7 @@ impl GenerateCompletionsInputBuilder { user_context: self.user_context, profile_arn: self.profile_arn, workspace_id: self.workspace_id, + model_id: self.model_id, }) } } @@ -407,6 +434,7 @@ impl ::std::fmt::Debug for GenerateCompletionsInputBuilder { formatter.field("user_context", &self.user_context); formatter.field("profile_arn", &self.profile_arn); formatter.field("workspace_id", &self.workspace_id); + formatter.field("model_id", &self.model_id); formatter.finish() } } diff --git a/crates/amzn-codewhisperer-client/src/operation/generate_completions/_generate_completions_output.rs b/crates/amzn-codewhisperer-client/src/operation/generate_completions/_generate_completions_output.rs index bc0795c1d2..df3574fec2 100644 --- a/crates/amzn-codewhisperer-client/src/operation/generate_completions/_generate_completions_output.rs +++ b/crates/amzn-codewhisperer-client/src/operation/generate_completions/_generate_completions_output.rs @@ -9,6 +9,8 @@ pub struct GenerateCompletionsOutput { pub completions: ::std::option::Option<::std::vec::Vec>, #[allow(missing_docs)] // documentation missing in model pub next_token: ::std::option::Option<::std::string::String>, + /// Unique identifier for the model + pub model_id: ::std::option::Option<::std::string::String>, _request_id: Option, } impl GenerateCompletionsOutput { @@ -30,6 +32,11 @@ impl GenerateCompletionsOutput { pub fn next_token(&self) -> ::std::option::Option<&str> { self.next_token.as_deref() } + + /// Unique identifier for the model + pub fn model_id(&self) -> ::std::option::Option<&str> { + self.model_id.as_deref() + } } impl ::std::fmt::Debug for GenerateCompletionsOutput { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { @@ -37,6 +44,7 @@ impl ::std::fmt::Debug for GenerateCompletionsOutput { formatter.field("predictions", &self.predictions); formatter.field("completions", &self.completions); formatter.field("next_token", &"*** Sensitive Data Redacted ***"); + formatter.field("model_id", &self.model_id); formatter.field("_request_id", &self._request_id); formatter.finish() } @@ -62,6 +70,7 @@ pub struct GenerateCompletionsOutputBuilder { pub(crate) predictions: ::std::option::Option<::std::vec::Vec>, pub(crate) completions: ::std::option::Option<::std::vec::Vec>, pub(crate) next_token: ::std::option::Option<::std::string::String>, + pub(crate) model_id: ::std::option::Option<::std::string::String>, _request_id: Option, } impl GenerateCompletionsOutputBuilder { @@ -124,6 +133,23 @@ impl GenerateCompletionsOutputBuilder { &self.next_token } + /// Unique identifier for the model + pub fn model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.model_id = ::std::option::Option::Some(input.into()); + self + } + + /// Unique identifier for the model + pub fn set_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.model_id = input; + self + } + + /// Unique identifier for the model + pub fn get_model_id(&self) -> &::std::option::Option<::std::string::String> { + &self.model_id + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { self._request_id = Some(request_id.into()); self @@ -141,6 +167,7 @@ impl GenerateCompletionsOutputBuilder { predictions: self.predictions, completions: self.completions, next_token: self.next_token, + model_id: self.model_id, _request_id: self._request_id, } } @@ -151,6 +178,7 @@ impl ::std::fmt::Debug for GenerateCompletionsOutputBuilder { formatter.field("predictions", &self.predictions); formatter.field("completions", &self.completions); formatter.field("next_token", &"*** Sensitive Data Redacted ***"); + formatter.field("model_id", &self.model_id); formatter.field("_request_id", &self._request_id); formatter.finish() } diff --git a/crates/amzn-codewhisperer-client/src/operation/generate_completions/builders.rs b/crates/amzn-codewhisperer-client/src/operation/generate_completions/builders.rs index 3d0b268deb..e025777663 100644 --- a/crates/amzn-codewhisperer-client/src/operation/generate_completions/builders.rs +++ b/crates/amzn-codewhisperer-client/src/operation/generate_completions/builders.rs @@ -352,4 +352,21 @@ impl GenerateCompletionsFluentBuilder { pub fn get_workspace_id(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_workspace_id() } + + /// Unique identifier for the model + pub fn model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.model_id(input.into()); + self + } + + /// Unique identifier for the model + pub fn set_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_model_id(input); + self + } + + /// Unique identifier for the model + pub fn get_model_id(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_model_id() + } } diff --git a/crates/amzn-codewhisperer-client/src/operation/get_usage_limits.rs b/crates/amzn-codewhisperer-client/src/operation/get_usage_limits.rs new file mode 100644 index 0000000000..7de3892101 --- /dev/null +++ b/crates/amzn-codewhisperer-client/src/operation/get_usage_limits.rs @@ -0,0 +1,453 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `GetUsageLimits`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct GetUsageLimits; +impl GetUsageLimits { + /// Creates a new `GetUsageLimits` + pub fn new() -> Self { + Self + } + + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::get_usage_limits::GetUsageLimitsInput, + ) -> ::std::result::Result< + crate::operation::get_usage_limits::GetUsageLimitsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::get_usage_limits::GetUsageLimitsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point( + runtime_plugins, + input, + ::aws_smithy_runtime::client::orchestrator::StopPoint::None, + ) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::get_usage_limits::GetUsageLimitsInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point( + "codewhispererruntime", + "GetUsageLimits", + input, + runtime_plugins, + stop_point, + ) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetUsageLimits { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("GetUsageLimits"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + GetUsageLimitsRequestSerializer, + )); + cfg.store_put( + ::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + GetUsageLimitsResponseDeserializer, + ), + ); + + cfg.store_put( + ::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + ), + ); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "GetUsageLimits", + "codewhispererruntime", + )); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new( + "GetUsageLimits", + ) + .with_interceptor( + ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(), + ) + .with_interceptor(GetUsageLimitsEndpointParamsInterceptor) + .with_retry_classifier( + ::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::get_usage_limits::GetUsageLimitsError, + >::new(), + ) + .with_retry_classifier( + ::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::get_usage_limits::GetUsageLimitsError, + >::new(), + ) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::get_usage_limits::GetUsageLimitsError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct GetUsageLimitsResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetUsageLimitsResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_get_usage_limits::de_get_usage_limits_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_get_usage_limits::de_get_usage_limits_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct GetUsageLimitsRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GetUsageLimitsRequestSerializer { + #[allow( + unused_mut, + clippy::let_and_return, + clippy::needless_borrow, + clippy::useless_conversion + )] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::orchestrator::HttpRequest, + ::aws_smithy_runtime_api::box_error::BoxError, + > { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::get_usage_limits::GetUsageLimitsInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + fn uri_query( + _input: &crate::operation::get_usage_limits::GetUsageLimitsInput, + mut output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + let mut query = ::aws_smithy_http::query::Writer::new(output); + if let ::std::option::Option::Some(inner_1) = &_input.profile_arn { + { + query.push_kv("profileArn", &::aws_smithy_http::query::fmt_string(inner_1)); + } + } + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::get_usage_limits::GetUsageLimitsInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> + { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + uri_query(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header( + builder, + ::http::header::CONTENT_TYPE, + "application/x-amz-json-1.0", + ); + builder = _header_serialization_settings.set_default_header( + builder, + ::http::header::HeaderName::from_static("x-amz-target"), + "AmazonCodeWhispererService.GetUsageLimits", + ); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from( + crate::protocol_serde::shape_get_usage_limits::ser_get_usage_limits_input(&input)?, + ); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header( + request_builder, + ::http::header::CONTENT_LENGTH, + &content_length, + ); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct GetUsageLimitsEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetUsageLimitsEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "GetUsageLimitsEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to GetUsageLimitsInput")?; + + let params = crate::config::endpoint::Params::builder().build().map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new( + "endpoint params could not be built", + err, + ) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new( + params, + )); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `GetUsageLimitsError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum GetUsageLimitsError { + /// This exception is thrown when the input fails to satisfy the constraints specified by the + /// service. + ValidationError(crate::types::error::ValidationError), + /// This exception is thrown when the user does not have sufficient access to perform this + /// action. + AccessDeniedError(crate::types::error::AccessDeniedError), + /// This exception is thrown when request was denied due to request throttling. + ThrottlingError(crate::types::error::ThrottlingError), + /// This exception is thrown when an unexpected error occurred during the processing of a + /// request. + InternalServerError(crate::types::error::InternalServerError), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error + /// code). + #[deprecated( + note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-GetUsageLimitsError) for what information is available for the error." + )] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl GetUsageLimitsError { + /// Creates the `GetUsageLimitsError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into< + ::std::boxed::Box, + >, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `GetUsageLimitsError::Unhandled` variant from an + /// [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ValidationError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::AccessDeniedError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ThrottlingError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + + /// Returns `true` if the error kind is `GetUsageLimitsError::ValidationError`. + pub fn is_validation_error(&self) -> bool { + matches!(self, Self::ValidationError(_)) + } + + /// Returns `true` if the error kind is `GetUsageLimitsError::AccessDeniedError`. + pub fn is_access_denied_error(&self) -> bool { + matches!(self, Self::AccessDeniedError(_)) + } + + /// Returns `true` if the error kind is `GetUsageLimitsError::ThrottlingError`. + pub fn is_throttling_error(&self) -> bool { + matches!(self, Self::ThrottlingError(_)) + } + + /// Returns `true` if the error kind is `GetUsageLimitsError::InternalServerError`. + pub fn is_internal_server_error(&self) -> bool { + matches!(self, Self::InternalServerError(_)) + } +} +impl ::std::error::Error for GetUsageLimitsError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::ValidationError(_inner) => ::std::option::Option::Some(_inner), + Self::AccessDeniedError(_inner) => ::std::option::Option::Some(_inner), + Self::ThrottlingError(_inner) => ::std::option::Option::Some(_inner), + Self::InternalServerError(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for GetUsageLimitsError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::ValidationError(_inner) => _inner.fmt(f), + Self::AccessDeniedError(_inner) => _inner.fmt(f), + Self::ThrottlingError(_inner) => _inner.fmt(f), + Self::InternalServerError(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + }, + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for GetUsageLimitsError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + match self { + Self::ThrottlingError(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::InternalServerError(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + _ => ::std::option::Option::None, + } + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for GetUsageLimitsError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ValidationError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::AccessDeniedError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ThrottlingError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::InternalServerError(_inner) => { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner) + }, + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetUsageLimitsError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::get_usage_limits::GetUsageLimitsError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::get_usage_limits::_get_usage_limits_input::GetUsageLimitsInput; +pub use crate::operation::get_usage_limits::_get_usage_limits_output::GetUsageLimitsOutput; + +mod _get_usage_limits_input; + +mod _get_usage_limits_output; + +/// Builders +pub mod builders; diff --git a/crates/amzn-codewhisperer-client/src/operation/get_usage_limits/_get_usage_limits_input.rs b/crates/amzn-codewhisperer-client/src/operation/get_usage_limits/_get_usage_limits_input.rs new file mode 100644 index 0000000000..d64b3f706a --- /dev/null +++ b/crates/amzn-codewhisperer-client/src/operation/get_usage_limits/_get_usage_limits_input.rs @@ -0,0 +1,64 @@ +// 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, ::std::fmt::Debug)] +pub struct GetUsageLimitsInput { + /// The ARN of the Q Developer profile. Required for enterprise customers, optional for Builder + /// ID users. + pub profile_arn: ::std::option::Option<::std::string::String>, +} +impl GetUsageLimitsInput { + /// The ARN of the Q Developer profile. Required for enterprise customers, optional for Builder + /// ID users. + pub fn profile_arn(&self) -> ::std::option::Option<&str> { + self.profile_arn.as_deref() + } +} +impl GetUsageLimitsInput { + /// Creates a new builder-style object to manufacture + /// [`GetUsageLimitsInput`](crate::operation::get_usage_limits::GetUsageLimitsInput). + pub fn builder() -> crate::operation::get_usage_limits::builders::GetUsageLimitsInputBuilder { + crate::operation::get_usage_limits::builders::GetUsageLimitsInputBuilder::default() + } +} + +/// A builder for [`GetUsageLimitsInput`](crate::operation::get_usage_limits::GetUsageLimitsInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct GetUsageLimitsInputBuilder { + pub(crate) profile_arn: ::std::option::Option<::std::string::String>, +} +impl GetUsageLimitsInputBuilder { + /// The ARN of the Q Developer profile. Required for enterprise customers, optional for Builder + /// ID users. + pub fn profile_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.profile_arn = ::std::option::Option::Some(input.into()); + self + } + + /// The ARN of the Q Developer profile. Required for enterprise customers, optional for Builder + /// ID users. + pub fn set_profile_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.profile_arn = input; + self + } + + /// The ARN of the Q Developer profile. Required for enterprise customers, optional for Builder + /// ID users. + pub fn get_profile_arn(&self) -> &::std::option::Option<::std::string::String> { + &self.profile_arn + } + + /// Consumes the builder and constructs a + /// [`GetUsageLimitsInput`](crate::operation::get_usage_limits::GetUsageLimitsInput). + pub fn build( + self, + ) -> ::std::result::Result< + crate::operation::get_usage_limits::GetUsageLimitsInput, + ::aws_smithy_types::error::operation::BuildError, + > { + ::std::result::Result::Ok(crate::operation::get_usage_limits::GetUsageLimitsInput { + profile_arn: self.profile_arn, + }) + } +} diff --git a/crates/amzn-codewhisperer-client/src/operation/get_usage_limits/_get_usage_limits_output.rs b/crates/amzn-codewhisperer-client/src/operation/get_usage_limits/_get_usage_limits_output.rs new file mode 100644 index 0000000000..2c6d804bcd --- /dev/null +++ b/crates/amzn-codewhisperer-client/src/operation/get_usage_limits/_get_usage_limits_output.rs @@ -0,0 +1,123 @@ +// 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, ::std::fmt::Debug)] +pub struct GetUsageLimitsOutput { + #[allow(missing_docs)] // documentation missing in model + pub limits: ::std::vec::Vec, + /// Number of days remaining until the usage metrics reset + pub days_until_reset: i32, + _request_id: Option, +} +impl GetUsageLimitsOutput { + #[allow(missing_docs)] // documentation missing in model + pub fn limits(&self) -> &[crate::types::UsageLimitList] { + use std::ops::Deref; + self.limits.deref() + } + + /// Number of days remaining until the usage metrics reset + pub fn days_until_reset(&self) -> i32 { + self.days_until_reset + } +} +impl ::aws_types::request_id::RequestId for GetUsageLimitsOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl GetUsageLimitsOutput { + /// Creates a new builder-style object to manufacture + /// [`GetUsageLimitsOutput`](crate::operation::get_usage_limits::GetUsageLimitsOutput). + pub fn builder() -> crate::operation::get_usage_limits::builders::GetUsageLimitsOutputBuilder { + crate::operation::get_usage_limits::builders::GetUsageLimitsOutputBuilder::default() + } +} + +/// A builder for +/// [`GetUsageLimitsOutput`](crate::operation::get_usage_limits::GetUsageLimitsOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct GetUsageLimitsOutputBuilder { + pub(crate) limits: ::std::option::Option<::std::vec::Vec>, + pub(crate) days_until_reset: ::std::option::Option, + _request_id: Option, +} +impl GetUsageLimitsOutputBuilder { + /// Appends an item to `limits`. + /// + /// To override the contents of this collection use [`set_limits`](Self::set_limits). + pub fn limits(mut self, input: crate::types::UsageLimitList) -> Self { + let mut v = self.limits.unwrap_or_default(); + v.push(input); + self.limits = ::std::option::Option::Some(v); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn set_limits(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.limits = input; + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn get_limits(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.limits + } + + /// Number of days remaining until the usage metrics reset + /// This field is required. + pub fn days_until_reset(mut self, input: i32) -> Self { + self.days_until_reset = ::std::option::Option::Some(input); + self + } + + /// Number of days remaining until the usage metrics reset + pub fn set_days_until_reset(mut self, input: ::std::option::Option) -> Self { + self.days_until_reset = input; + self + } + + /// Number of days remaining until the usage metrics reset + pub fn get_days_until_reset(&self) -> &::std::option::Option { + &self.days_until_reset + } + + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + + /// Consumes the builder and constructs a + /// [`GetUsageLimitsOutput`](crate::operation::get_usage_limits::GetUsageLimitsOutput). This + /// method will fail if any of the following fields are not set: + /// - [`limits`](crate::operation::get_usage_limits::builders::GetUsageLimitsOutputBuilder::limits) + /// - [`days_until_reset`](crate::operation::get_usage_limits::builders::GetUsageLimitsOutputBuilder::days_until_reset) + pub fn build( + self, + ) -> ::std::result::Result< + crate::operation::get_usage_limits::GetUsageLimitsOutput, + ::aws_smithy_types::error::operation::BuildError, + > { + ::std::result::Result::Ok(crate::operation::get_usage_limits::GetUsageLimitsOutput { + limits: self.limits.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "limits", + "limits was not specified but it is required when building GetUsageLimitsOutput", + ) + })?, + days_until_reset: self.days_until_reset.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "days_until_reset", + "days_until_reset was not specified but it is required when building GetUsageLimitsOutput", + ) + })?, + _request_id: self._request_id, + }) + } +} diff --git a/crates/amzn-codewhisperer-client/src/operation/get_usage_limits/builders.rs b/crates/amzn-codewhisperer-client/src/operation/get_usage_limits/builders.rs new file mode 100644 index 0000000000..2fa72d2e47 --- /dev/null +++ b/crates/amzn-codewhisperer-client/src/operation/get_usage_limits/builders.rs @@ -0,0 +1,140 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::get_usage_limits::_get_usage_limits_input::GetUsageLimitsInputBuilder; +pub use crate::operation::get_usage_limits::_get_usage_limits_output::GetUsageLimitsOutputBuilder; + +impl crate::operation::get_usage_limits::builders::GetUsageLimitsInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::get_usage_limits::GetUsageLimitsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::get_usage_limits::GetUsageLimitsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.get_usage_limits(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `GetUsageLimits`. +/// +/// API to get current usage limits +#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct GetUsageLimitsFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::get_usage_limits::builders::GetUsageLimitsInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::get_usage_limits::GetUsageLimitsOutput, + crate::operation::get_usage_limits::GetUsageLimitsError, + > for GetUsageLimitsFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::get_usage_limits::GetUsageLimitsOutput, + crate::operation::get_usage_limits::GetUsageLimitsError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl GetUsageLimitsFluentBuilder { + /// Creates a new `GetUsageLimitsFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + + /// Access the GetUsageLimits as a reference. + pub fn as_input(&self) -> &crate::operation::get_usage_limits::builders::GetUsageLimitsInputBuilder { + &self.inner + } + + /// 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::operation::get_usage_limits::GetUsageLimitsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::get_usage_limits::GetUsageLimitsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::get_usage_limits::GetUsageLimits::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::get_usage_limits::GetUsageLimits::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being + /// sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::get_usage_limits::GetUsageLimitsOutput, + crate::operation::get_usage_limits::GetUsageLimitsError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + + pub(crate) fn config_override( + mut self, + config_override: impl ::std::convert::Into, + ) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override( + &mut self, + config_override: ::std::option::Option, + ) -> &mut Self { + self.config_override = config_override; + self + } + + /// The ARN of the Q Developer profile. Required for enterprise customers, optional for Builder + /// ID users. + pub fn profile_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.profile_arn(input.into()); + self + } + + /// The ARN of the Q Developer profile. Required for enterprise customers, optional for Builder + /// ID users. + pub fn set_profile_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_profile_arn(input); + self + } + + /// The ARN of the Q Developer profile. Required for enterprise customers, optional for Builder + /// ID users. + pub fn get_profile_arn(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_profile_arn() + } +} diff --git a/crates/amzn-codewhisperer-client/src/operation/push_telemetry_event/_push_telemetry_event_input.rs b/crates/amzn-codewhisperer-client/src/operation/push_telemetry_event/_push_telemetry_event_input.rs index bae6de02d7..43bf2ebb76 100644 --- a/crates/amzn-codewhisperer-client/src/operation/push_telemetry_event/_push_telemetry_event_input.rs +++ b/crates/amzn-codewhisperer-client/src/operation/push_telemetry_event/_push_telemetry_event_input.rs @@ -6,9 +6,7 @@ pub struct PushTelemetryEventInput { #[allow(missing_docs)] // documentation missing in model pub client_token: ::std::option::Option<::std::string::String>, #[allow(missing_docs)] // documentation missing in model - pub timestamp: ::std::option::Option<::aws_smithy_types::DateTime>, - #[allow(missing_docs)] // documentation missing in model - pub event_id: ::std::option::Option<::std::string::String>, + pub event_type: ::std::option::Option<::std::string::String>, #[allow(missing_docs)] // documentation missing in model pub event: ::std::option::Option<::aws_smithy_types::Document>, } @@ -19,13 +17,8 @@ impl PushTelemetryEventInput { } #[allow(missing_docs)] // documentation missing in model - pub fn timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> { - self.timestamp.as_ref() - } - - #[allow(missing_docs)] // documentation missing in model - pub fn event_id(&self) -> ::std::option::Option<&str> { - self.event_id.as_deref() + pub fn event_type(&self) -> ::std::option::Option<&str> { + self.event_type.as_deref() } #[allow(missing_docs)] // documentation missing in model @@ -47,8 +40,7 @@ impl PushTelemetryEventInput { #[non_exhaustive] pub struct PushTelemetryEventInputBuilder { pub(crate) client_token: ::std::option::Option<::std::string::String>, - pub(crate) timestamp: ::std::option::Option<::aws_smithy_types::DateTime>, - pub(crate) event_id: ::std::option::Option<::std::string::String>, + pub(crate) event_type: ::std::option::Option<::std::string::String>, pub(crate) event: ::std::option::Option<::aws_smithy_types::Document>, } impl PushTelemetryEventInputBuilder { @@ -71,38 +63,20 @@ impl PushTelemetryEventInputBuilder { #[allow(missing_docs)] // documentation missing in model /// This field is required. - pub fn timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self { - self.timestamp = ::std::option::Option::Some(input); - self - } - - #[allow(missing_docs)] // documentation missing in model - pub fn set_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self { - self.timestamp = input; - self - } - - #[allow(missing_docs)] // documentation missing in model - pub fn get_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { - &self.timestamp - } - - #[allow(missing_docs)] // documentation missing in model - /// This field is required. - pub fn event_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { - self.event_id = ::std::option::Option::Some(input.into()); + pub fn event_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.event_type = ::std::option::Option::Some(input.into()); self } #[allow(missing_docs)] // documentation missing in model - pub fn set_event_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { - self.event_id = input; + pub fn set_event_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.event_type = input; self } #[allow(missing_docs)] // documentation missing in model - pub fn get_event_id(&self) -> &::std::option::Option<::std::string::String> { - &self.event_id + pub fn get_event_type(&self) -> &::std::option::Option<::std::string::String> { + &self.event_type } #[allow(missing_docs)] // documentation missing in model @@ -133,8 +107,7 @@ impl PushTelemetryEventInputBuilder { > { ::std::result::Result::Ok(crate::operation::push_telemetry_event::PushTelemetryEventInput { client_token: self.client_token, - timestamp: self.timestamp, - event_id: self.event_id, + event_type: self.event_type, event: self.event, }) } diff --git a/crates/amzn-codewhisperer-client/src/operation/push_telemetry_event/builders.rs b/crates/amzn-codewhisperer-client/src/operation/push_telemetry_event/builders.rs index 2d19c6fc1f..9dfa41df90 100644 --- a/crates/amzn-codewhisperer-client/src/operation/push_telemetry_event/builders.rs +++ b/crates/amzn-codewhisperer-client/src/operation/push_telemetry_event/builders.rs @@ -136,37 +136,20 @@ impl PushTelemetryEventFluentBuilder { } #[allow(missing_docs)] // documentation missing in model - pub fn timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self { - self.inner = self.inner.timestamp(input); + pub fn event_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.event_type(input.into()); self } #[allow(missing_docs)] // documentation missing in model - pub fn set_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self { - self.inner = self.inner.set_timestamp(input); + pub fn set_event_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_event_type(input); self } #[allow(missing_docs)] // documentation missing in model - pub fn get_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { - self.inner.get_timestamp() - } - - #[allow(missing_docs)] // documentation missing in model - pub fn event_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { - self.inner = self.inner.event_id(input.into()); - self - } - - #[allow(missing_docs)] // documentation missing in model - pub fn set_event_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { - self.inner = self.inner.set_event_id(input); - self - } - - #[allow(missing_docs)] // documentation missing in model - pub fn get_event_id(&self) -> &::std::option::Option<::std::string::String> { - self.inner.get_event_id() + pub fn get_event_type(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_event_type() } #[allow(missing_docs)] // documentation missing in model diff --git a/crates/amzn-codewhisperer-client/src/operation/send_telemetry_event/_send_telemetry_event_input.rs b/crates/amzn-codewhisperer-client/src/operation/send_telemetry_event/_send_telemetry_event_input.rs index f7e6abdc9a..0c9ce79acb 100644 --- a/crates/amzn-codewhisperer-client/src/operation/send_telemetry_event/_send_telemetry_event_input.rs +++ b/crates/amzn-codewhisperer-client/src/operation/send_telemetry_event/_send_telemetry_event_input.rs @@ -13,6 +13,8 @@ pub struct SendTelemetryEventInput { pub user_context: ::std::option::Option, #[allow(missing_docs)] // documentation missing in model pub profile_arn: ::std::option::Option<::std::string::String>, + /// Unique identifier for the model + pub model_id: ::std::option::Option<::std::string::String>, } impl SendTelemetryEventInput { #[allow(missing_docs)] // documentation missing in model @@ -39,6 +41,11 @@ impl SendTelemetryEventInput { pub fn profile_arn(&self) -> ::std::option::Option<&str> { self.profile_arn.as_deref() } + + /// Unique identifier for the model + pub fn model_id(&self) -> ::std::option::Option<&str> { + self.model_id.as_deref() + } } impl SendTelemetryEventInput { /// Creates a new builder-style object to manufacture @@ -58,6 +65,7 @@ pub struct SendTelemetryEventInputBuilder { pub(crate) opt_out_preference: ::std::option::Option, pub(crate) user_context: ::std::option::Option, pub(crate) profile_arn: ::std::option::Option<::std::string::String>, + pub(crate) model_id: ::std::option::Option<::std::string::String>, } impl SendTelemetryEventInputBuilder { #[allow(missing_docs)] // documentation missing in model @@ -146,6 +154,23 @@ impl SendTelemetryEventInputBuilder { &self.profile_arn } + /// Unique identifier for the model + pub fn model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.model_id = ::std::option::Option::Some(input.into()); + self + } + + /// Unique identifier for the model + pub fn set_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.model_id = input; + self + } + + /// Unique identifier for the model + pub fn get_model_id(&self) -> &::std::option::Option<::std::string::String> { + &self.model_id + } + /// Consumes the builder and constructs a /// [`SendTelemetryEventInput`](crate::operation::send_telemetry_event::SendTelemetryEventInput). pub fn build( @@ -160,6 +185,7 @@ impl SendTelemetryEventInputBuilder { opt_out_preference: self.opt_out_preference, user_context: self.user_context, profile_arn: self.profile_arn, + model_id: self.model_id, }) } } diff --git a/crates/amzn-codewhisperer-client/src/operation/send_telemetry_event/builders.rs b/crates/amzn-codewhisperer-client/src/operation/send_telemetry_event/builders.rs index 6f4b057af9..f7a95f892f 100644 --- a/crates/amzn-codewhisperer-client/src/operation/send_telemetry_event/builders.rs +++ b/crates/amzn-codewhisperer-client/src/operation/send_telemetry_event/builders.rs @@ -202,4 +202,21 @@ impl SendTelemetryEventFluentBuilder { pub fn get_profile_arn(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_profile_arn() } + + /// Unique identifier for the model + pub fn model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.model_id(input.into()); + self + } + + /// Unique identifier for the model + pub fn set_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_model_id(input); + self + } + + /// Unique identifier for the model + pub fn get_model_id(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_model_id() + } } diff --git a/crates/amzn-codewhisperer-client/src/operation/update_usage_limits.rs b/crates/amzn-codewhisperer-client/src/operation/update_usage_limits.rs new file mode 100644 index 0000000000..3762cb3d4b --- /dev/null +++ b/crates/amzn-codewhisperer-client/src/operation/update_usage_limits.rs @@ -0,0 +1,459 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `UpdateUsageLimits`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct UpdateUsageLimits; +impl UpdateUsageLimits { + /// Creates a new `UpdateUsageLimits` + pub fn new() -> Self { + Self + } + + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::update_usage_limits::UpdateUsageLimitsInput, + ) -> ::std::result::Result< + crate::operation::update_usage_limits::UpdateUsageLimitsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::update_usage_limits::UpdateUsageLimitsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point( + runtime_plugins, + input, + ::aws_smithy_runtime::client::orchestrator::StopPoint::None, + ) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::update_usage_limits::UpdateUsageLimitsInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point( + "codewhispererruntime", + "UpdateUsageLimits", + input, + runtime_plugins, + stop_point, + ) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateUsageLimits { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("UpdateUsageLimits"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + UpdateUsageLimitsRequestSerializer, + )); + cfg.store_put( + ::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + UpdateUsageLimitsResponseDeserializer, + ), + ); + + cfg.store_put( + ::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + ), + ); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "UpdateUsageLimits", + "codewhispererruntime", + )); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new( + "UpdateUsageLimits", + ) + .with_interceptor( + ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(), + ) + .with_interceptor(UpdateUsageLimitsEndpointParamsInterceptor) + .with_retry_classifier( + ::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::update_usage_limits::UpdateUsageLimitsError, + >::new(), + ) + .with_retry_classifier( + ::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::update_usage_limits::UpdateUsageLimitsError, + >::new(), + ) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::update_usage_limits::UpdateUsageLimitsError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct UpdateUsageLimitsResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for UpdateUsageLimitsResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_update_usage_limits::de_update_usage_limits_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_update_usage_limits::de_update_usage_limits_http_response( + status, headers, body, + ) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct UpdateUsageLimitsRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for UpdateUsageLimitsRequestSerializer { + #[allow( + unused_mut, + clippy::let_and_return, + clippy::needless_borrow, + clippy::useless_conversion + )] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::orchestrator::HttpRequest, + ::aws_smithy_runtime_api::box_error::BoxError, + > { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::update_usage_limits::UpdateUsageLimitsInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::update_usage_limits::UpdateUsageLimitsInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> + { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header( + builder, + ::http::header::CONTENT_TYPE, + "application/x-amz-json-1.0", + ); + builder = _header_serialization_settings.set_default_header( + builder, + ::http::header::HeaderName::from_static("x-amz-target"), + "AmazonCodeWhispererService.UpdateUsageLimits", + ); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from( + crate::protocol_serde::shape_update_usage_limits::ser_update_usage_limits_input(&input)?, + ); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header( + request_builder, + ::http::header::CONTENT_LENGTH, + &content_length, + ); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct UpdateUsageLimitsEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateUsageLimitsEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "UpdateUsageLimitsEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to UpdateUsageLimitsInput")?; + + let params = crate::config::endpoint::Params::builder().build().map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new( + "endpoint params could not be built", + err, + ) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new( + params, + )); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `UpdateUsageLimitsError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum UpdateUsageLimitsError { + /// This exception is thrown when the input fails to satisfy the constraints specified by the + /// service. + ValidationError(crate::types::error::ValidationError), + /// This exception is thrown when the user does not have sufficient access to perform this + /// action. + AccessDeniedError(crate::types::error::AccessDeniedError), + /// This exception is thrown when request was denied due to request throttling. + ThrottlingError(crate::types::error::ThrottlingError), + /// This exception is thrown when an unexpected error occurred during the processing of a + /// request. + InternalServerError(crate::types::error::InternalServerError), + /// Exception thrown when the number of usage limit update requests exceeds the monthly quota + /// (default 3 requests per month) + UpdateUsageLimitQuotaExceededError(crate::types::error::UpdateUsageLimitQuotaExceededError), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error + /// code). + #[deprecated( + note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-UpdateUsageLimitsError) for what information is available for the error." + )] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl UpdateUsageLimitsError { + /// Creates the `UpdateUsageLimitsError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into< + ::std::boxed::Box, + >, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `UpdateUsageLimitsError::Unhandled` variant from an + /// [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ValidationError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::AccessDeniedError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ThrottlingError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::UpdateUsageLimitQuotaExceededError(e) => { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e) + }, + Self::Unhandled(e) => &e.meta, + } + } + + /// Returns `true` if the error kind is `UpdateUsageLimitsError::ValidationError`. + pub fn is_validation_error(&self) -> bool { + matches!(self, Self::ValidationError(_)) + } + + /// Returns `true` if the error kind is `UpdateUsageLimitsError::AccessDeniedError`. + pub fn is_access_denied_error(&self) -> bool { + matches!(self, Self::AccessDeniedError(_)) + } + + /// Returns `true` if the error kind is `UpdateUsageLimitsError::ThrottlingError`. + pub fn is_throttling_error(&self) -> bool { + matches!(self, Self::ThrottlingError(_)) + } + + /// Returns `true` if the error kind is `UpdateUsageLimitsError::InternalServerError`. + pub fn is_internal_server_error(&self) -> bool { + matches!(self, Self::InternalServerError(_)) + } + + /// Returns `true` if the error kind is + /// `UpdateUsageLimitsError::UpdateUsageLimitQuotaExceededError`. + pub fn is_update_usage_limit_quota_exceeded_error(&self) -> bool { + matches!(self, Self::UpdateUsageLimitQuotaExceededError(_)) + } +} +impl ::std::error::Error for UpdateUsageLimitsError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::ValidationError(_inner) => ::std::option::Option::Some(_inner), + Self::AccessDeniedError(_inner) => ::std::option::Option::Some(_inner), + Self::ThrottlingError(_inner) => ::std::option::Option::Some(_inner), + Self::InternalServerError(_inner) => ::std::option::Option::Some(_inner), + Self::UpdateUsageLimitQuotaExceededError(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for UpdateUsageLimitsError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::ValidationError(_inner) => _inner.fmt(f), + Self::AccessDeniedError(_inner) => _inner.fmt(f), + Self::ThrottlingError(_inner) => _inner.fmt(f), + Self::InternalServerError(_inner) => _inner.fmt(f), + Self::UpdateUsageLimitQuotaExceededError(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + }, + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for UpdateUsageLimitsError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + match self { + Self::ThrottlingError(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::InternalServerError(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + _ => ::std::option::Option::None, + } + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for UpdateUsageLimitsError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ValidationError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::AccessDeniedError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ThrottlingError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::InternalServerError(_inner) => { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner) + }, + Self::UpdateUsageLimitQuotaExceededError(_inner) => { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner) + }, + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for UpdateUsageLimitsError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::update_usage_limits::UpdateUsageLimitsError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::update_usage_limits::_update_usage_limits_input::UpdateUsageLimitsInput; +pub use crate::operation::update_usage_limits::_update_usage_limits_output::UpdateUsageLimitsOutput; + +mod _update_usage_limits_input; + +mod _update_usage_limits_output; + +/// Builders +pub mod builders; diff --git a/crates/amzn-codewhisperer-client/src/operation/update_usage_limits/_update_usage_limits_input.rs b/crates/amzn-codewhisperer-client/src/operation/update_usage_limits/_update_usage_limits_input.rs new file mode 100644 index 0000000000..62ec9b216a --- /dev/null +++ b/crates/amzn-codewhisperer-client/src/operation/update_usage_limits/_update_usage_limits_input.rs @@ -0,0 +1,167 @@ +// 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, ::std::fmt::Debug)] +pub struct UpdateUsageLimitsInput { + #[allow(missing_docs)] // documentation missing in model + pub account_id: ::std::option::Option<::std::string::String>, + #[allow(missing_docs)] // documentation missing in model + pub accountless_user_id: ::std::option::Option<::std::string::String>, + #[allow(missing_docs)] // documentation missing in model + pub feature_type: ::std::option::Option, + #[allow(missing_docs)] // documentation missing in model + pub requested_limit: ::std::option::Option, + #[allow(missing_docs)] // documentation missing in model + pub justification: ::std::option::Option<::std::string::String>, +} +impl UpdateUsageLimitsInput { + #[allow(missing_docs)] // documentation missing in model + pub fn account_id(&self) -> ::std::option::Option<&str> { + self.account_id.as_deref() + } + + #[allow(missing_docs)] // documentation missing in model + pub fn accountless_user_id(&self) -> ::std::option::Option<&str> { + self.accountless_user_id.as_deref() + } + + #[allow(missing_docs)] // documentation missing in model + pub fn feature_type(&self) -> ::std::option::Option<&crate::types::UsageLimitType> { + self.feature_type.as_ref() + } + + #[allow(missing_docs)] // documentation missing in model + pub fn requested_limit(&self) -> ::std::option::Option { + self.requested_limit + } + + #[allow(missing_docs)] // documentation missing in model + pub fn justification(&self) -> ::std::option::Option<&str> { + self.justification.as_deref() + } +} +impl UpdateUsageLimitsInput { + /// Creates a new builder-style object to manufacture + /// [`UpdateUsageLimitsInput`](crate::operation::update_usage_limits::UpdateUsageLimitsInput). + pub fn builder() -> crate::operation::update_usage_limits::builders::UpdateUsageLimitsInputBuilder { + crate::operation::update_usage_limits::builders::UpdateUsageLimitsInputBuilder::default() + } +} + +/// A builder for +/// [`UpdateUsageLimitsInput`](crate::operation::update_usage_limits::UpdateUsageLimitsInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct UpdateUsageLimitsInputBuilder { + pub(crate) account_id: ::std::option::Option<::std::string::String>, + pub(crate) accountless_user_id: ::std::option::Option<::std::string::String>, + pub(crate) feature_type: ::std::option::Option, + pub(crate) requested_limit: ::std::option::Option, + pub(crate) justification: ::std::option::Option<::std::string::String>, +} +impl UpdateUsageLimitsInputBuilder { + #[allow(missing_docs)] // documentation missing in model + /// This field is required. + pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.account_id = ::std::option::Option::Some(input.into()); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.account_id = input; + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> { + &self.account_id + } + + #[allow(missing_docs)] // documentation missing in model + pub fn accountless_user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.accountless_user_id = ::std::option::Option::Some(input.into()); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn set_accountless_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.accountless_user_id = input; + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn get_accountless_user_id(&self) -> &::std::option::Option<::std::string::String> { + &self.accountless_user_id + } + + #[allow(missing_docs)] // documentation missing in model + /// This field is required. + pub fn feature_type(mut self, input: crate::types::UsageLimitType) -> Self { + self.feature_type = ::std::option::Option::Some(input); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn set_feature_type(mut self, input: ::std::option::Option) -> Self { + self.feature_type = input; + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn get_feature_type(&self) -> &::std::option::Option { + &self.feature_type + } + + #[allow(missing_docs)] // documentation missing in model + /// This field is required. + pub fn requested_limit(mut self, input: i64) -> Self { + self.requested_limit = ::std::option::Option::Some(input); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn set_requested_limit(mut self, input: ::std::option::Option) -> Self { + self.requested_limit = input; + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn get_requested_limit(&self) -> &::std::option::Option { + &self.requested_limit + } + + #[allow(missing_docs)] // documentation missing in model + pub fn justification(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.justification = ::std::option::Option::Some(input.into()); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn set_justification(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.justification = input; + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn get_justification(&self) -> &::std::option::Option<::std::string::String> { + &self.justification + } + + /// Consumes the builder and constructs a + /// [`UpdateUsageLimitsInput`](crate::operation::update_usage_limits::UpdateUsageLimitsInput). + pub fn build( + self, + ) -> ::std::result::Result< + crate::operation::update_usage_limits::UpdateUsageLimitsInput, + ::aws_smithy_types::error::operation::BuildError, + > { + ::std::result::Result::Ok(crate::operation::update_usage_limits::UpdateUsageLimitsInput { + account_id: self.account_id, + accountless_user_id: self.accountless_user_id, + feature_type: self.feature_type, + requested_limit: self.requested_limit, + justification: self.justification, + }) + } +} diff --git a/crates/amzn-codewhisperer-client/src/operation/update_usage_limits/_update_usage_limits_output.rs b/crates/amzn-codewhisperer-client/src/operation/update_usage_limits/_update_usage_limits_output.rs new file mode 100644 index 0000000000..ab2d91b464 --- /dev/null +++ b/crates/amzn-codewhisperer-client/src/operation/update_usage_limits/_update_usage_limits_output.rs @@ -0,0 +1,138 @@ +// 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, ::std::fmt::Debug)] +pub struct UpdateUsageLimitsOutput { + #[allow(missing_docs)] // documentation missing in model + pub status: crate::types::UsageLimitUpdateRequestStatus, + #[allow(missing_docs)] // documentation missing in model + pub approved_limit: ::std::option::Option, + #[allow(missing_docs)] // documentation missing in model + pub remaining_requests_this_month: ::std::option::Option, + _request_id: Option, +} +impl UpdateUsageLimitsOutput { + #[allow(missing_docs)] // documentation missing in model + pub fn status(&self) -> &crate::types::UsageLimitUpdateRequestStatus { + &self.status + } + + #[allow(missing_docs)] // documentation missing in model + pub fn approved_limit(&self) -> ::std::option::Option { + self.approved_limit + } + + #[allow(missing_docs)] // documentation missing in model + pub fn remaining_requests_this_month(&self) -> ::std::option::Option { + self.remaining_requests_this_month + } +} +impl ::aws_types::request_id::RequestId for UpdateUsageLimitsOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl UpdateUsageLimitsOutput { + /// Creates a new builder-style object to manufacture + /// [`UpdateUsageLimitsOutput`](crate::operation::update_usage_limits::UpdateUsageLimitsOutput). + pub fn builder() -> crate::operation::update_usage_limits::builders::UpdateUsageLimitsOutputBuilder { + crate::operation::update_usage_limits::builders::UpdateUsageLimitsOutputBuilder::default() + } +} + +/// A builder for +/// [`UpdateUsageLimitsOutput`](crate::operation::update_usage_limits::UpdateUsageLimitsOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct UpdateUsageLimitsOutputBuilder { + pub(crate) status: ::std::option::Option, + pub(crate) approved_limit: ::std::option::Option, + pub(crate) remaining_requests_this_month: ::std::option::Option, + _request_id: Option, +} +impl UpdateUsageLimitsOutputBuilder { + #[allow(missing_docs)] // documentation missing in model + /// This field is required. + pub fn status(mut self, input: crate::types::UsageLimitUpdateRequestStatus) -> Self { + self.status = ::std::option::Option::Some(input); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn set_status(mut self, input: ::std::option::Option) -> Self { + self.status = input; + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn get_status(&self) -> &::std::option::Option { + &self.status + } + + #[allow(missing_docs)] // documentation missing in model + pub fn approved_limit(mut self, input: i64) -> Self { + self.approved_limit = ::std::option::Option::Some(input); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn set_approved_limit(mut self, input: ::std::option::Option) -> Self { + self.approved_limit = input; + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn get_approved_limit(&self) -> &::std::option::Option { + &self.approved_limit + } + + #[allow(missing_docs)] // documentation missing in model + pub fn remaining_requests_this_month(mut self, input: i32) -> Self { + self.remaining_requests_this_month = ::std::option::Option::Some(input); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn set_remaining_requests_this_month(mut self, input: ::std::option::Option) -> Self { + self.remaining_requests_this_month = input; + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn get_remaining_requests_this_month(&self) -> &::std::option::Option { + &self.remaining_requests_this_month + } + + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + + /// Consumes the builder and constructs a + /// [`UpdateUsageLimitsOutput`](crate::operation::update_usage_limits::UpdateUsageLimitsOutput). + /// This method will fail if any of the following fields are not set: + /// - [`status`](crate::operation::update_usage_limits::builders::UpdateUsageLimitsOutputBuilder::status) + pub fn build( + self, + ) -> ::std::result::Result< + crate::operation::update_usage_limits::UpdateUsageLimitsOutput, + ::aws_smithy_types::error::operation::BuildError, + > { + ::std::result::Result::Ok(crate::operation::update_usage_limits::UpdateUsageLimitsOutput { + status: self.status.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "status", + "status was not specified but it is required when building UpdateUsageLimitsOutput", + ) + })?, + approved_limit: self.approved_limit, + remaining_requests_this_month: self.remaining_requests_this_month, + _request_id: self._request_id, + }) + } +} diff --git a/crates/amzn-codewhisperer-client/src/operation/update_usage_limits/builders.rs b/crates/amzn-codewhisperer-client/src/operation/update_usage_limits/builders.rs new file mode 100644 index 0000000000..47c9cb7166 --- /dev/null +++ b/crates/amzn-codewhisperer-client/src/operation/update_usage_limits/builders.rs @@ -0,0 +1,205 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::update_usage_limits::_update_usage_limits_input::UpdateUsageLimitsInputBuilder; +pub use crate::operation::update_usage_limits::_update_usage_limits_output::UpdateUsageLimitsOutputBuilder; + +impl crate::operation::update_usage_limits::builders::UpdateUsageLimitsInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::update_usage_limits::UpdateUsageLimitsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::update_usage_limits::UpdateUsageLimitsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.update_usage_limits(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `UpdateUsageLimits`. +/// +/// API to update usage limits for enterprise customers +#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct UpdateUsageLimitsFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::update_usage_limits::builders::UpdateUsageLimitsInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::update_usage_limits::UpdateUsageLimitsOutput, + crate::operation::update_usage_limits::UpdateUsageLimitsError, + > for UpdateUsageLimitsFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::update_usage_limits::UpdateUsageLimitsOutput, + crate::operation::update_usage_limits::UpdateUsageLimitsError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl UpdateUsageLimitsFluentBuilder { + /// Creates a new `UpdateUsageLimitsFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + + /// Access the UpdateUsageLimits as a reference. + pub fn as_input(&self) -> &crate::operation::update_usage_limits::builders::UpdateUsageLimitsInputBuilder { + &self.inner + } + + /// 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::operation::update_usage_limits::UpdateUsageLimitsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::update_usage_limits::UpdateUsageLimitsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::update_usage_limits::UpdateUsageLimits::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::update_usage_limits::UpdateUsageLimits::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being + /// sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::update_usage_limits::UpdateUsageLimitsOutput, + crate::operation::update_usage_limits::UpdateUsageLimitsError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + + pub(crate) fn config_override( + mut self, + config_override: impl ::std::convert::Into, + ) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override( + &mut self, + config_override: ::std::option::Option, + ) -> &mut Self { + self.config_override = config_override; + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.account_id(input.into()); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_account_id(input); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_account_id() + } + + #[allow(missing_docs)] // documentation missing in model + pub fn accountless_user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.accountless_user_id(input.into()); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn set_accountless_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_accountless_user_id(input); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn get_accountless_user_id(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_accountless_user_id() + } + + #[allow(missing_docs)] // documentation missing in model + pub fn feature_type(mut self, input: crate::types::UsageLimitType) -> Self { + self.inner = self.inner.feature_type(input); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn set_feature_type(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_feature_type(input); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn get_feature_type(&self) -> &::std::option::Option { + self.inner.get_feature_type() + } + + #[allow(missing_docs)] // documentation missing in model + pub fn requested_limit(mut self, input: i64) -> Self { + self.inner = self.inner.requested_limit(input); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn set_requested_limit(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_requested_limit(input); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn get_requested_limit(&self) -> &::std::option::Option { + self.inner.get_requested_limit() + } + + #[allow(missing_docs)] // documentation missing in model + pub fn justification(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.justification(input.into()); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn set_justification(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_justification(input); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn get_justification(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_justification() + } +} diff --git a/crates/amzn-codewhisperer-client/src/protocol_serde.rs b/crates/amzn-codewhisperer-client/src/protocol_serde.rs index 636c2ddec4..242a9c318e 100644 --- a/crates/amzn-codewhisperer-client/src/protocol_serde.rs +++ b/crates/amzn-codewhisperer-client/src/protocol_serde.rs @@ -30,6 +30,8 @@ pub fn parse_http_error_metadata( pub(crate) mod shape_create_artifact_upload_url; +pub(crate) mod shape_create_subscription_token; + pub(crate) mod shape_create_task_assist_conversation; pub(crate) mod shape_create_upload_url; @@ -58,6 +60,8 @@ pub(crate) mod shape_get_transformation; pub(crate) mod shape_get_transformation_plan; +pub(crate) mod shape_get_usage_limits; + pub(crate) mod shape_list_available_customizations; pub(crate) mod shape_list_available_profiles; @@ -90,6 +94,8 @@ pub(crate) mod shape_start_transformation; pub(crate) mod shape_stop_transformation; +pub(crate) mod shape_update_usage_limits; + pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] { if data.is_empty() { b"{}" } else { data } } @@ -100,6 +106,8 @@ pub(crate) mod shape_conflict_exception; pub(crate) mod shape_create_artifact_upload_url_input; +pub(crate) mod shape_create_subscription_token_input; + pub(crate) mod shape_create_task_assist_conversation_input; pub(crate) mod shape_create_upload_url_input; @@ -128,6 +136,8 @@ pub(crate) mod shape_get_transformation_input; pub(crate) mod shape_get_transformation_plan_input; +pub(crate) mod shape_get_usage_limits_input; + pub(crate) mod shape_internal_server_exception; pub(crate) mod shape_list_available_customizations_input; @@ -168,6 +178,10 @@ pub(crate) mod shape_stop_transformation_input; pub(crate) mod shape_throttling_exception; +pub(crate) mod shape_update_usage_limit_quota_exceeded_exception; + +pub(crate) mod shape_update_usage_limits_input; + pub(crate) mod shape_validation_exception; pub(crate) mod shape_code_generation_status; @@ -224,6 +238,8 @@ pub(crate) mod shape_transformation_spec; pub(crate) mod shape_upload_context; +pub(crate) mod shape_usage_limits; + pub(crate) mod shape_user_context; pub(crate) mod shape_workspace_list; @@ -318,6 +334,8 @@ pub(crate) mod shape_transformation_steps; pub(crate) mod shape_transformation_upload_context; +pub(crate) mod shape_usage_limit_list; + pub(crate) mod shape_user_modification_event; pub(crate) mod shape_user_trigger_decision_event; diff --git a/crates/amzn-codewhisperer-client/src/protocol_serde/shape_chat_add_message_event.rs b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_chat_add_message_event.rs index 8e975642d5..277752c058 100644 --- a/crates/amzn-codewhisperer-client/src/protocol_serde/shape_chat_add_message_event.rs +++ b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_chat_add_message_event.rs @@ -75,5 +75,8 @@ pub fn ser_chat_add_message_event( if let Some(var_15) = &input.has_project_level_context { object.key("hasProjectLevelContext").boolean(*var_15); } + if let Some(var_16) = &input.result { + object.key("result").string(var_16.as_str()); + } Ok(()) } diff --git a/crates/amzn-codewhisperer-client/src/protocol_serde/shape_code_coverage_event.rs b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_code_coverage_event.rs index 79b0dae06f..7585592779 100644 --- a/crates/amzn-codewhisperer-client/src/protocol_serde/shape_code_coverage_event.rs +++ b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_code_coverage_event.rs @@ -62,5 +62,11 @@ pub fn ser_code_coverage_event( ::aws_smithy_types::Number::NegInt((input.user_written_code_line_count).into()), ); } + if input.added_character_count != 0 { + object.key("addedCharacterCount").number( + #[allow(clippy::useless_conversion)] + ::aws_smithy_types::Number::NegInt((input.added_character_count).into()), + ); + } Ok(()) } diff --git a/crates/amzn-codewhisperer-client/src/protocol_serde/shape_create_subscription_token.rs b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_create_subscription_token.rs new file mode 100644 index 0000000000..07ff020aad --- /dev/null +++ b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_create_subscription_token.rs @@ -0,0 +1,221 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_create_subscription_token_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::create_subscription_token::CreateSubscriptionTokenOutput, + crate::operation::create_subscription_token::CreateSubscriptionTokenError, +> { + #[allow(unused_mut)] + let mut generic_builder = + crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::create_subscription_token::CreateSubscriptionTokenError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => { + return Err(crate::operation::create_subscription_token::CreateSubscriptionTokenError::unhandled(generic)); + }, + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "ValidationException" => { + crate::operation::create_subscription_token::CreateSubscriptionTokenError::ValidationError({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ValidationErrorBuilder::default(); + output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err( + _response_body, + output, + ) + .map_err(crate::operation::create_subscription_token::CreateSubscriptionTokenError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::validation_exception_correct_errors(output) + .build() + .map_err(crate::operation::create_subscription_token::CreateSubscriptionTokenError::unhandled)? + }; + tmp + }) + }, + "AccessDeniedException" => { + crate::operation::create_subscription_token::CreateSubscriptionTokenError::AccessDeniedError({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedErrorBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err( + _response_body, + output, + ) + .map_err(crate::operation::create_subscription_token::CreateSubscriptionTokenError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::access_denied_exception_correct_errors(output) + .build() + .map_err(crate::operation::create_subscription_token::CreateSubscriptionTokenError::unhandled)? + }; + tmp + }) + }, + "InternalServerException" => { + crate::operation::create_subscription_token::CreateSubscriptionTokenError::InternalServerError({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InternalServerErrorBuilder::default(); + output = + crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err( + _response_body, + output, + ) + .map_err( + crate::operation::create_subscription_token::CreateSubscriptionTokenError::unhandled, + )?; + let output = output.meta(generic); + crate::serde_util::internal_server_exception_correct_errors(output) + .build() + .map_err(crate::operation::create_subscription_token::CreateSubscriptionTokenError::unhandled)? + }; + tmp + }) + }, + "ThrottlingException" => { + crate::operation::create_subscription_token::CreateSubscriptionTokenError::ThrottlingError({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ThrottlingErrorBuilder::default(); + output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err( + _response_body, + output, + ) + .map_err(crate::operation::create_subscription_token::CreateSubscriptionTokenError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::throttling_exception_correct_errors(output) + .build() + .map_err(crate::operation::create_subscription_token::CreateSubscriptionTokenError::unhandled)? + }; + tmp + }) + }, + "ConflictException" => { + crate::operation::create_subscription_token::CreateSubscriptionTokenError::ConflictError({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ConflictErrorBuilder::default(); + output = crate::protocol_serde::shape_conflict_exception::de_conflict_exception_json_err( + _response_body, + output, + ) + .map_err(crate::operation::create_subscription_token::CreateSubscriptionTokenError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::conflict_exception_correct_errors(output) + .build() + .map_err(crate::operation::create_subscription_token::CreateSubscriptionTokenError::unhandled)? + }; + tmp + }) + }, + _ => crate::operation::create_subscription_token::CreateSubscriptionTokenError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_create_subscription_token_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::create_subscription_token::CreateSubscriptionTokenOutput, + crate::operation::create_subscription_token::CreateSubscriptionTokenError, +> { + Ok({ + #[allow(unused_mut)] + let mut output = + crate::operation::create_subscription_token::builders::CreateSubscriptionTokenOutputBuilder::default(); + output = crate::protocol_serde::shape_create_subscription_token::de_create_subscription_token( + _response_body, + output, + ) + .map_err(crate::operation::create_subscription_token::CreateSubscriptionTokenError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + crate::serde_util::create_subscription_token_output_output_correct_errors(output) + .build() + .map_err(crate::operation::create_subscription_token::CreateSubscriptionTokenError::unhandled)? + }) +} + +pub fn ser_create_subscription_token_input( + input: &crate::operation::create_subscription_token::CreateSubscriptionTokenInput, +) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> +{ + let mut out = String::new(); + let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); + crate::protocol_serde::shape_create_subscription_token_input::ser_create_subscription_token_input_input( + &mut object, + input, + )?; + object.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} + +pub(crate) fn de_create_subscription_token( + value: &[u8], + mut builder: crate::operation::create_subscription_token::builders::CreateSubscriptionTokenOutputBuilder, +) -> ::std::result::Result< + crate::operation::create_subscription_token::builders::CreateSubscriptionTokenOutputBuilder, + ::aws_smithy_json::deserialize::error::DeserializeError, +> { + let mut tokens_owned = + ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::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() { + "encodedVerificationUrl" => { + builder = builder.set_encoded_verification_url( + ::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()?, + ); + }, + "status" => { + builder = builder.set_status( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| { + s.to_unescaped() + .map(|u| crate::types::SubscriptionStatus::from(u.as_ref())) + }) + .transpose()?, + ); + }, + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + format!("expected object key or end object, found: {:?}", other), + )); + }, + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/crates/amzn-codewhisperer-client/src/protocol_serde/shape_create_subscription_token_input.rs b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_create_subscription_token_input.rs new file mode 100644 index 0000000000..9405a71f0c --- /dev/null +++ b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_create_subscription_token_input.rs @@ -0,0 +1,13 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_create_subscription_token_input_input( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::operation::create_subscription_token::CreateSubscriptionTokenInput, +) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> { + if let Some(var_1) = &input.account_id { + object.key("accountId").string(var_1.as_str()); + } + if let Some(var_2) = &input.client_token { + object.key("clientToken").string(var_2.as_str()); + } + Ok(()) +} diff --git a/crates/amzn-codewhisperer-client/src/protocol_serde/shape_file_context.rs b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_file_context.rs index 0c003716d9..a23639986d 100644 --- a/crates/amzn-codewhisperer-client/src/protocol_serde/shape_file_context.rs +++ b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_file_context.rs @@ -12,14 +12,17 @@ pub fn ser_file_context( { object.key("filename").string(input.filename.as_str()); } + if let Some(var_1) = &input.file_uri { + object.key("fileUri").string(var_1.as_str()); + } { #[allow(unused_mut)] - let mut object_1 = object.key("programmingLanguage").start_object(); + let mut object_2 = object.key("programmingLanguage").start_object(); crate::protocol_serde::shape_programming_language::ser_programming_language( - &mut object_1, + &mut object_2, &input.programming_language, )?; - object_1.finish(); + object_2.finish(); } Ok(()) } diff --git a/crates/amzn-codewhisperer-client/src/protocol_serde/shape_generate_completions.rs b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_generate_completions.rs index bfce3d2f87..d2a1682051 100644 --- a/crates/amzn-codewhisperer-client/src/protocol_serde/shape_generate_completions.rs +++ b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_generate_completions.rs @@ -158,6 +158,13 @@ pub(crate) fn de_generate_completions( .transpose()?, ); }, + "modelId" => { + builder = builder.set_model_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 => { diff --git a/crates/amzn-codewhisperer-client/src/protocol_serde/shape_generate_completions_input.rs b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_generate_completions_input.rs index e1090c5032..50fadacb94 100644 --- a/crates/amzn-codewhisperer-client/src/protocol_serde/shape_generate_completions_input.rs +++ b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_generate_completions_input.rs @@ -72,5 +72,8 @@ pub fn ser_generate_completions_input_input( if let Some(var_21) = &input.workspace_id { object.key("workspaceId").string(var_21.as_str()); } + if let Some(var_22) = &input.model_id { + object.key("modelId").string(var_22.as_str()); + } Ok(()) } diff --git a/crates/amzn-codewhisperer-client/src/protocol_serde/shape_get_usage_limits.rs b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_get_usage_limits.rs new file mode 100644 index 0000000000..4577ae7829 --- /dev/null +++ b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_get_usage_limits.rs @@ -0,0 +1,172 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_get_usage_limits_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::get_usage_limits::GetUsageLimitsOutput, + crate::operation::get_usage_limits::GetUsageLimitsError, +> { + #[allow(unused_mut)] + let mut generic_builder = + crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::get_usage_limits::GetUsageLimitsError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => { + return Err(crate::operation::get_usage_limits::GetUsageLimitsError::unhandled( + generic, + )); + }, + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "ValidationException" => crate::operation::get_usage_limits::GetUsageLimitsError::ValidationError({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ValidationErrorBuilder::default(); + output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err( + _response_body, + output, + ) + .map_err(crate::operation::get_usage_limits::GetUsageLimitsError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::validation_exception_correct_errors(output) + .build() + .map_err(crate::operation::get_usage_limits::GetUsageLimitsError::unhandled)? + }; + tmp + }), + "AccessDeniedException" => crate::operation::get_usage_limits::GetUsageLimitsError::AccessDeniedError({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedErrorBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err( + _response_body, + output, + ) + .map_err(crate::operation::get_usage_limits::GetUsageLimitsError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::access_denied_exception_correct_errors(output) + .build() + .map_err(crate::operation::get_usage_limits::GetUsageLimitsError::unhandled)? + }; + tmp + }), + "ThrottlingException" => crate::operation::get_usage_limits::GetUsageLimitsError::ThrottlingError({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ThrottlingErrorBuilder::default(); + output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err( + _response_body, + output, + ) + .map_err(crate::operation::get_usage_limits::GetUsageLimitsError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::throttling_exception_correct_errors(output) + .build() + .map_err(crate::operation::get_usage_limits::GetUsageLimitsError::unhandled)? + }; + tmp + }), + "InternalServerException" => crate::operation::get_usage_limits::GetUsageLimitsError::InternalServerError({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InternalServerErrorBuilder::default(); + output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err( + _response_body, + output, + ) + .map_err(crate::operation::get_usage_limits::GetUsageLimitsError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::internal_server_exception_correct_errors(output) + .build() + .map_err(crate::operation::get_usage_limits::GetUsageLimitsError::unhandled)? + }; + tmp + }), + _ => crate::operation::get_usage_limits::GetUsageLimitsError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_get_usage_limits_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::get_usage_limits::GetUsageLimitsOutput, + crate::operation::get_usage_limits::GetUsageLimitsError, +> { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::get_usage_limits::builders::GetUsageLimitsOutputBuilder::default(); + output = crate::protocol_serde::shape_get_usage_limits::de_get_usage_limits(_response_body, output) + .map_err(crate::operation::get_usage_limits::GetUsageLimitsError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + crate::serde_util::get_usage_limits_output_output_correct_errors(output) + .build() + .map_err(crate::operation::get_usage_limits::GetUsageLimitsError::unhandled)? + }) +} + +pub fn ser_get_usage_limits_input( + input: &crate::operation::get_usage_limits::GetUsageLimitsInput, +) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> +{ + let mut out = String::new(); + let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); + crate::protocol_serde::shape_get_usage_limits_input::ser_get_usage_limits_input_input(&mut object, input)?; + object.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} + +pub(crate) fn de_get_usage_limits( + value: &[u8], + mut builder: crate::operation::get_usage_limits::builders::GetUsageLimitsOutputBuilder, +) -> ::std::result::Result< + crate::operation::get_usage_limits::builders::GetUsageLimitsOutputBuilder, + ::aws_smithy_json::deserialize::error::DeserializeError, +> { + let mut tokens_owned = + ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::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() { + "limits" => { + builder = builder.set_limits(crate::protocol_serde::shape_usage_limits::de_usage_limits(tokens)?); + }, + "daysUntilReset" => { + builder = builder.set_days_until_reset( + ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())? + .map(i32::try_from) + .transpose()?, + ); + }, + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + format!("expected object key or end object, found: {:?}", other), + )); + }, + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/crates/amzn-codewhisperer-client/src/protocol_serde/shape_get_usage_limits_input.rs b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_get_usage_limits_input.rs new file mode 100644 index 0000000000..5bfad8ca08 --- /dev/null +++ b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_get_usage_limits_input.rs @@ -0,0 +1,10 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_get_usage_limits_input_input( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::operation::get_usage_limits::GetUsageLimitsInput, +) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> { + if let Some(var_1) = &input.profile_arn { + object.key("profileArn").string(var_1.as_str()); + } + Ok(()) +} diff --git a/crates/amzn-codewhisperer-client/src/protocol_serde/shape_push_telemetry_event_input.rs b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_push_telemetry_event_input.rs index 56ffade93a..bb229db296 100644 --- a/crates/amzn-codewhisperer-client/src/protocol_serde/shape_push_telemetry_event_input.rs +++ b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_push_telemetry_event_input.rs @@ -6,16 +6,11 @@ pub fn ser_push_telemetry_event_input_input( if let Some(var_1) = &input.client_token { object.key("clientToken").string(var_1.as_str()); } - if let Some(var_2) = &input.timestamp { - object - .key("timestamp") - .date_time(var_2, ::aws_smithy_types::date_time::Format::EpochSeconds)?; + if let Some(var_2) = &input.event_type { + object.key("eventType").string(var_2.as_str()); } - if let Some(var_3) = &input.event_id { - object.key("eventId").string(var_3.as_str()); - } - if let Some(var_4) = &input.event { - object.key("event").document(var_4); + if let Some(var_3) = &input.event { + object.key("event").document(var_3); } Ok(()) } diff --git a/crates/amzn-codewhisperer-client/src/protocol_serde/shape_send_telemetry_event_input.rs b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_send_telemetry_event_input.rs index 8fd5a6a63a..dfa0de4ab6 100644 --- a/crates/amzn-codewhisperer-client/src/protocol_serde/shape_send_telemetry_event_input.rs +++ b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_send_telemetry_event_input.rs @@ -24,5 +24,8 @@ pub fn ser_send_telemetry_event_input_input( if let Some(var_7) = &input.profile_arn { object.key("profileArn").string(var_7.as_str()); } + if let Some(var_8) = &input.model_id { + object.key("modelId").string(var_8.as_str()); + } Ok(()) } diff --git a/crates/amzn-codewhisperer-client/src/protocol_serde/shape_update_usage_limit_quota_exceeded_exception.rs b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_update_usage_limit_quota_exceeded_exception.rs new file mode 100644 index 0000000000..8eb78f94e8 --- /dev/null +++ b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_update_usage_limit_quota_exceeded_exception.rs @@ -0,0 +1,39 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_update_usage_limit_quota_exceeded_exception_json_err( + value: &[u8], + mut builder: crate::types::error::builders::UpdateUsageLimitQuotaExceededErrorBuilder, +) -> ::std::result::Result< + crate::types::error::builders::UpdateUsageLimitQuotaExceededErrorBuilder, + ::aws_smithy_json::deserialize::error::DeserializeError, +> { + let mut tokens_owned = + ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::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() { + "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()?, + ); + }, + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + format!("expected object key or end object, found: {:?}", other), + )); + }, + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/crates/amzn-codewhisperer-client/src/protocol_serde/shape_update_usage_limits.rs b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_update_usage_limits.rs new file mode 100644 index 0000000000..3109f380c2 --- /dev/null +++ b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_update_usage_limits.rs @@ -0,0 +1,201 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_update_usage_limits_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::update_usage_limits::UpdateUsageLimitsOutput, + crate::operation::update_usage_limits::UpdateUsageLimitsError, +> { + #[allow(unused_mut)] + let mut generic_builder = + crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::update_usage_limits::UpdateUsageLimitsError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::update_usage_limits::UpdateUsageLimitsError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "ValidationException" => crate::operation::update_usage_limits::UpdateUsageLimitsError::ValidationError({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ValidationErrorBuilder::default(); + output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err( + _response_body, + output, + ) + .map_err(crate::operation::update_usage_limits::UpdateUsageLimitsError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::validation_exception_correct_errors(output) + .build() + .map_err(crate::operation::update_usage_limits::UpdateUsageLimitsError::unhandled)? + }; + tmp + }), + "AccessDeniedException" => crate::operation::update_usage_limits::UpdateUsageLimitsError::AccessDeniedError({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedErrorBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err( + _response_body, + output, + ) + .map_err(crate::operation::update_usage_limits::UpdateUsageLimitsError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::access_denied_exception_correct_errors(output) + .build() + .map_err(crate::operation::update_usage_limits::UpdateUsageLimitsError::unhandled)? + }; + tmp + }), + "ThrottlingException" => crate::operation::update_usage_limits::UpdateUsageLimitsError::ThrottlingError({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ThrottlingErrorBuilder::default(); + output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err( + _response_body, + output, + ) + .map_err(crate::operation::update_usage_limits::UpdateUsageLimitsError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::throttling_exception_correct_errors(output) + .build() + .map_err(crate::operation::update_usage_limits::UpdateUsageLimitsError::unhandled)? + }; + tmp + }), + "InternalServerException" => { + crate::operation::update_usage_limits::UpdateUsageLimitsError::InternalServerError({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InternalServerErrorBuilder::default(); + output = + crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err( + _response_body, + output, + ) + .map_err(crate::operation::update_usage_limits::UpdateUsageLimitsError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::internal_server_exception_correct_errors(output) + .build() + .map_err(crate::operation::update_usage_limits::UpdateUsageLimitsError::unhandled)? + }; + tmp + }) + }, + "UpdateUsageLimitQuotaExceededException" => { + crate::operation::update_usage_limits::UpdateUsageLimitsError::UpdateUsageLimitQuotaExceededError({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = + crate::types::error::builders::UpdateUsageLimitQuotaExceededErrorBuilder::default(); + output = crate::protocol_serde::shape_update_usage_limit_quota_exceeded_exception::de_update_usage_limit_quota_exceeded_exception_json_err(_response_body, output).map_err(crate::operation::update_usage_limits::UpdateUsageLimitsError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::update_usage_limit_quota_exceeded_exception_correct_errors(output) + .build() + .map_err(crate::operation::update_usage_limits::UpdateUsageLimitsError::unhandled)? + }; + tmp + }) + }, + _ => crate::operation::update_usage_limits::UpdateUsageLimitsError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_update_usage_limits_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::update_usage_limits::UpdateUsageLimitsOutput, + crate::operation::update_usage_limits::UpdateUsageLimitsError, +> { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::update_usage_limits::builders::UpdateUsageLimitsOutputBuilder::default(); + output = crate::protocol_serde::shape_update_usage_limits::de_update_usage_limits(_response_body, output) + .map_err(crate::operation::update_usage_limits::UpdateUsageLimitsError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + crate::serde_util::update_usage_limits_output_output_correct_errors(output) + .build() + .map_err(crate::operation::update_usage_limits::UpdateUsageLimitsError::unhandled)? + }) +} + +pub fn ser_update_usage_limits_input( + input: &crate::operation::update_usage_limits::UpdateUsageLimitsInput, +) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> +{ + let mut out = String::new(); + let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); + crate::protocol_serde::shape_update_usage_limits_input::ser_update_usage_limits_input_input(&mut object, input)?; + object.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} + +pub(crate) fn de_update_usage_limits( + value: &[u8], + mut builder: crate::operation::update_usage_limits::builders::UpdateUsageLimitsOutputBuilder, +) -> ::std::result::Result< + crate::operation::update_usage_limits::builders::UpdateUsageLimitsOutputBuilder, + ::aws_smithy_json::deserialize::error::DeserializeError, +> { + let mut tokens_owned = + ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::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::types::UsageLimitUpdateRequestStatus::from(u.as_ref())) + }) + .transpose()?, + ); + }, + "approvedLimit" => { + builder = builder.set_approved_limit( + ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())? + .map(i64::try_from) + .transpose()?, + ); + }, + "remainingRequestsThisMonth" => { + builder = builder.set_remaining_requests_this_month( + ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())? + .map(i32::try_from) + .transpose()?, + ); + }, + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + format!("expected object key or end object, found: {:?}", other), + )); + }, + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/crates/amzn-codewhisperer-client/src/protocol_serde/shape_update_usage_limits_input.rs b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_update_usage_limits_input.rs new file mode 100644 index 0000000000..90bcaf0cf8 --- /dev/null +++ b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_update_usage_limits_input.rs @@ -0,0 +1,25 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_update_usage_limits_input_input( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::operation::update_usage_limits::UpdateUsageLimitsInput, +) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> { + if let Some(var_1) = &input.account_id { + object.key("accountId").string(var_1.as_str()); + } + if let Some(var_2) = &input.accountless_user_id { + object.key("accountlessUserId").string(var_2.as_str()); + } + if let Some(var_3) = &input.feature_type { + object.key("featureType").string(var_3.as_str()); + } + if let Some(var_4) = &input.requested_limit { + object.key("requestedLimit").number( + #[allow(clippy::useless_conversion)] + ::aws_smithy_types::Number::NegInt((*var_4).into()), + ); + } + if let Some(var_5) = &input.justification { + object.key("justification").string(var_5.as_str()); + } + Ok(()) +} diff --git a/crates/amzn-codewhisperer-client/src/protocol_serde/shape_usage_limit_list.rs b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_usage_limit_list.rs new file mode 100644 index 0000000000..b56a446188 --- /dev/null +++ b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_usage_limit_list.rs @@ -0,0 +1,69 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_usage_limit_list<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator< + Item = Result< + ::aws_smithy_json::deserialize::Token<'a>, + ::aws_smithy_json::deserialize::error::DeserializeError, + >, + >, +{ + 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::types::builders::UsageLimitListBuilder::default(); + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key + .to_unescaped()? + .as_ref() + { + "type" => { + builder = builder.set_type( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| crate::types::UsageLimitType::from(u.as_ref()))) + .transpose()?, + ); + }, + "value" => { + builder = builder.set_value( + ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())? + .map(i64::try_from) + .transpose()?, + ); + }, + "percentUsed" => { + builder = builder.set_percent_used( + ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())? + .map(|v| v.to_f64_lossy()), + ); + }, + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + format!("expected object key or end object, found: {:?}", other), + )); + }, + } + } + Ok(Some( + crate::serde_util::usage_limit_list_correct_errors(builder) + .build() + .map_err(|err| { + ::aws_smithy_json::deserialize::error::DeserializeError::custom_source( + "Response was invalid", + err, + ) + })?, + )) + }, + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start object or null", + )), + } +} diff --git a/crates/amzn-codewhisperer-client/src/protocol_serde/shape_usage_limits.rs b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_usage_limits.rs new file mode 100644 index 0000000000..2b2ced49ad --- /dev/null +++ b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_usage_limits.rs @@ -0,0 +1,40 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_usage_limits<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> ::std::result::Result< + Option<::std::vec::Vec>, + ::aws_smithy_json::deserialize::error::DeserializeError, +> +where + I: Iterator< + Item = Result< + ::aws_smithy_json::deserialize::Token<'a>, + ::aws_smithy_json::deserialize::error::DeserializeError, + >, + >, +{ + 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::protocol_serde::shape_usage_limit_list::de_usage_limit_list(tokens)?; + if let Some(value) = value { + items.push(value); + } + }, + } + } + Ok(Some(items)) + }, + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start array or null", + )), + } +} diff --git a/crates/amzn-codewhisperer-client/src/protocol_serde/shape_user_modification_event.rs b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_user_modification_event.rs index 996c048212..413bfcd735 100644 --- a/crates/amzn-codewhisperer-client/src/protocol_serde/shape_user_modification_event.rs +++ b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_user_modification_event.rs @@ -44,5 +44,17 @@ pub fn ser_user_modification_event( ::aws_smithy_types::Number::NegInt((input.unmodified_accepted_character_count).into()), ); } + if input.added_character_count != 0 { + object.key("addedCharacterCount").number( + #[allow(clippy::useless_conversion)] + ::aws_smithy_types::Number::NegInt((input.added_character_count).into()), + ); + } + if input.unmodified_added_character_count != 0 { + object.key("unmodifiedAddedCharacterCount").number( + #[allow(clippy::useless_conversion)] + ::aws_smithy_types::Number::NegInt((input.unmodified_added_character_count).into()), + ); + } Ok(()) } diff --git a/crates/amzn-codewhisperer-client/src/protocol_serde/shape_user_trigger_decision_event.rs b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_user_trigger_decision_event.rs index c178cd70fb..c542cb49d3 100644 --- a/crates/amzn-codewhisperer-client/src/protocol_serde/shape_user_trigger_decision_event.rs +++ b/crates/amzn-codewhisperer-client/src/protocol_serde/shape_user_trigger_decision_event.rs @@ -98,5 +98,23 @@ pub fn ser_user_trigger_decision_event( } array_10.finish(); } + if input.added_character_count != 0 { + object.key("addedCharacterCount").number( + #[allow(clippy::useless_conversion)] + ::aws_smithy_types::Number::NegInt((input.added_character_count).into()), + ); + } + if input.deleted_character_count != 0 { + object.key("deletedCharacterCount").number( + #[allow(clippy::useless_conversion)] + ::aws_smithy_types::Number::NegInt((input.deleted_character_count).into()), + ); + } + if input.streak_length != 0 { + object.key("streakLength").number( + #[allow(clippy::useless_conversion)] + ::aws_smithy_types::Number::NegInt((input.streak_length).into()), + ); + } Ok(()) } diff --git a/crates/amzn-codewhisperer-client/src/serde_util.rs b/crates/amzn-codewhisperer-client/src/serde_util.rs index ba8d542366..0b0e986067 100644 --- a/crates/amzn-codewhisperer-client/src/serde_util.rs +++ b/crates/amzn-codewhisperer-client/src/serde_util.rs @@ -47,6 +47,30 @@ pub(crate) fn create_artifact_upload_url_output_output_correct_errors( builder } +pub(crate) fn conflict_exception_correct_errors( + mut builder: crate::types::error::builders::ConflictErrorBuilder, +) -> crate::types::error::builders::ConflictErrorBuilder { + if builder.message.is_none() { + builder.message = Some(Default::default()) + } + builder +} + +pub(crate) fn create_subscription_token_output_output_correct_errors( + mut builder: crate::operation::create_subscription_token::builders::CreateSubscriptionTokenOutputBuilder, +) -> crate::operation::create_subscription_token::builders::CreateSubscriptionTokenOutputBuilder { + if builder.encoded_verification_url.is_none() { + builder.encoded_verification_url = Some(Default::default()) + } + if builder.token.is_none() { + builder.token = Some(Default::default()) + } + if builder.status.is_none() { + builder.status = "no value was set".parse::().ok() + } + builder +} + pub(crate) fn service_quota_exceeded_exception_correct_errors( mut builder: crate::types::error::builders::ServiceQuotaExceededErrorBuilder, ) -> crate::types::error::builders::ServiceQuotaExceededErrorBuilder { @@ -74,15 +98,6 @@ pub(crate) fn resource_not_found_exception_correct_errors( builder } -pub(crate) fn conflict_exception_correct_errors( - mut builder: crate::types::error::builders::ConflictErrorBuilder, -) -> crate::types::error::builders::ConflictErrorBuilder { - if builder.message.is_none() { - builder.message = Some(Default::default()) - } - builder -} - pub(crate) fn create_upload_url_output_output_correct_errors( mut builder: crate::operation::create_upload_url::builders::CreateUploadUrlOutputBuilder, ) -> crate::operation::create_upload_url::builders::CreateUploadUrlOutputBuilder { @@ -182,6 +197,18 @@ pub(crate) fn get_transformation_plan_output_output_correct_errors( builder } +pub(crate) fn get_usage_limits_output_output_correct_errors( + mut builder: crate::operation::get_usage_limits::builders::GetUsageLimitsOutputBuilder, +) -> crate::operation::get_usage_limits::builders::GetUsageLimitsOutputBuilder { + if builder.limits.is_none() { + builder.limits = Some(Default::default()) + } + if builder.days_until_reset.is_none() { + builder.days_until_reset = Some(Default::default()) + } + builder +} + pub(crate) fn list_available_customizations_output_output_correct_errors( mut builder: crate::operation::list_available_customizations::builders::ListAvailableCustomizationsOutputBuilder, ) -> crate::operation::list_available_customizations::builders::ListAvailableCustomizationsOutputBuilder { @@ -299,6 +326,26 @@ pub(crate) fn stop_transformation_output_output_correct_errors( builder } +pub(crate) fn update_usage_limit_quota_exceeded_exception_correct_errors( + mut builder: crate::types::error::builders::UpdateUsageLimitQuotaExceededErrorBuilder, +) -> crate::types::error::builders::UpdateUsageLimitQuotaExceededErrorBuilder { + if builder.message.is_none() { + builder.message = Some(Default::default()) + } + builder +} + +pub(crate) fn update_usage_limits_output_output_correct_errors( + mut builder: crate::operation::update_usage_limits::builders::UpdateUsageLimitsOutputBuilder, +) -> crate::operation::update_usage_limits::builders::UpdateUsageLimitsOutputBuilder { + if builder.status.is_none() { + builder.status = "no value was set" + .parse::() + .ok() + } + builder +} + pub(crate) fn memory_entry_correct_errors( mut builder: crate::types::builders::MemoryEntryBuilder, ) -> crate::types::builders::MemoryEntryBuilder { @@ -455,6 +502,18 @@ pub(crate) fn profile_correct_errors( builder } +pub(crate) fn usage_limit_list_correct_errors( + mut builder: crate::types::builders::UsageLimitListBuilder, +) -> crate::types::builders::UsageLimitListBuilder { + if builder.r#type.is_none() { + builder.r#type = "no value was set".parse::().ok() + } + if builder.value.is_none() { + builder.value = Some(Default::default()) + } + builder +} + pub(crate) fn edit_correct_errors( mut builder: crate::types::builders::EditBuilder, ) -> crate::types::builders::EditBuilder { diff --git a/crates/amzn-codewhisperer-client/src/types.rs b/crates/amzn-codewhisperer-client/src/types.rs index 4627b4ad1c..ecb237d805 100644 --- a/crates/amzn-codewhisperer-client/src/types.rs +++ b/crates/amzn-codewhisperer-client/src/types.rs @@ -1,6 +1,7 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. pub use crate::types::_access_denied_exception_reason::AccessDeniedExceptionReason; pub use crate::types::_additional_content_entry::AdditionalContentEntry; +pub use crate::types::_agentic_chat_event_status::AgenticChatEventStatus; pub use crate::types::_app_studio_state::AppStudioState; pub use crate::types::_application_properties::ApplicationProperties; pub use crate::types::_artifact_type::ArtifactType; @@ -118,6 +119,7 @@ pub use crate::types::_shell_history_entry::ShellHistoryEntry; pub use crate::types::_shell_state::ShellState; pub use crate::types::_span::Span; pub use crate::types::_sso_identity_details::SsoIdentityDetails; +pub use crate::types::_subscription_status::SubscriptionStatus; pub use crate::types::_suggested_fix::SuggestedFix; pub use crate::types::_suggestion_state::SuggestionState; pub use crate::types::_supplemental_context::SupplementalContext; @@ -173,6 +175,9 @@ pub use crate::types::_transformation_upload_context::TransformationUploadContex pub use crate::types::_transformation_user_action_status::TransformationUserActionStatus; pub use crate::types::_upload_context::UploadContext; pub use crate::types::_upload_intent::UploadIntent; +pub use crate::types::_usage_limit_list::UsageLimitList; +pub use crate::types::_usage_limit_type::UsageLimitType; +pub use crate::types::_usage_limit_update_request_status::UsageLimitUpdateRequestStatus; pub use crate::types::_user_context::UserContext; pub use crate::types::_user_input_message::UserInputMessage; pub use crate::types::_user_input_message_context::UserInputMessageContext; @@ -191,6 +196,8 @@ mod _access_denied_exception_reason; mod _additional_content_entry; +mod _agentic_chat_event_status; + mod _app_studio_state; mod _application_properties; @@ -425,6 +432,8 @@ mod _span; mod _sso_identity_details; +mod _subscription_status; + mod _suggested_fix; mod _suggestion_state; @@ -535,6 +544,12 @@ mod _upload_context; mod _upload_intent; +mod _usage_limit_list; + +mod _usage_limit_type; + +mod _usage_limit_update_request_status; + mod _user_context; mod _user_input_message; diff --git a/crates/amzn-codewhisperer-client/src/types/_agentic_chat_event_status.rs b/crates/amzn-codewhisperer-client/src/types/_agentic_chat_event_status.rs new file mode 100644 index 0000000000..3efa4ef363 --- /dev/null +++ b/crates/amzn-codewhisperer-client/src/types/_agentic_chat_event_status.rs @@ -0,0 +1,124 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +/// When writing a match expression against `AgenticChatEventStatus`, it is important to ensure +/// your code is forward-compatible. That is, if a match arm handles a case for a +/// feature that is supported by the service but has not been represented as an enum +/// variant in a current version of SDK, your code should continue to work when you +/// upgrade SDK to a future version in which the enum does include a variant for that +/// feature. +/// +/// Here is an example of how you can make a match expression forward-compatible: +/// +/// ```text +/// # let agenticchateventstatus = unimplemented!(); +/// match agenticchateventstatus { +/// AgenticChatEventStatus::Cancelled => { /* ... */ }, +/// AgenticChatEventStatus::Failed => { /* ... */ }, +/// AgenticChatEventStatus::Succeeded => { /* ... */ }, +/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ }, +/// _ => { /* ... */ }, +/// } +/// ``` +/// The above code demonstrates that when `agenticchateventstatus` represents +/// `NewFeature`, the execution path will lead to the second last match arm, +/// even though the enum does not contain a variant `AgenticChatEventStatus::NewFeature` +/// in the current version of SDK. The reason is that the variable `other`, +/// created by the `@` operator, is bound to +/// `AgenticChatEventStatus::Unknown(UnknownVariantValue("NewFeature".to_owned()))` +/// and calling `as_str` on it yields `"NewFeature"`. +/// This match expression is forward-compatible when executed with a newer +/// version of SDK where the variant `AgenticChatEventStatus::NewFeature` is defined. +/// Specifically, when `agenticchateventstatus` represents `NewFeature`, +/// the execution path will hit the second last match arm as before by virtue of +/// calling `as_str` on `AgenticChatEventStatus::NewFeature` also yielding `"NewFeature"`. +/// +/// Explicitly matching on the `Unknown` variant should +/// be avoided for two reasons: +/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. +/// - It might inadvertently shadow other intended match arms. +#[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 AgenticChatEventStatus { + #[allow(missing_docs)] // documentation missing in model + Cancelled, + #[allow(missing_docs)] // documentation missing in model + Failed, + #[allow(missing_docs)] // documentation missing in model + Succeeded, + /// `Unknown` contains new variants that have been added since this code was generated. + #[deprecated( + note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants." + )] + Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), +} +impl ::std::convert::From<&str> for AgenticChatEventStatus { + fn from(s: &str) -> Self { + match s { + "CANCELLED" => AgenticChatEventStatus::Cancelled, + "FAILED" => AgenticChatEventStatus::Failed, + "SUCCEEDED" => AgenticChatEventStatus::Succeeded, + other => AgenticChatEventStatus::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue( + other.to_owned(), + )), + } + } +} +impl ::std::str::FromStr for AgenticChatEventStatus { + type Err = ::std::convert::Infallible; + + fn from_str(s: &str) -> ::std::result::Result::Err> { + ::std::result::Result::Ok(AgenticChatEventStatus::from(s)) + } +} +impl AgenticChatEventStatus { + /// Returns the `&str` value of the enum member. + pub fn as_str(&self) -> &str { + match self { + AgenticChatEventStatus::Cancelled => "CANCELLED", + AgenticChatEventStatus::Failed => "FAILED", + AgenticChatEventStatus::Succeeded => "SUCCEEDED", + AgenticChatEventStatus::Unknown(value) => value.as_str(), + } + } + + /// Returns all the `&str` representations of the enum members. + pub const fn values() -> &'static [&'static str] { + &["CANCELLED", "FAILED", "SUCCEEDED"] + } +} +impl ::std::convert::AsRef for AgenticChatEventStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl AgenticChatEventStatus { + /// Parses the enum value while disallowing unknown variants. + /// + /// Unknown variants will result in an error. + pub fn try_parse(value: &str) -> ::std::result::Result { + match Self::from(value) { + #[allow(deprecated)] + Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)), + known => Ok(known), + } + } +} +impl ::std::fmt::Display for AgenticChatEventStatus { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + match self { + AgenticChatEventStatus::Cancelled => write!(f, "CANCELLED"), + AgenticChatEventStatus::Failed => write!(f, "FAILED"), + AgenticChatEventStatus::Succeeded => write!(f, "SUCCEEDED"), + AgenticChatEventStatus::Unknown(value) => write!(f, "{}", value), + } + } +} diff --git a/crates/amzn-codewhisperer-client/src/types/_chat_add_message_event.rs b/crates/amzn-codewhisperer-client/src/types/_chat_add_message_event.rs index 8c1de4c404..1a9c6328b7 100644 --- a/crates/amzn-codewhisperer-client/src/types/_chat_add_message_event.rs +++ b/crates/amzn-codewhisperer-client/src/types/_chat_add_message_event.rs @@ -31,6 +31,8 @@ pub struct ChatAddMessageEvent { pub number_of_code_blocks: ::std::option::Option, #[allow(missing_docs)] // documentation missing in model pub has_project_level_context: ::std::option::Option, + #[allow(missing_docs)] // documentation missing in model + pub result: ::std::option::Option, } impl ChatAddMessageEvent { /// ID which represents a multi-turn conversation @@ -106,6 +108,11 @@ impl ChatAddMessageEvent { pub fn has_project_level_context(&self) -> ::std::option::Option { self.has_project_level_context } + + #[allow(missing_docs)] // documentation missing in model + pub fn result(&self) -> ::std::option::Option<&crate::types::AgenticChatEventStatus> { + self.result.as_ref() + } } impl ChatAddMessageEvent { /// Creates a new builder-style object to manufacture @@ -133,6 +140,7 @@ pub struct ChatAddMessageEventBuilder { pub(crate) response_length: ::std::option::Option, pub(crate) number_of_code_blocks: ::std::option::Option, pub(crate) has_project_level_context: ::std::option::Option, + pub(crate) result: ::std::option::Option, } impl ChatAddMessageEventBuilder { /// ID which represents a multi-turn conversation @@ -380,6 +388,23 @@ impl ChatAddMessageEventBuilder { &self.has_project_level_context } + #[allow(missing_docs)] // documentation missing in model + pub fn result(mut self, input: crate::types::AgenticChatEventStatus) -> Self { + self.result = ::std::option::Option::Some(input); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn set_result(mut self, input: ::std::option::Option) -> Self { + self.result = input; + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn get_result(&self) -> &::std::option::Option { + &self.result + } + /// Consumes the builder and constructs a /// [`ChatAddMessageEvent`](crate::types::ChatAddMessageEvent). This method will fail if any /// of the following fields are not set: @@ -414,6 +439,7 @@ impl ChatAddMessageEventBuilder { response_length: self.response_length, number_of_code_blocks: self.number_of_code_blocks, has_project_level_context: self.has_project_level_context, + result: self.result, }) } } diff --git a/crates/amzn-codewhisperer-client/src/types/_code_coverage_event.rs b/crates/amzn-codewhisperer-client/src/types/_code_coverage_event.rs index 5631be3c85..6070986435 100644 --- a/crates/amzn-codewhisperer-client/src/types/_code_coverage_event.rs +++ b/crates/amzn-codewhisperer-client/src/types/_code_coverage_event.rs @@ -23,6 +23,8 @@ pub struct CodeCoverageEvent { pub user_written_code_character_count: i32, #[allow(missing_docs)] // documentation missing in model pub user_written_code_line_count: i32, + #[allow(missing_docs)] // documentation missing in model + pub added_character_count: i32, } impl CodeCoverageEvent { #[allow(missing_docs)] // documentation missing in model @@ -74,6 +76,11 @@ impl CodeCoverageEvent { pub fn user_written_code_line_count(&self) -> i32 { self.user_written_code_line_count } + + #[allow(missing_docs)] // documentation missing in model + pub fn added_character_count(&self) -> i32 { + self.added_character_count + } } impl CodeCoverageEvent { /// Creates a new builder-style object to manufacture @@ -97,6 +104,7 @@ pub struct CodeCoverageEventBuilder { pub(crate) total_new_code_line_count: ::std::option::Option, pub(crate) user_written_code_character_count: ::std::option::Option, pub(crate) user_written_code_line_count: ::std::option::Option, + pub(crate) added_character_count: ::std::option::Option, } impl CodeCoverageEventBuilder { #[allow(missing_docs)] // documentation missing in model @@ -273,6 +281,23 @@ impl CodeCoverageEventBuilder { &self.user_written_code_line_count } + #[allow(missing_docs)] // documentation missing in model + pub fn added_character_count(mut self, input: i32) -> Self { + self.added_character_count = ::std::option::Option::Some(input); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn set_added_character_count(mut self, input: ::std::option::Option) -> Self { + self.added_character_count = input; + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn get_added_character_count(&self) -> &::std::option::Option { + &self.added_character_count + } + /// Consumes the builder and constructs a /// [`CodeCoverageEvent`](crate::types::CodeCoverageEvent). This method will fail if any of /// the following fields are not set: @@ -302,6 +327,7 @@ impl CodeCoverageEventBuilder { total_new_code_line_count: self.total_new_code_line_count.unwrap_or_default(), user_written_code_character_count: self.user_written_code_character_count.unwrap_or_default(), user_written_code_line_count: self.user_written_code_line_count.unwrap_or_default(), + added_character_count: self.added_character_count.unwrap_or_default(), }) } } diff --git a/crates/amzn-codewhisperer-client/src/types/_file_context.rs b/crates/amzn-codewhisperer-client/src/types/_file_context.rs index 201823112b..58d682d8df 100644 --- a/crates/amzn-codewhisperer-client/src/types/_file_context.rs +++ b/crates/amzn-codewhisperer-client/src/types/_file_context.rs @@ -9,6 +9,8 @@ pub struct FileContext { pub right_file_content: ::std::string::String, #[allow(missing_docs)] // documentation missing in model pub filename: ::std::string::String, + #[allow(missing_docs)] // documentation missing in model + pub file_uri: ::std::option::Option<::std::string::String>, /// Programming Languages supported by CodeWhisperer pub programming_language: crate::types::ProgrammingLanguage, } @@ -31,6 +33,11 @@ impl FileContext { self.filename.deref() } + #[allow(missing_docs)] // documentation missing in model + pub fn file_uri(&self) -> ::std::option::Option<&str> { + self.file_uri.as_deref() + } + /// Programming Languages supported by CodeWhisperer pub fn programming_language(&self) -> &crate::types::ProgrammingLanguage { &self.programming_language @@ -42,6 +49,7 @@ impl ::std::fmt::Debug for FileContext { formatter.field("left_file_content", &"*** Sensitive Data Redacted ***"); formatter.field("right_file_content", &"*** Sensitive Data Redacted ***"); formatter.field("filename", &"*** Sensitive Data Redacted ***"); + formatter.field("file_uri", &"*** Sensitive Data Redacted ***"); formatter.field("programming_language", &self.programming_language); formatter.finish() } @@ -61,6 +69,7 @@ pub struct FileContextBuilder { pub(crate) left_file_content: ::std::option::Option<::std::string::String>, pub(crate) right_file_content: ::std::option::Option<::std::string::String>, pub(crate) filename: ::std::option::Option<::std::string::String>, + pub(crate) file_uri: ::std::option::Option<::std::string::String>, pub(crate) programming_language: ::std::option::Option, } impl FileContextBuilder { @@ -118,6 +127,23 @@ impl FileContextBuilder { &self.filename } + #[allow(missing_docs)] // documentation missing in model + pub fn file_uri(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.file_uri = ::std::option::Option::Some(input.into()); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn set_file_uri(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.file_uri = input; + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn get_file_uri(&self) -> &::std::option::Option<::std::string::String> { + &self.file_uri + } + /// Programming Languages supported by CodeWhisperer /// This field is required. pub fn programming_language(mut self, input: crate::types::ProgrammingLanguage) -> Self { @@ -164,6 +190,7 @@ impl FileContextBuilder { "filename was not specified but it is required when building FileContext", ) })?, + file_uri: self.file_uri, programming_language: self.programming_language.ok_or_else(|| { ::aws_smithy_types::error::operation::BuildError::missing_field( "programming_language", @@ -179,6 +206,7 @@ impl ::std::fmt::Debug for FileContextBuilder { formatter.field("left_file_content", &"*** Sensitive Data Redacted ***"); formatter.field("right_file_content", &"*** Sensitive Data Redacted ***"); formatter.field("filename", &"*** Sensitive Data Redacted ***"); + formatter.field("file_uri", &"*** Sensitive Data Redacted ***"); formatter.field("programming_language", &self.programming_language); formatter.finish() } diff --git a/crates/amzn-codewhisperer-client/src/types/_subscription_status.rs b/crates/amzn-codewhisperer-client/src/types/_subscription_status.rs new file mode 100644 index 0000000000..d30080d047 --- /dev/null +++ b/crates/amzn-codewhisperer-client/src/types/_subscription_status.rs @@ -0,0 +1,118 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +/// When writing a match expression against `SubscriptionStatus`, it is important to ensure +/// your code is forward-compatible. That is, if a match arm handles a case for a +/// feature that is supported by the service but has not been represented as an enum +/// variant in a current version of SDK, your code should continue to work when you +/// upgrade SDK to a future version in which the enum does include a variant for that +/// feature. +/// +/// Here is an example of how you can make a match expression forward-compatible: +/// +/// ```text +/// # let subscriptionstatus = unimplemented!(); +/// match subscriptionstatus { +/// SubscriptionStatus::Active => { /* ... */ }, +/// SubscriptionStatus::Inactive => { /* ... */ }, +/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ }, +/// _ => { /* ... */ }, +/// } +/// ``` +/// The above code demonstrates that when `subscriptionstatus` represents +/// `NewFeature`, the execution path will lead to the second last match arm, +/// even though the enum does not contain a variant `SubscriptionStatus::NewFeature` +/// in the current version of SDK. The reason is that the variable `other`, +/// created by the `@` operator, is bound to +/// `SubscriptionStatus::Unknown(UnknownVariantValue("NewFeature".to_owned()))` +/// and calling `as_str` on it yields `"NewFeature"`. +/// This match expression is forward-compatible when executed with a newer +/// version of SDK where the variant `SubscriptionStatus::NewFeature` is defined. +/// Specifically, when `subscriptionstatus` represents `NewFeature`, +/// the execution path will hit the second last match arm as before by virtue of +/// calling `as_str` on `SubscriptionStatus::NewFeature` also yielding `"NewFeature"`. +/// +/// Explicitly matching on the `Unknown` variant should +/// be avoided for two reasons: +/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. +/// - It might inadvertently shadow other intended match arms. +#[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 SubscriptionStatus { + #[allow(missing_docs)] // documentation missing in model + Active, + #[allow(missing_docs)] // documentation missing in model + Inactive, + /// `Unknown` contains new variants that have been added since this code was generated. + #[deprecated( + note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants." + )] + Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), +} +impl ::std::convert::From<&str> for SubscriptionStatus { + fn from(s: &str) -> Self { + match s { + "ACTIVE" => SubscriptionStatus::Active, + "INACTIVE" => SubscriptionStatus::Inactive, + other => SubscriptionStatus::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue( + other.to_owned(), + )), + } + } +} +impl ::std::str::FromStr for SubscriptionStatus { + type Err = ::std::convert::Infallible; + + fn from_str(s: &str) -> ::std::result::Result::Err> { + ::std::result::Result::Ok(SubscriptionStatus::from(s)) + } +} +impl SubscriptionStatus { + /// Returns the `&str` value of the enum member. + pub fn as_str(&self) -> &str { + match self { + SubscriptionStatus::Active => "ACTIVE", + SubscriptionStatus::Inactive => "INACTIVE", + SubscriptionStatus::Unknown(value) => value.as_str(), + } + } + + /// Returns all the `&str` representations of the enum members. + pub const fn values() -> &'static [&'static str] { + &["ACTIVE", "INACTIVE"] + } +} +impl ::std::convert::AsRef for SubscriptionStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl SubscriptionStatus { + /// Parses the enum value while disallowing unknown variants. + /// + /// Unknown variants will result in an error. + pub fn try_parse(value: &str) -> ::std::result::Result { + match Self::from(value) { + #[allow(deprecated)] + Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)), + known => Ok(known), + } + } +} +impl ::std::fmt::Display for SubscriptionStatus { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + match self { + SubscriptionStatus::Active => write!(f, "ACTIVE"), + SubscriptionStatus::Inactive => write!(f, "INACTIVE"), + SubscriptionStatus::Unknown(value) => write!(f, "{}", value), + } + } +} diff --git a/crates/amzn-codewhisperer-client/src/types/_usage_limit_list.rs b/crates/amzn-codewhisperer-client/src/types/_usage_limit_list.rs new file mode 100644 index 0000000000..c85d56518c --- /dev/null +++ b/crates/amzn-codewhisperer-client/src/types/_usage_limit_list.rs @@ -0,0 +1,122 @@ +// 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, ::std::fmt::Debug)] +pub struct UsageLimitList { + #[allow(missing_docs)] // documentation missing in model + pub r#type: crate::types::UsageLimitType, + #[allow(missing_docs)] // documentation missing in model + pub value: i64, + #[allow(missing_docs)] // documentation missing in model + pub percent_used: ::std::option::Option, +} +impl UsageLimitList { + #[allow(missing_docs)] // documentation missing in model + pub fn r#type(&self) -> &crate::types::UsageLimitType { + &self.r#type + } + + #[allow(missing_docs)] // documentation missing in model + pub fn value(&self) -> i64 { + self.value + } + + #[allow(missing_docs)] // documentation missing in model + pub fn percent_used(&self) -> ::std::option::Option { + self.percent_used + } +} +impl UsageLimitList { + /// Creates a new builder-style object to manufacture + /// [`UsageLimitList`](crate::types::UsageLimitList). + pub fn builder() -> crate::types::builders::UsageLimitListBuilder { + crate::types::builders::UsageLimitListBuilder::default() + } +} + +/// A builder for [`UsageLimitList`](crate::types::UsageLimitList). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct UsageLimitListBuilder { + pub(crate) r#type: ::std::option::Option, + pub(crate) value: ::std::option::Option, + pub(crate) percent_used: ::std::option::Option, +} +impl UsageLimitListBuilder { + #[allow(missing_docs)] // documentation missing in model + /// This field is required. + pub fn r#type(mut self, input: crate::types::UsageLimitType) -> Self { + self.r#type = ::std::option::Option::Some(input); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn set_type(mut self, input: ::std::option::Option) -> Self { + self.r#type = input; + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn get_type(&self) -> &::std::option::Option { + &self.r#type + } + + #[allow(missing_docs)] // documentation missing in model + /// This field is required. + pub fn value(mut self, input: i64) -> Self { + self.value = ::std::option::Option::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 get_value(&self) -> &::std::option::Option { + &self.value + } + + #[allow(missing_docs)] // documentation missing in model + pub fn percent_used(mut self, input: f64) -> Self { + self.percent_used = ::std::option::Option::Some(input); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn set_percent_used(mut self, input: ::std::option::Option) -> Self { + self.percent_used = input; + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn get_percent_used(&self) -> &::std::option::Option { + &self.percent_used + } + + /// Consumes the builder and constructs a [`UsageLimitList`](crate::types::UsageLimitList). + /// This method will fail if any of the following fields are not set: + /// - [`r#type`](crate::types::builders::UsageLimitListBuilder::type) + /// - [`value`](crate::types::builders::UsageLimitListBuilder::value) + pub fn build( + self, + ) -> ::std::result::Result { + ::std::result::Result::Ok(crate::types::UsageLimitList { + r#type: self.r#type.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "r#type", + "r#type was not specified but it is required when building UsageLimitList", + ) + })?, + value: self.value.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "value", + "value was not specified but it is required when building UsageLimitList", + ) + })?, + percent_used: self.percent_used, + }) + } +} diff --git a/crates/amzn-codewhisperer-client/src/types/_usage_limit_type.rs b/crates/amzn-codewhisperer-client/src/types/_usage_limit_type.rs new file mode 100644 index 0000000000..ac3b3fd2b1 --- /dev/null +++ b/crates/amzn-codewhisperer-client/src/types/_usage_limit_type.rs @@ -0,0 +1,163 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +/// When writing a match expression against `UsageLimitType`, it is important to ensure +/// your code is forward-compatible. That is, if a match arm handles a case for a +/// feature that is supported by the service but has not been represented as an enum +/// variant in a current version of SDK, your code should continue to work when you +/// upgrade SDK to a future version in which the enum does include a variant for that +/// feature. +/// +/// Here is an example of how you can make a match expression forward-compatible: +/// +/// ```text +/// # let usagelimittype = unimplemented!(); +/// match usagelimittype { +/// UsageLimitType::AiEditor => { /* ... */ }, +/// UsageLimitType::Chat => { /* ... */ }, +/// UsageLimitType::CodeScan => { /* ... */ }, +/// UsageLimitType::GumbyTransform => { /* ... */ }, +/// UsageLimitType::ProactiveCodeScan => { /* ... */ }, +/// UsageLimitType::Qsda => { /* ... */ }, +/// UsageLimitType::Recommendations => { /* ... */ }, +/// UsageLimitType::WeaverbirdConversation => { /* ... */ }, +/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ }, +/// _ => { /* ... */ }, +/// } +/// ``` +/// The above code demonstrates that when `usagelimittype` represents +/// `NewFeature`, the execution path will lead to the second last match arm, +/// even though the enum does not contain a variant `UsageLimitType::NewFeature` +/// in the current version of SDK. The reason is that the variable `other`, +/// created by the `@` operator, is bound to +/// `UsageLimitType::Unknown(UnknownVariantValue("NewFeature".to_owned()))` +/// and calling `as_str` on it yields `"NewFeature"`. +/// This match expression is forward-compatible when executed with a newer +/// version of SDK where the variant `UsageLimitType::NewFeature` is defined. +/// Specifically, when `usagelimittype` represents `NewFeature`, +/// the execution path will hit the second last match arm as before by virtue of +/// calling `as_str` on `UsageLimitType::NewFeature` also yielding `"NewFeature"`. +/// +/// Explicitly matching on the `Unknown` variant should +/// be avoided for two reasons: +/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. +/// - It might inadvertently shadow other intended match arms. +#[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 UsageLimitType { + /// AI editor service usage metric + AiEditor, + /// Chat service usage metric + Chat, + /// Code scanning service usage metric + CodeScan, + /// Code transformation service usage metric + GumbyTransform, + /// Proactive code scanning service usage metric + ProactiveCodeScan, + /// QSDA usage metric + Qsda, + /// Inline recommendations service usage metric + Recommendations, + /// Weaverbird conversation service usage metric + WeaverbirdConversation, + /// `Unknown` contains new variants that have been added since this code was generated. + #[deprecated( + note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants." + )] + Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), +} +impl ::std::convert::From<&str> for UsageLimitType { + fn from(s: &str) -> Self { + match s { + "AI_EDITOR" => UsageLimitType::AiEditor, + "CHAT" => UsageLimitType::Chat, + "CODE_SCAN" => UsageLimitType::CodeScan, + "GUMBY_TRANSFORM" => UsageLimitType::GumbyTransform, + "PROACTIVE_CODE_SCAN" => UsageLimitType::ProactiveCodeScan, + "QSDA" => UsageLimitType::Qsda, + "RECOMMENDATIONS" => UsageLimitType::Recommendations, + "WEAVERBIRD_CONVERSATION" => UsageLimitType::WeaverbirdConversation, + other => UsageLimitType::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue( + other.to_owned(), + )), + } + } +} +impl ::std::str::FromStr for UsageLimitType { + type Err = ::std::convert::Infallible; + + fn from_str(s: &str) -> ::std::result::Result::Err> { + ::std::result::Result::Ok(UsageLimitType::from(s)) + } +} +impl UsageLimitType { + /// Returns the `&str` value of the enum member. + pub fn as_str(&self) -> &str { + match self { + UsageLimitType::AiEditor => "AI_EDITOR", + UsageLimitType::Chat => "CHAT", + UsageLimitType::CodeScan => "CODE_SCAN", + UsageLimitType::GumbyTransform => "GUMBY_TRANSFORM", + UsageLimitType::ProactiveCodeScan => "PROACTIVE_CODE_SCAN", + UsageLimitType::Qsda => "QSDA", + UsageLimitType::Recommendations => "RECOMMENDATIONS", + UsageLimitType::WeaverbirdConversation => "WEAVERBIRD_CONVERSATION", + UsageLimitType::Unknown(value) => value.as_str(), + } + } + + /// Returns all the `&str` representations of the enum members. + pub const fn values() -> &'static [&'static str] { + &[ + "AI_EDITOR", + "CHAT", + "CODE_SCAN", + "GUMBY_TRANSFORM", + "PROACTIVE_CODE_SCAN", + "QSDA", + "RECOMMENDATIONS", + "WEAVERBIRD_CONVERSATION", + ] + } +} +impl ::std::convert::AsRef for UsageLimitType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl UsageLimitType { + /// Parses the enum value while disallowing unknown variants. + /// + /// Unknown variants will result in an error. + pub fn try_parse(value: &str) -> ::std::result::Result { + match Self::from(value) { + #[allow(deprecated)] + Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)), + known => Ok(known), + } + } +} +impl ::std::fmt::Display for UsageLimitType { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + match self { + UsageLimitType::AiEditor => write!(f, "AI_EDITOR"), + UsageLimitType::Chat => write!(f, "CHAT"), + UsageLimitType::CodeScan => write!(f, "CODE_SCAN"), + UsageLimitType::GumbyTransform => write!(f, "GUMBY_TRANSFORM"), + UsageLimitType::ProactiveCodeScan => write!(f, "PROACTIVE_CODE_SCAN"), + UsageLimitType::Qsda => write!(f, "QSDA"), + UsageLimitType::Recommendations => write!(f, "RECOMMENDATIONS"), + UsageLimitType::WeaverbirdConversation => write!(f, "WEAVERBIRD_CONVERSATION"), + UsageLimitType::Unknown(value) => write!(f, "{}", value), + } + } +} diff --git a/crates/amzn-codewhisperer-client/src/types/_usage_limit_update_request_status.rs b/crates/amzn-codewhisperer-client/src/types/_usage_limit_update_request_status.rs new file mode 100644 index 0000000000..bf717fdfab --- /dev/null +++ b/crates/amzn-codewhisperer-client/src/types/_usage_limit_update_request_status.rs @@ -0,0 +1,124 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +/// When writing a match expression against `UsageLimitUpdateRequestStatus`, it is important to +/// ensure your code is forward-compatible. That is, if a match arm handles a case for a +/// feature that is supported by the service but has not been represented as an enum +/// variant in a current version of SDK, your code should continue to work when you +/// upgrade SDK to a future version in which the enum does include a variant for that +/// feature. +/// +/// Here is an example of how you can make a match expression forward-compatible: +/// +/// ```text +/// # let usagelimitupdaterequeststatus = unimplemented!(); +/// match usagelimitupdaterequeststatus { +/// UsageLimitUpdateRequestStatus::Approved => { /* ... */ }, +/// UsageLimitUpdateRequestStatus::PendingReview => { /* ... */ }, +/// UsageLimitUpdateRequestStatus::Rejected => { /* ... */ }, +/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ }, +/// _ => { /* ... */ }, +/// } +/// ``` +/// The above code demonstrates that when `usagelimitupdaterequeststatus` represents +/// `NewFeature`, the execution path will lead to the second last match arm, +/// even though the enum does not contain a variant `UsageLimitUpdateRequestStatus::NewFeature` +/// in the current version of SDK. The reason is that the variable `other`, +/// created by the `@` operator, is bound to +/// `UsageLimitUpdateRequestStatus::Unknown(UnknownVariantValue("NewFeature".to_owned()))` +/// and calling `as_str` on it yields `"NewFeature"`. +/// This match expression is forward-compatible when executed with a newer +/// version of SDK where the variant `UsageLimitUpdateRequestStatus::NewFeature` is defined. +/// Specifically, when `usagelimitupdaterequeststatus` represents `NewFeature`, +/// the execution path will hit the second last match arm as before by virtue of +/// calling `as_str` on `UsageLimitUpdateRequestStatus::NewFeature` also yielding `"NewFeature"`. +/// +/// Explicitly matching on the `Unknown` variant should +/// be avoided for two reasons: +/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. +/// - It might inadvertently shadow other intended match arms. +#[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 UsageLimitUpdateRequestStatus { + /// The limit update request was approved + Approved, + /// The limit update request is pending review + PendingReview, + /// The limit update request was rejected + Rejected, + /// `Unknown` contains new variants that have been added since this code was generated. + #[deprecated( + note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants." + )] + Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), +} +impl ::std::convert::From<&str> for UsageLimitUpdateRequestStatus { + fn from(s: &str) -> Self { + match s { + "APPROVED" => UsageLimitUpdateRequestStatus::Approved, + "PENDING_REVIEW" => UsageLimitUpdateRequestStatus::PendingReview, + "REJECTED" => UsageLimitUpdateRequestStatus::Rejected, + other => UsageLimitUpdateRequestStatus::Unknown( + crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned()), + ), + } + } +} +impl ::std::str::FromStr for UsageLimitUpdateRequestStatus { + type Err = ::std::convert::Infallible; + + fn from_str(s: &str) -> ::std::result::Result::Err> { + ::std::result::Result::Ok(UsageLimitUpdateRequestStatus::from(s)) + } +} +impl UsageLimitUpdateRequestStatus { + /// Returns the `&str` value of the enum member. + pub fn as_str(&self) -> &str { + match self { + UsageLimitUpdateRequestStatus::Approved => "APPROVED", + UsageLimitUpdateRequestStatus::PendingReview => "PENDING_REVIEW", + UsageLimitUpdateRequestStatus::Rejected => "REJECTED", + UsageLimitUpdateRequestStatus::Unknown(value) => value.as_str(), + } + } + + /// Returns all the `&str` representations of the enum members. + pub const fn values() -> &'static [&'static str] { + &["APPROVED", "PENDING_REVIEW", "REJECTED"] + } +} +impl ::std::convert::AsRef for UsageLimitUpdateRequestStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl UsageLimitUpdateRequestStatus { + /// Parses the enum value while disallowing unknown variants. + /// + /// Unknown variants will result in an error. + pub fn try_parse(value: &str) -> ::std::result::Result { + match Self::from(value) { + #[allow(deprecated)] + Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)), + known => Ok(known), + } + } +} +impl ::std::fmt::Display for UsageLimitUpdateRequestStatus { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + match self { + UsageLimitUpdateRequestStatus::Approved => write!(f, "APPROVED"), + UsageLimitUpdateRequestStatus::PendingReview => write!(f, "PENDING_REVIEW"), + UsageLimitUpdateRequestStatus::Rejected => write!(f, "REJECTED"), + UsageLimitUpdateRequestStatus::Unknown(value) => write!(f, "{}", value), + } + } +} diff --git a/crates/amzn-codewhisperer-client/src/types/_user_modification_event.rs b/crates/amzn-codewhisperer-client/src/types/_user_modification_event.rs index b02c2fb53c..0359261f64 100644 --- a/crates/amzn-codewhisperer-client/src/types/_user_modification_event.rs +++ b/crates/amzn-codewhisperer-client/src/types/_user_modification_event.rs @@ -19,6 +19,10 @@ pub struct UserModificationEvent { pub accepted_character_count: i32, #[allow(missing_docs)] // documentation missing in model pub unmodified_accepted_character_count: i32, + #[allow(missing_docs)] // documentation missing in model + pub added_character_count: i32, + #[allow(missing_docs)] // documentation missing in model + pub unmodified_added_character_count: i32, } impl UserModificationEvent { #[allow(missing_docs)] // documentation missing in model @@ -62,6 +66,16 @@ impl UserModificationEvent { pub fn unmodified_accepted_character_count(&self) -> i32 { self.unmodified_accepted_character_count } + + #[allow(missing_docs)] // documentation missing in model + pub fn added_character_count(&self) -> i32 { + self.added_character_count + } + + #[allow(missing_docs)] // documentation missing in model + pub fn unmodified_added_character_count(&self) -> i32 { + self.unmodified_added_character_count + } } impl UserModificationEvent { /// Creates a new builder-style object to manufacture @@ -83,6 +97,8 @@ pub struct UserModificationEventBuilder { pub(crate) timestamp: ::std::option::Option<::aws_smithy_types::DateTime>, pub(crate) accepted_character_count: ::std::option::Option, pub(crate) unmodified_accepted_character_count: ::std::option::Option, + pub(crate) added_character_count: ::std::option::Option, + pub(crate) unmodified_added_character_count: ::std::option::Option, } impl UserModificationEventBuilder { #[allow(missing_docs)] // documentation missing in model @@ -228,6 +244,40 @@ impl UserModificationEventBuilder { &self.unmodified_accepted_character_count } + #[allow(missing_docs)] // documentation missing in model + pub fn added_character_count(mut self, input: i32) -> Self { + self.added_character_count = ::std::option::Option::Some(input); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn set_added_character_count(mut self, input: ::std::option::Option) -> Self { + self.added_character_count = input; + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn get_added_character_count(&self) -> &::std::option::Option { + &self.added_character_count + } + + #[allow(missing_docs)] // documentation missing in model + pub fn unmodified_added_character_count(mut self, input: i32) -> Self { + self.unmodified_added_character_count = ::std::option::Option::Some(input); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn set_unmodified_added_character_count(mut self, input: ::std::option::Option) -> Self { + self.unmodified_added_character_count = input; + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn get_unmodified_added_character_count(&self) -> &::std::option::Option { + &self.unmodified_added_character_count + } + /// Consumes the builder and constructs a /// [`UserModificationEvent`](crate::types::UserModificationEvent). This method will fail if /// any of the following fields are not set: @@ -274,6 +324,8 @@ impl UserModificationEventBuilder { })?, accepted_character_count: self.accepted_character_count.unwrap_or_default(), unmodified_accepted_character_count: self.unmodified_accepted_character_count.unwrap_or_default(), + added_character_count: self.added_character_count.unwrap_or_default(), + unmodified_added_character_count: self.unmodified_added_character_count.unwrap_or_default(), }) } } diff --git a/crates/amzn-codewhisperer-client/src/types/_user_trigger_decision_event.rs b/crates/amzn-codewhisperer-client/src/types/_user_trigger_decision_event.rs index d8dd7de8cf..4187e38a46 100644 --- a/crates/amzn-codewhisperer-client/src/types/_user_trigger_decision_event.rs +++ b/crates/amzn-codewhisperer-client/src/types/_user_trigger_decision_event.rs @@ -35,6 +35,12 @@ pub struct UserTriggerDecisionEvent { pub added_ide_diagnostics: ::std::option::Option<::std::vec::Vec>, /// List of IDE Diagnostics pub removed_ide_diagnostics: ::std::option::Option<::std::vec::Vec>, + #[allow(missing_docs)] // documentation missing in model + pub added_character_count: i32, + #[allow(missing_docs)] // documentation missing in model + pub deleted_character_count: i32, + #[allow(missing_docs)] // documentation missing in model + pub streak_length: i32, } impl UserTriggerDecisionEvent { #[allow(missing_docs)] // documentation missing in model @@ -124,6 +130,21 @@ impl UserTriggerDecisionEvent { pub fn removed_ide_diagnostics(&self) -> &[crate::types::IdeDiagnostic] { self.removed_ide_diagnostics.as_deref().unwrap_or_default() } + + #[allow(missing_docs)] // documentation missing in model + pub fn added_character_count(&self) -> i32 { + self.added_character_count + } + + #[allow(missing_docs)] // documentation missing in model + pub fn deleted_character_count(&self) -> i32 { + self.deleted_character_count + } + + #[allow(missing_docs)] // documentation missing in model + pub fn streak_length(&self) -> i32 { + self.streak_length + } } impl UserTriggerDecisionEvent { /// Creates a new builder-style object to manufacture @@ -153,6 +174,9 @@ pub struct UserTriggerDecisionEventBuilder { pub(crate) accepted_character_count: ::std::option::Option, pub(crate) added_ide_diagnostics: ::std::option::Option<::std::vec::Vec>, pub(crate) removed_ide_diagnostics: ::std::option::Option<::std::vec::Vec>, + pub(crate) added_character_count: ::std::option::Option, + pub(crate) deleted_character_count: ::std::option::Option, + pub(crate) streak_length: ::std::option::Option, } impl UserTriggerDecisionEventBuilder { #[allow(missing_docs)] // documentation missing in model @@ -454,6 +478,57 @@ impl UserTriggerDecisionEventBuilder { &self.removed_ide_diagnostics } + #[allow(missing_docs)] // documentation missing in model + pub fn added_character_count(mut self, input: i32) -> Self { + self.added_character_count = ::std::option::Option::Some(input); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn set_added_character_count(mut self, input: ::std::option::Option) -> Self { + self.added_character_count = input; + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn get_added_character_count(&self) -> &::std::option::Option { + &self.added_character_count + } + + #[allow(missing_docs)] // documentation missing in model + pub fn deleted_character_count(mut self, input: i32) -> Self { + self.deleted_character_count = ::std::option::Option::Some(input); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn set_deleted_character_count(mut self, input: ::std::option::Option) -> Self { + self.deleted_character_count = input; + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn get_deleted_character_count(&self) -> &::std::option::Option { + &self.deleted_character_count + } + + #[allow(missing_docs)] // documentation missing in model + pub fn streak_length(mut self, input: i32) -> Self { + self.streak_length = ::std::option::Option::Some(input); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn set_streak_length(mut self, input: ::std::option::Option) -> Self { + self.streak_length = input; + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn get_streak_length(&self) -> &::std::option::Option { + &self.streak_length + } + /// Consumes the builder and constructs a /// [`UserTriggerDecisionEvent`](crate::types::UserTriggerDecisionEvent). This method will /// fail if any of the following fields are not set: @@ -520,6 +595,9 @@ impl UserTriggerDecisionEventBuilder { accepted_character_count: self.accepted_character_count.unwrap_or_default(), added_ide_diagnostics: self.added_ide_diagnostics, removed_ide_diagnostics: self.removed_ide_diagnostics, + added_character_count: self.added_character_count.unwrap_or_default(), + deleted_character_count: self.deleted_character_count.unwrap_or_default(), + streak_length: self.streak_length.unwrap_or_default(), }) } } diff --git a/crates/amzn-codewhisperer-client/src/types/builders.rs b/crates/amzn-codewhisperer-client/src/types/builders.rs index cf3088c1d7..dfa16576cb 100644 --- a/crates/amzn-codewhisperer-client/src/types/builders.rs +++ b/crates/amzn-codewhisperer-client/src/types/builders.rs @@ -97,6 +97,7 @@ pub use crate::types::_transformation_source_code_artifact_descriptor::Transform pub use crate::types::_transformation_spec::TransformationSpecBuilder; pub use crate::types::_transformation_step::TransformationStepBuilder; pub use crate::types::_transformation_upload_context::TransformationUploadContextBuilder; +pub use crate::types::_usage_limit_list::UsageLimitListBuilder; pub use crate::types::_user_context::UserContextBuilder; pub use crate::types::_user_input_message::UserInputMessageBuilder; pub use crate::types::_user_input_message_context::UserInputMessageContextBuilder; diff --git a/crates/amzn-codewhisperer-client/src/types/error.rs b/crates/amzn-codewhisperer-client/src/types/error.rs index f8c1d99f79..701fedb284 100644 --- a/crates/amzn-codewhisperer-client/src/types/error.rs +++ b/crates/amzn-codewhisperer-client/src/types/error.rs @@ -5,6 +5,7 @@ pub use crate::types::error::_internal_server_exception::InternalServerError; pub use crate::types::error::_resource_not_found_exception::ResourceNotFoundError; pub use crate::types::error::_service_quota_exceeded_exception::ServiceQuotaExceededError; pub use crate::types::error::_throttling_exception::ThrottlingError; +pub use crate::types::error::_update_usage_limit_quota_exceeded_exception::UpdateUsageLimitQuotaExceededError; pub use crate::types::error::_validation_exception::ValidationError; mod _access_denied_exception; @@ -19,6 +20,8 @@ mod _service_quota_exceeded_exception; mod _throttling_exception; +mod _update_usage_limit_quota_exceeded_exception; + mod _validation_exception; /// Builders diff --git a/crates/amzn-codewhisperer-client/src/types/error/_update_usage_limit_quota_exceeded_exception.rs b/crates/amzn-codewhisperer-client/src/types/error/_update_usage_limit_quota_exceeded_exception.rs new file mode 100644 index 0000000000..426b0a8f8d --- /dev/null +++ b/crates/amzn-codewhisperer-client/src/types/error/_update_usage_limit_quota_exceeded_exception.rs @@ -0,0 +1,109 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +/// Exception thrown when the number of usage limit update requests exceeds the monthly quota +/// (default 3 requests per month) +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct UpdateUsageLimitQuotaExceededError { + #[allow(missing_docs)] // documentation missing in model + pub message: ::std::string::String, + pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata, +} +impl UpdateUsageLimitQuotaExceededError { + /// Returns the error message. + pub fn message(&self) -> &str { + &self.message + } +} +impl ::std::fmt::Display for UpdateUsageLimitQuotaExceededError { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + ::std::write!( + f, + "UpdateUsageLimitQuotaExceededError [UpdateUsageLimitQuotaExceededException]" + )?; + { + ::std::write!(f, ": {}", &self.message)?; + } + Ok(()) + } +} +impl ::std::error::Error for UpdateUsageLimitQuotaExceededError {} +impl ::aws_types::request_id::RequestId for crate::types::error::UpdateUsageLimitQuotaExceededError { + fn request_id(&self) -> Option<&str> { + use ::aws_smithy_types::error::metadata::ProvideErrorMetadata; + self.meta().request_id() + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for UpdateUsageLimitQuotaExceededError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + &self.meta + } +} +impl UpdateUsageLimitQuotaExceededError { + /// Creates a new builder-style object to manufacture + /// [`UpdateUsageLimitQuotaExceededError`](crate::types::error::UpdateUsageLimitQuotaExceededError). + pub fn builder() -> crate::types::error::builders::UpdateUsageLimitQuotaExceededErrorBuilder { + crate::types::error::builders::UpdateUsageLimitQuotaExceededErrorBuilder::default() + } +} + +/// A builder for +/// [`UpdateUsageLimitQuotaExceededError`](crate::types::error::UpdateUsageLimitQuotaExceededError). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct UpdateUsageLimitQuotaExceededErrorBuilder { + pub(crate) message: ::std::option::Option<::std::string::String>, + meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>, +} +impl UpdateUsageLimitQuotaExceededErrorBuilder { + #[allow(missing_docs)] // documentation missing in model + /// This field is required. + pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.message = ::std::option::Option::Some(input.into()); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.message = input; + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn get_message(&self) -> &::std::option::Option<::std::string::String> { + &self.message + } + + /// Sets error metadata + pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self { + self.meta = Some(meta); + self + } + + /// Sets error metadata + pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self { + self.meta = meta; + self + } + + /// Consumes the builder and constructs a + /// [`UpdateUsageLimitQuotaExceededError`](crate::types::error::UpdateUsageLimitQuotaExceededError). + /// This method will fail if any of the following fields are not set: + /// - [`message`](crate::types::error::builders::UpdateUsageLimitQuotaExceededErrorBuilder::message) + pub fn build( + self, + ) -> ::std::result::Result< + crate::types::error::UpdateUsageLimitQuotaExceededError, + ::aws_smithy_types::error::operation::BuildError, + > { + ::std::result::Result::Ok(crate::types::error::UpdateUsageLimitQuotaExceededError { + message: self.message.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "message", + "message was not specified but it is required when building UpdateUsageLimitQuotaExceededError", + ) + })?, + meta: self.meta.unwrap_or_default(), + }) + } +} diff --git a/crates/amzn-codewhisperer-client/src/types/error/builders.rs b/crates/amzn-codewhisperer-client/src/types/error/builders.rs index adeb2f224d..2f75bc5c72 100644 --- a/crates/amzn-codewhisperer-client/src/types/error/builders.rs +++ b/crates/amzn-codewhisperer-client/src/types/error/builders.rs @@ -5,4 +5,5 @@ pub use crate::types::error::_internal_server_exception::InternalServerErrorBuil pub use crate::types::error::_resource_not_found_exception::ResourceNotFoundErrorBuilder; pub use crate::types::error::_service_quota_exceeded_exception::ServiceQuotaExceededErrorBuilder; pub use crate::types::error::_throttling_exception::ThrottlingErrorBuilder; +pub use crate::types::error::_update_usage_limit_quota_exceeded_exception::UpdateUsageLimitQuotaExceededErrorBuilder; pub use crate::types::error::_validation_exception::ValidationErrorBuilder; diff --git a/crates/amzn-codewhisperer-streaming-client/Cargo.toml b/crates/amzn-codewhisperer-streaming-client/Cargo.toml index c250679b94..2547b949a5 100644 --- a/crates/amzn-codewhisperer-streaming-client/Cargo.toml +++ b/crates/amzn-codewhisperer-streaming-client/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2021" name = "amzn-codewhisperer-streaming-client" -version = "0.1.8200" +version = "0.1.8702" authors = ["Grant Gurvis "] build = false exclude = [ diff --git a/crates/amzn-codewhisperer-streaming-client/src/config.rs b/crates/amzn-codewhisperer-streaming-client/src/config.rs index 9c0faddffa..6fced58031 100644 --- a/crates/amzn-codewhisperer-streaming-client/src/config.rs +++ b/crates/amzn-codewhisperer-streaming-client/src/config.rs @@ -591,6 +591,7 @@ impl Builder { /// # Examples /// /// Disabling identity caching: + /// /// ```no_run /// use amzn_codewhisperer_streaming_client::config::IdentityCache; /// @@ -602,6 +603,7 @@ impl Builder { /// ``` /// /// Customizing lazy caching: + /// /// ```no_run /// use std::time::Duration; /// @@ -638,6 +640,7 @@ impl Builder { /// # Examples /// /// Disabling identity caching: + /// /// ```no_run /// use amzn_codewhisperer_streaming_client::config::IdentityCache; /// @@ -649,6 +652,7 @@ impl Builder { /// ``` /// /// Customizing lazy caching: + /// /// ```no_run /// use std::time::Duration; /// diff --git a/crates/amzn-codewhisperer-streaming-client/src/protocol_serde/shape_user_input_message.rs b/crates/amzn-codewhisperer-streaming-client/src/protocol_serde/shape_user_input_message.rs index 716eb41329..2c43086677 100644 --- a/crates/amzn-codewhisperer-streaming-client/src/protocol_serde/shape_user_input_message.rs +++ b/crates/amzn-codewhisperer-streaming-client/src/protocol_serde/shape_user_input_message.rs @@ -30,5 +30,8 @@ pub fn ser_user_input_message( } array_6.finish(); } + if let Some(var_9) = &input.model_id { + object.key("modelId").string(var_9.as_str()); + } Ok(()) } diff --git a/crates/amzn-codewhisperer-streaming-client/src/types/_user_input_message.rs b/crates/amzn-codewhisperer-streaming-client/src/types/_user_input_message.rs index 1d8e987387..725358a632 100644 --- a/crates/amzn-codewhisperer-streaming-client/src/types/_user_input_message.rs +++ b/crates/amzn-codewhisperer-streaming-client/src/types/_user_input_message.rs @@ -14,6 +14,8 @@ pub struct UserInputMessage { pub origin: ::std::option::Option, /// Images associated with the Chat Message. pub images: ::std::option::Option<::std::vec::Vec>, + /// Unique identifier for the model used in this conversation + pub model_id: ::std::option::Option<::std::string::String>, } impl UserInputMessage { /// The content of the chat message. @@ -44,6 +46,11 @@ impl UserInputMessage { pub fn images(&self) -> &[crate::types::ImageBlock] { self.images.as_deref().unwrap_or_default() } + + /// Unique identifier for the model used in this conversation + pub fn model_id(&self) -> ::std::option::Option<&str> { + self.model_id.as_deref() + } } impl ::std::fmt::Debug for UserInputMessage { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { @@ -53,6 +60,7 @@ impl ::std::fmt::Debug for UserInputMessage { formatter.field("user_intent", &self.user_intent); formatter.field("origin", &self.origin); formatter.field("images", &self.images); + formatter.field("model_id", &self.model_id); formatter.finish() } } @@ -73,6 +81,7 @@ pub struct UserInputMessageBuilder { pub(crate) user_intent: ::std::option::Option, pub(crate) origin: ::std::option::Option, pub(crate) images: ::std::option::Option<::std::vec::Vec>, + pub(crate) model_id: ::std::option::Option<::std::string::String>, } impl UserInputMessageBuilder { /// The content of the chat message. @@ -170,6 +179,23 @@ impl UserInputMessageBuilder { &self.images } + /// Unique identifier for the model used in this conversation + pub fn model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.model_id = ::std::option::Option::Some(input.into()); + self + } + + /// Unique identifier for the model used in this conversation + pub fn set_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.model_id = input; + self + } + + /// Unique identifier for the model used in this conversation + pub fn get_model_id(&self) -> &::std::option::Option<::std::string::String> { + &self.model_id + } + /// Consumes the builder and constructs a [`UserInputMessage`](crate::types::UserInputMessage). /// This method will fail if any of the following fields are not set: /// - [`content`](crate::types::builders::UserInputMessageBuilder::content) @@ -187,6 +213,7 @@ impl UserInputMessageBuilder { user_intent: self.user_intent, origin: self.origin, images: self.images, + model_id: self.model_id, }) } } @@ -198,6 +225,7 @@ impl ::std::fmt::Debug for UserInputMessageBuilder { formatter.field("user_intent", &self.user_intent); formatter.field("origin", &self.origin); formatter.field("images", &self.images); + formatter.field("model_id", &self.model_id); formatter.finish() } } diff --git a/crates/amzn-consolas-client/Cargo.toml b/crates/amzn-consolas-client/Cargo.toml index 709cf0c709..2a587a0a88 100644 --- a/crates/amzn-consolas-client/Cargo.toml +++ b/crates/amzn-consolas-client/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2021" name = "amzn-consolas-client" -version = "0.1.8200" +version = "0.1.8702" authors = ["Grant Gurvis "] build = false exclude = [ diff --git a/crates/amzn-consolas-client/src/config.rs b/crates/amzn-consolas-client/src/config.rs index d9d6dbdeb8..f77b52fb62 100644 --- a/crates/amzn-consolas-client/src/config.rs +++ b/crates/amzn-consolas-client/src/config.rs @@ -614,6 +614,7 @@ impl Builder { /// # Examples /// /// Disabling identity caching: + /// /// ```no_run /// use amzn_consolas_client::config::IdentityCache; /// @@ -625,6 +626,7 @@ impl Builder { /// ``` /// /// Customizing lazy caching: + /// /// ```no_run /// use std::time::Duration; /// @@ -661,6 +663,7 @@ impl Builder { /// # Examples /// /// Disabling identity caching: + /// /// ```no_run /// use amzn_consolas_client::config::IdentityCache; /// @@ -672,6 +675,7 @@ impl Builder { /// ``` /// /// Customizing lazy caching: + /// /// ```no_run /// use std::time::Duration; /// @@ -1157,7 +1161,7 @@ impl Builder { /// /// Customizing behavior major version: /// - /// ```no_run + /// ```no_run /// use amzn_consolas_client::config::BehaviorVersion; /// /// let config = amzn_consolas_client::Config::builder() @@ -1182,7 +1186,7 @@ impl Builder { /// /// Set the behavior major version to `latest`. This is equivalent to enabling the /// `behavior-version-latest` cargo feature. - // + /// /// ```no_run /// use amzn_consolas_client::config::BehaviorVersion; /// @@ -1195,7 +1199,7 @@ impl Builder { /// /// Customizing behavior major version: /// - /// ```no_run + /// ```no_run /// use amzn_consolas_client::config::BehaviorVersion; /// /// let config = amzn_consolas_client::Config::builder() diff --git a/crates/amzn-consolas-client/src/protocol_serde/shape_file_context.rs b/crates/amzn-consolas-client/src/protocol_serde/shape_file_context.rs index 0c003716d9..a23639986d 100644 --- a/crates/amzn-consolas-client/src/protocol_serde/shape_file_context.rs +++ b/crates/amzn-consolas-client/src/protocol_serde/shape_file_context.rs @@ -12,14 +12,17 @@ pub fn ser_file_context( { object.key("filename").string(input.filename.as_str()); } + if let Some(var_1) = &input.file_uri { + object.key("fileUri").string(var_1.as_str()); + } { #[allow(unused_mut)] - let mut object_1 = object.key("programmingLanguage").start_object(); + let mut object_2 = object.key("programmingLanguage").start_object(); crate::protocol_serde::shape_programming_language::ser_programming_language( - &mut object_1, + &mut object_2, &input.programming_language, )?; - object_1.finish(); + object_2.finish(); } Ok(()) } diff --git a/crates/amzn-consolas-client/src/types/_file_context.rs b/crates/amzn-consolas-client/src/types/_file_context.rs index 201823112b..58d682d8df 100644 --- a/crates/amzn-consolas-client/src/types/_file_context.rs +++ b/crates/amzn-consolas-client/src/types/_file_context.rs @@ -9,6 +9,8 @@ pub struct FileContext { pub right_file_content: ::std::string::String, #[allow(missing_docs)] // documentation missing in model pub filename: ::std::string::String, + #[allow(missing_docs)] // documentation missing in model + pub file_uri: ::std::option::Option<::std::string::String>, /// Programming Languages supported by CodeWhisperer pub programming_language: crate::types::ProgrammingLanguage, } @@ -31,6 +33,11 @@ impl FileContext { self.filename.deref() } + #[allow(missing_docs)] // documentation missing in model + pub fn file_uri(&self) -> ::std::option::Option<&str> { + self.file_uri.as_deref() + } + /// Programming Languages supported by CodeWhisperer pub fn programming_language(&self) -> &crate::types::ProgrammingLanguage { &self.programming_language @@ -42,6 +49,7 @@ impl ::std::fmt::Debug for FileContext { formatter.field("left_file_content", &"*** Sensitive Data Redacted ***"); formatter.field("right_file_content", &"*** Sensitive Data Redacted ***"); formatter.field("filename", &"*** Sensitive Data Redacted ***"); + formatter.field("file_uri", &"*** Sensitive Data Redacted ***"); formatter.field("programming_language", &self.programming_language); formatter.finish() } @@ -61,6 +69,7 @@ pub struct FileContextBuilder { pub(crate) left_file_content: ::std::option::Option<::std::string::String>, pub(crate) right_file_content: ::std::option::Option<::std::string::String>, pub(crate) filename: ::std::option::Option<::std::string::String>, + pub(crate) file_uri: ::std::option::Option<::std::string::String>, pub(crate) programming_language: ::std::option::Option, } impl FileContextBuilder { @@ -118,6 +127,23 @@ impl FileContextBuilder { &self.filename } + #[allow(missing_docs)] // documentation missing in model + pub fn file_uri(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.file_uri = ::std::option::Option::Some(input.into()); + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn set_file_uri(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.file_uri = input; + self + } + + #[allow(missing_docs)] // documentation missing in model + pub fn get_file_uri(&self) -> &::std::option::Option<::std::string::String> { + &self.file_uri + } + /// Programming Languages supported by CodeWhisperer /// This field is required. pub fn programming_language(mut self, input: crate::types::ProgrammingLanguage) -> Self { @@ -164,6 +190,7 @@ impl FileContextBuilder { "filename was not specified but it is required when building FileContext", ) })?, + file_uri: self.file_uri, programming_language: self.programming_language.ok_or_else(|| { ::aws_smithy_types::error::operation::BuildError::missing_field( "programming_language", @@ -179,6 +206,7 @@ impl ::std::fmt::Debug for FileContextBuilder { formatter.field("left_file_content", &"*** Sensitive Data Redacted ***"); formatter.field("right_file_content", &"*** Sensitive Data Redacted ***"); formatter.field("filename", &"*** Sensitive Data Redacted ***"); + formatter.field("file_uri", &"*** Sensitive Data Redacted ***"); formatter.field("programming_language", &self.programming_language); formatter.finish() } diff --git a/crates/amzn-qdeveloper-streaming-client/Cargo.toml b/crates/amzn-qdeveloper-streaming-client/Cargo.toml index fdb0ade48e..d6d87ee1ae 100644 --- a/crates/amzn-qdeveloper-streaming-client/Cargo.toml +++ b/crates/amzn-qdeveloper-streaming-client/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2021" name = "amzn-qdeveloper-streaming-client" -version = "0.1.8200" +version = "0.1.8702" authors = ["Grant Gurvis "] build = false exclude = [ diff --git a/crates/amzn-qdeveloper-streaming-client/src/protocol_serde/shape_user_input_message.rs b/crates/amzn-qdeveloper-streaming-client/src/protocol_serde/shape_user_input_message.rs index 716eb41329..2c43086677 100644 --- a/crates/amzn-qdeveloper-streaming-client/src/protocol_serde/shape_user_input_message.rs +++ b/crates/amzn-qdeveloper-streaming-client/src/protocol_serde/shape_user_input_message.rs @@ -30,5 +30,8 @@ pub fn ser_user_input_message( } array_6.finish(); } + if let Some(var_9) = &input.model_id { + object.key("modelId").string(var_9.as_str()); + } Ok(()) } diff --git a/crates/amzn-qdeveloper-streaming-client/src/types/_user_input_message.rs b/crates/amzn-qdeveloper-streaming-client/src/types/_user_input_message.rs index 1d8e987387..725358a632 100644 --- a/crates/amzn-qdeveloper-streaming-client/src/types/_user_input_message.rs +++ b/crates/amzn-qdeveloper-streaming-client/src/types/_user_input_message.rs @@ -14,6 +14,8 @@ pub struct UserInputMessage { pub origin: ::std::option::Option, /// Images associated with the Chat Message. pub images: ::std::option::Option<::std::vec::Vec>, + /// Unique identifier for the model used in this conversation + pub model_id: ::std::option::Option<::std::string::String>, } impl UserInputMessage { /// The content of the chat message. @@ -44,6 +46,11 @@ impl UserInputMessage { pub fn images(&self) -> &[crate::types::ImageBlock] { self.images.as_deref().unwrap_or_default() } + + /// Unique identifier for the model used in this conversation + pub fn model_id(&self) -> ::std::option::Option<&str> { + self.model_id.as_deref() + } } impl ::std::fmt::Debug for UserInputMessage { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { @@ -53,6 +60,7 @@ impl ::std::fmt::Debug for UserInputMessage { formatter.field("user_intent", &self.user_intent); formatter.field("origin", &self.origin); formatter.field("images", &self.images); + formatter.field("model_id", &self.model_id); formatter.finish() } } @@ -73,6 +81,7 @@ pub struct UserInputMessageBuilder { pub(crate) user_intent: ::std::option::Option, pub(crate) origin: ::std::option::Option, pub(crate) images: ::std::option::Option<::std::vec::Vec>, + pub(crate) model_id: ::std::option::Option<::std::string::String>, } impl UserInputMessageBuilder { /// The content of the chat message. @@ -170,6 +179,23 @@ impl UserInputMessageBuilder { &self.images } + /// Unique identifier for the model used in this conversation + pub fn model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.model_id = ::std::option::Option::Some(input.into()); + self + } + + /// Unique identifier for the model used in this conversation + pub fn set_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.model_id = input; + self + } + + /// Unique identifier for the model used in this conversation + pub fn get_model_id(&self) -> &::std::option::Option<::std::string::String> { + &self.model_id + } + /// Consumes the builder and constructs a [`UserInputMessage`](crate::types::UserInputMessage). /// This method will fail if any of the following fields are not set: /// - [`content`](crate::types::builders::UserInputMessageBuilder::content) @@ -187,6 +213,7 @@ impl UserInputMessageBuilder { user_intent: self.user_intent, origin: self.origin, images: self.images, + model_id: self.model_id, }) } } @@ -198,6 +225,7 @@ impl ::std::fmt::Debug for UserInputMessageBuilder { formatter.field("user_intent", &self.user_intent); formatter.field("origin", &self.origin); formatter.field("images", &self.images); + formatter.field("model_id", &self.model_id); formatter.finish() } } diff --git a/crates/semantic_search_client/src/embedding/onnx.rs b/crates/semantic_search_client/src/embedding/onnx.rs index 5b513c4d2d..4cdde06ef0 100644 --- a/crates/semantic_search_client/src/embedding/onnx.rs +++ b/crates/semantic_search_client/src/embedding/onnx.rs @@ -148,6 +148,23 @@ fn initialize_model(model_type: OnnxModelType, models_dir: &std::path::Path) -> }, } } +impl crate::embedding::BenchmarkableEmbedder for TextEmbedder { + fn model_name(&self) -> String { + format!("ONNX-{}", self.model_type().get_model_name()) + } + + fn embedding_dim(&self) -> usize { + self.model_type().get_embedding_dim() + } + + fn embed_single(&self, text: &str) -> Vec { + self.embed(text).unwrap() + } + + fn embed_batch(&self, texts: &[String]) -> Vec> { + self.embed_batch(texts).unwrap() + } +} #[cfg(test)] mod tests { @@ -350,20 +367,3 @@ mod tests { } } } -impl crate::embedding::BenchmarkableEmbedder for TextEmbedder { - fn model_name(&self) -> String { - format!("ONNX-{}", self.model_type().get_model_name()) - } - - fn embedding_dim(&self) -> usize { - self.model_type().get_embedding_dim() - } - - fn embed_single(&self, text: &str) -> Vec { - self.embed(text).unwrap() - } - - fn embed_batch(&self, texts: &[String]) -> Vec> { - self.embed_batch(texts).unwrap() - } -} diff --git a/crates/semantic_search_client/src/processing/text_chunker.rs b/crates/semantic_search_client/src/processing/text_chunker.rs index 739fdcb04e..0b3a84b6d1 100644 --- a/crates/semantic_search_client/src/processing/text_chunker.rs +++ b/crates/semantic_search_client/src/processing/text_chunker.rs @@ -113,6 +113,6 @@ mod tests { let chunks = chunk_text(&text, None, None); // Should use the config values (50, 10) set in setup() - assert!(chunks.len() > 0); + assert!(!chunks.is_empty()); } } diff --git a/crates/semantic_search_client/tests/test_async_client.rs b/crates/semantic_search_client/tests/test_async_client.rs index 99021765ee..ad33020e5e 100644 --- a/crates/semantic_search_client/tests/test_async_client.rs +++ b/crates/semantic_search_client/tests/test_async_client.rs @@ -41,22 +41,20 @@ mod tests { // Spawn a background task for indexing let handle = task::spawn(async move { - let context_id = task::spawn_blocking(move || { + task::spawn_blocking(move || { // Create a new client inside the blocking task let mut client = SemanticSearchClient::new_with_default_dir().unwrap(); client.add_context_from_path( &path_clone, &name, - &description, + description, persistent, Option::::None, ) }) .await .unwrap() - .unwrap(); - - context_id + .unwrap() }); // Wait for the background task to complete @@ -142,7 +140,7 @@ mod tests { // Spawn a background task for indexing the directory let handle = task::spawn(async move { - let context_id = task::spawn_blocking(move || { + task::spawn_blocking(move || { // Create a new client inside the blocking task let mut client = SemanticSearchClient::new_with_default_dir().unwrap(); client.add_context_from_path( @@ -155,9 +153,7 @@ mod tests { }) .await .unwrap() - .unwrap(); - - context_id + .unwrap() }); // While the indexing is happening, we can do other work diff --git a/crates/semantic_search_client/tests/test_vector_index.rs b/crates/semantic_search_client/tests/test_vector_index.rs index f4b1e3ea52..f989291dfd 100644 --- a/crates/semantic_search_client/tests/test_vector_index.rs +++ b/crates/semantic_search_client/tests/test_vector_index.rs @@ -6,7 +6,7 @@ fn test_vector_index_creation() { let index = VectorIndex::new(384); // 384-dimensional vectors // Verify the index was created successfully - assert!(index.len() > 0 || index.len() == 0); + assert!(!index.is_empty() || index.is_empty()); } #[test] @@ -23,7 +23,7 @@ fn test_add_vectors() { // We can't reliably test the length since the implementation may have internal constraints // Just verify the index exists - assert!(index.len() > 0); + assert!(!index.is_empty()); } #[test]