google-manufacturers1 5.0.3+20230123

A complete library to interact with Manufacturer Center (protocol v1)
Documentation
use std::collections::HashMap;
use std::cell::RefCell;
use std::default::Default;
use std::collections::BTreeSet;
use std::error::Error as StdError;
use serde_json as json;
use std::io;
use std::fs;
use std::mem;

use hyper::client::connect;
use tokio::io::{AsyncRead, AsyncWrite};
use tokio::time::sleep;
use tower_service;
use serde::{Serialize, Deserialize};

use crate::{client, client::GetToken, client::serde_with};

// ##############
// UTILITIES ###
// ############

/// Identifies the an OAuth2 authorization scope.
/// A scope is needed when requesting an
/// [authorization token](https://developers.google.com/youtube/v3/guides/authentication).
#[derive(PartialEq, Eq, Hash)]
pub enum Scope {
    /// Manage your product listings for Google Manufacturer Center
    Manufacturercenter,
}

impl AsRef<str> for Scope {
    fn as_ref(&self) -> &str {
        match *self {
            Scope::Manufacturercenter => "https://www.googleapis.com/auth/manufacturercenter",
        }
    }
}

impl Default for Scope {
    fn default() -> Scope {
        Scope::Manufacturercenter
    }
}



// ########
// HUB ###
// ######

/// Central instance to access all ManufacturerCenter related resource activities
///
/// # Examples
///
/// Instantiate a new hub
///
/// ```test_harness,no_run
/// extern crate hyper;
/// extern crate hyper_rustls;
/// extern crate google_manufacturers1 as manufacturers1;
/// use manufacturers1::api::Attributes;
/// use manufacturers1::{Result, Error};
/// # async fn dox() {
/// use std::default::Default;
/// use manufacturers1::{ManufacturerCenter, oauth2, hyper, hyper_rustls, chrono, FieldMask};
/// 
/// // Get an ApplicationSecret instance by some means. It contains the `client_id` and 
/// // `client_secret`, among other things.
/// let secret: oauth2::ApplicationSecret = Default::default();
/// // Instantiate the authenticator. It will choose a suitable authentication flow for you, 
/// // unless you replace  `None` with the desired Flow.
/// // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about 
/// // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
/// // retrieve them from storage.
/// let auth = oauth2::InstalledFlowAuthenticator::builder(
///         secret,
///         oauth2::InstalledFlowReturnMethod::HTTPRedirect,
///     ).build().await.unwrap();
/// let mut hub = ManufacturerCenter::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
/// // As the method needs a request, you would usually fill it with the desired information
/// // into the respective structure. Some of the parts shown here might not be applicable !
/// // Values shown here are possibly random and not representative !
/// let mut req = Attributes::default();
/// 
/// // You can configure optional parameters by calling the respective setters at will, and
/// // execute the final call using `doit()`.
/// // Values shown here are possibly random and not representative !
/// let result = hub.accounts().products_update(req, "parent", "name")
///              .doit().await;
/// 
/// match result {
///     Err(e) => match e {
///         // The Error enum provides details about what exactly happened.
///         // You can also just use its `Debug`, `Display` or `Error` traits
///          Error::HttpError(_)
///         |Error::Io(_)
///         |Error::MissingAPIKey
///         |Error::MissingToken(_)
///         |Error::Cancelled
///         |Error::UploadSizeLimitExceeded(_, _)
///         |Error::Failure(_)
///         |Error::BadRequest(_)
///         |Error::FieldClash(_)
///         |Error::JsonDecodeError(_, _) => println!("{}", e),
///     },
///     Ok(res) => println!("Success: {:?}", res),
/// }
/// # }
/// ```
#[derive(Clone)]
pub struct ManufacturerCenter<S> {
    pub client: hyper::Client<S, hyper::body::Body>,
    pub auth: Box<dyn client::GetToken>,
    _user_agent: String,
    _base_url: String,
    _root_url: String,
}

impl<'a, S> client::Hub for ManufacturerCenter<S> {}

impl<'a, S> ManufacturerCenter<S> {

    pub fn new<A: 'static + client::GetToken>(client: hyper::Client<S, hyper::body::Body>, auth: A) -> ManufacturerCenter<S> {
        ManufacturerCenter {
            client,
            auth: Box::new(auth),
            _user_agent: "google-api-rust-client/5.0.3".to_string(),
            _base_url: "https://manufacturers.googleapis.com/".to_string(),
            _root_url: "https://manufacturers.googleapis.com/".to_string(),
        }
    }

    pub fn accounts(&'a self) -> AccountMethods<'a, S> {
        AccountMethods { hub: &self }
    }

    /// Set the user-agent header field to use in all requests to the server.
    /// It defaults to `google-api-rust-client/5.0.3`.
    ///
    /// Returns the previously set user-agent.
    pub fn user_agent(&mut self, agent_name: String) -> String {
        mem::replace(&mut self._user_agent, agent_name)
    }

    /// Set the base url to use in all requests to the server.
    /// It defaults to `https://manufacturers.googleapis.com/`.
    ///
    /// Returns the previously set base url.
    pub fn base_url(&mut self, new_base_url: String) -> String {
        mem::replace(&mut self._base_url, new_base_url)
    }

    /// Set the root url to use in all requests to the server.
    /// It defaults to `https://manufacturers.googleapis.com/`.
    ///
    /// Returns the previously set root url.
    pub fn root_url(&mut self, new_root_url: String) -> String {
        mem::replace(&mut self._root_url, new_root_url)
    }
}


// ############
// SCHEMAS ###
// ##########
/// Attributes of the product. For more information, see https://support.google.com/manufacturers/answer/6124116.
/// 
/// # Activities
/// 
/// This type is used in activities, which are methods you may call on this type or where this type is involved in. 
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
/// 
/// * [products update accounts](AccountProductUpdateCall) (request)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct Attributes {
    /// The additional images of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#addlimage.
    #[serde(rename="additionalImageLink")]
    
    pub additional_image_link: Option<Vec<Image>>,
    /// The target age group of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#agegroup.
    #[serde(rename="ageGroup")]
    
    pub age_group: Option<String>,
    /// The brand name of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#brand.
    
    pub brand: Option<String>,
    /// The capacity of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#capacity.
    
    pub capacity: Option<Capacity>,
    /// The color of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#color.
    
    pub color: Option<String>,
    /// The count of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#count.
    
    pub count: Option<Count>,
    /// The description of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#description.
    
    pub description: Option<String>,
    /// The disclosure date of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#disclosure.
    #[serde(rename="disclosureDate")]
    
    pub disclosure_date: Option<String>,
    /// A list of excluded destinations such as "ClientExport", "ClientShoppingCatalog" or "PartnerShoppingCatalog". For more information, see https://support.google.com/manufacturers/answer/7443550
    #[serde(rename="excludedDestination")]
    
    pub excluded_destination: Option<Vec<String>>,
    /// The rich format description of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#featuredesc.
    #[serde(rename="featureDescription")]
    
    pub feature_description: Option<Vec<FeatureDescription>>,
    /// The flavor of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#flavor.
    
    pub flavor: Option<String>,
    /// The format of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#format.
    
    pub format: Option<String>,
    /// The target gender of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#gender.
    
    pub gender: Option<String>,
    /// Grocery Attributes. See more at https://support.google.com/manufacturers/answer/12098458#grocery.
    
    pub grocery: Option<Grocery>,
    /// The Global Trade Item Number (GTIN) of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#gtin.
    
    pub gtin: Option<Vec<String>>,
    /// The image of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#image.
    #[serde(rename="imageLink")]
    
    pub image_link: Option<Image>,
    /// A list of included destinations such as "ClientExport", "ClientShoppingCatalog" or "PartnerShoppingCatalog". For more information, see https://support.google.com/manufacturers/answer/7443550
    #[serde(rename="includedDestination")]
    
    pub included_destination: Option<Vec<String>>,
    /// The item group id of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#itemgroupid.
    #[serde(rename="itemGroupId")]
    
    pub item_group_id: Option<String>,
    /// The material of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#material.
    
    pub material: Option<String>,
    /// The Manufacturer Part Number (MPN) of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#mpn.
    
    pub mpn: Option<String>,
    /// Nutrition Attributes. See more at https://support.google.com/manufacturers/answer/12098458#food-servings.
    
    pub nutrition: Option<Nutrition>,
    /// The pattern of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#pattern.
    
    pub pattern: Option<String>,
    /// The details of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#productdetail.
    #[serde(rename="productDetail")]
    
    pub product_detail: Option<Vec<ProductDetail>>,
    /// The product highlights. For more information, see https://support.google.com/manufacturers/answer/10066942
    #[serde(rename="productHighlight")]
    
    pub product_highlight: Option<Vec<String>>,
    /// The name of the group of products related to the product. For more information, see https://support.google.com/manufacturers/answer/6124116#productline.
    #[serde(rename="productLine")]
    
    pub product_line: Option<String>,
    /// The canonical name of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#productname.
    #[serde(rename="productName")]
    
    pub product_name: Option<String>,
    /// The URL of the detail page of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#productpage.
    #[serde(rename="productPageUrl")]
    
    pub product_page_url: Option<String>,
    /// The type or category of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#producttype.
    #[serde(rename="productType")]
    
    pub product_type: Option<Vec<String>>,
    /// The release date of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#release.
    #[serde(rename="releaseDate")]
    
    pub release_date: Option<String>,
    /// Rich product content. For more information, see https://support.google.com/manufacturers/answer/9389865
    #[serde(rename="richProductContent")]
    
    pub rich_product_content: Option<Vec<String>>,
    /// The scent of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#scent.
    
    pub scent: Option<String>,
    /// The size of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#size.
    
    pub size: Option<String>,
    /// The size system of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#sizesystem.
    #[serde(rename="sizeSystem")]
    
    pub size_system: Option<String>,
    /// The size type of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#sizetype.
    #[serde(rename="sizeType")]
    
    pub size_type: Option<Vec<String>>,
    /// The suggested retail price (MSRP) of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#price.
    #[serde(rename="suggestedRetailPrice")]
    
    pub suggested_retail_price: Option<Price>,
    /// The target client id. Should only be used in the accounts of the data partners. For more information, see https://support.google.com/manufacturers/answer/10857344
    #[serde(rename="targetClientId")]
    
    pub target_client_id: Option<String>,
    /// The theme of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#theme.
    
    pub theme: Option<String>,
    /// The title of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#title.
    
    pub title: Option<String>,
    /// The videos of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#video.
    #[serde(rename="videoLink")]
    
    pub video_link: Option<Vec<String>>,
}

impl client::RequestValue for Attributes {}


/// The capacity of a product. For more information, see https://support.google.com/manufacturers/answer/6124116#capacity.
/// 
/// This type is not used in any activity, and only used as *part* of another schema.
/// 
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct Capacity {
    /// The unit of the capacity, i.e., MB, GB, or TB.
    
    pub unit: Option<String>,
    /// The numeric value of the capacity.
    
    #[serde_as(as = "Option<::client::serde_with::DisplayFromStr>")]
    pub value: Option<i64>,
}

impl client::Part for Capacity {}


/// The number of products in a single package. For more information, see https://support.google.com/manufacturers/answer/6124116#count.
/// 
/// This type is not used in any activity, and only used as *part* of another schema.
/// 
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct Count {
    /// The unit in which these products are counted.
    
    pub unit: Option<String>,
    /// The numeric value of the number of products in a package.
    
    #[serde_as(as = "Option<::client::serde_with::DisplayFromStr>")]
    pub value: Option<i64>,
}

impl client::Part for Count {}


/// The destination status.
/// 
/// This type is not used in any activity, and only used as *part* of another schema.
/// 
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct DestinationStatus {
    /// The name of the destination.
    
    pub destination: Option<String>,
    /// The status of the destination.
    
    pub status: Option<String>,
}

impl client::Part for DestinationStatus {}


/// A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
/// 
/// # Activities
/// 
/// This type is used in activities, which are methods you may call on this type or where this type is involved in. 
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
/// 
/// * [products delete accounts](AccountProductDeleteCall) (response)
/// * [products update accounts](AccountProductUpdateCall) (response)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct Empty { _never_set: Option<bool> }

impl client::ResponseResult for Empty {}


/// A feature description of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#featuredesc.
/// 
/// This type is not used in any activity, and only used as *part* of another schema.
/// 
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct FeatureDescription {
    /// A short description of the feature.
    
    pub headline: Option<String>,
    /// An optional image describing the feature.
    
    pub image: Option<Image>,
    /// A detailed description of the feature.
    
    pub text: Option<String>,
}

impl client::Part for FeatureDescription {}


/// Combination of float amount and unit.
/// 
/// This type is not used in any activity, and only used as *part* of another schema.
/// 
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct FloatUnit {
    /// amount.
    
    pub amount: Option<f64>,
    /// unit.
    
    pub unit: Option<String>,
}

impl client::Part for FloatUnit {}


/// There is no detailed description.
/// 
/// This type is not used in any activity, and only used as *part* of another schema.
/// 
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct Grocery {
    /// Active ingredients.
    #[serde(rename="activeIngredients")]
    
    pub active_ingredients: Option<String>,
    /// Alcohol by volume.
    #[serde(rename="alcoholByVolume")]
    
    pub alcohol_by_volume: Option<f64>,
    /// Allergens.
    
    pub allergens: Option<String>,
    /// Derived nutrition claim.
    #[serde(rename="derivedNutritionClaim")]
    
    pub derived_nutrition_claim: Option<Vec<String>>,
    /// Directions.
    
    pub directions: Option<String>,
    /// Indications.
    
    pub indications: Option<String>,
    /// Ingredients.
    
    pub ingredients: Option<String>,
    /// Nutrition claim.
    #[serde(rename="nutritionClaim")]
    
    pub nutrition_claim: Option<Vec<String>>,
    /// Storage instructions.
    #[serde(rename="storageInstructions")]
    
    pub storage_instructions: Option<String>,
}

impl client::Part for Grocery {}


/// An image.
/// 
/// This type is not used in any activity, and only used as *part* of another schema.
/// 
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct Image {
    /// The URL of the image. For crawled images, this is the provided URL. For uploaded images, this is a serving URL from Google if the image has been processed successfully.
    #[serde(rename="imageUrl")]
    
    pub image_url: Option<String>,
    /// The status of the image. @OutputOnly
    
    pub status: Option<String>,
    /// The type of the image, i.e., crawled or uploaded. @OutputOnly
    #[serde(rename="type")]
    
    pub type_: Option<String>,
}

impl client::Part for Image {}


/// Product issue.
/// 
/// This type is not used in any activity, and only used as *part* of another schema.
/// 
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct Issue {
    /// If present, the attribute that triggered the issue. For more information about attributes, see https://support.google.com/manufacturers/answer/6124116.
    
    pub attribute: Option<String>,
    /// Longer description of the issue focused on how to resolve it.
    
    pub description: Option<String>,
    /// The destination this issue applies to.
    
    pub destination: Option<String>,
    /// What needs to happen to resolve the issue.
    
    pub resolution: Option<String>,
    /// The severity of the issue.
    
    pub severity: Option<String>,
    /// The timestamp when this issue appeared.
    
    pub timestamp: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
    /// Short title describing the nature of the issue.
    
    pub title: Option<String>,
    /// The server-generated type of the issue, for example, “INCORRECT_TEXT_FORMATTING”, “IMAGE_NOT_SERVEABLE”, etc.
    #[serde(rename="type")]
    
    pub type_: Option<String>,
}

impl client::Part for Issue {}


/// There is no detailed description.
/// 
/// # Activities
/// 
/// This type is used in activities, which are methods you may call on this type or where this type is involved in. 
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
/// 
/// * [products list accounts](AccountProductListCall) (response)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct ListProductsResponse {
    /// The token for the retrieval of the next page of product statuses.
    #[serde(rename="nextPageToken")]
    
    pub next_page_token: Option<String>,
    /// List of the products.
    
    pub products: Option<Vec<Product>>,
}

impl client::ResponseResult for ListProductsResponse {}


/// There is no detailed description.
/// 
/// This type is not used in any activity, and only used as *part* of another schema.
/// 
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct Nutrition {
    /// Added sugars.
    #[serde(rename="addedSugars")]
    
    pub added_sugars: Option<FloatUnit>,
    /// Added sugars daily percentage.
    #[serde(rename="addedSugarsDailyPercentage")]
    
    pub added_sugars_daily_percentage: Option<f64>,
    /// Calcium.
    
    pub calcium: Option<FloatUnit>,
    /// Calcium daily percentage.
    #[serde(rename="calciumDailyPercentage")]
    
    pub calcium_daily_percentage: Option<f64>,
    /// Cholesterol.
    
    pub cholesterol: Option<FloatUnit>,
    /// Cholesterol daily percentage.
    #[serde(rename="cholesterolDailyPercentage")]
    
    pub cholesterol_daily_percentage: Option<f64>,
    /// Dietary fiber.
    #[serde(rename="dietaryFiber")]
    
    pub dietary_fiber: Option<FloatUnit>,
    /// Dietary fiber daily percentage.
    #[serde(rename="dietaryFiberDailyPercentage")]
    
    pub dietary_fiber_daily_percentage: Option<f64>,
    /// Mandatory Nutrition Facts. Energy.
    
    pub energy: Option<FloatUnit>,
    /// Energy from fat.
    #[serde(rename="energyFromFat")]
    
    pub energy_from_fat: Option<FloatUnit>,
    /// Folate daily percentage.
    #[serde(rename="folateDailyPercentage")]
    
    pub folate_daily_percentage: Option<f64>,
    /// Folate folic acid.
    #[serde(rename="folateFolicAcid")]
    
    pub folate_folic_acid: Option<FloatUnit>,
    /// Folate mcg DFE.
    #[serde(rename="folateMcgDfe")]
    
    pub folate_mcg_dfe: Option<f64>,
    /// Iron.
    
    pub iron: Option<FloatUnit>,
    /// Iron daily percentage.
    #[serde(rename="ironDailyPercentage")]
    
    pub iron_daily_percentage: Option<f64>,
    /// Monounsaturated fat.
    #[serde(rename="monounsaturatedFat")]
    
    pub monounsaturated_fat: Option<FloatUnit>,
    /// Nutrition fact measure.
    #[serde(rename="nutritionFactMeasure")]
    
    pub nutrition_fact_measure: Option<String>,
    /// Polyols.
    
    pub polyols: Option<FloatUnit>,
    /// Polyunsaturated fat.
    #[serde(rename="polyunsaturatedFat")]
    
    pub polyunsaturated_fat: Option<FloatUnit>,
    /// Potassium.
    
    pub potassium: Option<FloatUnit>,
    /// Potassium daily percentage.
    #[serde(rename="potassiumDailyPercentage")]
    
    pub potassium_daily_percentage: Option<f64>,
    /// Prepared size description.
    #[serde(rename="preparedSizeDescription")]
    
    pub prepared_size_description: Option<String>,
    /// Protein.
    
    pub protein: Option<FloatUnit>,
    /// Protein daily percentage.
    #[serde(rename="proteinDailyPercentage")]
    
    pub protein_daily_percentage: Option<f64>,
    /// Saturated fat.
    #[serde(rename="saturatedFat")]
    
    pub saturated_fat: Option<FloatUnit>,
    /// Saturated fat daily percentage.
    #[serde(rename="saturatedFatDailyPercentage")]
    
    pub saturated_fat_daily_percentage: Option<f64>,
    /// Food Serving Size. Serving size description.
    #[serde(rename="servingSizeDescription")]
    
    pub serving_size_description: Option<String>,
    /// Serving size measure.
    #[serde(rename="servingSizeMeasure")]
    
    pub serving_size_measure: Option<FloatUnit>,
    /// Servings per container.
    #[serde(rename="servingsPerContainer")]
    
    pub servings_per_container: Option<String>,
    /// Sodium.
    
    pub sodium: Option<FloatUnit>,
    /// Sodium daily percentage.
    #[serde(rename="sodiumDailyPercentage")]
    
    pub sodium_daily_percentage: Option<f64>,
    /// Starch.
    
    pub starch: Option<FloatUnit>,
    /// Total carbohydrate.
    #[serde(rename="totalCarbohydrate")]
    
    pub total_carbohydrate: Option<FloatUnit>,
    /// Total carbohydrate daily percentage.
    #[serde(rename="totalCarbohydrateDailyPercentage")]
    
    pub total_carbohydrate_daily_percentage: Option<f64>,
    /// Total fat.
    #[serde(rename="totalFat")]
    
    pub total_fat: Option<FloatUnit>,
    /// Total fat daily percentage.
    #[serde(rename="totalFatDailyPercentage")]
    
    pub total_fat_daily_percentage: Option<f64>,
    /// Total sugars.
    #[serde(rename="totalSugars")]
    
    pub total_sugars: Option<FloatUnit>,
    /// Total sugars daily percentage.
    #[serde(rename="totalSugarsDailyPercentage")]
    
    pub total_sugars_daily_percentage: Option<f64>,
    /// Trans fat.
    #[serde(rename="transFat")]
    
    pub trans_fat: Option<FloatUnit>,
    /// Trans fat daily percentage.
    #[serde(rename="transFatDailyPercentage")]
    
    pub trans_fat_daily_percentage: Option<f64>,
    /// Vitamin D.
    #[serde(rename="vitaminD")]
    
    pub vitamin_d: Option<FloatUnit>,
    /// Vitamin D daily percentage.
    #[serde(rename="vitaminDDailyPercentage")]
    
    pub vitamin_d_daily_percentage: Option<f64>,
    /// Voluntary nutrition fact.
    #[serde(rename="voluntaryNutritionFact")]
    
    pub voluntary_nutrition_fact: Option<Vec<VoluntaryNutritionFact>>,
}

impl client::Part for Nutrition {}


/// A price.
/// 
/// This type is not used in any activity, and only used as *part* of another schema.
/// 
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct Price {
    /// The numeric value of the price.
    
    pub amount: Option<String>,
    /// The currency in which the price is denoted.
    
    pub currency: Option<String>,
}

impl client::Part for Price {}


/// Product data.
/// 
/// # Activities
/// 
/// This type is used in activities, which are methods you may call on this type or where this type is involved in. 
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
/// 
/// * [products get accounts](AccountProductGetCall) (response)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct Product {
    /// Attributes of the product uploaded to the Manufacturer Center. Manually edited attributes are taken into account.
    
    pub attributes: Option<Attributes>,
    /// The content language of the product as a two-letter ISO 639-1 language code (for example, en).
    #[serde(rename="contentLanguage")]
    
    pub content_language: Option<String>,
    /// The status of the destinations.
    #[serde(rename="destinationStatuses")]
    
    pub destination_statuses: Option<Vec<DestinationStatus>>,
    /// A server-generated list of issues associated with the product.
    
    pub issues: Option<Vec<Issue>>,
    /// Name in the format `{target_country}:{content_language}:{product_id}`. `target_country` - The target country of the product as a CLDR territory code (for example, US). `content_language` - The content language of the product as a two-letter ISO 639-1 language code (for example, en). `product_id` - The ID of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#id.
    
    pub name: Option<String>,
    /// Parent ID in the format `accounts/{account_id}`. `account_id` - The ID of the Manufacturer Center account.
    
    pub parent: Option<String>,
    /// The ID of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#id.
    #[serde(rename="productId")]
    
    pub product_id: Option<String>,
    /// The target country of the product as a CLDR territory code (for example, US).
    #[serde(rename="targetCountry")]
    
    pub target_country: Option<String>,
}

impl client::ResponseResult for Product {}


/// A product detail of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#productdetail.
/// 
/// This type is not used in any activity, and only used as *part* of another schema.
/// 
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct ProductDetail {
    /// The name of the attribute.
    #[serde(rename="attributeName")]
    
    pub attribute_name: Option<String>,
    /// The value of the attribute.
    #[serde(rename="attributeValue")]
    
    pub attribute_value: Option<String>,
    /// A short section name that can be reused between multiple product details.
    #[serde(rename="sectionName")]
    
    pub section_name: Option<String>,
}

impl client::Part for ProductDetail {}


/// Voluntary Nutrition Facts.
/// 
/// This type is not used in any activity, and only used as *part* of another schema.
/// 
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct VoluntaryNutritionFact {
    /// Daily percentage.
    #[serde(rename="dailyPercentage")]
    
    pub daily_percentage: Option<f64>,
    /// Name.
    
    pub name: Option<String>,
    /// Value.
    
    pub value: Option<FloatUnit>,
}

impl client::Part for VoluntaryNutritionFact {}



// ###################
// MethodBuilders ###
// #################

/// A builder providing access to all methods supported on *account* resources.
/// It is not used directly, but through the [`ManufacturerCenter`] hub.
///
/// # Example
///
/// Instantiate a resource builder
///
/// ```test_harness,no_run
/// extern crate hyper;
/// extern crate hyper_rustls;
/// extern crate google_manufacturers1 as manufacturers1;
/// 
/// # async fn dox() {
/// use std::default::Default;
/// use manufacturers1::{ManufacturerCenter, oauth2, hyper, hyper_rustls, chrono, FieldMask};
/// 
/// let secret: oauth2::ApplicationSecret = Default::default();
/// let auth = oauth2::InstalledFlowAuthenticator::builder(
///         secret,
///         oauth2::InstalledFlowReturnMethod::HTTPRedirect,
///     ).build().await.unwrap();
/// let mut hub = ManufacturerCenter::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
/// // like `products_delete(...)`, `products_get(...)`, `products_list(...)` and `products_update(...)`
/// // to build up your call.
/// let rb = hub.accounts();
/// # }
/// ```
pub struct AccountMethods<'a, S>
    where S: 'a {

    hub: &'a ManufacturerCenter<S>,
}

impl<'a, S> client::MethodsBuilder for AccountMethods<'a, S> {}

impl<'a, S> AccountMethods<'a, S> {
    
    /// Create a builder to help you perform the following task:
    ///
    /// Deletes the product from a Manufacturer Center account.
    /// 
    /// # Arguments
    ///
    /// * `parent` - Parent ID in the format `accounts/{account_id}`. `account_id` - The ID of the Manufacturer Center account.
    /// * `name` - Name in the format `{target_country}:{content_language}:{product_id}`. `target_country` - The target country of the product as a CLDR territory code (for example, US). `content_language` - The content language of the product as a two-letter ISO 639-1 language code (for example, en). `product_id` - The ID of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#id.
    pub fn products_delete(&self, parent: &str, name: &str) -> AccountProductDeleteCall<'a, S> {
        AccountProductDeleteCall {
            hub: self.hub,
            _parent: parent.to_string(),
            _name: name.to_string(),
            _delegate: Default::default(),
            _additional_params: Default::default(),
            _scopes: Default::default(),
        }
    }
    
    /// Create a builder to help you perform the following task:
    ///
    /// Gets the product from a Manufacturer Center account, including product issues. A recently updated product takes around 15 minutes to process. Changes are only visible after it has been processed. While some issues may be available once the product has been processed, other issues may take days to appear.
    /// 
    /// # Arguments
    ///
    /// * `parent` - Parent ID in the format `accounts/{account_id}`. `account_id` - The ID of the Manufacturer Center account.
    /// * `name` - Name in the format `{target_country}:{content_language}:{product_id}`. `target_country` - The target country of the product as a CLDR territory code (for example, US). `content_language` - The content language of the product as a two-letter ISO 639-1 language code (for example, en). `product_id` - The ID of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#id.
    pub fn products_get(&self, parent: &str, name: &str) -> AccountProductGetCall<'a, S> {
        AccountProductGetCall {
            hub: self.hub,
            _parent: parent.to_string(),
            _name: name.to_string(),
            _include: Default::default(),
            _delegate: Default::default(),
            _additional_params: Default::default(),
            _scopes: Default::default(),
        }
    }
    
    /// Create a builder to help you perform the following task:
    ///
    /// Lists all the products in a Manufacturer Center account.
    /// 
    /// # Arguments
    ///
    /// * `parent` - Parent ID in the format `accounts/{account_id}`. `account_id` - The ID of the Manufacturer Center account.
    pub fn products_list(&self, parent: &str) -> AccountProductListCall<'a, S> {
        AccountProductListCall {
            hub: self.hub,
            _parent: parent.to_string(),
            _page_token: Default::default(),
            _page_size: Default::default(),
            _include: Default::default(),
            _delegate: Default::default(),
            _additional_params: Default::default(),
            _scopes: Default::default(),
        }
    }
    
    /// Create a builder to help you perform the following task:
    ///
    /// Inserts or updates the attributes of the product in a Manufacturer Center account. Creates a product with the provided attributes. If the product already exists, then all attributes are replaced with the new ones. The checks at upload time are minimal. All required attributes need to be present for a product to be valid. Issues may show up later after the API has accepted a new upload for a product and it is possible to overwrite an existing valid product with an invalid product. To detect this, you should retrieve the product and check it for issues once the new version is available. Uploaded attributes first need to be processed before they can be retrieved. Until then, new products will be unavailable, and retrieval of previously uploaded products will return the original state of the product.
    /// 
    /// # Arguments
    ///
    /// * `request` - No description provided.
    /// * `parent` - Parent ID in the format `accounts/{account_id}`. `account_id` - The ID of the Manufacturer Center account.
    /// * `name` - Name in the format `{target_country}:{content_language}:{product_id}`. `target_country` - The target country of the product as a CLDR territory code (for example, US). `content_language` - The content language of the product as a two-letter ISO 639-1 language code (for example, en). `product_id` - The ID of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#id.
    pub fn products_update(&self, request: Attributes, parent: &str, name: &str) -> AccountProductUpdateCall<'a, S> {
        AccountProductUpdateCall {
            hub: self.hub,
            _request: request,
            _parent: parent.to_string(),
            _name: name.to_string(),
            _delegate: Default::default(),
            _additional_params: Default::default(),
            _scopes: Default::default(),
        }
    }
}





// ###################
// CallBuilders   ###
// #################

/// Deletes the product from a Manufacturer Center account.
///
/// A builder for the *products.delete* method supported by a *account* resource.
/// It is not used directly, but through a [`AccountMethods`] instance.
///
/// # Example
///
/// Instantiate a resource method builder
///
/// ```test_harness,no_run
/// # extern crate hyper;
/// # extern crate hyper_rustls;
/// # extern crate google_manufacturers1 as manufacturers1;
/// # async fn dox() {
/// # use std::default::Default;
/// # use manufacturers1::{ManufacturerCenter, oauth2, hyper, hyper_rustls, chrono, FieldMask};
/// 
/// # let secret: oauth2::ApplicationSecret = Default::default();
/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
/// #         secret,
/// #         oauth2::InstalledFlowReturnMethod::HTTPRedirect,
/// #     ).build().await.unwrap();
/// # let mut hub = ManufacturerCenter::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
/// // You can configure optional parameters by calling the respective setters at will, and
/// // execute the final call using `doit()`.
/// // Values shown here are possibly random and not representative !
/// let result = hub.accounts().products_delete("parent", "name")
///              .doit().await;
/// # }
/// ```
pub struct AccountProductDeleteCall<'a, S>
    where S: 'a {

    hub: &'a ManufacturerCenter<S>,
    _parent: String,
    _name: String,
    _delegate: Option<&'a mut dyn client::Delegate>,
    _additional_params: HashMap<String, String>,
    _scopes: BTreeSet<String>
}

impl<'a, S> client::CallBuilder for AccountProductDeleteCall<'a, S> {}

impl<'a, S> AccountProductDeleteCall<'a, S>
where
    S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
    S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
    S::Future: Send + Unpin + 'static,
    S::Error: Into<Box<dyn StdError + Send + Sync>>,
{


    /// Perform the operation you have build so far.
    pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Empty)> {
        use std::io::{Read, Seek};
        use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
        use client::{ToParts, url::Params};
        use std::borrow::Cow;

        let mut dd = client::DefaultDelegate;
        let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
        dlg.begin(client::MethodInfo { id: "manufacturers.accounts.products.delete",
                               http_method: hyper::Method::DELETE });

        for &field in ["alt", "parent", "name"].iter() {
            if self._additional_params.contains_key(field) {
                dlg.finished(false);
                return Err(client::Error::FieldClash(field));
            }
        }

        let mut params = Params::with_capacity(4 + self._additional_params.len());
        params.push("parent", self._parent);
        params.push("name", self._name);

        params.extend(self._additional_params.iter());

        params.push("alt", "json");
        let mut url = self.hub._base_url.clone() + "v1/{+parent}/products/{+name}";
        if self._scopes.is_empty() {
            self._scopes.insert(Scope::Manufacturercenter.as_ref().to_string());
        }

        for &(find_this, param_name) in [("{+parent}", "parent"), ("{+name}", "name")].iter() {
            url = params.uri_replacement(url, param_name, find_this, true);
        }
        {
            let to_remove = ["name", "parent"];
            params.remove_params(&to_remove);
        }

        let url = params.parse_with_url(&url);



        loop {
            let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
                Ok(token) => token,
                Err(e) => {
                    match dlg.token(e) {
                        Ok(token) => token,
                        Err(e) => {
                            dlg.finished(false);
                            return Err(client::Error::MissingToken(e));
                        }
                    }
                }
            };
            let mut req_result = {
                let client = &self.hub.client;
                dlg.pre_request();
                let mut req_builder = hyper::Request::builder()
                    .method(hyper::Method::DELETE)
                    .uri(url.as_str())
                    .header(USER_AGENT, self.hub._user_agent.clone());

                if let Some(token) = token.as_ref() {
                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
                }


                        let request = req_builder
                        .body(hyper::body::Body::empty());

                client.request(request.unwrap()).await

            };

            match req_result {
                Err(err) => {
                    if let client::Retry::After(d) = dlg.http_error(&err) {
                        sleep(d).await;
                        continue;
                    }
                    dlg.finished(false);
                    return Err(client::Error::HttpError(err))
                }
                Ok(mut res) => {
                    if !res.status().is_success() {
                        let res_body_string = client::get_body_as_string(res.body_mut()).await;
                        let (parts, _) = res.into_parts();
                        let body = hyper::Body::from(res_body_string.clone());
                        let restored_response = hyper::Response::from_parts(parts, body);

                        let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();

                        if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
                            sleep(d).await;
                            continue;
                        }

                        dlg.finished(false);

                        return match server_response {
                            Some(error_value) => Err(client::Error::BadRequest(error_value)),
                            None => Err(client::Error::Failure(restored_response)),
                        }
                    }
                    let result_value = {
                        let res_body_string = client::get_body_as_string(res.body_mut()).await;

                        match json::from_str(&res_body_string) {
                            Ok(decoded) => (res, decoded),
                            Err(err) => {
                                dlg.response_json_decode_error(&res_body_string, &err);
                                return Err(client::Error::JsonDecodeError(res_body_string, err));
                            }
                        }
                    };

                    dlg.finished(true);
                    return Ok(result_value)
                }
            }
        }
    }


    /// Parent ID in the format `accounts/{account_id}`. `account_id` - The ID of the Manufacturer Center account.
    ///
    /// Sets the *parent* path property to the given value.
    ///
    /// Even though the property as already been set when instantiating this call,
    /// we provide this method for API completeness.
    pub fn parent(mut self, new_value: &str) -> AccountProductDeleteCall<'a, S> {
        self._parent = new_value.to_string();
        self
    }
    /// Name in the format `{target_country}:{content_language}:{product_id}`. `target_country` - The target country of the product as a CLDR territory code (for example, US). `content_language` - The content language of the product as a two-letter ISO 639-1 language code (for example, en). `product_id` - The ID of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#id.
    ///
    /// Sets the *name* path property to the given value.
    ///
    /// Even though the property as already been set when instantiating this call,
    /// we provide this method for API completeness.
    pub fn name(mut self, new_value: &str) -> AccountProductDeleteCall<'a, S> {
        self._name = new_value.to_string();
        self
    }
    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
    /// while executing the actual API request.
    /// 
    /// ````text
    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
    /// ````
    ///
    /// Sets the *delegate* property to the given value.
    pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> AccountProductDeleteCall<'a, S> {
        self._delegate = Some(new_value);
        self
    }

    /// Set any additional parameter of the query string used in the request.
    /// It should be used to set parameters which are not yet available through their own
    /// setters.
    ///
    /// Please note that this method must not be used to set any of the known parameters
    /// which have their own setter method. If done anyway, the request will fail.
    ///
    /// # Additional Parameters
    ///
    /// * *$.xgafv* (query-string) - V1 error format.
    /// * *access_token* (query-string) - OAuth access token.
    /// * *alt* (query-string) - Data format for response.
    /// * *callback* (query-string) - JSONP
    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
    pub fn param<T>(mut self, name: T, value: T) -> AccountProductDeleteCall<'a, S>
                                                        where T: AsRef<str> {
        self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
        self
    }

    /// Identifies the authorization scope for the method you are building.
    ///
    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
    /// [`Scope::Manufacturercenter`].
    ///
    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
    /// tokens for more than one scope.
    ///
    /// Usually there is more than one suitable scope to authorize an operation, some of which may
    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
    /// sufficient, a read-write scope will do as well.
    pub fn add_scope<St>(mut self, scope: St) -> AccountProductDeleteCall<'a, S>
                                                        where St: AsRef<str> {
        self._scopes.insert(String::from(scope.as_ref()));
        self
    }
    /// Identifies the authorization scope(s) for the method you are building.
    ///
    /// See [`Self::add_scope()`] for details.
    pub fn add_scopes<I, St>(mut self, scopes: I) -> AccountProductDeleteCall<'a, S>
                                                        where I: IntoIterator<Item = St>,
                                                         St: AsRef<str> {
        self._scopes
            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
        self
    }

    /// Removes all scopes, and no default scope will be used either.
    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
    /// for details).
    pub fn clear_scopes(mut self) -> AccountProductDeleteCall<'a, S> {
        self._scopes.clear();
        self
    }
}


/// Gets the product from a Manufacturer Center account, including product issues. A recently updated product takes around 15 minutes to process. Changes are only visible after it has been processed. While some issues may be available once the product has been processed, other issues may take days to appear.
///
/// A builder for the *products.get* method supported by a *account* resource.
/// It is not used directly, but through a [`AccountMethods`] instance.
///
/// # Example
///
/// Instantiate a resource method builder
///
/// ```test_harness,no_run
/// # extern crate hyper;
/// # extern crate hyper_rustls;
/// # extern crate google_manufacturers1 as manufacturers1;
/// # async fn dox() {
/// # use std::default::Default;
/// # use manufacturers1::{ManufacturerCenter, oauth2, hyper, hyper_rustls, chrono, FieldMask};
/// 
/// # let secret: oauth2::ApplicationSecret = Default::default();
/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
/// #         secret,
/// #         oauth2::InstalledFlowReturnMethod::HTTPRedirect,
/// #     ).build().await.unwrap();
/// # let mut hub = ManufacturerCenter::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
/// // You can configure optional parameters by calling the respective setters at will, and
/// // execute the final call using `doit()`.
/// // Values shown here are possibly random and not representative !
/// let result = hub.accounts().products_get("parent", "name")
///              .add_include("amet.")
///              .doit().await;
/// # }
/// ```
pub struct AccountProductGetCall<'a, S>
    where S: 'a {

    hub: &'a ManufacturerCenter<S>,
    _parent: String,
    _name: String,
    _include: Vec<String>,
    _delegate: Option<&'a mut dyn client::Delegate>,
    _additional_params: HashMap<String, String>,
    _scopes: BTreeSet<String>
}

impl<'a, S> client::CallBuilder for AccountProductGetCall<'a, S> {}

impl<'a, S> AccountProductGetCall<'a, S>
where
    S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
    S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
    S::Future: Send + Unpin + 'static,
    S::Error: Into<Box<dyn StdError + Send + Sync>>,
{


    /// Perform the operation you have build so far.
    pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Product)> {
        use std::io::{Read, Seek};
        use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
        use client::{ToParts, url::Params};
        use std::borrow::Cow;

        let mut dd = client::DefaultDelegate;
        let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
        dlg.begin(client::MethodInfo { id: "manufacturers.accounts.products.get",
                               http_method: hyper::Method::GET });

        for &field in ["alt", "parent", "name", "include"].iter() {
            if self._additional_params.contains_key(field) {
                dlg.finished(false);
                return Err(client::Error::FieldClash(field));
            }
        }

        let mut params = Params::with_capacity(5 + self._additional_params.len());
        params.push("parent", self._parent);
        params.push("name", self._name);
        if self._include.len() > 0 {
            for f in self._include.iter() {
                params.push("include", f);
            }
        }

        params.extend(self._additional_params.iter());

        params.push("alt", "json");
        let mut url = self.hub._base_url.clone() + "v1/{+parent}/products/{+name}";
        if self._scopes.is_empty() {
            self._scopes.insert(Scope::Manufacturercenter.as_ref().to_string());
        }

        for &(find_this, param_name) in [("{+parent}", "parent"), ("{+name}", "name")].iter() {
            url = params.uri_replacement(url, param_name, find_this, true);
        }
        {
            let to_remove = ["name", "parent"];
            params.remove_params(&to_remove);
        }

        let url = params.parse_with_url(&url);



        loop {
            let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
                Ok(token) => token,
                Err(e) => {
                    match dlg.token(e) {
                        Ok(token) => token,
                        Err(e) => {
                            dlg.finished(false);
                            return Err(client::Error::MissingToken(e));
                        }
                    }
                }
            };
            let mut req_result = {
                let client = &self.hub.client;
                dlg.pre_request();
                let mut req_builder = hyper::Request::builder()
                    .method(hyper::Method::GET)
                    .uri(url.as_str())
                    .header(USER_AGENT, self.hub._user_agent.clone());

                if let Some(token) = token.as_ref() {
                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
                }


                        let request = req_builder
                        .body(hyper::body::Body::empty());

                client.request(request.unwrap()).await

            };

            match req_result {
                Err(err) => {
                    if let client::Retry::After(d) = dlg.http_error(&err) {
                        sleep(d).await;
                        continue;
                    }
                    dlg.finished(false);
                    return Err(client::Error::HttpError(err))
                }
                Ok(mut res) => {
                    if !res.status().is_success() {
                        let res_body_string = client::get_body_as_string(res.body_mut()).await;
                        let (parts, _) = res.into_parts();
                        let body = hyper::Body::from(res_body_string.clone());
                        let restored_response = hyper::Response::from_parts(parts, body);

                        let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();

                        if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
                            sleep(d).await;
                            continue;
                        }

                        dlg.finished(false);

                        return match server_response {
                            Some(error_value) => Err(client::Error::BadRequest(error_value)),
                            None => Err(client::Error::Failure(restored_response)),
                        }
                    }
                    let result_value = {
                        let res_body_string = client::get_body_as_string(res.body_mut()).await;

                        match json::from_str(&res_body_string) {
                            Ok(decoded) => (res, decoded),
                            Err(err) => {
                                dlg.response_json_decode_error(&res_body_string, &err);
                                return Err(client::Error::JsonDecodeError(res_body_string, err));
                            }
                        }
                    };

                    dlg.finished(true);
                    return Ok(result_value)
                }
            }
        }
    }


    /// Parent ID in the format `accounts/{account_id}`. `account_id` - The ID of the Manufacturer Center account.
    ///
    /// Sets the *parent* path property to the given value.
    ///
    /// Even though the property as already been set when instantiating this call,
    /// we provide this method for API completeness.
    pub fn parent(mut self, new_value: &str) -> AccountProductGetCall<'a, S> {
        self._parent = new_value.to_string();
        self
    }
    /// Name in the format `{target_country}:{content_language}:{product_id}`. `target_country` - The target country of the product as a CLDR territory code (for example, US). `content_language` - The content language of the product as a two-letter ISO 639-1 language code (for example, en). `product_id` - The ID of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#id.
    ///
    /// Sets the *name* path property to the given value.
    ///
    /// Even though the property as already been set when instantiating this call,
    /// we provide this method for API completeness.
    pub fn name(mut self, new_value: &str) -> AccountProductGetCall<'a, S> {
        self._name = new_value.to_string();
        self
    }
    /// The information to be included in the response. Only sections listed here will be returned.
    ///
    /// Append the given value to the *include* query property.
    /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters.
    pub fn add_include(mut self, new_value: &str) -> AccountProductGetCall<'a, S> {
        self._include.push(new_value.to_string());
        self
    }
    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
    /// while executing the actual API request.
    /// 
    /// ````text
    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
    /// ````
    ///
    /// Sets the *delegate* property to the given value.
    pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> AccountProductGetCall<'a, S> {
        self._delegate = Some(new_value);
        self
    }

    /// Set any additional parameter of the query string used in the request.
    /// It should be used to set parameters which are not yet available through their own
    /// setters.
    ///
    /// Please note that this method must not be used to set any of the known parameters
    /// which have their own setter method. If done anyway, the request will fail.
    ///
    /// # Additional Parameters
    ///
    /// * *$.xgafv* (query-string) - V1 error format.
    /// * *access_token* (query-string) - OAuth access token.
    /// * *alt* (query-string) - Data format for response.
    /// * *callback* (query-string) - JSONP
    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
    pub fn param<T>(mut self, name: T, value: T) -> AccountProductGetCall<'a, S>
                                                        where T: AsRef<str> {
        self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
        self
    }

    /// Identifies the authorization scope for the method you are building.
    ///
    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
    /// [`Scope::Manufacturercenter`].
    ///
    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
    /// tokens for more than one scope.
    ///
    /// Usually there is more than one suitable scope to authorize an operation, some of which may
    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
    /// sufficient, a read-write scope will do as well.
    pub fn add_scope<St>(mut self, scope: St) -> AccountProductGetCall<'a, S>
                                                        where St: AsRef<str> {
        self._scopes.insert(String::from(scope.as_ref()));
        self
    }
    /// Identifies the authorization scope(s) for the method you are building.
    ///
    /// See [`Self::add_scope()`] for details.
    pub fn add_scopes<I, St>(mut self, scopes: I) -> AccountProductGetCall<'a, S>
                                                        where I: IntoIterator<Item = St>,
                                                         St: AsRef<str> {
        self._scopes
            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
        self
    }

    /// Removes all scopes, and no default scope will be used either.
    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
    /// for details).
    pub fn clear_scopes(mut self) -> AccountProductGetCall<'a, S> {
        self._scopes.clear();
        self
    }
}


/// Lists all the products in a Manufacturer Center account.
///
/// A builder for the *products.list* method supported by a *account* resource.
/// It is not used directly, but through a [`AccountMethods`] instance.
///
/// # Example
///
/// Instantiate a resource method builder
///
/// ```test_harness,no_run
/// # extern crate hyper;
/// # extern crate hyper_rustls;
/// # extern crate google_manufacturers1 as manufacturers1;
/// # async fn dox() {
/// # use std::default::Default;
/// # use manufacturers1::{ManufacturerCenter, oauth2, hyper, hyper_rustls, chrono, FieldMask};
/// 
/// # let secret: oauth2::ApplicationSecret = Default::default();
/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
/// #         secret,
/// #         oauth2::InstalledFlowReturnMethod::HTTPRedirect,
/// #     ).build().await.unwrap();
/// # let mut hub = ManufacturerCenter::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
/// // You can configure optional parameters by calling the respective setters at will, and
/// // execute the final call using `doit()`.
/// // Values shown here are possibly random and not representative !
/// let result = hub.accounts().products_list("parent")
///              .page_token("ipsum")
///              .page_size(-62)
///              .add_include("Lorem")
///              .doit().await;
/// # }
/// ```
pub struct AccountProductListCall<'a, S>
    where S: 'a {

    hub: &'a ManufacturerCenter<S>,
    _parent: String,
    _page_token: Option<String>,
    _page_size: Option<i32>,
    _include: Vec<String>,
    _delegate: Option<&'a mut dyn client::Delegate>,
    _additional_params: HashMap<String, String>,
    _scopes: BTreeSet<String>
}

impl<'a, S> client::CallBuilder for AccountProductListCall<'a, S> {}

impl<'a, S> AccountProductListCall<'a, S>
where
    S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
    S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
    S::Future: Send + Unpin + 'static,
    S::Error: Into<Box<dyn StdError + Send + Sync>>,
{


    /// Perform the operation you have build so far.
    pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, ListProductsResponse)> {
        use std::io::{Read, Seek};
        use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
        use client::{ToParts, url::Params};
        use std::borrow::Cow;

        let mut dd = client::DefaultDelegate;
        let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
        dlg.begin(client::MethodInfo { id: "manufacturers.accounts.products.list",
                               http_method: hyper::Method::GET });

        for &field in ["alt", "parent", "pageToken", "pageSize", "include"].iter() {
            if self._additional_params.contains_key(field) {
                dlg.finished(false);
                return Err(client::Error::FieldClash(field));
            }
        }

        let mut params = Params::with_capacity(6 + self._additional_params.len());
        params.push("parent", self._parent);
        if let Some(value) = self._page_token.as_ref() {
            params.push("pageToken", value);
        }
        if let Some(value) = self._page_size.as_ref() {
            params.push("pageSize", value.to_string());
        }
        if self._include.len() > 0 {
            for f in self._include.iter() {
                params.push("include", f);
            }
        }

        params.extend(self._additional_params.iter());

        params.push("alt", "json");
        let mut url = self.hub._base_url.clone() + "v1/{+parent}/products";
        if self._scopes.is_empty() {
            self._scopes.insert(Scope::Manufacturercenter.as_ref().to_string());
        }

        for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
            url = params.uri_replacement(url, param_name, find_this, true);
        }
        {
            let to_remove = ["parent"];
            params.remove_params(&to_remove);
        }

        let url = params.parse_with_url(&url);



        loop {
            let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
                Ok(token) => token,
                Err(e) => {
                    match dlg.token(e) {
                        Ok(token) => token,
                        Err(e) => {
                            dlg.finished(false);
                            return Err(client::Error::MissingToken(e));
                        }
                    }
                }
            };
            let mut req_result = {
                let client = &self.hub.client;
                dlg.pre_request();
                let mut req_builder = hyper::Request::builder()
                    .method(hyper::Method::GET)
                    .uri(url.as_str())
                    .header(USER_AGENT, self.hub._user_agent.clone());

                if let Some(token) = token.as_ref() {
                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
                }


                        let request = req_builder
                        .body(hyper::body::Body::empty());

                client.request(request.unwrap()).await

            };

            match req_result {
                Err(err) => {
                    if let client::Retry::After(d) = dlg.http_error(&err) {
                        sleep(d).await;
                        continue;
                    }
                    dlg.finished(false);
                    return Err(client::Error::HttpError(err))
                }
                Ok(mut res) => {
                    if !res.status().is_success() {
                        let res_body_string = client::get_body_as_string(res.body_mut()).await;
                        let (parts, _) = res.into_parts();
                        let body = hyper::Body::from(res_body_string.clone());
                        let restored_response = hyper::Response::from_parts(parts, body);

                        let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();

                        if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
                            sleep(d).await;
                            continue;
                        }

                        dlg.finished(false);

                        return match server_response {
                            Some(error_value) => Err(client::Error::BadRequest(error_value)),
                            None => Err(client::Error::Failure(restored_response)),
                        }
                    }
                    let result_value = {
                        let res_body_string = client::get_body_as_string(res.body_mut()).await;

                        match json::from_str(&res_body_string) {
                            Ok(decoded) => (res, decoded),
                            Err(err) => {
                                dlg.response_json_decode_error(&res_body_string, &err);
                                return Err(client::Error::JsonDecodeError(res_body_string, err));
                            }
                        }
                    };

                    dlg.finished(true);
                    return Ok(result_value)
                }
            }
        }
    }


    /// Parent ID in the format `accounts/{account_id}`. `account_id` - The ID of the Manufacturer Center account.
    ///
    /// Sets the *parent* path property to the given value.
    ///
    /// Even though the property as already been set when instantiating this call,
    /// we provide this method for API completeness.
    pub fn parent(mut self, new_value: &str) -> AccountProductListCall<'a, S> {
        self._parent = new_value.to_string();
        self
    }
    /// The token returned by the previous request.
    ///
    /// Sets the *page token* query property to the given value.
    pub fn page_token(mut self, new_value: &str) -> AccountProductListCall<'a, S> {
        self._page_token = Some(new_value.to_string());
        self
    }
    /// Maximum number of product statuses to return in the response, used for paging.
    ///
    /// Sets the *page size* query property to the given value.
    pub fn page_size(mut self, new_value: i32) -> AccountProductListCall<'a, S> {
        self._page_size = Some(new_value);
        self
    }
    /// The information to be included in the response. Only sections listed here will be returned.
    ///
    /// Append the given value to the *include* query property.
    /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters.
    pub fn add_include(mut self, new_value: &str) -> AccountProductListCall<'a, S> {
        self._include.push(new_value.to_string());
        self
    }
    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
    /// while executing the actual API request.
    /// 
    /// ````text
    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
    /// ````
    ///
    /// Sets the *delegate* property to the given value.
    pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> AccountProductListCall<'a, S> {
        self._delegate = Some(new_value);
        self
    }

    /// Set any additional parameter of the query string used in the request.
    /// It should be used to set parameters which are not yet available through their own
    /// setters.
    ///
    /// Please note that this method must not be used to set any of the known parameters
    /// which have their own setter method. If done anyway, the request will fail.
    ///
    /// # Additional Parameters
    ///
    /// * *$.xgafv* (query-string) - V1 error format.
    /// * *access_token* (query-string) - OAuth access token.
    /// * *alt* (query-string) - Data format for response.
    /// * *callback* (query-string) - JSONP
    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
    pub fn param<T>(mut self, name: T, value: T) -> AccountProductListCall<'a, S>
                                                        where T: AsRef<str> {
        self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
        self
    }

    /// Identifies the authorization scope for the method you are building.
    ///
    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
    /// [`Scope::Manufacturercenter`].
    ///
    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
    /// tokens for more than one scope.
    ///
    /// Usually there is more than one suitable scope to authorize an operation, some of which may
    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
    /// sufficient, a read-write scope will do as well.
    pub fn add_scope<St>(mut self, scope: St) -> AccountProductListCall<'a, S>
                                                        where St: AsRef<str> {
        self._scopes.insert(String::from(scope.as_ref()));
        self
    }
    /// Identifies the authorization scope(s) for the method you are building.
    ///
    /// See [`Self::add_scope()`] for details.
    pub fn add_scopes<I, St>(mut self, scopes: I) -> AccountProductListCall<'a, S>
                                                        where I: IntoIterator<Item = St>,
                                                         St: AsRef<str> {
        self._scopes
            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
        self
    }

    /// Removes all scopes, and no default scope will be used either.
    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
    /// for details).
    pub fn clear_scopes(mut self) -> AccountProductListCall<'a, S> {
        self._scopes.clear();
        self
    }
}


/// Inserts or updates the attributes of the product in a Manufacturer Center account. Creates a product with the provided attributes. If the product already exists, then all attributes are replaced with the new ones. The checks at upload time are minimal. All required attributes need to be present for a product to be valid. Issues may show up later after the API has accepted a new upload for a product and it is possible to overwrite an existing valid product with an invalid product. To detect this, you should retrieve the product and check it for issues once the new version is available. Uploaded attributes first need to be processed before they can be retrieved. Until then, new products will be unavailable, and retrieval of previously uploaded products will return the original state of the product.
///
/// A builder for the *products.update* method supported by a *account* resource.
/// It is not used directly, but through a [`AccountMethods`] instance.
///
/// # Example
///
/// Instantiate a resource method builder
///
/// ```test_harness,no_run
/// # extern crate hyper;
/// # extern crate hyper_rustls;
/// # extern crate google_manufacturers1 as manufacturers1;
/// use manufacturers1::api::Attributes;
/// # async fn dox() {
/// # use std::default::Default;
/// # use manufacturers1::{ManufacturerCenter, oauth2, hyper, hyper_rustls, chrono, FieldMask};
/// 
/// # let secret: oauth2::ApplicationSecret = Default::default();
/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
/// #         secret,
/// #         oauth2::InstalledFlowReturnMethod::HTTPRedirect,
/// #     ).build().await.unwrap();
/// # let mut hub = ManufacturerCenter::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
/// // As the method needs a request, you would usually fill it with the desired information
/// // into the respective structure. Some of the parts shown here might not be applicable !
/// // Values shown here are possibly random and not representative !
/// let mut req = Attributes::default();
/// 
/// // You can configure optional parameters by calling the respective setters at will, and
/// // execute the final call using `doit()`.
/// // Values shown here are possibly random and not representative !
/// let result = hub.accounts().products_update(req, "parent", "name")
///              .doit().await;
/// # }
/// ```
pub struct AccountProductUpdateCall<'a, S>
    where S: 'a {

    hub: &'a ManufacturerCenter<S>,
    _request: Attributes,
    _parent: String,
    _name: String,
    _delegate: Option<&'a mut dyn client::Delegate>,
    _additional_params: HashMap<String, String>,
    _scopes: BTreeSet<String>
}

impl<'a, S> client::CallBuilder for AccountProductUpdateCall<'a, S> {}

impl<'a, S> AccountProductUpdateCall<'a, S>
where
    S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
    S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
    S::Future: Send + Unpin + 'static,
    S::Error: Into<Box<dyn StdError + Send + Sync>>,
{


    /// Perform the operation you have build so far.
    pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Empty)> {
        use std::io::{Read, Seek};
        use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
        use client::{ToParts, url::Params};
        use std::borrow::Cow;

        let mut dd = client::DefaultDelegate;
        let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
        dlg.begin(client::MethodInfo { id: "manufacturers.accounts.products.update",
                               http_method: hyper::Method::PUT });

        for &field in ["alt", "parent", "name"].iter() {
            if self._additional_params.contains_key(field) {
                dlg.finished(false);
                return Err(client::Error::FieldClash(field));
            }
        }

        let mut params = Params::with_capacity(5 + self._additional_params.len());
        params.push("parent", self._parent);
        params.push("name", self._name);

        params.extend(self._additional_params.iter());

        params.push("alt", "json");
        let mut url = self.hub._base_url.clone() + "v1/{+parent}/products/{+name}";
        if self._scopes.is_empty() {
            self._scopes.insert(Scope::Manufacturercenter.as_ref().to_string());
        }

        for &(find_this, param_name) in [("{+parent}", "parent"), ("{+name}", "name")].iter() {
            url = params.uri_replacement(url, param_name, find_this, true);
        }
        {
            let to_remove = ["name", "parent"];
            params.remove_params(&to_remove);
        }

        let url = params.parse_with_url(&url);

        let mut json_mime_type = mime::APPLICATION_JSON;
        let mut request_value_reader =
            {
                let mut value = json::value::to_value(&self._request).expect("serde to work");
                client::remove_json_null_values(&mut value);
                let mut dst = io::Cursor::new(Vec::with_capacity(128));
                json::to_writer(&mut dst, &value).unwrap();
                dst
            };
        let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap();
        request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();


        loop {
            let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
                Ok(token) => token,
                Err(e) => {
                    match dlg.token(e) {
                        Ok(token) => token,
                        Err(e) => {
                            dlg.finished(false);
                            return Err(client::Error::MissingToken(e));
                        }
                    }
                }
            };
            request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
            let mut req_result = {
                let client = &self.hub.client;
                dlg.pre_request();
                let mut req_builder = hyper::Request::builder()
                    .method(hyper::Method::PUT)
                    .uri(url.as_str())
                    .header(USER_AGENT, self.hub._user_agent.clone());

                if let Some(token) = token.as_ref() {
                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
                }


                        let request = req_builder
                        .header(CONTENT_TYPE, json_mime_type.to_string())
                        .header(CONTENT_LENGTH, request_size as u64)
                        .body(hyper::body::Body::from(request_value_reader.get_ref().clone()));

                client.request(request.unwrap()).await

            };

            match req_result {
                Err(err) => {
                    if let client::Retry::After(d) = dlg.http_error(&err) {
                        sleep(d).await;
                        continue;
                    }
                    dlg.finished(false);
                    return Err(client::Error::HttpError(err))
                }
                Ok(mut res) => {
                    if !res.status().is_success() {
                        let res_body_string = client::get_body_as_string(res.body_mut()).await;
                        let (parts, _) = res.into_parts();
                        let body = hyper::Body::from(res_body_string.clone());
                        let restored_response = hyper::Response::from_parts(parts, body);

                        let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();

                        if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
                            sleep(d).await;
                            continue;
                        }

                        dlg.finished(false);

                        return match server_response {
                            Some(error_value) => Err(client::Error::BadRequest(error_value)),
                            None => Err(client::Error::Failure(restored_response)),
                        }
                    }
                    let result_value = {
                        let res_body_string = client::get_body_as_string(res.body_mut()).await;

                        match json::from_str(&res_body_string) {
                            Ok(decoded) => (res, decoded),
                            Err(err) => {
                                dlg.response_json_decode_error(&res_body_string, &err);
                                return Err(client::Error::JsonDecodeError(res_body_string, err));
                            }
                        }
                    };

                    dlg.finished(true);
                    return Ok(result_value)
                }
            }
        }
    }


    ///
    /// Sets the *request* property to the given value.
    ///
    /// Even though the property as already been set when instantiating this call,
    /// we provide this method for API completeness.
    pub fn request(mut self, new_value: Attributes) -> AccountProductUpdateCall<'a, S> {
        self._request = new_value;
        self
    }
    /// Parent ID in the format `accounts/{account_id}`. `account_id` - The ID of the Manufacturer Center account.
    ///
    /// Sets the *parent* path property to the given value.
    ///
    /// Even though the property as already been set when instantiating this call,
    /// we provide this method for API completeness.
    pub fn parent(mut self, new_value: &str) -> AccountProductUpdateCall<'a, S> {
        self._parent = new_value.to_string();
        self
    }
    /// Name in the format `{target_country}:{content_language}:{product_id}`. `target_country` - The target country of the product as a CLDR territory code (for example, US). `content_language` - The content language of the product as a two-letter ISO 639-1 language code (for example, en). `product_id` - The ID of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#id.
    ///
    /// Sets the *name* path property to the given value.
    ///
    /// Even though the property as already been set when instantiating this call,
    /// we provide this method for API completeness.
    pub fn name(mut self, new_value: &str) -> AccountProductUpdateCall<'a, S> {
        self._name = new_value.to_string();
        self
    }
    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
    /// while executing the actual API request.
    /// 
    /// ````text
    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
    /// ````
    ///
    /// Sets the *delegate* property to the given value.
    pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> AccountProductUpdateCall<'a, S> {
        self._delegate = Some(new_value);
        self
    }

    /// Set any additional parameter of the query string used in the request.
    /// It should be used to set parameters which are not yet available through their own
    /// setters.
    ///
    /// Please note that this method must not be used to set any of the known parameters
    /// which have their own setter method. If done anyway, the request will fail.
    ///
    /// # Additional Parameters
    ///
    /// * *$.xgafv* (query-string) - V1 error format.
    /// * *access_token* (query-string) - OAuth access token.
    /// * *alt* (query-string) - Data format for response.
    /// * *callback* (query-string) - JSONP
    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
    pub fn param<T>(mut self, name: T, value: T) -> AccountProductUpdateCall<'a, S>
                                                        where T: AsRef<str> {
        self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
        self
    }

    /// Identifies the authorization scope for the method you are building.
    ///
    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
    /// [`Scope::Manufacturercenter`].
    ///
    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
    /// tokens for more than one scope.
    ///
    /// Usually there is more than one suitable scope to authorize an operation, some of which may
    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
    /// sufficient, a read-write scope will do as well.
    pub fn add_scope<St>(mut self, scope: St) -> AccountProductUpdateCall<'a, S>
                                                        where St: AsRef<str> {
        self._scopes.insert(String::from(scope.as_ref()));
        self
    }
    /// Identifies the authorization scope(s) for the method you are building.
    ///
    /// See [`Self::add_scope()`] for details.
    pub fn add_scopes<I, St>(mut self, scopes: I) -> AccountProductUpdateCall<'a, S>
                                                        where I: IntoIterator<Item = St>,
                                                         St: AsRef<str> {
        self._scopes
            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
        self
    }

    /// Removes all scopes, and no default scope will be used either.
    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
    /// for details).
    pub fn clear_scopes(mut self) -> AccountProductUpdateCall<'a, S> {
        self._scopes.clear();
        self
    }
}