/// Both `workspace` and `resource` were set on the upload request, but the workspace
/// derived from the resource does not match the explicitly-supplied workspace. Returned
/// as a defensive sanity check so callers don't accidentally believe they're uploading
/// to one workspace while the file is actually being routed to another.
#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    PartialEq,
    Eq,
    PartialOrd,
    Ord,
    Hash
)]
#[serde(crate = "conjure_object::serde")]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct WorkspaceResourceMismatch {
    #[serde(rename = "resourceRid")]
    resource_rid: conjure_object::ResourceIdentifier,
    #[serde(rename = "requestedWorkspace")]
    requested_workspace: conjure_object::ResourceIdentifier,
    #[serde(rename = "resolvedWorkspace")]
    resolved_workspace: conjure_object::ResourceIdentifier,
}
impl WorkspaceResourceMismatch {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(
        resource_rid: conjure_object::ResourceIdentifier,
        requested_workspace: conjure_object::ResourceIdentifier,
        resolved_workspace: conjure_object::ResourceIdentifier,
    ) -> Self {
        Self::builder()
            .resource_rid(resource_rid)
            .requested_workspace(requested_workspace)
            .resolved_workspace(resolved_workspace)
            .build()
    }
    #[inline]
    pub fn resource_rid(&self) -> &conjure_object::ResourceIdentifier {
        &self.resource_rid
    }
    #[inline]
    pub fn requested_workspace(&self) -> &conjure_object::ResourceIdentifier {
        &self.requested_workspace
    }
    #[inline]
    pub fn resolved_workspace(&self) -> &conjure_object::ResourceIdentifier {
        &self.resolved_workspace
    }
}
impl conjure_error::ErrorType for WorkspaceResourceMismatch {
    #[inline]
    fn code() -> conjure_error::ErrorCode {
        conjure_error::ErrorCode::InvalidArgument
    }
    #[inline]
    fn name() -> &'static str {
        "UploadService:WorkspaceResourceMismatch"
    }
    #[inline]
    fn safe_args() -> &'static [&'static str] {
        &["requestedWorkspace", "resolvedWorkspace", "resourceRid"]
    }
}
