Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Jess Frazelle <[email protected]>
  • Loading branch information
jessfraz committed Jan 22, 2025
1 parent 50a6fb0 commit e3f5249
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion remote/remote-api.rs.patch.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"op": "add",
"path": "/paths/~1v1~1employments/post/x-rust",
"value": {
"example": "/// Create employment\n/// \n/// Creates an employment. We support creating employees and contractors.\n/// \n/// This endpoint requires and returns country-specific data. The exact required and returned fields will\n/// vary depending on which country the employment is in. To see the list of parameters for each country,\n/// see the **Show form schema** endpoint under the [Countries](#tag/Countries) category.\n/// \n/// Please note that the compliance requirements for each country are subject to change, which will result\n/// in required and optional parameters being added and deleted without notice.\n/// \n/// If you are using this endpoint to build an integration, make sure you are dynamically collecting or\n/// displaying the latest parameters for each country by querying the _\"Show form schema\"_ endpoint.\n/// \n/// For more information on JSON Schemas, see the **How JSON Schemas work** documentation.\n/// \n/// To learn how you can dynamically generate forms to display in your UI, see the documentation for\n/// the [json-schema-form](https://www.notion.so/remotecom/json-schema-form-Documentation-4f390236948b4b2e8b7350ebcd488ca6) tool.\n/// \n/// \nasync fn example_employments_post_create() -> anyhow::Result<()> {\n let client = remote_api::Client::new_from_env();\n let result: remote_api::types::EmploymentResponse = client\n .employments()\n .post_create(&remote_api::types::EmploymentBasicParams {\n company_id: \"some-string\".to_string(),\n country_code: Some(\"some-string\".to_string()),\n full_name: \"some-string\".to_string(),\n job_title: \"some-string\".to_string(),\n personal_email: \"[email protected]\".to_string(),\n provisional_start_date: Some(chrono::Utc::now().date_naive()),\n type_: remote_api::types::EmploymentBasicParamsType::Contractor,\n })\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n",
"example": "/// Create employment\n/// \n/// Creates an employment. We support creating employees and contractors.\n/// \n/// This endpoint requires and returns country-specific data. The exact required and returned fields will\n/// vary depending on which country the employment is in. To see the list of parameters for each country,\n/// see the **Show form schema** endpoint under the [Countries](#tag/Countries) category.\n/// \n/// Please note that the compliance requirements for each country are subject to change, which will result\n/// in required and optional parameters being added and deleted without notice.\n/// \n/// If you are using this endpoint to build an integration, make sure you are dynamically collecting or\n/// displaying the latest parameters for each country by querying the _\"Show form schema\"_ endpoint.\n/// \n/// For more information on JSON Schemas, see the **How JSON Schemas work** documentation.\n/// \n/// To learn how you can dynamically generate forms to display in your UI, see the documentation for\n/// the [json-schema-form](https://www.notion.so/remotecom/json-schema-form-Documentation-4f390236948b4b2e8b7350ebcd488ca6) tool.\n/// \n/// \nasync fn example_employments_post_create() -> anyhow::Result<()> {\n let client = remote_api::Client::new_from_env();\n let result: remote_api::types::EmploymentResponse = client\n .employments()\n .post_create(&remote_api::types::EmploymentBasicParams {\n company_id: \"some-string\".to_string(),\n country_code: Some(\"some-string\".to_string()),\n full_name: \"some-string\".to_string(),\n job_title: Some(\"some-string\".to_string()),\n personal_email: \"[email protected]\".to_string(),\n provisional_start_date: Some(chrono::Utc::now().date_naive()),\n type_: remote_api::types::EmploymentBasicParamsType::Contractor,\n })\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n",
"libDocsLink": "https://docs.rs/remote-api/latest/remote-api/employments/struct.Employments.html#method.post_create"
}
},
Expand Down
2 changes: 1 addition & 1 deletion remote/src/employments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl Employments {
}
}

#[doc = "Create employment\n\nCreates an employment. We support creating employees and contractors.\n\nThis endpoint requires and returns country-specific data. The exact required and returned fields will\nvary depending on which country the employment is in. To see the list of parameters for each country,\nsee the **Show form schema** endpoint under the [Countries](#tag/Countries) category.\n\nPlease note that the compliance requirements for each country are subject to change, which will result\nin required and optional parameters being added and deleted without notice.\n\nIf you are using this endpoint to build an integration, make sure you are dynamically collecting or\ndisplaying the latest parameters for each country by querying the _\"Show form schema\"_ endpoint.\n\nFor more information on JSON Schemas, see the **How JSON Schemas work** documentation.\n\nTo learn how you can dynamically generate forms to display in your UI, see the documentation for\nthe [json-schema-form](https://www.notion.so/remotecom/json-schema-form-Documentation-4f390236948b4b2e8b7350ebcd488ca6) tool.\n\n\n\n```rust,no_run\nasync fn example_employments_post_create() -> anyhow::Result<()> {\n let client = remote_api::Client::new_from_env();\n let result: remote_api::types::EmploymentResponse = client\n .employments()\n .post_create(&remote_api::types::EmploymentBasicParams {\n company_id: \"some-string\".to_string(),\n country_code: Some(\"some-string\".to_string()),\n full_name: \"some-string\".to_string(),\n job_title: \"some-string\".to_string(),\n personal_email: \"[email protected]\".to_string(),\n provisional_start_date: Some(chrono::Utc::now().date_naive()),\n type_: remote_api::types::EmploymentBasicParamsType::Contractor,\n })\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"]
#[doc = "Create employment\n\nCreates an employment. We support creating employees and contractors.\n\nThis endpoint requires and returns country-specific data. The exact required and returned fields will\nvary depending on which country the employment is in. To see the list of parameters for each country,\nsee the **Show form schema** endpoint under the [Countries](#tag/Countries) category.\n\nPlease note that the compliance requirements for each country are subject to change, which will result\nin required and optional parameters being added and deleted without notice.\n\nIf you are using this endpoint to build an integration, make sure you are dynamically collecting or\ndisplaying the latest parameters for each country by querying the _\"Show form schema\"_ endpoint.\n\nFor more information on JSON Schemas, see the **How JSON Schemas work** documentation.\n\nTo learn how you can dynamically generate forms to display in your UI, see the documentation for\nthe [json-schema-form](https://www.notion.so/remotecom/json-schema-form-Documentation-4f390236948b4b2e8b7350ebcd488ca6) tool.\n\n\n\n```rust,no_run\nasync fn example_employments_post_create() -> anyhow::Result<()> {\n let client = remote_api::Client::new_from_env();\n let result: remote_api::types::EmploymentResponse = client\n .employments()\n .post_create(&remote_api::types::EmploymentBasicParams {\n company_id: \"some-string\".to_string(),\n country_code: Some(\"some-string\".to_string()),\n full_name: \"some-string\".to_string(),\n job_title: Some(\"some-string\".to_string()),\n personal_email: \"[email protected]\".to_string(),\n provisional_start_date: Some(chrono::Utc::now().date_naive()),\n type_: remote_api::types::EmploymentBasicParamsType::Contractor,\n })\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"]
#[tracing::instrument]
pub async fn post_create<'a>(
&'a self,
Expand Down
5 changes: 3 additions & 2 deletions remote/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1645,7 +1645,8 @@ pub struct EmploymentBasicParams {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub country_code: Option<String>,
pub full_name: String,
pub job_title: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub job_title: Option<String>,
pub personal_email: String,
#[doc = "Required for employees, optional for contractors"]
#[serde(default, skip_serializing_if = "Option::is_none")]
Expand All @@ -1672,7 +1673,7 @@ impl tabled::Tabled for EmploymentBasicParams {
self.company_id.clone().into(),
format!("{:?}", self.country_code).into(),
self.full_name.clone().into(),
self.job_title.clone().into(),
format!("{:?}", self.job_title).into(),
self.personal_email.clone().into(),
if let Some(provisional_start_date) = &self.provisional_start_date {
format!("{:?}", provisional_start_date).into()
Expand Down
3 changes: 2 additions & 1 deletion specs/remote.json
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,8 @@
"job_title": {
"type": "string",
"x-struct": null,
"x-validate": null
"x-validate": null,
"nullable": true
},
"personal_email": {
"format": "email",
Expand Down

0 comments on commit e3f5249

Please sign in to comment.