Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
Signed-off-by: Jess Frazelle <[email protected]>
  • Loading branch information
jessfraz committed Aug 12, 2024
1 parent 5a652f6 commit dc5c039
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 16 deletions.
4 changes: 3 additions & 1 deletion ramp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ serde_json = "1"
serde_urlencoded = { version = "^0.7", optional = true }
tabled = { version = "0.15.0", features = ["ansi"], optional = true }
thiserror = "1"
tokio = { version = "1.38.0", features = ["rt", "macros"] }
tracing = { version = "^0.1", optional = true }
url = { version = "2", features = ["serde"] }
uuid = { version = "1", features = ["serde", "v4", "v7"] }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tokio = { version = "1.38.0", features = ["rt", "macros"] }

[dev-dependencies]
expectorate = "1"
futures-util = "^0.3.26"
Expand Down
10 changes: 5 additions & 5 deletions ramp/ramp-api.rs.patch.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions ramp/src/card.rs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ramp/src/card_program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ impl CardProgram {
}
}

#[doc = "Create a card program\n\n**NOTE:** This operation is marked as deprecated.\n\n```rust,no_run\nuse std::str::FromStr;\nasync fn example_card_program_post_list_deprecated() -> anyhow::Result<()> {\n let client =\n ramp_api::Client::new_from_env(String::from(\"token\"), String::from(\"refresh-token\"));\n let result: ramp_api::types::ApiCardProgramResource = client\n .card_program()\n .post_list_deprecated(&ramp_api::types::ApiCardProgramCreateRequestBody {\n acting_user_id: 4 as i64,\n business_id: 4 as i64,\n description: \"some-string\".to_string(),\n display_name: \"some-string\".to_string(),\n icon: Some(ramp_api::types::Icon::TravelExpensesIcon),\n is_default: false,\n is_physical: false,\n policy_id: 4 as i64,\n spending_restrictions: ramp_api::types::ApiCardSpendingRestrictionsRequestBody {\n amount: serde_json::Value::String(\"some-string\".to_string()),\n blocked_mcc_codes: Some(vec![\"some-string\".to_string()]),\n card_accounting_rules: Some(vec![\n ramp_api::types::ApiCardAccountingRulesDataRequestBody {\n tracking_category_id: uuid::Uuid::from_str(\n \"d9797f8d-9ad6-4e08-90d7-2ec17e13471c\",\n )?,\n tracking_category_option_id: uuid::Uuid::from_str(\n \"d9797f8d-9ad6-4e08-90d7-2ec17e13471c\",\n )?,\n tracking_category_option_remote_name: \"some-string\".to_string(),\n },\n ]),\n categories: Some(vec![4 as i64]),\n categories_blacklist: Some(vec![4 as i64]),\n categories_whitelist: Some(vec![4 as i64]),\n currency: Some(\"some-string\".to_string()),\n interval: ramp_api::types::Interval::Yearly,\n lock_date: Some(chrono::Utc::now()),\n policy_id: Some(\"some-string\".to_string()),\n transaction_amount_limit: Some(serde_json::Value::String(\n \"some-string\".to_string(),\n )),\n vendor_blacklist: Some(vec![uuid::Uuid::from_str(\n \"d9797f8d-9ad6-4e08-90d7-2ec17e13471c\",\n )?]),\n vendor_whitelist: Some(vec![uuid::Uuid::from_str(\n \"d9797f8d-9ad6-4e08-90d7-2ec17e13471c\",\n )?]),\n },\n })\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"]
#[doc = "Create a card program\n\n**NOTE:** This operation is marked as deprecated.\n\n```rust,no_run\nuse std::str::FromStr;\nasync fn example_card_program_post_list_deprecated() -> anyhow::Result<()> {\n let client =\n ramp_api::Client::new_from_env(String::from(\"token\"), String::from(\"refresh-token\"));\n let result: ramp_api::types::ApiCardProgramResource = client\n .card_program()\n .post_list_deprecated(&ramp_api::types::ApiCardProgramCreateRequestBody {\n acting_user_id: 4 as i64,\n business_id: 4 as i64,\n description: \"some-string\".to_string(),\n display_name: \"some-string\".to_string(),\n icon: Some(ramp_api::types::Icon::TravelExpensesIcon),\n is_default: false,\n is_physical: false,\n policy_id: 4 as i64,\n spending_restrictions: ramp_api::types::ApiCardSpendingRestrictionsRequestBody {\n amount: 3.14 as f64,\n blocked_mcc_codes: Some(vec![\"some-string\".to_string()]),\n card_accounting_rules: Some(vec![\n ramp_api::types::ApiCardAccountingRulesDataRequestBody {\n tracking_category_id: uuid::Uuid::from_str(\n \"d9797f8d-9ad6-4e08-90d7-2ec17e13471c\",\n )?,\n tracking_category_option_id: uuid::Uuid::from_str(\n \"d9797f8d-9ad6-4e08-90d7-2ec17e13471c\",\n )?,\n tracking_category_option_remote_name: \"some-string\".to_string(),\n },\n ]),\n categories: Some(vec![4 as i64]),\n categories_blacklist: Some(vec![4 as i64]),\n categories_whitelist: Some(vec![4 as i64]),\n currency: Some(\"some-string\".to_string()),\n interval: ramp_api::types::Interval::Yearly,\n lock_date: Some(chrono::Utc::now()),\n policy_id: Some(\"some-string\".to_string()),\n transaction_amount_limit: Some(3.14 as f64),\n vendor_blacklist: Some(vec![uuid::Uuid::from_str(\n \"d9797f8d-9ad6-4e08-90d7-2ec17e13471c\",\n )?]),\n vendor_whitelist: Some(vec![uuid::Uuid::from_str(\n \"d9797f8d-9ad6-4e08-90d7-2ec17e13471c\",\n )?]),\n },\n })\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"]
#[tracing::instrument]
pub async fn post_list_deprecated<'a>(
&'a self,
Expand Down
2 changes: 1 addition & 1 deletion ramp/src/sales_lead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ impl SalesLead {
Self { client }
}

#[doc = "Create a sales lead\n\n```rust,no_run\nasync fn example_sales_lead_post_creation() -> anyhow::Result<()> {\n let client =\n ramp_api::Client::new_from_env(String::from(\"token\"), String::from(\"refresh-token\"));\n client\n .sales_lead()\n .post_creation(&ramp_api::types::ApiSalesLeadCreateRequestBody {\n business_info: Some(ramp_api::types::ApiSalesLeadBusinessRequestBody {\n business_description: Some(\"some-string\".to_string()),\n business_name_dba: \"some-string\".to_string(),\n business_name_legal: \"some-string\".to_string(),\n business_name_website: Some(\"some-string\".to_string()),\n date_of_incorporation: Some(chrono::Utc::now().date().naive_utc()),\n ein_number: Some(\"some-string\".to_string()),\n entity_type: Some(ramp_api::types::EntityType::SoleProprietorship),\n estimated_monthly_spend: Some(\"some-string\".to_string()),\n industry: Some(\"some-string\".to_string()),\n industry_group: Some(\"some-string\".to_string()),\n office_address: Some(ramp_api::types::ApiSalesLeadOfficeAddressRequestBody {\n office_apt_suite: Some(\"some-string\".to_string()),\n office_city: Some(\"some-string\".to_string()),\n office_country: Some(\"some-string\".to_string()),\n office_postal_code: Some(\"some-string\".to_string()),\n office_state: Some(\"some-string\".to_string()),\n office_street_address: Some(\"some-string\".to_string()),\n }),\n office_phone_number: Some(\"some-string\".to_string()),\n sector: Some(\"some-string\".to_string()),\n state_of_incorporation: Some(\"some-string\".to_string()),\n sub_industry: Some(\"some-string\".to_string()),\n }),\n email: \"some-string\".to_string(),\n external_id: \"some-string\".to_string(),\n first_name: \"some-string\".to_string(),\n last_name: \"some-string\".to_string(),\n phone: Some(\"some-string\".to_string()),\n redirect_uri: \"some-string\".to_string(),\n source: ramp_api::types::Source::Quanta,\n state: \"some-string\".to_string(),\n })\n .await?;\n Ok(())\n}\n```"]
#[doc = "Create a sales lead\n\n```rust,no_run\nasync fn example_sales_lead_post_creation() -> anyhow::Result<()> {\n let client =\n ramp_api::Client::new_from_env(String::from(\"token\"), String::from(\"refresh-token\"));\n client\n .sales_lead()\n .post_creation(&ramp_api::types::ApiSalesLeadCreateRequestBody {\n business_info: Some(ramp_api::types::ApiSalesLeadBusinessRequestBody {\n business_description: Some(\"some-string\".to_string()),\n business_name_dba: \"some-string\".to_string(),\n business_name_legal: \"some-string\".to_string(),\n business_name_website: Some(\"some-string\".to_string()),\n date_of_incorporation: Some(chrono::Utc::now().date_naive()),\n ein_number: Some(\"some-string\".to_string()),\n entity_type: Some(ramp_api::types::EntityType::SoleProprietorship),\n estimated_monthly_spend: Some(\"some-string\".to_string()),\n industry: Some(\"some-string\".to_string()),\n industry_group: Some(\"some-string\".to_string()),\n office_address: Some(ramp_api::types::ApiSalesLeadOfficeAddressRequestBody {\n office_apt_suite: Some(\"some-string\".to_string()),\n office_city: Some(\"some-string\".to_string()),\n office_country: Some(\"some-string\".to_string()),\n office_postal_code: Some(\"some-string\".to_string()),\n office_state: Some(\"some-string\".to_string()),\n office_street_address: Some(\"some-string\".to_string()),\n }),\n office_phone_number: Some(\"some-string\".to_string()),\n sector: Some(\"some-string\".to_string()),\n state_of_incorporation: Some(\"some-string\".to_string()),\n sub_industry: Some(\"some-string\".to_string()),\n }),\n email: \"some-string\".to_string(),\n external_id: \"some-string\".to_string(),\n first_name: \"some-string\".to_string(),\n last_name: \"some-string\".to_string(),\n phone: Some(\"some-string\".to_string()),\n redirect_uri: \"some-string\".to_string(),\n source: ramp_api::types::Source::Quanta,\n state: \"some-string\".to_string(),\n })\n .await?;\n Ok(())\n}\n```"]
#[tracing::instrument]
pub async fn post_creation<'a>(
&'a self,
Expand Down
4 changes: 3 additions & 1 deletion remote/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ serde_json = "1"
serde_urlencoded = { version = "^0.7", optional = true }
tabled = { version = "0.15.0", features = ["ansi"], optional = true }
thiserror = "1"
tokio = { version = "1.38.0", features = ["rt", "macros"] }
tracing = { version = "^0.1", optional = true }
url = { version = "2", features = ["serde"] }
uuid = { version = "1", features = ["serde", "v4", "v7"] }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tokio = { version = "1.38.0", features = ["rt", "macros"] }

[dev-dependencies]
expectorate = "1"
futures-util = "^0.3.26"
Expand Down
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-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-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-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-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
Loading

0 comments on commit dc5c039

Please sign in to comment.