1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>An error corresponding to the calculation of a route between the <code>DeparturePosition</code> and <code>DestinationPosition</code>.</p>
/// <p>The error code can be one of the following:</p>
/// <ul>
/// <li> <p> <code>RouteNotFound</code> - Unable to find a valid route with the given parameters.</p> </li>
/// </ul>
/// <ul>
/// <li> <p> <code>RouteTooLong</code> - Route calculation went beyond the maximum size of a route and was terminated before completion.</p> </li>
/// </ul>
/// <ul>
/// <li> <p> <code>PositionsNotFound</code> - One or more of the input positions were not found on the route network.</p> </li>
/// </ul>
/// <ul>
/// <li> <p> <code>DestinationPositionNotFound</code> - The destination position was not found on the route network.</p> </li>
/// </ul>
/// <ul>
/// <li> <p> <code>DeparturePositionNotFound</code> - The departure position was not found on the route network.</p> </li>
/// </ul>
/// <ul>
/// <li> <p> <code>OtherValidationError</code> - The given inputs were not valid or a route was not found. More information is given in the error <code>Message</code> </p> </li>
/// </ul>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct RouteMatrixEntryError {
    /// <p>The type of error which occurred for the route calculation.</p>
    pub code: ::std::option::Option<crate::types::RouteMatrixErrorCode>,
    /// <p>A message about the error that occurred for the route calculation.</p>
    pub message: ::std::option::Option<::std::string::String>,
}
impl RouteMatrixEntryError {
    /// <p>The type of error which occurred for the route calculation.</p>
    pub fn code(&self) -> ::std::option::Option<&crate::types::RouteMatrixErrorCode> {
        self.code.as_ref()
    }
    /// <p>A message about the error that occurred for the route calculation.</p>
    pub fn message(&self) -> ::std::option::Option<&str> {
        self.message.as_deref()
    }
}
impl RouteMatrixEntryError {
    /// Creates a new builder-style object to manufacture [`RouteMatrixEntryError`](crate::types::RouteMatrixEntryError).
    pub fn builder() -> crate::types::builders::RouteMatrixEntryErrorBuilder {
        crate::types::builders::RouteMatrixEntryErrorBuilder::default()
    }
}

/// A builder for [`RouteMatrixEntryError`](crate::types::RouteMatrixEntryError).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct RouteMatrixEntryErrorBuilder {
    pub(crate) code: ::std::option::Option<crate::types::RouteMatrixErrorCode>,
    pub(crate) message: ::std::option::Option<::std::string::String>,
}
impl RouteMatrixEntryErrorBuilder {
    /// <p>The type of error which occurred for the route calculation.</p>
    pub fn code(mut self, input: crate::types::RouteMatrixErrorCode) -> Self {
        self.code = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of error which occurred for the route calculation.</p>
    pub fn set_code(mut self, input: ::std::option::Option<crate::types::RouteMatrixErrorCode>) -> Self {
        self.code = input;
        self
    }
    /// <p>The type of error which occurred for the route calculation.</p>
    pub fn get_code(&self) -> &::std::option::Option<crate::types::RouteMatrixErrorCode> {
        &self.code
    }
    /// <p>A message about the error that occurred for the route calculation.</p>
    pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.message = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A message about the error that occurred for the route calculation.</p>
    pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.message = input;
        self
    }
    /// <p>A message about the error that occurred for the route calculation.</p>
    pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
        &self.message
    }
    /// Consumes the builder and constructs a [`RouteMatrixEntryError`](crate::types::RouteMatrixEntryError).
    pub fn build(self) -> crate::types::RouteMatrixEntryError {
        crate::types::RouteMatrixEntryError {
            code: self.code,
            message: self.message,
        }
    }
}