MyApp

<back to all web services

UpdateChinookEmployee

Media Store
The following routes are available for this service:
PUT/employees/{EmployeeId}
#![allow(
    dead_code,
    non_camel_case_types,
    non_snake_case,
    clippy::upper_case_acronyms
)]

use serde::{Deserialize, Serialize};
use serde_json::Value;
use std::collections::HashMap;

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
#[serde(default)]
pub struct UpdateChinookEmployee {
    #[serde(rename = "employeeId")]
    pub employee_id: i64,
    #[serde(rename = "lastName")]
    pub last_name: String,
    #[serde(rename = "firstName")]
    pub first_name: String,
    pub title: String,
    #[serde(rename = "reportsTo")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub reports_to: Option<i64>,
    #[serde(rename = "birthDate")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub birth_date: Option<String>,
    #[serde(rename = "hireDate")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub hire_date: Option<String>,
    pub address: String,
    pub city: String,
    pub state: String,
    pub country: String,
    #[serde(rename = "postalCode")]
    pub postal_code: String,
    pub phone: String,
    pub fax: String,
    pub email: String,
}

Rust UpdateChinookEmployee DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

PUT /employees/{EmployeeId} HTTP/1.1 
Host: blazor-gallery.servicestack.net 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	employeeId: 0,
	lastName: String,
	firstName: String,
	title: String,
	reportsTo: 0,
	birthDate: 0001-01-01,
	hireDate: 0001-01-01,
	address: String,
	city: String,
	state: String,
	country: String,
	postalCode: String,
	phone: String,
	fax: String,
	email: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	id: String,
	responseStatus: 
	{
		errorCode: String,
		message: String,
		stackTrace: String,
		errors: 
		[
			{
				errorCode: String,
				fieldName: String,
				message: String,
				meta: 
				{
					String: String
				}
			}
		],
		meta: 
		{
			String: String
		}
	}
}