@@ -446,3 +446,107 @@ pub struct CreateTranslationResponseVerboseJson {
446446pub struct CreateSpeechResponse {
447447 pub bytes : Bytes ,
448448}
449+
450+ /// A consent recording used to authorize creation of a custom voice.
451+ #[ derive( Debug , Serialize , Deserialize , Clone , PartialEq ) ]
452+ pub struct VoiceConsentResource {
453+ /// The object type, which is always `audio.voice_consent`.
454+ pub object : String ,
455+ /// The consent recording identifier.
456+ pub id : String ,
457+ /// The label provided when the consent recording was uploaded.
458+ pub name : String ,
459+ /// The BCP 47 language tag for the consent phrase (for example, `en-US`).
460+ pub language : String ,
461+ /// The Unix timestamp (in seconds) for when the consent recording was created.
462+ pub created_at : u64 ,
463+ }
464+
465+ /// Request to create a voice consent recording.
466+ #[ derive( Clone , Default , Debug , Builder , PartialEq ) ]
467+ #[ builder( name = "CreateVoiceConsentRequestArgs" ) ]
468+ #[ builder( pattern = "mutable" ) ]
469+ #[ builder( setter( into, strip_option) , default ) ]
470+ #[ builder( derive( Debug ) ) ]
471+ #[ builder( build_fn( error = "OpenAIError" ) ) ]
472+ pub struct CreateVoiceConsentRequest {
473+ /// The label to use for this consent recording.
474+ pub name : String ,
475+ /// The consent audio recording file. Maximum size is 10 MiB.
476+ /// Supported MIME types: `audio/mpeg`, `audio/wav`, `audio/x-wav`, `audio/ogg`,
477+ /// `audio/aac`, `audio/flac`, `audio/webm`, `audio/mp4`.
478+ pub recording : AudioInput ,
479+ /// The BCP 47 language tag for the consent phrase (for example, `en-US`).
480+ pub language : String ,
481+ }
482+
483+ /// Request to update a voice consent recording (metadata only).
484+ #[ derive( Clone , Serialize , Default , Debug , Deserialize , Builder , PartialEq ) ]
485+ #[ builder( name = "UpdateVoiceConsentRequestArgs" ) ]
486+ #[ builder( pattern = "mutable" ) ]
487+ #[ builder( setter( into, strip_option) , default ) ]
488+ #[ builder( derive( Debug ) ) ]
489+ #[ builder( build_fn( error = "OpenAIError" ) ) ]
490+ pub struct UpdateVoiceConsentRequest {
491+ /// The updated label for this consent recording.
492+ pub name : String ,
493+ }
494+
495+ /// The voice consent deletion object.
496+ #[ derive( Debug , Serialize , Deserialize , Clone , PartialEq ) ]
497+ pub struct VoiceConsentDeletedResource {
498+ /// The consent recording identifier.
499+ pub id : String ,
500+ /// The object type, which is always `audio.voice_consent`.
501+ pub object : String ,
502+ /// Whether the consent recording was deleted.
503+ pub deleted : bool ,
504+ }
505+
506+ /// The voice consent list object.
507+ #[ derive( Debug , Serialize , Deserialize , Clone , PartialEq ) ]
508+ pub struct VoiceConsentListResource {
509+ /// The object type, which is always `list`.
510+ pub object : String ,
511+ /// The list of voice consent recordings.
512+ pub data : Vec < VoiceConsentResource > ,
513+ /// The ID of the first voice consent recording in the list.
514+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
515+ pub first_id : Option < String > ,
516+ /// The ID of the last voice consent recording in the list.
517+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
518+ pub last_id : Option < String > ,
519+ /// Whether there are more voice consent recordings available.
520+ pub has_more : bool ,
521+ }
522+
523+ /// A custom voice that can be used for audio output.
524+ #[ derive( Debug , Serialize , Deserialize , Clone , PartialEq ) ]
525+ pub struct VoiceResource {
526+ /// The object type, which is always `audio.voice`.
527+ pub object : String ,
528+ /// The voice identifier, which can be referenced in API endpoints.
529+ pub id : String ,
530+ /// The name of the voice.
531+ pub name : String ,
532+ /// The Unix timestamp (in seconds) for when the voice was created.
533+ pub created_at : u64 ,
534+ }
535+
536+ /// Request to create a custom voice.
537+ #[ derive( Clone , Default , Debug , Builder , PartialEq ) ]
538+ #[ builder( name = "CreateVoiceRequestArgs" ) ]
539+ #[ builder( pattern = "mutable" ) ]
540+ #[ builder( setter( into, strip_option) , default ) ]
541+ #[ builder( derive( Debug ) ) ]
542+ #[ builder( build_fn( error = "OpenAIError" ) ) ]
543+ pub struct CreateVoiceRequest {
544+ /// The name of the new voice.
545+ pub name : String ,
546+ /// The sample audio recording file. Maximum size is 10 MiB.
547+ /// Supported MIME types: `audio/mpeg`, `audio/wav`, `audio/x-wav`, `audio/ogg`,
548+ /// `audio/aac`, `audio/flac`, `audio/webm`, `audio/mp4`.
549+ pub audio_sample : AudioInput ,
550+ /// The consent recording ID (for example, `cons_1234`).
551+ pub consent : String ,
552+ }
0 commit comments