|
| 1 | +use crate::{ |
| 2 | + admin_api_keys::AdminAPIKeys, |
| 3 | + assistants::Assistants, |
| 4 | + audio::Audio, |
| 5 | + audit_logs::AuditLogs, |
| 6 | + batches::Batches, |
| 7 | + certificates::Certificates, |
| 8 | + chat::Chat, |
| 9 | + chatkit::{Chatkit, ChatkitSessions, ChatkitThreads}, |
| 10 | + completion::Completions, |
| 11 | + container_files::ContainerFiles, |
| 12 | + containers::Containers, |
| 13 | + conversation_items::ConversationItems, |
| 14 | + conversations::Conversations, |
| 15 | + embedding::Embeddings, |
| 16 | + eval_run_output_items::EvalRunOutputItems, |
| 17 | + eval_runs::EvalRuns, |
| 18 | + evals::Evals, |
| 19 | + file::Files, |
| 20 | + fine_tuning::FineTuning, |
| 21 | + group_roles::GroupRoles, |
| 22 | + group_users::GroupUsers, |
| 23 | + groups::Groups, |
| 24 | + image::Images, |
| 25 | + invites::Invites, |
| 26 | + messages::Messages, |
| 27 | + model::Models, |
| 28 | + moderation::Moderations, |
| 29 | + project_api_keys::ProjectAPIKeys, |
| 30 | + project_certificates::ProjectCertificates, |
| 31 | + project_group_roles::ProjectGroupRoles, |
| 32 | + project_groups::ProjectGroups, |
| 33 | + project_rate_limits::ProjectRateLimits, |
| 34 | + project_roles::ProjectRoles, |
| 35 | + project_service_accounts::ProjectServiceAccounts, |
| 36 | + project_user_roles::ProjectUserRoles, |
| 37 | + project_users::ProjectUsers, |
| 38 | + projects::Projects, |
| 39 | + responses::Responses, |
| 40 | + roles::Roles, |
| 41 | + runs::Runs, |
| 42 | + speech::Speech, |
| 43 | + steps::Steps, |
| 44 | + threads::Threads, |
| 45 | + transcriptions::Transcriptions, |
| 46 | + translations::Translations, |
| 47 | + uploads::Uploads, |
| 48 | + usage::Usage, |
| 49 | + user_roles::UserRoles, |
| 50 | + users::Users, |
| 51 | + vector_store_file_batches::VectorStoreFileBatches, |
| 52 | + vector_store_files::VectorStoreFiles, |
| 53 | + vector_stores::VectorStores, |
| 54 | + video::Videos, |
| 55 | +}; |
| 56 | + |
| 57 | +// request builder impls macro |
| 58 | + |
| 59 | +/// Macro to implement `RequestOptionsBuilder` for wrapper types containing `RequestOptions` |
| 60 | +macro_rules! impl_request_options_builder { |
| 61 | + ($type:ident) => { |
| 62 | + impl<'c, C: crate::config::Config> crate::traits::RequestOptionsBuilder for $type<'c, C> { |
| 63 | + fn options_mut(&mut self) -> &mut crate::RequestOptions { |
| 64 | + &mut self.request_options |
| 65 | + } |
| 66 | + |
| 67 | + fn options(&self) -> &crate::RequestOptions { |
| 68 | + &self.request_options |
| 69 | + } |
| 70 | + } |
| 71 | + }; |
| 72 | +} |
| 73 | + |
| 74 | +#[cfg(feature = "realtime")] |
| 75 | +use crate::Realtime; |
| 76 | + |
| 77 | +impl_request_options_builder!(AdminAPIKeys); |
| 78 | +impl_request_options_builder!(Assistants); |
| 79 | +impl_request_options_builder!(Audio); |
| 80 | +impl_request_options_builder!(AuditLogs); |
| 81 | +impl_request_options_builder!(Batches); |
| 82 | +impl_request_options_builder!(Certificates); |
| 83 | +impl_request_options_builder!(Chat); |
| 84 | +impl_request_options_builder!(Chatkit); |
| 85 | +impl_request_options_builder!(ChatkitSessions); |
| 86 | +impl_request_options_builder!(ChatkitThreads); |
| 87 | +impl_request_options_builder!(Completions); |
| 88 | +impl_request_options_builder!(ContainerFiles); |
| 89 | +impl_request_options_builder!(Containers); |
| 90 | +impl_request_options_builder!(ConversationItems); |
| 91 | +impl_request_options_builder!(Conversations); |
| 92 | +impl_request_options_builder!(Embeddings); |
| 93 | +impl_request_options_builder!(Evals); |
| 94 | +impl_request_options_builder!(EvalRunOutputItems); |
| 95 | +impl_request_options_builder!(EvalRuns); |
| 96 | +impl_request_options_builder!(Files); |
| 97 | +impl_request_options_builder!(FineTuning); |
| 98 | +impl_request_options_builder!(GroupRoles); |
| 99 | +impl_request_options_builder!(GroupUsers); |
| 100 | +impl_request_options_builder!(Groups); |
| 101 | +impl_request_options_builder!(Images); |
| 102 | +impl_request_options_builder!(Invites); |
| 103 | +impl_request_options_builder!(Messages); |
| 104 | +impl_request_options_builder!(Models); |
| 105 | +impl_request_options_builder!(Moderations); |
| 106 | +impl_request_options_builder!(Projects); |
| 107 | +impl_request_options_builder!(ProjectGroupRoles); |
| 108 | +impl_request_options_builder!(ProjectGroups); |
| 109 | +impl_request_options_builder!(ProjectRoles); |
| 110 | +impl_request_options_builder!(ProjectUserRoles); |
| 111 | +impl_request_options_builder!(ProjectUsers); |
| 112 | +impl_request_options_builder!(ProjectServiceAccounts); |
| 113 | +impl_request_options_builder!(ProjectAPIKeys); |
| 114 | +impl_request_options_builder!(ProjectRateLimits); |
| 115 | +impl_request_options_builder!(ProjectCertificates); |
| 116 | +impl_request_options_builder!(Roles); |
| 117 | +#[cfg(feature = "realtime")] |
| 118 | +impl_request_options_builder!(Realtime); |
| 119 | +impl_request_options_builder!(Responses); |
| 120 | +impl_request_options_builder!(Runs); |
| 121 | +impl_request_options_builder!(Speech); |
| 122 | +impl_request_options_builder!(Steps); |
| 123 | +impl_request_options_builder!(Threads); |
| 124 | +impl_request_options_builder!(Transcriptions); |
| 125 | +impl_request_options_builder!(Translations); |
| 126 | +impl_request_options_builder!(Uploads); |
| 127 | +impl_request_options_builder!(Usage); |
| 128 | +impl_request_options_builder!(UserRoles); |
| 129 | +impl_request_options_builder!(Users); |
| 130 | +impl_request_options_builder!(VectorStoreFileBatches); |
| 131 | +impl_request_options_builder!(VectorStoreFiles); |
| 132 | +impl_request_options_builder!(VectorStores); |
| 133 | +impl_request_options_builder!(Videos); |
0 commit comments