ibm_watson/text-to-speech/speaker-models/
errors.rs

1use thiserror::Error;
2#[derive(Debug, Error)]
3pub enum ListSpeakersError {
4    #[error("The service experienced an internal error.")]
5    /// The service experienced an internal error
6    InternalServerError500, // 500
7    #[error("The service is currently unavailable.")]
8    /// The service is currently unavailable
9    ServiceUnavailable503, // 503
10    #[error("{0}")]
11    /// There was an error making the request
12    ConnectionError(String),
13    /// The request failed. Possible failure causes include. Invalid service credentials were passed with the request
14    #[error("The request failed. Possible failure causes include. Invalid service credentials were passed with the request")]
15    BadRequest400,
16}
17
18#[derive(Debug, Error)]
19pub enum CreateSpeakerError {
20    #[error("")]
21    BadRequest400,
22    #[error("The service is currently unavailable")]
23    /// The service is currently unavailable
24    ServiceUnavailable503,
25    /// The service experienced an internal error
26    #[error("The service experienced an internal error")]
27    InternalServerError500,
28    /// There was an error reading the file
29    #[error("There was an error reading the file: {0}")]
30    FileReadError(String),
31    /// The request passed an unacceptable media type with the Content-Type header. The header must pass a value of multipart/form-data
32    #[error("The request passed an unacceptable media type with the Content-Type header. The header must pass a value of multipart/form-data")]
33    UnsupportedMediaType415,
34    /// The specified customisation_id is invalid for the requesting credentials
35    #[error("The specified customisation_id  {0} is invalid for the requesting credentials")]
36    Unauthorised401(String),
37}
38
39#[derive(Debug, Error)]
40pub enum GetSpeakerError {
41    /// There was an error establishing the connection
42    #[error("{0}")]
43    ConnectionError(String),
44    #[error("A required input parameter is null or a specified input parameter or header value is invalid or not supported")]
45    BadRequest400,
46    #[error("The service is currently unavailable")]
47    /// The service is currently unavailable
48    ServiceUnavailable503,
49    /// The service experienced an internal error
50    #[error("The service experienced an internal error")]
51    InternalServerError500,
52    /// The specified speaker_id is invalid for the requesting credentials")]
53    #[error("The specified speaker_id: {0} is invalid for the requesting credentials")]
54    Unauthorised401(String),
55    /// The requested resource has not been modified since the time specified by the If-Modified-Since header, as documented in the HTTP specification
56    #[error("The requested resource has not been modified since the time specified by the If-Modified-Since header, as documented in the HTTP specification")]
57    NotModified304,
58}
59
60#[derive(Error, Debug)]
61pub enum DeleteSpeakerError {
62    /// There was an error establishing the connection
63    #[error("{0}")]
64    ConnectionError(String),
65    /// A required input parameter is null or a specified input parameter or header value is invalid or not supported
66    #[error("A required input parameter is null or a specified input parameter or header value is invalid or not supported")]
67    BadRequest400(String),
68    #[error("The service is currently unavailable")]
69    /// The service is currently unavailable
70    ServiceUnavailable503,
71    #[error("The service experienced an internal error")]
72    /// The service experienced an internal error
73    InternalServerError500,
74    #[error("The specified speaker_id {0} is invalid for the requesting credentials")]
75    /// The specified speaker_id is invalid for the requesting credentials
76    Unauthorised401(String),
77}