late 0.0.1383

API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema). Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
Documentation
/*
 * Zernio API
 *
 * API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api  Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal.  Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).  Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
 *
 * The version of the OpenAPI document: 1.603.1
 * Contact: support@zernio.com
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateGoogleBusinessLocationRequest {
    /// Business name as shown on Google.
    #[serde(rename = "title")]
    pub title: String,
    /// BCP-47 language of the listing (e.g. \"es\"). Immutable after creation.
    #[serde(rename = "languageCode")]
    pub language_code: String,
    /// Category name from GET gmb-categories (e.g. \"categories/gcid:cafe\"). A bare \"gcid:cafe\" is also accepted.
    #[serde(rename = "primaryCategory")]
    pub primary_category: String,
    /// Further category names, same format as primaryCategory.
    #[serde(
        rename = "additionalCategories",
        skip_serializing_if = "Option::is_none"
    )]
    pub additional_categories: Option<Vec<String>>,
    #[serde(rename = "storefrontAddress", skip_serializing_if = "Option::is_none")]
    pub storefront_address:
        Option<Box<models::CreateGoogleBusinessLocationRequestStorefrontAddress>>,
    #[serde(rename = "serviceArea", skip_serializing_if = "Option::is_none")]
    pub service_area: Option<Box<models::CreateGoogleBusinessLocationRequestServiceArea>>,
    /// Primary phone number. Required when storefrontAddress is absent and websiteUri is not set.
    #[serde(rename = "phone", skip_serializing_if = "Option::is_none")]
    pub phone: Option<String>,
    /// Website URL. Required when storefrontAddress is absent and phone is not set.
    #[serde(rename = "websiteUri", skip_serializing_if = "Option::is_none")]
    pub website_uri: Option<String>,
    /// Business description (Google profile.description).
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Google `regularHours` object (periods with openDay, openTime, closeDay, closeTime).
    #[serde(rename = "regularHours", skip_serializing_if = "Option::is_none")]
    pub regular_hours: Option<std::collections::HashMap<String, serde_json::Value>>,
    /// Validate with Google without creating the listing or attaching anything.
    #[serde(rename = "validateOnly", skip_serializing_if = "Option::is_none")]
    pub validate_only: Option<bool>,
}

impl CreateGoogleBusinessLocationRequest {
    pub fn new(
        title: String,
        language_code: String,
        primary_category: String,
    ) -> CreateGoogleBusinessLocationRequest {
        CreateGoogleBusinessLocationRequest {
            title,
            language_code,
            primary_category,
            additional_categories: None,
            storefront_address: None,
            service_area: None,
            phone: None,
            website_uri: None,
            description: None,
            regular_hours: None,
            validate_only: None,
        }
    }
}