<commit_before>/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0.
 */

use aws_config::meta::region::RegionProviderChain;
use aws_sdk_snowball::model::Address;
use aws_sdk_snowball::{Client, Error, Region, PKG_VERSION};
use structopt::StructOpt;

#[derive(Debug, StructOpt)]
struct Opt {
    /// The AWS Region.
    #[structopt(short, long)]
    region: Option<String>,

    // Address information.
    #[structopt(long)]
    city: String,

    #[structopt(long)]
    company: Option<String>,

    #[structopt(long)]
    country: String,

    #[structopt(long)]
    landmark: Option<String>,

    #[structopt(long)]
    name: String,

    #[structopt(long)]
    phone_number: String,

    #[structopt(long)]
    postal_code: String,

    #[structopt(long)]
    prefecture_or_district: Option<String>,

    #[structopt(long)]
    state: String,

    #[structopt(long)]
    street1: String,

    #[structopt(long)]
    street2: Option<String>,

    #[structopt(long)]
    street3: Option<String>,

    /// Whether to display additional information.
    #[structopt(short, long)]
    verbose: bool,
}

// Create an address.
async fn add_address(client: &Client, address: Address) -> Result<(), Error> {
    let result = client.create_address().address(address).send().await?;

    println!();
    println!("Address: {:?}", result.address_id.unwrap());

    Ok(())
}
// snippet-end:[snowball.rust.create-address]

/// Creates an AWS Snowball address.<commit_msg>Fixed snippet tags in Snowball code examples in Rust<commit_after>/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0.
 */

use aws_config::meta::region::RegionProviderChain;
use aws_sdk_snowball::model::Address;
use aws_sdk_snowball::{Client, Error, Region, PKG_VERSION};
use structopt::StructOpt;

#[derive(Debug, StructOpt)]
struct Opt {
    /// The AWS Region.
    #[structopt(short, long)]
    region: Option<String>,

    // Address information.
    #[structopt(long)]
    city: String,

    #[structopt(long)]
    company: Option<String>,

    #[structopt(long)]
    country: String,

    #[structopt(long)]
    landmark: Option<String>,

    #[structopt(long)]
    name: String,

    #[structopt(long)]
    phone_number: String,

    #[structopt(long)]
    postal_code: String,

    #[structopt(long)]
    prefecture_or_district: Option<String>,

    #[structopt(long)]
    state: String,

    #[structopt(long)]
    street1: String,

    #[structopt(long)]
    street2: Option<String>,

    #[structopt(long)]
    street3: Option<String>,

    /// Whether to display additional information.
    #[structopt(short, long)]
    verbose: bool,
}

// Create an address.
// snippet-start:[snowball.rust.create-address]
async fn add_address(client: &Client, address: Address) -> Result<(), Error> {
    let result = client.create_address().address(address).send().await?;

    println!();
    println!("Address: {:?}", result.address_id.unwrap());

    Ok(())
}
// snippet-end:[snowball.rust.create-address]

/// Creates an AWS Snowball address.
{'fraction_non_alphanumeric': 0.1576590981771666, 'fraction_numerical': 0.0031979533098816758, 'mean_word_length': 3.7037593984962407, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4362144', 'n_tokens_mistral': 1013, 'n_tokens_neox': 1010, 'n_words': 218}