/*
* iNaturalist API
*
* # https://api.inaturalist.org/v1/ [iNaturalist](https://www.inaturalist.org/) is a global community of naturalists, scientists, and members of the public sharing over a million wildlife sightings to teach one another about the natural world while creating high quality citizen science data for science and conservation. These API methods return data in JSON/JSONP and PNG response formats. They are meant to supplement the existing [iNaturalist API](https://www.inaturalist.org/pages/api+reference), implemented in Ruby on Rails, which has more functionality and supports more write operations, but tends to be slower and have less consistent response formats. Visit our [developers page](https://www.inaturalist.org/pages/developers) for more information. Write operations that expect and return JSON describe a single `body` parameter that represents the request body, which should be specified as JSON. See the \"Model\" of each body parameter for attributes that we accept in these JSON objects. Multiple values for a single URL parameter should be separated by commas, e.g. `taxon_id=1,2,3`. Map tiles are generated using the [node-mapnik](https://github.com/mapnik/node-mapnik) library, following the XYZ map tiling scheme. The \"Observation Tile\" methods accept nearly all the parameters of the observation search APIs, and will generate map tiles reflecting the same observations returned by searches. These \"Observation Tile\" methods have corresponding [UTFGrid](https://github.com/mapbox/utfgrid-spec) JSON responses which return information needed to make interactive maps. Authentication in the Node API is handled via JSON Web Tokens (JWT). To obtain one, make an [OAuth-authenticated request](http://www.inaturalist.org/pages/api+reference#auth) to https://www.inaturalist.org/users/api_token. Each JWT will expire after 24 hours. Authentication required for all PUT and POST requests. Some GET requests will also include private information like hidden coordinates if the authenticated user has permission to view them. Photos served from https://static.inaturalist.org and https://inaturalist-open-data.s3.amazonaws.com have multiple size variants and not all size variants are returned in responses. To access other sizes, the photo URL can be modified to replace only the size qualifier (each variant shares the exact same extension). The domain a photo is hosted under reflects the license under which the photo is being shared, and the domain may change over time if the license changes. Photos in the `inaturalist-open-data` domain are shared under open licenses. These can be accessed in bulk in the [iNaturalist AWS Open Dataset]( https://registry.opendata.aws/inaturalist-open-data/). Photos in the `static.inaturalist.org` domain do not have open licenses. The available photo sizes are: * original (max 2048px in either dimension) * large (max 1024px in either dimension) * medium (max 500px in either dimension) * small (max 240px in either dimension) * thumb (max 100px in either dimension) * square (75px square) iNaturalist Website: https://www.inaturalist.org/ Open Source Software: https://github.com/inaturalist/ ## Terms of Use Use of this API is subject to the iNaturalist [Terms of Service](https://www.inaturalist.org/terms) and [Privacy Policy](https://www.inaturalist.org/privacy). We will block any use of our API that violates our Terms or Privacy Policy without notice. The API is intended to support application development, not data scraping. For pre- generated data exports, see https://www.inaturalist.org/pages/developers. Please note that we throttle API usage to a max of 100 requests per minute, though we ask that you try to keep it to 60 requests per minute or lower, and to keep under 10,000 requests per day. If we notice usage that has serious impact on our performance we may institute blocks without notification. Terms of Service: https://www.inaturalist.org/terms Privacy Policy: https://www.inaturalist.org/privacy
*
* The version of the OpenAPI document: 1.3.0
*
* Generated by: https://openapi-generator.tech
*/
use super::{configuration, ContentType, Error};
use crate::{apis::ResponseContent, models};
use reqwest;
use serde::{de::Error as _, Deserialize, Serialize};
/// struct for passing parameters to the method [`colored_heatmap_zoom_xy_grid_json_get`]
#[derive(Clone, Debug)]
pub struct ColoredHeatmapZoomXyGridJsonGetParams {
/// Zoom level. Z coordinate in the XYZ tiling scheme
pub zoom: i32,
/// X coordinate in the XYZ tiling scheme. Must be less than 2^zoom
pub x: i32,
/// Y coordinate in the XYZ tiling scheme. Must be less than 2^zoom
pub y: i32,
/// Primary color to use in tile creation. Accepts common colors by string (e.g. `color=blue`), and accepts escaped color HEX codes (e.g. `color=%2386a91c`)
pub color: Option<String>,
/// Whether or not positional accuracy / coordinate uncertainty has been specified
pub acc: Option<bool>,
/// Captive or cultivated observations
pub captive: Option<bool>,
/// Observations whose taxa are endemic to their location
pub endemic: Option<bool>,
/// Observations that are georeferenced
pub geo: Option<bool>,
/// Observations with the deprecated `ID, Please!` flag. Note that this will return observations, but that this attribute is no longer used.
pub id_please: Option<bool>,
/// Observations that have community identifications
pub identified: Option<bool>,
/// Observations whose taxa are introduced in their location
pub introduced: Option<bool>,
/// Observations that show on map tiles
pub mappable: Option<bool>,
/// Observations whose taxa are native to their location
pub native: Option<bool>,
/// Observations whose taxa are outside their known ranges
pub out_of_range: Option<bool>,
/// Observations identified by the curator of a project. If the `project_id` parameter is also specified, this will only consider observations identified by curators of the specified project(s)
pub pcid: Option<bool>,
/// Observations with photos
pub photos: Option<bool>,
/// Observations that have been favorited by at least one user
pub popular: Option<bool>,
/// Observations with sounds
pub sounds: Option<bool>,
/// Observations of active taxon concepts
pub taxon_is_active: Option<bool>,
/// Observations whose taxa are threatened in their location
pub threatened: Option<bool>,
/// Observations with a `quality_grade` of either `needs_id` or `research`. Equivalent to `quality_grade=needs_id,research`
pub verifiable: Option<bool>,
/// License attribute of an observation must not be null
pub licensed: Option<bool>,
/// License attribute of at least one photo of an observation must not be null
pub photo_licensed: Option<bool>,
/// Observation taxon is expected nearby
pub expected_nearby: Option<bool>,
/// Must have this ID
pub id: Option<Vec<String>>,
/// Must not have this ID
pub not_id: Option<Vec<String>>,
/// Observation must have this license
pub license: Option<Vec<String>>,
/// Must have an observation field value with this datatype
pub ofv_datatype: Option<Vec<String>>,
/// Must have at least one photo with this license
pub photo_license: Option<Vec<String>>,
/// Must be observed within the place with this ID
pub place_id: Option<Vec<i32>>,
/// Must be added to the project this ID or slug
pub project_id: Option<Vec<String>>,
/// Taxon must have this rank
pub rank: Option<Vec<String>>,
/// Must be affiliated with the iNaturalist network website with this ID
pub site_id: Option<Vec<String>>,
/// Must have at least one sound with this license
pub sound_license: Option<Vec<String>>,
/// Only show observations of these taxa and their descendants
pub taxon_id: Option<Vec<String>>,
/// Exclude observations of these taxa and their descendants
pub without_taxon_id: Option<Vec<String>>,
/// Taxon must have a scientific or common name matching this string
pub taxon_name: Option<Vec<String>>,
/// User must have this ID or login
pub user_id: Option<Vec<String>>,
/// User must have this login
pub user_login: Option<Vec<String>>,
/// Observations identified by a particular user
pub ident_user_id: Option<i32>,
/// Must be observed within this hour of the day
pub hour: Option<Vec<String>>,
/// Must be observed within this day of the month
pub day: Option<Vec<String>>,
/// Must be observed within this month
pub month: Option<Vec<String>>,
/// Must be observed within this year
pub year: Option<Vec<String>>,
/// Must be created within this day of the month
pub created_day: Option<Vec<String>>,
/// Must be created within this month
pub created_month: Option<Vec<String>>,
/// Must be created within this year
pub created_year: Option<Vec<String>>,
/// Must have an annotation using this controlled term ID
pub term_id: Option<Vec<i32>>,
/// Must have an annotation using this controlled value ID. Must be combined with the `term_id` parameter
pub term_value_id: Option<Vec<i32>>,
/// Exclude observations with annotations using this controlled value ID.
pub without_term_id: Option<i32>,
/// Exclude observations with annotations using this controlled value ID. Must be combined with the `term_id` parameter
pub without_term_value_id: Option<Vec<i32>>,
/// Must be combined with the `term_value_id` or the `without_term_value_id` parameter. Must have an annotation using this controlled term ID and associated term value IDs or be missing this annotation.
pub term_id_or_unknown: Option<Vec<i32>>,
/// Must have an annotation created by this user
pub annotation_user_id: Option<Vec<String>>,
/// Must have a positional accuracy above this value (meters)
pub acc_above: Option<String>,
/// Must have a positional accuracy below this value (meters)
pub acc_below: Option<String>,
/// Positional accuracy must be below this value (in meters) or be unknown
pub acc_below_or_unknown: Option<String>,
/// Must be observed on or after this date
pub d1: Option<String>,
/// Must be observed on or before this date
pub d2: Option<String>,
/// Must be created at or after this time
pub created_d1: Option<String>,
/// Must be created at or before this time
pub created_d2: Option<String>,
/// Must be created on this date
pub created_on: Option<String>,
/// Must be observed on this date
pub observed_on: Option<String>,
/// Must not be of a taxon previously observed by this user
pub unobserved_by_user_id: Option<i32>,
/// Must match the rules of the project with this ID or slug
pub apply_project_rules_for: Option<String>,
/// Taxon must have this conservation status code. If the `place_id` parameter is also specified, this will only consider statuses specific to that place
pub cs: Option<String>,
/// Taxon must have a conservation status from this authority. If the `place_id` parameter is also specified, this will only consider statuses specific to that place
pub csa: Option<String>,
/// Taxon must have this IUCN conservation status. If the `place_id` parameter is also specified, this will only consider statuses specific to that place
pub csi: Option<Vec<String>>,
/// Must have this geoprivacy setting
pub geoprivacy: Option<Vec<String>>,
/// Filter observations by the most conservative geoprivacy applied by a conservation status associated with one of the taxa proposed in the current identifications.
pub taxon_geoprivacy: Option<Vec<String>>,
/// Must have `geoprivacy` or `taxon_geoprivacy` fields matching these values
pub obscuration: Option<Vec<String>>,
/// Taxon must have this rank or lower
pub hrank: Option<String>,
/// Taxon must have this rank or higher
pub lrank: Option<String>,
/// Taxon must by within this iconic taxon
pub iconic_taxa: Option<Vec<String>>,
/// Must have an ID above this value
pub id_above: Option<String>,
/// Must have an ID below this value
pub id_below: Option<String>,
/// Identifications must meet these criteria
pub identifications: Option<String>,
/// Must be within a {`radius`} kilometer circle around this lat/lng (*lat, *lng, radius)
pub lat: Option<f64>,
/// Must be within a {`radius`} kilometer circle around this lat/lng (*lat, *lng, radius)
pub lng: Option<f64>,
/// Must be within a {`radius`} kilometer circle around this lat/lng (*lat, *lng, radius)
pub radius: Option<String>,
/// Must be within this bounding box (*nelat, *nelng, *swlat, *swlng)
pub nelat: Option<f64>,
/// Must be within this bounding box (*nelat, *nelng, *swlat, *swlng)
pub nelng: Option<f64>,
/// Must be within this bounding box (*nelat, *nelng, *swlat, *swlng)
pub swlat: Option<f64>,
/// Must be within this bounding box (*nelat, *nelng, *swlat, *swlng)
pub swlng: Option<f64>,
/// Taxon must be in the list with this ID
pub list_id: Option<i32>,
/// Must not be in the project with this ID or slug
pub not_in_project: Option<String>,
/// Must not match the rules of the project with this ID or slug
pub not_matching_project_rules_for: Option<String>,
/// Must included in this observation accuracy experiment
pub observation_accuracy_experiment_id: Option<Vec<i32>>,
/// Search observation properties. Can be combined with `search_on`
pub q: Option<String>,
/// Properties to search on, when combined with `q`. Searches across all properties by default
pub search_on: Option<String>,
/// Must have this quality grade
pub quality_grade: Option<String>,
/// Must be updated since this time
pub updated_since: Option<String>,
/// See `reviewed`
pub viewer_id: Option<String>,
/// Observations have been reviewed by the user with ID equal to the value of the `viewer_id` parameter
pub reviewed: Option<bool>,
}
/// struct for passing parameters to the method [`grid_zoom_xy_grid_json_get`]
#[derive(Clone, Debug)]
pub struct GridZoomXyGridJsonGetParams {
/// Zoom level. Z coordinate in the XYZ tiling scheme
pub zoom: i32,
/// X coordinate in the XYZ tiling scheme. Must be less than 2^zoom
pub x: i32,
/// Y coordinate in the XYZ tiling scheme. Must be less than 2^zoom
pub y: i32,
/// Primary color to use in tile creation. Accepts common colors by string (e.g. `color=blue`), and accepts escaped color HEX codes (e.g. `color=%2386a91c`)
pub color: Option<String>,
/// Whether or not positional accuracy / coordinate uncertainty has been specified
pub acc: Option<bool>,
/// Captive or cultivated observations
pub captive: Option<bool>,
/// Observations whose taxa are endemic to their location
pub endemic: Option<bool>,
/// Observations that are georeferenced
pub geo: Option<bool>,
/// Observations with the deprecated `ID, Please!` flag. Note that this will return observations, but that this attribute is no longer used.
pub id_please: Option<bool>,
/// Observations that have community identifications
pub identified: Option<bool>,
/// Observations whose taxa are introduced in their location
pub introduced: Option<bool>,
/// Observations that show on map tiles
pub mappable: Option<bool>,
/// Observations whose taxa are native to their location
pub native: Option<bool>,
/// Observations whose taxa are outside their known ranges
pub out_of_range: Option<bool>,
/// Observations identified by the curator of a project. If the `project_id` parameter is also specified, this will only consider observations identified by curators of the specified project(s)
pub pcid: Option<bool>,
/// Observations with photos
pub photos: Option<bool>,
/// Observations that have been favorited by at least one user
pub popular: Option<bool>,
/// Observations with sounds
pub sounds: Option<bool>,
/// Observations of active taxon concepts
pub taxon_is_active: Option<bool>,
/// Observations whose taxa are threatened in their location
pub threatened: Option<bool>,
/// Observations with a `quality_grade` of either `needs_id` or `research`. Equivalent to `quality_grade=needs_id,research`
pub verifiable: Option<bool>,
/// License attribute of an observation must not be null
pub licensed: Option<bool>,
/// License attribute of at least one photo of an observation must not be null
pub photo_licensed: Option<bool>,
/// Observation taxon is expected nearby
pub expected_nearby: Option<bool>,
/// Must have this ID
pub id: Option<Vec<String>>,
/// Must not have this ID
pub not_id: Option<Vec<String>>,
/// Observation must have this license
pub license: Option<Vec<String>>,
/// Must have an observation field value with this datatype
pub ofv_datatype: Option<Vec<String>>,
/// Must have at least one photo with this license
pub photo_license: Option<Vec<String>>,
/// Must be observed within the place with this ID
pub place_id: Option<Vec<i32>>,
/// Must be added to the project this ID or slug
pub project_id: Option<Vec<String>>,
/// Taxon must have this rank
pub rank: Option<Vec<String>>,
/// Must be affiliated with the iNaturalist network website with this ID
pub site_id: Option<Vec<String>>,
/// Must have at least one sound with this license
pub sound_license: Option<Vec<String>>,
/// Only show observations of these taxa and their descendants
pub taxon_id: Option<Vec<String>>,
/// Exclude observations of these taxa and their descendants
pub without_taxon_id: Option<Vec<String>>,
/// Taxon must have a scientific or common name matching this string
pub taxon_name: Option<Vec<String>>,
/// User must have this ID or login
pub user_id: Option<Vec<String>>,
/// User must have this login
pub user_login: Option<Vec<String>>,
/// Observations identified by a particular user
pub ident_user_id: Option<i32>,
/// Must be observed within this hour of the day
pub hour: Option<Vec<String>>,
/// Must be observed within this day of the month
pub day: Option<Vec<String>>,
/// Must be observed within this month
pub month: Option<Vec<String>>,
/// Must be observed within this year
pub year: Option<Vec<String>>,
/// Must be created within this day of the month
pub created_day: Option<Vec<String>>,
/// Must be created within this month
pub created_month: Option<Vec<String>>,
/// Must be created within this year
pub created_year: Option<Vec<String>>,
/// Must have an annotation using this controlled term ID
pub term_id: Option<Vec<i32>>,
/// Must have an annotation using this controlled value ID. Must be combined with the `term_id` parameter
pub term_value_id: Option<Vec<i32>>,
/// Exclude observations with annotations using this controlled value ID.
pub without_term_id: Option<i32>,
/// Exclude observations with annotations using this controlled value ID. Must be combined with the `term_id` parameter
pub without_term_value_id: Option<Vec<i32>>,
/// Must be combined with the `term_value_id` or the `without_term_value_id` parameter. Must have an annotation using this controlled term ID and associated term value IDs or be missing this annotation.
pub term_id_or_unknown: Option<Vec<i32>>,
/// Must have an annotation created by this user
pub annotation_user_id: Option<Vec<String>>,
/// Must have a positional accuracy above this value (meters)
pub acc_above: Option<String>,
/// Must have a positional accuracy below this value (meters)
pub acc_below: Option<String>,
/// Positional accuracy must be below this value (in meters) or be unknown
pub acc_below_or_unknown: Option<String>,
/// Must be observed on or after this date
pub d1: Option<String>,
/// Must be observed on or before this date
pub d2: Option<String>,
/// Must be created at or after this time
pub created_d1: Option<String>,
/// Must be created at or before this time
pub created_d2: Option<String>,
/// Must be created on this date
pub created_on: Option<String>,
/// Must be observed on this date
pub observed_on: Option<String>,
/// Must not be of a taxon previously observed by this user
pub unobserved_by_user_id: Option<i32>,
/// Must match the rules of the project with this ID or slug
pub apply_project_rules_for: Option<String>,
/// Taxon must have this conservation status code. If the `place_id` parameter is also specified, this will only consider statuses specific to that place
pub cs: Option<String>,
/// Taxon must have a conservation status from this authority. If the `place_id` parameter is also specified, this will only consider statuses specific to that place
pub csa: Option<String>,
/// Taxon must have this IUCN conservation status. If the `place_id` parameter is also specified, this will only consider statuses specific to that place
pub csi: Option<Vec<String>>,
/// Must have this geoprivacy setting
pub geoprivacy: Option<Vec<String>>,
/// Filter observations by the most conservative geoprivacy applied by a conservation status associated with one of the taxa proposed in the current identifications.
pub taxon_geoprivacy: Option<Vec<String>>,
/// Must have `geoprivacy` or `taxon_geoprivacy` fields matching these values
pub obscuration: Option<Vec<String>>,
/// Taxon must have this rank or lower
pub hrank: Option<String>,
/// Taxon must have this rank or higher
pub lrank: Option<String>,
/// Taxon must by within this iconic taxon
pub iconic_taxa: Option<Vec<String>>,
/// Must have an ID above this value
pub id_above: Option<String>,
/// Must have an ID below this value
pub id_below: Option<String>,
/// Identifications must meet these criteria
pub identifications: Option<String>,
/// Must be within a {`radius`} kilometer circle around this lat/lng (*lat, *lng, radius)
pub lat: Option<f64>,
/// Must be within a {`radius`} kilometer circle around this lat/lng (*lat, *lng, radius)
pub lng: Option<f64>,
/// Must be within a {`radius`} kilometer circle around this lat/lng (*lat, *lng, radius)
pub radius: Option<String>,
/// Must be within this bounding box (*nelat, *nelng, *swlat, *swlng)
pub nelat: Option<f64>,
/// Must be within this bounding box (*nelat, *nelng, *swlat, *swlng)
pub nelng: Option<f64>,
/// Must be within this bounding box (*nelat, *nelng, *swlat, *swlng)
pub swlat: Option<f64>,
/// Must be within this bounding box (*nelat, *nelng, *swlat, *swlng)
pub swlng: Option<f64>,
/// Taxon must be in the list with this ID
pub list_id: Option<i32>,
/// Must not be in the project with this ID or slug
pub not_in_project: Option<String>,
/// Must not match the rules of the project with this ID or slug
pub not_matching_project_rules_for: Option<String>,
/// Must included in this observation accuracy experiment
pub observation_accuracy_experiment_id: Option<Vec<i32>>,
/// Search observation properties. Can be combined with `search_on`
pub q: Option<String>,
/// Properties to search on, when combined with `q`. Searches across all properties by default
pub search_on: Option<String>,
/// Must have this quality grade
pub quality_grade: Option<String>,
/// Must be updated since this time
pub updated_since: Option<String>,
/// See `reviewed`
pub viewer_id: Option<String>,
/// Observations have been reviewed by the user with ID equal to the value of the `viewer_id` parameter
pub reviewed: Option<bool>,
}
/// struct for passing parameters to the method [`heatmap_zoom_xy_grid_json_get`]
#[derive(Clone, Debug)]
pub struct HeatmapZoomXyGridJsonGetParams {
/// Zoom level. Z coordinate in the XYZ tiling scheme
pub zoom: i32,
/// X coordinate in the XYZ tiling scheme. Must be less than 2^zoom
pub x: i32,
/// Y coordinate in the XYZ tiling scheme. Must be less than 2^zoom
pub y: i32,
/// Primary color to use in tile creation. Accepts common colors by string (e.g. `color=blue`), and accepts escaped color HEX codes (e.g. `color=%2386a91c`)
pub color: Option<String>,
/// Whether or not positional accuracy / coordinate uncertainty has been specified
pub acc: Option<bool>,
/// Captive or cultivated observations
pub captive: Option<bool>,
/// Observations whose taxa are endemic to their location
pub endemic: Option<bool>,
/// Observations that are georeferenced
pub geo: Option<bool>,
/// Observations with the deprecated `ID, Please!` flag. Note that this will return observations, but that this attribute is no longer used.
pub id_please: Option<bool>,
/// Observations that have community identifications
pub identified: Option<bool>,
/// Observations whose taxa are introduced in their location
pub introduced: Option<bool>,
/// Observations that show on map tiles
pub mappable: Option<bool>,
/// Observations whose taxa are native to their location
pub native: Option<bool>,
/// Observations whose taxa are outside their known ranges
pub out_of_range: Option<bool>,
/// Observations identified by the curator of a project. If the `project_id` parameter is also specified, this will only consider observations identified by curators of the specified project(s)
pub pcid: Option<bool>,
/// Observations with photos
pub photos: Option<bool>,
/// Observations that have been favorited by at least one user
pub popular: Option<bool>,
/// Observations with sounds
pub sounds: Option<bool>,
/// Observations of active taxon concepts
pub taxon_is_active: Option<bool>,
/// Observations whose taxa are threatened in their location
pub threatened: Option<bool>,
/// Observations with a `quality_grade` of either `needs_id` or `research`. Equivalent to `quality_grade=needs_id,research`
pub verifiable: Option<bool>,
/// License attribute of an observation must not be null
pub licensed: Option<bool>,
/// License attribute of at least one photo of an observation must not be null
pub photo_licensed: Option<bool>,
/// Observation taxon is expected nearby
pub expected_nearby: Option<bool>,
/// Must have this ID
pub id: Option<Vec<String>>,
/// Must not have this ID
pub not_id: Option<Vec<String>>,
/// Observation must have this license
pub license: Option<Vec<String>>,
/// Must have an observation field value with this datatype
pub ofv_datatype: Option<Vec<String>>,
/// Must have at least one photo with this license
pub photo_license: Option<Vec<String>>,
/// Must be observed within the place with this ID
pub place_id: Option<Vec<i32>>,
/// Must be added to the project this ID or slug
pub project_id: Option<Vec<String>>,
/// Taxon must have this rank
pub rank: Option<Vec<String>>,
/// Must be affiliated with the iNaturalist network website with this ID
pub site_id: Option<Vec<String>>,
/// Must have at least one sound with this license
pub sound_license: Option<Vec<String>>,
/// Only show observations of these taxa and their descendants
pub taxon_id: Option<Vec<String>>,
/// Exclude observations of these taxa and their descendants
pub without_taxon_id: Option<Vec<String>>,
/// Taxon must have a scientific or common name matching this string
pub taxon_name: Option<Vec<String>>,
/// User must have this ID or login
pub user_id: Option<Vec<String>>,
/// User must have this login
pub user_login: Option<Vec<String>>,
/// Observations identified by a particular user
pub ident_user_id: Option<i32>,
/// Must be observed within this hour of the day
pub hour: Option<Vec<String>>,
/// Must be observed within this day of the month
pub day: Option<Vec<String>>,
/// Must be observed within this month
pub month: Option<Vec<String>>,
/// Must be observed within this year
pub year: Option<Vec<String>>,
/// Must be created within this day of the month
pub created_day: Option<Vec<String>>,
/// Must be created within this month
pub created_month: Option<Vec<String>>,
/// Must be created within this year
pub created_year: Option<Vec<String>>,
/// Must have an annotation using this controlled term ID
pub term_id: Option<Vec<i32>>,
/// Must have an annotation using this controlled value ID. Must be combined with the `term_id` parameter
pub term_value_id: Option<Vec<i32>>,
/// Exclude observations with annotations using this controlled value ID.
pub without_term_id: Option<i32>,
/// Exclude observations with annotations using this controlled value ID. Must be combined with the `term_id` parameter
pub without_term_value_id: Option<Vec<i32>>,
/// Must be combined with the `term_value_id` or the `without_term_value_id` parameter. Must have an annotation using this controlled term ID and associated term value IDs or be missing this annotation.
pub term_id_or_unknown: Option<Vec<i32>>,
/// Must have an annotation created by this user
pub annotation_user_id: Option<Vec<String>>,
/// Must have a positional accuracy above this value (meters)
pub acc_above: Option<String>,
/// Must have a positional accuracy below this value (meters)
pub acc_below: Option<String>,
/// Positional accuracy must be below this value (in meters) or be unknown
pub acc_below_or_unknown: Option<String>,
/// Must be observed on or after this date
pub d1: Option<String>,
/// Must be observed on or before this date
pub d2: Option<String>,
/// Must be created at or after this time
pub created_d1: Option<String>,
/// Must be created at or before this time
pub created_d2: Option<String>,
/// Must be created on this date
pub created_on: Option<String>,
/// Must be observed on this date
pub observed_on: Option<String>,
/// Must not be of a taxon previously observed by this user
pub unobserved_by_user_id: Option<i32>,
/// Must match the rules of the project with this ID or slug
pub apply_project_rules_for: Option<String>,
/// Taxon must have this conservation status code. If the `place_id` parameter is also specified, this will only consider statuses specific to that place
pub cs: Option<String>,
/// Taxon must have a conservation status from this authority. If the `place_id` parameter is also specified, this will only consider statuses specific to that place
pub csa: Option<String>,
/// Taxon must have this IUCN conservation status. If the `place_id` parameter is also specified, this will only consider statuses specific to that place
pub csi: Option<Vec<String>>,
/// Must have this geoprivacy setting
pub geoprivacy: Option<Vec<String>>,
/// Filter observations by the most conservative geoprivacy applied by a conservation status associated with one of the taxa proposed in the current identifications.
pub taxon_geoprivacy: Option<Vec<String>>,
/// Must have `geoprivacy` or `taxon_geoprivacy` fields matching these values
pub obscuration: Option<Vec<String>>,
/// Taxon must have this rank or lower
pub hrank: Option<String>,
/// Taxon must have this rank or higher
pub lrank: Option<String>,
/// Taxon must by within this iconic taxon
pub iconic_taxa: Option<Vec<String>>,
/// Must have an ID above this value
pub id_above: Option<String>,
/// Must have an ID below this value
pub id_below: Option<String>,
/// Identifications must meet these criteria
pub identifications: Option<String>,
/// Must be within a {`radius`} kilometer circle around this lat/lng (*lat, *lng, radius)
pub lat: Option<f64>,
/// Must be within a {`radius`} kilometer circle around this lat/lng (*lat, *lng, radius)
pub lng: Option<f64>,
/// Must be within a {`radius`} kilometer circle around this lat/lng (*lat, *lng, radius)
pub radius: Option<String>,
/// Must be within this bounding box (*nelat, *nelng, *swlat, *swlng)
pub nelat: Option<f64>,
/// Must be within this bounding box (*nelat, *nelng, *swlat, *swlng)
pub nelng: Option<f64>,
/// Must be within this bounding box (*nelat, *nelng, *swlat, *swlng)
pub swlat: Option<f64>,
/// Must be within this bounding box (*nelat, *nelng, *swlat, *swlng)
pub swlng: Option<f64>,
/// Taxon must be in the list with this ID
pub list_id: Option<i32>,
/// Must not be in the project with this ID or slug
pub not_in_project: Option<String>,
/// Must not match the rules of the project with this ID or slug
pub not_matching_project_rules_for: Option<String>,
/// Must included in this observation accuracy experiment
pub observation_accuracy_experiment_id: Option<Vec<i32>>,
/// Search observation properties. Can be combined with `search_on`
pub q: Option<String>,
/// Properties to search on, when combined with `q`. Searches across all properties by default
pub search_on: Option<String>,
/// Must have this quality grade
pub quality_grade: Option<String>,
/// Must be updated since this time
pub updated_since: Option<String>,
/// See `reviewed`
pub viewer_id: Option<String>,
/// Observations have been reviewed by the user with ID equal to the value of the `viewer_id` parameter
pub reviewed: Option<bool>,
}
/// struct for passing parameters to the method [`points_zoom_xy_grid_json_get`]
#[derive(Clone, Debug)]
pub struct PointsZoomXyGridJsonGetParams {
/// Zoom level. Z coordinate in the XYZ tiling scheme
pub zoom: i32,
/// X coordinate in the XYZ tiling scheme. Must be less than 2^zoom
pub x: i32,
/// Y coordinate in the XYZ tiling scheme. Must be less than 2^zoom
pub y: i32,
/// Primary color to use in tile creation. Accepts common colors by string (e.g. `color=blue`), and accepts escaped color HEX codes (e.g. `color=%2386a91c`)
pub color: Option<String>,
/// Whether or not positional accuracy / coordinate uncertainty has been specified
pub acc: Option<bool>,
/// Captive or cultivated observations
pub captive: Option<bool>,
/// Observations whose taxa are endemic to their location
pub endemic: Option<bool>,
/// Observations that are georeferenced
pub geo: Option<bool>,
/// Observations with the deprecated `ID, Please!` flag. Note that this will return observations, but that this attribute is no longer used.
pub id_please: Option<bool>,
/// Observations that have community identifications
pub identified: Option<bool>,
/// Observations whose taxa are introduced in their location
pub introduced: Option<bool>,
/// Observations that show on map tiles
pub mappable: Option<bool>,
/// Observations whose taxa are native to their location
pub native: Option<bool>,
/// Observations whose taxa are outside their known ranges
pub out_of_range: Option<bool>,
/// Observations identified by the curator of a project. If the `project_id` parameter is also specified, this will only consider observations identified by curators of the specified project(s)
pub pcid: Option<bool>,
/// Observations with photos
pub photos: Option<bool>,
/// Observations that have been favorited by at least one user
pub popular: Option<bool>,
/// Observations with sounds
pub sounds: Option<bool>,
/// Observations of active taxon concepts
pub taxon_is_active: Option<bool>,
/// Observations whose taxa are threatened in their location
pub threatened: Option<bool>,
/// Observations with a `quality_grade` of either `needs_id` or `research`. Equivalent to `quality_grade=needs_id,research`
pub verifiable: Option<bool>,
/// License attribute of an observation must not be null
pub licensed: Option<bool>,
/// License attribute of at least one photo of an observation must not be null
pub photo_licensed: Option<bool>,
/// Observation taxon is expected nearby
pub expected_nearby: Option<bool>,
/// Must have this ID
pub id: Option<Vec<String>>,
/// Must not have this ID
pub not_id: Option<Vec<String>>,
/// Observation must have this license
pub license: Option<Vec<String>>,
/// Must have an observation field value with this datatype
pub ofv_datatype: Option<Vec<String>>,
/// Must have at least one photo with this license
pub photo_license: Option<Vec<String>>,
/// Must be observed within the place with this ID
pub place_id: Option<Vec<i32>>,
/// Must be added to the project this ID or slug
pub project_id: Option<Vec<String>>,
/// Taxon must have this rank
pub rank: Option<Vec<String>>,
/// Must be affiliated with the iNaturalist network website with this ID
pub site_id: Option<Vec<String>>,
/// Must have at least one sound with this license
pub sound_license: Option<Vec<String>>,
/// Only show observations of these taxa and their descendants
pub taxon_id: Option<Vec<String>>,
/// Exclude observations of these taxa and their descendants
pub without_taxon_id: Option<Vec<String>>,
/// Taxon must have a scientific or common name matching this string
pub taxon_name: Option<Vec<String>>,
/// User must have this ID or login
pub user_id: Option<Vec<String>>,
/// User must have this login
pub user_login: Option<Vec<String>>,
/// Observations identified by a particular user
pub ident_user_id: Option<i32>,
/// Must be observed within this hour of the day
pub hour: Option<Vec<String>>,
/// Must be observed within this day of the month
pub day: Option<Vec<String>>,
/// Must be observed within this month
pub month: Option<Vec<String>>,
/// Must be observed within this year
pub year: Option<Vec<String>>,
/// Must be created within this day of the month
pub created_day: Option<Vec<String>>,
/// Must be created within this month
pub created_month: Option<Vec<String>>,
/// Must be created within this year
pub created_year: Option<Vec<String>>,
/// Must have an annotation using this controlled term ID
pub term_id: Option<Vec<i32>>,
/// Must have an annotation using this controlled value ID. Must be combined with the `term_id` parameter
pub term_value_id: Option<Vec<i32>>,
/// Exclude observations with annotations using this controlled value ID.
pub without_term_id: Option<i32>,
/// Exclude observations with annotations using this controlled value ID. Must be combined with the `term_id` parameter
pub without_term_value_id: Option<Vec<i32>>,
/// Must be combined with the `term_value_id` or the `without_term_value_id` parameter. Must have an annotation using this controlled term ID and associated term value IDs or be missing this annotation.
pub term_id_or_unknown: Option<Vec<i32>>,
/// Must have an annotation created by this user
pub annotation_user_id: Option<Vec<String>>,
/// Must have a positional accuracy above this value (meters)
pub acc_above: Option<String>,
/// Must have a positional accuracy below this value (meters)
pub acc_below: Option<String>,
/// Positional accuracy must be below this value (in meters) or be unknown
pub acc_below_or_unknown: Option<String>,
/// Must be observed on or after this date
pub d1: Option<String>,
/// Must be observed on or before this date
pub d2: Option<String>,
/// Must be created at or after this time
pub created_d1: Option<String>,
/// Must be created at or before this time
pub created_d2: Option<String>,
/// Must be created on this date
pub created_on: Option<String>,
/// Must be observed on this date
pub observed_on: Option<String>,
/// Must not be of a taxon previously observed by this user
pub unobserved_by_user_id: Option<i32>,
/// Must match the rules of the project with this ID or slug
pub apply_project_rules_for: Option<String>,
/// Taxon must have this conservation status code. If the `place_id` parameter is also specified, this will only consider statuses specific to that place
pub cs: Option<String>,
/// Taxon must have a conservation status from this authority. If the `place_id` parameter is also specified, this will only consider statuses specific to that place
pub csa: Option<String>,
/// Taxon must have this IUCN conservation status. If the `place_id` parameter is also specified, this will only consider statuses specific to that place
pub csi: Option<Vec<String>>,
/// Must have this geoprivacy setting
pub geoprivacy: Option<Vec<String>>,
/// Filter observations by the most conservative geoprivacy applied by a conservation status associated with one of the taxa proposed in the current identifications.
pub taxon_geoprivacy: Option<Vec<String>>,
/// Must have `geoprivacy` or `taxon_geoprivacy` fields matching these values
pub obscuration: Option<Vec<String>>,
/// Taxon must have this rank or lower
pub hrank: Option<String>,
/// Taxon must have this rank or higher
pub lrank: Option<String>,
/// Taxon must by within this iconic taxon
pub iconic_taxa: Option<Vec<String>>,
/// Must have an ID above this value
pub id_above: Option<String>,
/// Must have an ID below this value
pub id_below: Option<String>,
/// Identifications must meet these criteria
pub identifications: Option<String>,
/// Must be within a {`radius`} kilometer circle around this lat/lng (*lat, *lng, radius)
pub lat: Option<f64>,
/// Must be within a {`radius`} kilometer circle around this lat/lng (*lat, *lng, radius)
pub lng: Option<f64>,
/// Must be within a {`radius`} kilometer circle around this lat/lng (*lat, *lng, radius)
pub radius: Option<String>,
/// Must be within this bounding box (*nelat, *nelng, *swlat, *swlng)
pub nelat: Option<f64>,
/// Must be within this bounding box (*nelat, *nelng, *swlat, *swlng)
pub nelng: Option<f64>,
/// Must be within this bounding box (*nelat, *nelng, *swlat, *swlng)
pub swlat: Option<f64>,
/// Must be within this bounding box (*nelat, *nelng, *swlat, *swlng)
pub swlng: Option<f64>,
/// Taxon must be in the list with this ID
pub list_id: Option<i32>,
/// Must not be in the project with this ID or slug
pub not_in_project: Option<String>,
/// Must not match the rules of the project with this ID or slug
pub not_matching_project_rules_for: Option<String>,
/// Must included in this observation accuracy experiment
pub observation_accuracy_experiment_id: Option<Vec<i32>>,
/// Search observation properties. Can be combined with `search_on`
pub q: Option<String>,
/// Properties to search on, when combined with `q`. Searches across all properties by default
pub search_on: Option<String>,
/// Must have this quality grade
pub quality_grade: Option<String>,
/// Must be updated since this time
pub updated_since: Option<String>,
/// See `reviewed`
pub viewer_id: Option<String>,
/// Observations have been reviewed by the user with ID equal to the value of the `viewer_id` parameter
pub reviewed: Option<bool>,
}
/// struct for typed errors of method [`colored_heatmap_zoom_xy_grid_json_get`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ColoredHeatmapZoomXyGridJsonGetError {
DefaultResponse(models::Error),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`grid_zoom_xy_grid_json_get`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GridZoomXyGridJsonGetError {
DefaultResponse(models::Error),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`heatmap_zoom_xy_grid_json_get`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum HeatmapZoomXyGridJsonGetError {
DefaultResponse(models::Error),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`points_zoom_xy_grid_json_get`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PointsZoomXyGridJsonGetError {
DefaultResponse(models::Error),
UnknownValue(serde_json::Value),
}
/// Given zero to many of following parameters, returns a JSON file following the UTFGrid spec, representing observations matching the search criteria
pub async fn colored_heatmap_zoom_xy_grid_json_get(
configuration: &configuration::Configuration,
params: ColoredHeatmapZoomXyGridJsonGetParams,
) -> Result<models::UtfGridResponse, Error<ColoredHeatmapZoomXyGridJsonGetError>> {
let uri_str = format!(
"{}/colored_heatmap/{zoom}/{x}/{y}.grid.json",
configuration.base_path,
zoom = params.zoom,
x = params.x,
y = params.y
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = params.color {
req_builder = req_builder.query(&[("color", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.acc {
req_builder = req_builder.query(&[("acc", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.captive {
req_builder = req_builder.query(&[("captive", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.endemic {
req_builder = req_builder.query(&[("endemic", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.geo {
req_builder = req_builder.query(&[("geo", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.id_please {
req_builder = req_builder.query(&[("id_please", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.identified {
req_builder = req_builder.query(&[("identified", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.introduced {
req_builder = req_builder.query(&[("introduced", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.mappable {
req_builder = req_builder.query(&[("mappable", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.native {
req_builder = req_builder.query(&[("native", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.out_of_range {
req_builder = req_builder.query(&[("out_of_range", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.pcid {
req_builder = req_builder.query(&[("pcid", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.photos {
req_builder = req_builder.query(&[("photos", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.popular {
req_builder = req_builder.query(&[("popular", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.sounds {
req_builder = req_builder.query(&[("sounds", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.taxon_is_active {
req_builder = req_builder.query(&[("taxon_is_active", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.threatened {
req_builder = req_builder.query(&[("threatened", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.verifiable {
req_builder = req_builder.query(&[("verifiable", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.licensed {
req_builder = req_builder.query(&[("licensed", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.photo_licensed {
req_builder = req_builder.query(&[("photo_licensed", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.expected_nearby {
req_builder = req_builder.query(&[("expected_nearby", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.not_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("not_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"not_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.license {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("license".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"license",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.ofv_datatype {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("ofv_datatype".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"ofv_datatype",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.photo_license {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("photo_license".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"photo_license",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.place_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("place_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"place_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.project_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("project_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"project_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.rank {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("rank".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"rank",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.site_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("site_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"site_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.sound_license {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("sound_license".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"sound_license",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.taxon_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("taxon_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"taxon_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.without_taxon_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("without_taxon_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"without_taxon_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.taxon_name {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("taxon_name".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"taxon_name",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.user_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("user_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"user_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.user_login {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("user_login".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"user_login",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.ident_user_id {
req_builder = req_builder.query(&[("ident_user_id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.hour {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("hour".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"hour",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.day {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("day".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"day",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.month {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("month".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"month",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.year {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("year".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"year",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.created_day {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("created_day".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"created_day",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.created_month {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("created_month".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"created_month",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.created_year {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("created_year".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"created_year",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.term_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("term_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"term_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.term_value_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("term_value_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"term_value_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.without_term_id {
req_builder = req_builder.query(&[("without_term_id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.without_term_value_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("without_term_value_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"without_term_value_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.term_id_or_unknown {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("term_id_or_unknown".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"term_id_or_unknown",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.annotation_user_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("annotation_user_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"annotation_user_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.acc_above {
req_builder = req_builder.query(&[("acc_above", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.acc_below {
req_builder = req_builder.query(&[("acc_below", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.acc_below_or_unknown {
req_builder = req_builder.query(&[("acc_below_or_unknown", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.d1 {
req_builder = req_builder.query(&[("d1", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.d2 {
req_builder = req_builder.query(&[("d2", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.created_d1 {
req_builder = req_builder.query(&[("created_d1", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.created_d2 {
req_builder = req_builder.query(&[("created_d2", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.created_on {
req_builder = req_builder.query(&[("created_on", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observed_on {
req_builder = req_builder.query(&[("observed_on", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.unobserved_by_user_id {
req_builder = req_builder.query(&[("unobserved_by_user_id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.apply_project_rules_for {
req_builder = req_builder.query(&[("apply_project_rules_for", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.cs {
req_builder = req_builder.query(&[("cs", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.csa {
req_builder = req_builder.query(&[("csa", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.csi {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("csi".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"csi",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.geoprivacy {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("geoprivacy".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"geoprivacy",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.taxon_geoprivacy {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("taxon_geoprivacy".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"taxon_geoprivacy",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.obscuration {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("obscuration".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"obscuration",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.hrank {
req_builder = req_builder.query(&[("hrank", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.lrank {
req_builder = req_builder.query(&[("lrank", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.iconic_taxa {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("iconic_taxa".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"iconic_taxa",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.id_above {
req_builder = req_builder.query(&[("id_above", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.id_below {
req_builder = req_builder.query(&[("id_below", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.identifications {
req_builder = req_builder.query(&[("identifications", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.lat {
req_builder = req_builder.query(&[("lat", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.lng {
req_builder = req_builder.query(&[("lng", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.radius {
req_builder = req_builder.query(&[("radius", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.nelat {
req_builder = req_builder.query(&[("nelat", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.nelng {
req_builder = req_builder.query(&[("nelng", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.swlat {
req_builder = req_builder.query(&[("swlat", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.swlng {
req_builder = req_builder.query(&[("swlng", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.list_id {
req_builder = req_builder.query(&[("list_id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.not_in_project {
req_builder = req_builder.query(&[("not_in_project", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.not_matching_project_rules_for {
req_builder =
req_builder.query(&[("not_matching_project_rules_for", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observation_accuracy_experiment_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| {
(
"observation_accuracy_experiment_id".to_owned(),
p.to_string(),
)
})
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"observation_accuracy_experiment_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.q {
req_builder = req_builder.query(&[("q", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.search_on {
req_builder = req_builder.query(&[("search_on", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.quality_grade {
req_builder = req_builder.query(&[("quality_grade", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.updated_since {
req_builder = req_builder.query(&[("updated_since", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.viewer_id {
req_builder = req_builder.query(&[("viewer_id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.reviewed {
req_builder = req_builder.query(&[("reviewed", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UtfGridResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UtfGridResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ColoredHeatmapZoomXyGridJsonGetError> =
serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
/// Given zero to many of following parameters, returns a JSON file following the UTFGrid spec, representing observations matching the search criteria
pub async fn grid_zoom_xy_grid_json_get(
configuration: &configuration::Configuration,
params: GridZoomXyGridJsonGetParams,
) -> Result<models::UtfGridResponse, Error<GridZoomXyGridJsonGetError>> {
let uri_str = format!(
"{}/grid/{zoom}/{x}/{y}.grid.json",
configuration.base_path,
zoom = params.zoom,
x = params.x,
y = params.y
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = params.color {
req_builder = req_builder.query(&[("color", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.acc {
req_builder = req_builder.query(&[("acc", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.captive {
req_builder = req_builder.query(&[("captive", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.endemic {
req_builder = req_builder.query(&[("endemic", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.geo {
req_builder = req_builder.query(&[("geo", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.id_please {
req_builder = req_builder.query(&[("id_please", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.identified {
req_builder = req_builder.query(&[("identified", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.introduced {
req_builder = req_builder.query(&[("introduced", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.mappable {
req_builder = req_builder.query(&[("mappable", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.native {
req_builder = req_builder.query(&[("native", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.out_of_range {
req_builder = req_builder.query(&[("out_of_range", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.pcid {
req_builder = req_builder.query(&[("pcid", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.photos {
req_builder = req_builder.query(&[("photos", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.popular {
req_builder = req_builder.query(&[("popular", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.sounds {
req_builder = req_builder.query(&[("sounds", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.taxon_is_active {
req_builder = req_builder.query(&[("taxon_is_active", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.threatened {
req_builder = req_builder.query(&[("threatened", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.verifiable {
req_builder = req_builder.query(&[("verifiable", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.licensed {
req_builder = req_builder.query(&[("licensed", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.photo_licensed {
req_builder = req_builder.query(&[("photo_licensed", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.expected_nearby {
req_builder = req_builder.query(&[("expected_nearby", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.not_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("not_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"not_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.license {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("license".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"license",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.ofv_datatype {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("ofv_datatype".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"ofv_datatype",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.photo_license {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("photo_license".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"photo_license",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.place_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("place_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"place_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.project_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("project_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"project_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.rank {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("rank".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"rank",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.site_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("site_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"site_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.sound_license {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("sound_license".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"sound_license",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.taxon_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("taxon_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"taxon_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.without_taxon_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("without_taxon_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"without_taxon_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.taxon_name {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("taxon_name".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"taxon_name",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.user_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("user_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"user_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.user_login {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("user_login".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"user_login",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.ident_user_id {
req_builder = req_builder.query(&[("ident_user_id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.hour {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("hour".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"hour",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.day {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("day".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"day",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.month {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("month".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"month",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.year {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("year".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"year",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.created_day {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("created_day".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"created_day",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.created_month {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("created_month".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"created_month",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.created_year {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("created_year".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"created_year",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.term_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("term_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"term_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.term_value_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("term_value_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"term_value_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.without_term_id {
req_builder = req_builder.query(&[("without_term_id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.without_term_value_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("without_term_value_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"without_term_value_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.term_id_or_unknown {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("term_id_or_unknown".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"term_id_or_unknown",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.annotation_user_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("annotation_user_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"annotation_user_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.acc_above {
req_builder = req_builder.query(&[("acc_above", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.acc_below {
req_builder = req_builder.query(&[("acc_below", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.acc_below_or_unknown {
req_builder = req_builder.query(&[("acc_below_or_unknown", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.d1 {
req_builder = req_builder.query(&[("d1", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.d2 {
req_builder = req_builder.query(&[("d2", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.created_d1 {
req_builder = req_builder.query(&[("created_d1", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.created_d2 {
req_builder = req_builder.query(&[("created_d2", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.created_on {
req_builder = req_builder.query(&[("created_on", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observed_on {
req_builder = req_builder.query(&[("observed_on", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.unobserved_by_user_id {
req_builder = req_builder.query(&[("unobserved_by_user_id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.apply_project_rules_for {
req_builder = req_builder.query(&[("apply_project_rules_for", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.cs {
req_builder = req_builder.query(&[("cs", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.csa {
req_builder = req_builder.query(&[("csa", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.csi {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("csi".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"csi",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.geoprivacy {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("geoprivacy".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"geoprivacy",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.taxon_geoprivacy {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("taxon_geoprivacy".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"taxon_geoprivacy",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.obscuration {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("obscuration".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"obscuration",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.hrank {
req_builder = req_builder.query(&[("hrank", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.lrank {
req_builder = req_builder.query(&[("lrank", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.iconic_taxa {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("iconic_taxa".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"iconic_taxa",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.id_above {
req_builder = req_builder.query(&[("id_above", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.id_below {
req_builder = req_builder.query(&[("id_below", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.identifications {
req_builder = req_builder.query(&[("identifications", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.lat {
req_builder = req_builder.query(&[("lat", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.lng {
req_builder = req_builder.query(&[("lng", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.radius {
req_builder = req_builder.query(&[("radius", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.nelat {
req_builder = req_builder.query(&[("nelat", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.nelng {
req_builder = req_builder.query(&[("nelng", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.swlat {
req_builder = req_builder.query(&[("swlat", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.swlng {
req_builder = req_builder.query(&[("swlng", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.list_id {
req_builder = req_builder.query(&[("list_id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.not_in_project {
req_builder = req_builder.query(&[("not_in_project", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.not_matching_project_rules_for {
req_builder =
req_builder.query(&[("not_matching_project_rules_for", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observation_accuracy_experiment_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| {
(
"observation_accuracy_experiment_id".to_owned(),
p.to_string(),
)
})
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"observation_accuracy_experiment_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.q {
req_builder = req_builder.query(&[("q", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.search_on {
req_builder = req_builder.query(&[("search_on", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.quality_grade {
req_builder = req_builder.query(&[("quality_grade", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.updated_since {
req_builder = req_builder.query(&[("updated_since", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.viewer_id {
req_builder = req_builder.query(&[("viewer_id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.reviewed {
req_builder = req_builder.query(&[("reviewed", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UtfGridResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UtfGridResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GridZoomXyGridJsonGetError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
/// Given zero to many of following parameters, returns a JSON file following the UTFGrid spec, representing observations matching the search criteria
pub async fn heatmap_zoom_xy_grid_json_get(
configuration: &configuration::Configuration,
params: HeatmapZoomXyGridJsonGetParams,
) -> Result<models::UtfGridResponse, Error<HeatmapZoomXyGridJsonGetError>> {
let uri_str = format!(
"{}/heatmap/{zoom}/{x}/{y}.grid.json",
configuration.base_path,
zoom = params.zoom,
x = params.x,
y = params.y
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = params.color {
req_builder = req_builder.query(&[("color", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.acc {
req_builder = req_builder.query(&[("acc", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.captive {
req_builder = req_builder.query(&[("captive", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.endemic {
req_builder = req_builder.query(&[("endemic", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.geo {
req_builder = req_builder.query(&[("geo", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.id_please {
req_builder = req_builder.query(&[("id_please", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.identified {
req_builder = req_builder.query(&[("identified", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.introduced {
req_builder = req_builder.query(&[("introduced", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.mappable {
req_builder = req_builder.query(&[("mappable", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.native {
req_builder = req_builder.query(&[("native", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.out_of_range {
req_builder = req_builder.query(&[("out_of_range", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.pcid {
req_builder = req_builder.query(&[("pcid", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.photos {
req_builder = req_builder.query(&[("photos", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.popular {
req_builder = req_builder.query(&[("popular", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.sounds {
req_builder = req_builder.query(&[("sounds", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.taxon_is_active {
req_builder = req_builder.query(&[("taxon_is_active", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.threatened {
req_builder = req_builder.query(&[("threatened", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.verifiable {
req_builder = req_builder.query(&[("verifiable", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.licensed {
req_builder = req_builder.query(&[("licensed", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.photo_licensed {
req_builder = req_builder.query(&[("photo_licensed", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.expected_nearby {
req_builder = req_builder.query(&[("expected_nearby", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.not_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("not_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"not_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.license {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("license".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"license",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.ofv_datatype {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("ofv_datatype".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"ofv_datatype",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.photo_license {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("photo_license".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"photo_license",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.place_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("place_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"place_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.project_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("project_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"project_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.rank {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("rank".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"rank",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.site_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("site_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"site_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.sound_license {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("sound_license".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"sound_license",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.taxon_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("taxon_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"taxon_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.without_taxon_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("without_taxon_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"without_taxon_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.taxon_name {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("taxon_name".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"taxon_name",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.user_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("user_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"user_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.user_login {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("user_login".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"user_login",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.ident_user_id {
req_builder = req_builder.query(&[("ident_user_id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.hour {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("hour".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"hour",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.day {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("day".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"day",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.month {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("month".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"month",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.year {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("year".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"year",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.created_day {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("created_day".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"created_day",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.created_month {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("created_month".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"created_month",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.created_year {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("created_year".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"created_year",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.term_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("term_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"term_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.term_value_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("term_value_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"term_value_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.without_term_id {
req_builder = req_builder.query(&[("without_term_id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.without_term_value_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("without_term_value_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"without_term_value_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.term_id_or_unknown {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("term_id_or_unknown".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"term_id_or_unknown",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.annotation_user_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("annotation_user_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"annotation_user_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.acc_above {
req_builder = req_builder.query(&[("acc_above", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.acc_below {
req_builder = req_builder.query(&[("acc_below", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.acc_below_or_unknown {
req_builder = req_builder.query(&[("acc_below_or_unknown", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.d1 {
req_builder = req_builder.query(&[("d1", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.d2 {
req_builder = req_builder.query(&[("d2", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.created_d1 {
req_builder = req_builder.query(&[("created_d1", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.created_d2 {
req_builder = req_builder.query(&[("created_d2", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.created_on {
req_builder = req_builder.query(&[("created_on", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observed_on {
req_builder = req_builder.query(&[("observed_on", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.unobserved_by_user_id {
req_builder = req_builder.query(&[("unobserved_by_user_id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.apply_project_rules_for {
req_builder = req_builder.query(&[("apply_project_rules_for", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.cs {
req_builder = req_builder.query(&[("cs", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.csa {
req_builder = req_builder.query(&[("csa", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.csi {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("csi".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"csi",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.geoprivacy {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("geoprivacy".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"geoprivacy",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.taxon_geoprivacy {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("taxon_geoprivacy".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"taxon_geoprivacy",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.obscuration {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("obscuration".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"obscuration",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.hrank {
req_builder = req_builder.query(&[("hrank", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.lrank {
req_builder = req_builder.query(&[("lrank", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.iconic_taxa {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("iconic_taxa".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"iconic_taxa",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.id_above {
req_builder = req_builder.query(&[("id_above", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.id_below {
req_builder = req_builder.query(&[("id_below", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.identifications {
req_builder = req_builder.query(&[("identifications", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.lat {
req_builder = req_builder.query(&[("lat", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.lng {
req_builder = req_builder.query(&[("lng", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.radius {
req_builder = req_builder.query(&[("radius", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.nelat {
req_builder = req_builder.query(&[("nelat", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.nelng {
req_builder = req_builder.query(&[("nelng", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.swlat {
req_builder = req_builder.query(&[("swlat", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.swlng {
req_builder = req_builder.query(&[("swlng", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.list_id {
req_builder = req_builder.query(&[("list_id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.not_in_project {
req_builder = req_builder.query(&[("not_in_project", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.not_matching_project_rules_for {
req_builder =
req_builder.query(&[("not_matching_project_rules_for", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observation_accuracy_experiment_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| {
(
"observation_accuracy_experiment_id".to_owned(),
p.to_string(),
)
})
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"observation_accuracy_experiment_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.q {
req_builder = req_builder.query(&[("q", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.search_on {
req_builder = req_builder.query(&[("search_on", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.quality_grade {
req_builder = req_builder.query(&[("quality_grade", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.updated_since {
req_builder = req_builder.query(&[("updated_since", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.viewer_id {
req_builder = req_builder.query(&[("viewer_id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.reviewed {
req_builder = req_builder.query(&[("reviewed", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UtfGridResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UtfGridResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<HeatmapZoomXyGridJsonGetError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
/// Given zero to many of following parameters, returns a JSON file following the UTFGrid spec, representing observations matching the search criteria
pub async fn points_zoom_xy_grid_json_get(
configuration: &configuration::Configuration,
params: PointsZoomXyGridJsonGetParams,
) -> Result<models::UtfGridResponse, Error<PointsZoomXyGridJsonGetError>> {
let uri_str = format!(
"{}/points/{zoom}/{x}/{y}.grid.json",
configuration.base_path,
zoom = params.zoom,
x = params.x,
y = params.y
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = params.color {
req_builder = req_builder.query(&[("color", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.acc {
req_builder = req_builder.query(&[("acc", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.captive {
req_builder = req_builder.query(&[("captive", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.endemic {
req_builder = req_builder.query(&[("endemic", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.geo {
req_builder = req_builder.query(&[("geo", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.id_please {
req_builder = req_builder.query(&[("id_please", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.identified {
req_builder = req_builder.query(&[("identified", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.introduced {
req_builder = req_builder.query(&[("introduced", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.mappable {
req_builder = req_builder.query(&[("mappable", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.native {
req_builder = req_builder.query(&[("native", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.out_of_range {
req_builder = req_builder.query(&[("out_of_range", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.pcid {
req_builder = req_builder.query(&[("pcid", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.photos {
req_builder = req_builder.query(&[("photos", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.popular {
req_builder = req_builder.query(&[("popular", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.sounds {
req_builder = req_builder.query(&[("sounds", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.taxon_is_active {
req_builder = req_builder.query(&[("taxon_is_active", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.threatened {
req_builder = req_builder.query(&[("threatened", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.verifiable {
req_builder = req_builder.query(&[("verifiable", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.licensed {
req_builder = req_builder.query(&[("licensed", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.photo_licensed {
req_builder = req_builder.query(&[("photo_licensed", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.expected_nearby {
req_builder = req_builder.query(&[("expected_nearby", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.not_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("not_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"not_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.license {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("license".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"license",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.ofv_datatype {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("ofv_datatype".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"ofv_datatype",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.photo_license {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("photo_license".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"photo_license",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.place_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("place_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"place_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.project_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("project_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"project_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.rank {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("rank".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"rank",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.site_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("site_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"site_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.sound_license {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("sound_license".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"sound_license",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.taxon_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("taxon_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"taxon_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.without_taxon_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("without_taxon_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"without_taxon_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.taxon_name {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("taxon_name".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"taxon_name",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.user_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("user_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"user_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.user_login {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("user_login".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"user_login",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.ident_user_id {
req_builder = req_builder.query(&[("ident_user_id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.hour {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("hour".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"hour",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.day {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("day".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"day",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.month {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("month".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"month",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.year {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("year".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"year",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.created_day {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("created_day".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"created_day",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.created_month {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("created_month".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"created_month",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.created_year {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("created_year".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"created_year",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.term_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("term_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"term_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.term_value_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("term_value_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"term_value_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.without_term_id {
req_builder = req_builder.query(&[("without_term_id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.without_term_value_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("without_term_value_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"without_term_value_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.term_id_or_unknown {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("term_id_or_unknown".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"term_id_or_unknown",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.annotation_user_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("annotation_user_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"annotation_user_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.acc_above {
req_builder = req_builder.query(&[("acc_above", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.acc_below {
req_builder = req_builder.query(&[("acc_below", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.acc_below_or_unknown {
req_builder = req_builder.query(&[("acc_below_or_unknown", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.d1 {
req_builder = req_builder.query(&[("d1", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.d2 {
req_builder = req_builder.query(&[("d2", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.created_d1 {
req_builder = req_builder.query(&[("created_d1", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.created_d2 {
req_builder = req_builder.query(&[("created_d2", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.created_on {
req_builder = req_builder.query(&[("created_on", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observed_on {
req_builder = req_builder.query(&[("observed_on", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.unobserved_by_user_id {
req_builder = req_builder.query(&[("unobserved_by_user_id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.apply_project_rules_for {
req_builder = req_builder.query(&[("apply_project_rules_for", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.cs {
req_builder = req_builder.query(&[("cs", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.csa {
req_builder = req_builder.query(&[("csa", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.csi {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("csi".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"csi",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.geoprivacy {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("geoprivacy".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"geoprivacy",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.taxon_geoprivacy {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("taxon_geoprivacy".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"taxon_geoprivacy",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.obscuration {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("obscuration".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"obscuration",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.hrank {
req_builder = req_builder.query(&[("hrank", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.lrank {
req_builder = req_builder.query(&[("lrank", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.iconic_taxa {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("iconic_taxa".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"iconic_taxa",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.id_above {
req_builder = req_builder.query(&[("id_above", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.id_below {
req_builder = req_builder.query(&[("id_below", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.identifications {
req_builder = req_builder.query(&[("identifications", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.lat {
req_builder = req_builder.query(&[("lat", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.lng {
req_builder = req_builder.query(&[("lng", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.radius {
req_builder = req_builder.query(&[("radius", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.nelat {
req_builder = req_builder.query(&[("nelat", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.nelng {
req_builder = req_builder.query(&[("nelng", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.swlat {
req_builder = req_builder.query(&[("swlat", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.swlng {
req_builder = req_builder.query(&[("swlng", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.list_id {
req_builder = req_builder.query(&[("list_id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.not_in_project {
req_builder = req_builder.query(&[("not_in_project", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.not_matching_project_rules_for {
req_builder =
req_builder.query(&[("not_matching_project_rules_for", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observation_accuracy_experiment_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| {
(
"observation_accuracy_experiment_id".to_owned(),
p.to_string(),
)
})
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"observation_accuracy_experiment_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.q {
req_builder = req_builder.query(&[("q", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.search_on {
req_builder = req_builder.query(&[("search_on", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.quality_grade {
req_builder = req_builder.query(&[("quality_grade", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.updated_since {
req_builder = req_builder.query(&[("updated_since", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.viewer_id {
req_builder = req_builder.query(&[("viewer_id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.reviewed {
req_builder = req_builder.query(&[("reviewed", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UtfGridResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UtfGridResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PointsZoomXyGridJsonGetError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}