Skip to content

Commit 6f40950

Browse files
Merge branch 'master' into comp-analysis
2 parents cf617dc + 3806d2c commit 6f40950

34 files changed

+1241
-393
lines changed

.gitignore

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,19 @@
1313
*DS_Store*
1414
*.swp
1515
*.iml
16-
__MACOSX
16+
__MACOSX
17+
18+
# Devenv
19+
.devenv*
20+
devenv.local.nix
21+
22+
# direnv
23+
.direnv
24+
25+
# pre-commit
26+
.pre-commit-config.yaml
27+
28+
devenv.lock
29+
devenv.nix
30+
devenv.yaml
31+
.envrc

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ us_street_api:
4747
us_zipcode_api:
4848
RUST_LOG=trace cargo run --example us_zipcode_api
4949

50+
us_enrichment_api:
51+
RUST_LOG=trace cargo run --example us_enrichment_api
52+
5053
examples: international_autocomplete_api international_street_api logger us_autocomplete_pro_api us_extract_api us_reverse_geo_api us_street_api us_zipcode_api
5154

52-
.PHONY: clean test dependencies package examples clippy international_autocomplete_api international_street_api logger us_autocomplete_pro_api us_extract_api us_reverse_geo_api us_street_api us_zipcode_api
55+
.PHONY: clean test dependencies package examples clippy international_autocomplete_api international_street_api logger us_autocomplete_pro_api us_extract_api us_reverse_geo_api us_street_api us_zipcode_api us_enrichment_api

smarty-rust-sdk/examples/international_autocomplete_api.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
2323
);
2424

2525
let options = OptionsBuilder::new(Some(authentication))
26-
// The appropriate license values to be used for your subscriptions
27-
// can be found on the Subscriptions page of the account dashboard.
28-
// https://www.smartystreets.com/docs/cloud/licensing
29-
.with_license("international-autocomplete-v2-cloud")
26+
.with_logging()
3027
.build();
3128

3229
let client = InternationalAutocompleteClient::new(options)?;

smarty-rust-sdk/examples/international_street_api.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
2828
);
2929

3030
let options = OptionsBuilder::new(Some(authentication))
31-
// The appropriate license values to be used for your subscriptions
32-
// can be found on the Subscriptions page of the account dashboard.
33-
// https://www.smartystreets.com/docs/cloud/licensing
34-
.with_license("international-global-plus-cloud")
31+
.with_logging()
3532
.build();
3633

3734
let client = InternationalStreetClient::new(options)?;

smarty-rust-sdk/examples/logger.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ async fn main() -> Result<(), Box<dyn Error>> {
4242

4343
// Create the options from it's builder pattern
4444
let options = OptionsBuilder::new(Some(authentication))
45-
// The appropriate license values to be used for your subscriptions
46-
// can be found on the Subscriptions page the account dashboard.
47-
// https://www.smartystreets.com/docs/cloud/licensing
48-
.with_license("us-core-cloud")
4945
.with_logging()
5046
.with_retries(2)
5147
.build();

smarty-rust-sdk/examples/us_autocomplete_pro_api.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
2828
);
2929

3030
let options = OptionsBuilder::new(Some(authentication))
31-
// The appropriate license values to be used for your subscriptions
32-
// can be found on the Subscriptions page of the account dashboard.
33-
// https://www.smartystreets.com/docs/cloud/licensing
34-
.with_license("us-autocomplete-pro-cloud")
31+
.with_logging()
3532
.build();
3633

3734
let client = USAutocompleteProClient::new(options)?;

smarty-rust-sdk/examples/us_enrichment_api.rs

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
use smarty_rust_sdk::sdk::authentication::SecretKeyCredential;
22
use smarty_rust_sdk::sdk::options::OptionsBuilder;
3-
use smarty_rust_sdk::us_enrichment_api::client::USEnrichmentClient;
3+
4+
use smarty_rust_sdk::us_enrichment_api::client::*;
5+
use smarty_rust_sdk::us_enrichment_api::financial::*;
6+
use smarty_rust_sdk::us_enrichment_api::geo::*;
7+
use smarty_rust_sdk::us_enrichment_api::principal::*;
8+
49
use smarty_rust_sdk::us_enrichment_api::lookup::EnrichmentLookup;
5-
use smarty_rust_sdk::us_enrichment_api::results::{
6-
EnrichmentResponse, FinancialResponse, PrincipalResponse,
7-
};
10+
use smarty_rust_sdk::us_enrichment_api::response::EnrichmentResponse;
11+
use smarty_rust_sdk::us_enrichment_api::secondary::SecondaryCountResponse;
12+
use smarty_rust_sdk::us_enrichment_api::secondary::SecondaryResponse;
13+
use smarty_rust_sdk::us_enrichment_api::risk::RiskResponse;
14+
815
use std::error::Error;
916

1017
#[tokio::main]
@@ -13,23 +20,29 @@ async fn main() -> Result<(), Box<dyn Error>> {
1320

1421
lookup::<FinancialResponse>(key).await?;
1522
lookup::<PrincipalResponse>(key).await?;
23+
lookup::<GeoReferenceResponse>(key).await?;
24+
lookup::<GeoReference2010Response>(key).await?;
25+
lookup::<GeoReference2020Response>(key).await?;
26+
lookup::<SecondaryResponse>(key).await?;
27+
lookup::<SecondaryCountResponse>(key).await?;
28+
lookup::<RiskResponse>(key).await?;
1629

1730
Ok(())
1831
}
1932

2033
async fn lookup<R: EnrichmentResponse>(key: u32) -> Result<(), Box<dyn Error>> {
21-
let mut lookup = EnrichmentLookup::<R>::new(key);
34+
let mut lookup = EnrichmentLookup::<R> {
35+
smarty_key: key,
36+
etag: "".to_string(),
37+
..Default::default()
38+
};
2239

2340
let authentication = SecretKeyCredential::new(
2441
std::env::var("SMARTY_AUTH_ID").expect("Missing SMARTY_AUTH_ID env variable"),
2542
std::env::var("SMARTY_AUTH_TOKEN").expect("Missing SMARTY_AUTH_TOKEN env variable"),
2643
);
2744

2845
let options = OptionsBuilder::new(Some(authentication))
29-
// The appropriate license values to be used for your subscriptions
30-
// can be found on the Subscriptions page of the account dashboard.
31-
// https://www.smartystreets.com/docs/cloud/licensing
32-
.with_license(&format!("us-property-data-{}-cloud", R::lookup_type()))
3346
.with_logging()
3447
.build();
3548

smarty-rust-sdk/examples/us_extract_api.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ async fn main() -> Result<(), Box<dyn Error>> {
2828
);
2929

3030
let options = OptionsBuilder::new(Some(authentication))
31-
// The appropriate license values to be used for your subscriptions
32-
// can be found on the Subscriptions page of the account dashboard.
33-
// https://www.smartystreets.com/docs/cloud/licensing
34-
.with_license("us-core-cloud")
3531
.with_logging()
3632
.build();
3733

smarty-rust-sdk/examples/us_reverse_geo_api.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
2323
);
2424

2525
let options = OptionsBuilder::new(Some(authentication))
26-
// The appropriate license values to be used for your subscriptions
27-
// can be found on the Subscriptions page of the account dashboard.
28-
// https://www.smartystreets.com/docs/cloud/licensing
29-
.with_license("us-reverse-geocoding-cloud")
26+
.with_logging()
3027
.build();
3128

3229
let client = USReverseGeoClient::new(options)?;

smarty-rust-sdk/examples/us_street_api.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
3737
);
3838

3939
let options = OptionsBuilder::new(Some(authentication))
40-
// The appropriate license values to be used for your subscriptions
41-
// can be found on the Subscriptions page of the account dashboard.
42-
// https://www.smartystreets.com/docs/cloud/licensing
43-
.with_license("us-core-cloud")
40+
.with_logging()
4441
.build();
4542

4643
let client = USStreetAddressClient::new(options)?;

0 commit comments

Comments
 (0)