/*
* 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 [`identifications_categories_get`]
#[derive(Clone, Debug)]
pub struct IdentificationsCategoriesGetParams {
/// ID's taxon is the same it's observation's taxon
pub current_taxon: Option<bool>,
/// ID was added by the observer
pub own_observation: Option<bool>,
/// ID was created as a results of a taxon change
pub is_change: Option<bool>,
/// ID's taxon is currently an active taxon
pub taxon_active: Option<bool>,
/// Observation's taxon is currently an active taxon
pub observation_taxon_active: Option<bool>,
/// Identification ID
pub id: Option<Vec<i32>>,
/// ID's taxon must have this rank
pub rank: Option<Vec<String>>,
/// Observation's taxon must have this rank
pub observation_rank: Option<Vec<String>>,
/// Identifier must have this user ID
pub user_id: Option<Vec<i32>>,
/// Identifier must have this login
pub user_login: Option<Vec<String>>,
/// Most recent ID on a observation by a user
pub current: Option<bool>,
/// Type of identification
pub category: Option<Vec<String>>,
/// Observation must occur in this place
pub place_id: Option<Vec<String>>,
/// Observation must have this quality grade
pub quality_grade: Option<Vec<String>>,
/// Only return identifications that were created as part of the specified taxon change
pub taxon_change_id: Option<Vec<String>>,
/// ID taxa must match the given taxa or their descendants
pub taxon_id: Option<Vec<String>>,
/// Observation taxa must match the given taxa or their descendants
pub observation_taxon_id: Option<Vec<String>>,
/// ID iconic taxon ID
pub iconic_taxon_id: Option<Vec<String>>,
/// Observation iconic taxon ID
pub observation_iconic_taxon_id: Option<Vec<String>>,
/// ID taxon must have this rank or higher
pub lrank: Option<String>,
/// ID taxon must have this rank or lower
pub hrank: Option<String>,
/// Observation taxon must have this rank or higher
pub observation_lrank: Option<String>,
/// Observation taxon must have this rank or lower
pub observation_hrank: Option<String>,
/// Exclude IDs of these taxa and their descendants
pub without_taxon_id: Option<Vec<String>>,
/// Exclude IDs of observations of these taxa and their descendants
pub without_observation_taxon_id: Option<Vec<String>>,
/// ID created on or after this time
pub d1: Option<String>,
/// ID created on or before this time
pub d2: Option<String>,
/// Observation created on or after this date
pub observation_created_d1: Option<String>,
/// Observation created on or before this date
pub observation_created_d2: Option<String>,
/// Observation observed on or after this date
pub observed_d1: Option<String>,
/// Observation observed on or before this date
pub observed_d2: Option<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>,
/// Pagination `page` number
pub page: Option<String>,
/// Number of results to return in a `page`. The maximum value is generally 200 unless otherwise noted
pub per_page: Option<String>,
/// Sort order
pub order: Option<String>,
/// Sort field
pub order_by: Option<String>,
/// Return only the record IDs
pub only_id: Option<bool>,
}
/// struct for passing parameters to the method [`identifications_get`]
#[derive(Clone, Debug)]
pub struct IdentificationsGetParams {
/// ID's taxon is the same it's observation's taxon
pub current_taxon: Option<bool>,
/// ID was added by the observer
pub own_observation: Option<bool>,
/// ID was created as a results of a taxon change
pub is_change: Option<bool>,
/// ID's taxon is currently an active taxon
pub taxon_active: Option<bool>,
/// Observation's taxon is currently an active taxon
pub observation_taxon_active: Option<bool>,
/// Identification ID
pub id: Option<Vec<i32>>,
/// ID's taxon must have this rank
pub rank: Option<Vec<String>>,
/// Observation's taxon must have this rank
pub observation_rank: Option<Vec<String>>,
/// Identifier must have this user ID
pub user_id: Option<Vec<i32>>,
/// Identifier must have this login
pub user_login: Option<Vec<String>>,
/// Most recent ID on a observation by a user
pub current: Option<bool>,
/// Type of identification
pub category: Option<Vec<String>>,
/// Observation must occur in this place
pub place_id: Option<Vec<String>>,
/// Observation must have this quality grade
pub quality_grade: Option<Vec<String>>,
/// Only return identifications that were created as part of the specified taxon change
pub taxon_change_id: Option<Vec<String>>,
/// ID taxa must match the given taxa or their descendants
pub taxon_id: Option<Vec<String>>,
/// Observation taxa must match the given taxa or their descendants
pub observation_taxon_id: Option<Vec<String>>,
/// ID iconic taxon ID
pub iconic_taxon_id: Option<Vec<String>>,
/// Observation iconic taxon ID
pub observation_iconic_taxon_id: Option<Vec<String>>,
/// ID taxon must have this rank or higher
pub lrank: Option<String>,
/// ID taxon must have this rank or lower
pub hrank: Option<String>,
/// Observation taxon must have this rank or higher
pub observation_lrank: Option<String>,
/// Observation taxon must have this rank or lower
pub observation_hrank: Option<String>,
/// Exclude IDs of these taxa and their descendants
pub without_taxon_id: Option<Vec<String>>,
/// Exclude IDs of observations of these taxa and their descendants
pub without_observation_taxon_id: Option<Vec<String>>,
/// ID created on or after this time
pub d1: Option<String>,
/// ID created on or before this time
pub d2: Option<String>,
/// Observation created on or after this date
pub observation_created_d1: Option<String>,
/// Observation created on or before this date
pub observation_created_d2: Option<String>,
/// Observation observed on or after this date
pub observed_d1: Option<String>,
/// Observation observed on or before this date
pub observed_d2: Option<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>,
/// Pagination `page` number
pub page: Option<String>,
/// Number of results to return in a `page`. The maximum value is generally 200 unless otherwise noted
pub per_page: Option<String>,
/// Sort order
pub order: Option<String>,
/// Sort field
pub order_by: Option<String>,
/// Return only the record IDs
pub only_id: Option<bool>,
}
/// struct for passing parameters to the method [`identifications_id_delete`]
#[derive(Clone, Debug)]
pub struct IdentificationsIdDeleteParams {
/// ID of the record
pub id: i32,
}
/// struct for passing parameters to the method [`identifications_id_get`]
#[derive(Clone, Debug)]
pub struct IdentificationsIdGetParams {
/// Must have this ID
pub id: Vec<i32>,
}
/// struct for passing parameters to the method [`identifications_id_put`]
#[derive(Clone, Debug)]
pub struct IdentificationsIdPutParams {
/// ID of the record
pub id: i32,
/// Identification object
pub body: Option<models::PostIdentification>,
}
/// struct for passing parameters to the method [`identifications_identifiers_get`]
#[derive(Clone, Debug)]
pub struct IdentificationsIdentifiersGetParams {
/// ID's taxon is the same it's observation's taxon
pub current_taxon: Option<bool>,
/// ID was added by the observer
pub own_observation: Option<bool>,
/// ID was created as a results of a taxon change
pub is_change: Option<bool>,
/// ID's taxon is currently an active taxon
pub taxon_active: Option<bool>,
/// Observation's taxon is currently an active taxon
pub observation_taxon_active: Option<bool>,
/// Identification ID
pub id: Option<Vec<i32>>,
/// ID's taxon must have this rank
pub rank: Option<Vec<String>>,
/// Observation's taxon must have this rank
pub observation_rank: Option<Vec<String>>,
/// Identifier must have this user ID
pub user_id: Option<Vec<i32>>,
/// Identifier must have this login
pub user_login: Option<Vec<String>>,
/// Most recent ID on a observation by a user
pub current: Option<bool>,
/// Type of identification
pub category: Option<Vec<String>>,
/// Observation must occur in this place
pub place_id: Option<Vec<String>>,
/// Observation must have this quality grade
pub quality_grade: Option<Vec<String>>,
/// Only return identifications that were created as part of the specified taxon change
pub taxon_change_id: Option<Vec<String>>,
/// ID taxa must match the given taxa or their descendants
pub taxon_id: Option<Vec<String>>,
/// Observation taxa must match the given taxa or their descendants
pub observation_taxon_id: Option<Vec<String>>,
/// ID iconic taxon ID
pub iconic_taxon_id: Option<Vec<String>>,
/// Observation iconic taxon ID
pub observation_iconic_taxon_id: Option<Vec<String>>,
/// ID taxon must have this rank or higher
pub lrank: Option<String>,
/// ID taxon must have this rank or lower
pub hrank: Option<String>,
/// Observation taxon must have this rank or higher
pub observation_lrank: Option<String>,
/// Observation taxon must have this rank or lower
pub observation_hrank: Option<String>,
/// Exclude IDs of these taxa and their descendants
pub without_taxon_id: Option<Vec<String>>,
/// Exclude IDs of observations of these taxa and their descendants
pub without_observation_taxon_id: Option<Vec<String>>,
/// ID created on or after this time
pub d1: Option<String>,
/// ID created on or before this time
pub d2: Option<String>,
/// Observation created on or after this date
pub observation_created_d1: Option<String>,
/// Observation created on or before this date
pub observation_created_d2: Option<String>,
/// Observation observed on or after this date
pub observed_d1: Option<String>,
/// Observation observed on or before this date
pub observed_d2: Option<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>,
/// Pagination `page` number
pub page: Option<String>,
/// Number of results to return in a `page`. The maximum value is generally 200 unless otherwise noted
pub per_page: Option<String>,
/// Sort order
pub order: Option<String>,
/// Sort field
pub order_by: Option<String>,
/// Return only the record IDs
pub only_id: Option<bool>,
}
/// struct for passing parameters to the method [`identifications_observers_get`]
#[derive(Clone, Debug)]
pub struct IdentificationsObserversGetParams {
/// ID's taxon is the same it's observation's taxon
pub current_taxon: Option<bool>,
/// ID was added by the observer
pub own_observation: Option<bool>,
/// ID was created as a results of a taxon change
pub is_change: Option<bool>,
/// ID's taxon is currently an active taxon
pub taxon_active: Option<bool>,
/// Observation's taxon is currently an active taxon
pub observation_taxon_active: Option<bool>,
/// Identification ID
pub id: Option<Vec<i32>>,
/// ID's taxon must have this rank
pub rank: Option<Vec<String>>,
/// Observation's taxon must have this rank
pub observation_rank: Option<Vec<String>>,
/// Identifier must have this user ID
pub user_id: Option<Vec<i32>>,
/// Identifier must have this login
pub user_login: Option<Vec<String>>,
/// Most recent ID on a observation by a user
pub current: Option<bool>,
/// Type of identification
pub category: Option<Vec<String>>,
/// Observation must occur in this place
pub place_id: Option<Vec<String>>,
/// Observation must have this quality grade
pub quality_grade: Option<Vec<String>>,
/// Only return identifications that were created as part of the specified taxon change
pub taxon_change_id: Option<Vec<String>>,
/// ID taxa must match the given taxa or their descendants
pub taxon_id: Option<Vec<String>>,
/// Observation taxa must match the given taxa or their descendants
pub observation_taxon_id: Option<Vec<String>>,
/// ID iconic taxon ID
pub iconic_taxon_id: Option<Vec<String>>,
/// Observation iconic taxon ID
pub observation_iconic_taxon_id: Option<Vec<String>>,
/// ID taxon must have this rank or higher
pub lrank: Option<String>,
/// ID taxon must have this rank or lower
pub hrank: Option<String>,
/// Observation taxon must have this rank or higher
pub observation_lrank: Option<String>,
/// Observation taxon must have this rank or lower
pub observation_hrank: Option<String>,
/// Exclude IDs of these taxa and their descendants
pub without_taxon_id: Option<Vec<String>>,
/// Exclude IDs of observations of these taxa and their descendants
pub without_observation_taxon_id: Option<Vec<String>>,
/// ID created on or after this time
pub d1: Option<String>,
/// ID created on or before this time
pub d2: Option<String>,
/// Observation created on or after this date
pub observation_created_d1: Option<String>,
/// Observation created on or before this date
pub observation_created_d2: Option<String>,
/// Observation observed on or after this date
pub observed_d1: Option<String>,
/// Observation observed on or before this date
pub observed_d2: Option<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>,
/// Pagination `page` number
pub page: Option<String>,
/// Number of results to return in a `page`. The maximum value is generally 200 unless otherwise noted
pub per_page: Option<String>,
/// Sort order
pub order: Option<String>,
/// Sort field
pub order_by: Option<String>,
/// Return only the record IDs
pub only_id: Option<bool>,
}
/// struct for passing parameters to the method [`identifications_post`]
#[derive(Clone, Debug)]
pub struct IdentificationsPostParams {
/// Identification object
pub body: Option<models::PostIdentification>,
}
/// struct for passing parameters to the method [`identifications_recent_taxa_get`]
#[derive(Clone, Debug)]
pub struct IdentificationsRecentTaxaGetParams {
/// ID's taxon is the same it's observation's taxon
pub current_taxon: Option<bool>,
/// ID was added by the observer
pub own_observation: Option<bool>,
/// ID was created as a results of a taxon change
pub is_change: Option<bool>,
/// ID's taxon is currently an active taxon
pub taxon_active: Option<bool>,
/// Observation's taxon is currently an active taxon
pub observation_taxon_active: Option<bool>,
/// Identification ID
pub id: Option<Vec<i32>>,
/// ID's taxon must have this rank
pub rank: Option<Vec<String>>,
/// Observation's taxon must have this rank
pub observation_rank: Option<Vec<String>>,
/// Identifier must have this user ID
pub user_id: Option<Vec<i32>>,
/// Identifier must have this login
pub user_login: Option<Vec<String>>,
/// Most recent ID on a observation by a user
pub current: Option<bool>,
/// Type of identification
pub category: Option<Vec<String>>,
/// Observation must occur in this place
pub place_id: Option<Vec<String>>,
/// Observation must have this quality grade
pub quality_grade: Option<Vec<String>>,
/// Only return identifications that were created as part of the specified taxon change
pub taxon_change_id: Option<Vec<String>>,
/// ID taxa must match the given taxa or their descendants
pub taxon_id: Option<Vec<String>>,
/// Observation taxa must match the given taxa or their descendants
pub observation_taxon_id: Option<Vec<String>>,
/// ID iconic taxon ID
pub iconic_taxon_id: Option<Vec<String>>,
/// Observation iconic taxon ID
pub observation_iconic_taxon_id: Option<Vec<String>>,
/// ID taxon must have this rank or higher
pub lrank: Option<String>,
/// ID taxon must have this rank or lower
pub hrank: Option<String>,
/// Observation taxon must have this rank or higher
pub observation_lrank: Option<String>,
/// Observation taxon must have this rank or lower
pub observation_hrank: Option<String>,
/// Exclude IDs of these taxa and their descendants
pub without_taxon_id: Option<Vec<String>>,
/// Exclude IDs of observations of these taxa and their descendants
pub without_observation_taxon_id: Option<Vec<String>>,
/// ID created on or after this time
pub d1: Option<String>,
/// ID created on or before this time
pub d2: Option<String>,
/// Observation created on or after this date
pub observation_created_d1: Option<String>,
/// Observation created on or before this date
pub observation_created_d2: Option<String>,
/// Observation observed on or after this date
pub observed_d1: Option<String>,
/// Observation observed on or before this date
pub observed_d2: Option<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>,
/// Pagination `page` number
pub page: Option<String>,
/// Number of results to return in a `page`. The maximum value is generally 200 unless otherwise noted
pub per_page: Option<String>,
/// Sort order
pub order: Option<String>,
/// Sort field
pub order_by: Option<String>,
/// Return only the record IDs
pub only_id: Option<bool>,
}
/// struct for passing parameters to the method [`identifications_similar_species_get`]
#[derive(Clone, Debug)]
pub struct IdentificationsSimilarSpeciesGetParams {
/// Only show observations of these taxa and their descendants
pub taxon_id: i32,
/// 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>>,
/// 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>>,
/// Must be voted as not accurately depicting an organism or scene
pub fails_dqa_accurate: Option<bool>,
/// Must be voted as not having an accurate date
pub fails_dqa_date: Option<bool>,
/// Must be voted as not evidence of an organism
pub fails_dqa_evidence: Option<bool>,
/// Must be voted as not having an accurate location
pub fails_dqa_location: Option<bool>,
/// Must be voted as the community ID cannot be improved
pub fails_dqa_needs_id: Option<bool>,
/// Must be voted as not recent evidence of an organism
pub fails_dqa_recent: Option<bool>,
/// Must be voted as not having evidence related to a single subject
pub fails_dqa_subject: Option<bool>,
/// Must be voted as not wild
pub fails_dqa_wild: Option<bool>,
/// 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 [`identifications_species_counts_get`]
#[derive(Clone, Debug)]
pub struct IdentificationsSpeciesCountsGetParams {
/// ID's taxon is the same it's observation's taxon
pub current_taxon: Option<bool>,
/// ID was added by the observer
pub own_observation: Option<bool>,
/// ID was created as a results of a taxon change
pub is_change: Option<bool>,
/// ID's taxon is currently an active taxon
pub taxon_active: Option<bool>,
/// Observation's taxon is currently an active taxon
pub observation_taxon_active: Option<bool>,
/// Identification ID
pub id: Option<Vec<i32>>,
/// ID's taxon must have this rank
pub rank: Option<Vec<String>>,
/// Observation's taxon must have this rank
pub observation_rank: Option<Vec<String>>,
/// Identifier must have this user ID
pub user_id: Option<Vec<i32>>,
/// Identifier must have this login
pub user_login: Option<Vec<String>>,
/// Most recent ID on a observation by a user
pub current: Option<bool>,
/// Type of identification
pub category: Option<Vec<String>>,
/// Observation must occur in this place
pub place_id: Option<Vec<String>>,
/// Observation must have this quality grade
pub quality_grade: Option<Vec<String>>,
/// Only return identifications that were created as part of the specified taxon change
pub taxon_change_id: Option<Vec<String>>,
/// ID taxa must match the given taxa or their descendants
pub taxon_id: Option<Vec<String>>,
/// Observation taxa must match the given taxa or their descendants
pub observation_taxon_id: Option<Vec<String>>,
/// ID iconic taxon ID
pub iconic_taxon_id: Option<Vec<String>>,
/// Observation iconic taxon ID
pub observation_iconic_taxon_id: Option<Vec<String>>,
/// ID taxon must have this rank or higher
pub lrank: Option<String>,
/// ID taxon must have this rank or lower
pub hrank: Option<String>,
/// Observation taxon must have this rank or higher
pub observation_lrank: Option<String>,
/// Observation taxon must have this rank or lower
pub observation_hrank: Option<String>,
/// Exclude IDs of these taxa and their descendants
pub without_taxon_id: Option<Vec<String>>,
/// Exclude IDs of observations of these taxa and their descendants
pub without_observation_taxon_id: Option<Vec<String>>,
/// ID created on or after this time
pub d1: Option<String>,
/// ID created on or before this time
pub d2: Option<String>,
/// Observation created on or after this date
pub observation_created_d1: Option<String>,
/// Observation created on or before this date
pub observation_created_d2: Option<String>,
/// Observation observed on or after this date
pub observed_d1: Option<String>,
/// Observation observed on or before this date
pub observed_d2: Option<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>,
/// Pagination `page` number
pub page: Option<String>,
/// Number of results to return in a `page`. The maximum value is generally 200 unless otherwise noted
pub per_page: Option<String>,
/// Sort field
pub order_by: Option<String>,
/// Return only the record IDs
pub only_id: Option<bool>,
/// Source of the taxon for counting
pub taxon_of: Option<String>,
/// Sort order
pub order: Option<String>,
}
/// struct for typed errors of method [`identifications_categories_get`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum IdentificationsCategoriesGetError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`identifications_get`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum IdentificationsGetError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`identifications_id_delete`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum IdentificationsIdDeleteError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`identifications_id_get`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum IdentificationsIdGetError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`identifications_id_put`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum IdentificationsIdPutError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`identifications_identifiers_get`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum IdentificationsIdentifiersGetError {
DefaultResponse(models::Error),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`identifications_observers_get`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum IdentificationsObserversGetError {
DefaultResponse(models::Error),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`identifications_post`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum IdentificationsPostError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`identifications_recent_taxa_get`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum IdentificationsRecentTaxaGetError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`identifications_similar_species_get`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum IdentificationsSimilarSpeciesGetError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`identifications_species_counts_get`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum IdentificationsSpeciesCountsGetError {
DefaultResponse(models::Error),
UnknownValue(serde_json::Value),
}
/// Given zero to many of following parameters, return counts of the categories of identifications matching the search criteria
pub async fn identifications_categories_get(
configuration: &configuration::Configuration,
params: IdentificationsCategoriesGetParams,
) -> Result<(), Error<IdentificationsCategoriesGetError>> {
let uri_str = format!("{}/identifications/categories", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = params.current_taxon {
req_builder = req_builder.query(&[("current_taxon", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.own_observation {
req_builder = req_builder.query(&[("own_observation", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.is_change {
req_builder = req_builder.query(&[("is_change", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.taxon_active {
req_builder = req_builder.query(&[("taxon_active", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observation_taxon_active {
req_builder = req_builder.query(&[("observation_taxon_active", ¶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.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.observation_rank {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("observation_rank".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"observation_rank",
¶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.current {
req_builder = req_builder.query(&[("current", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.category {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("category".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"category",
¶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.quality_grade {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("quality_grade".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"quality_grade",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.taxon_change_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("taxon_change_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"taxon_change_id",
¶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.observation_taxon_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("observation_taxon_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"observation_taxon_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.iconic_taxon_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("iconic_taxon_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"iconic_taxon_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.observation_iconic_taxon_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("observation_iconic_taxon_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"observation_iconic_taxon_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.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.hrank {
req_builder = req_builder.query(&[("hrank", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observation_lrank {
req_builder = req_builder.query(&[("observation_lrank", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observation_hrank {
req_builder = req_builder.query(&[("observation_hrank", ¶m_value.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.without_observation_taxon_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("without_observation_taxon_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"without_observation_taxon_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.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.observation_created_d1 {
req_builder = req_builder.query(&[("observation_created_d1", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observation_created_d2 {
req_builder = req_builder.query(&[("observation_created_d2", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observed_d1 {
req_builder = req_builder.query(&[("observed_d1", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observed_d2 {
req_builder = req_builder.query(&[("observed_d2", ¶m_value.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.page {
req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.per_page {
req_builder = req_builder.query(&[("per_page", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.order {
req_builder = req_builder.query(&[("order", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.order_by {
req_builder = req_builder.query(&[("order_by", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.only_id {
req_builder = req_builder.query(&[("only_id", ¶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();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<IdentificationsCategoriesGetError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
/// Given zero to many of following parameters, returns identifications matching the search criteria
pub async fn identifications_get(
configuration: &configuration::Configuration,
params: IdentificationsGetParams,
) -> Result<(), Error<IdentificationsGetError>> {
let uri_str = format!("{}/identifications", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = params.current_taxon {
req_builder = req_builder.query(&[("current_taxon", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.own_observation {
req_builder = req_builder.query(&[("own_observation", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.is_change {
req_builder = req_builder.query(&[("is_change", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.taxon_active {
req_builder = req_builder.query(&[("taxon_active", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observation_taxon_active {
req_builder = req_builder.query(&[("observation_taxon_active", ¶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.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.observation_rank {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("observation_rank".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"observation_rank",
¶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.current {
req_builder = req_builder.query(&[("current", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.category {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("category".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"category",
¶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.quality_grade {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("quality_grade".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"quality_grade",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.taxon_change_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("taxon_change_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"taxon_change_id",
¶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.observation_taxon_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("observation_taxon_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"observation_taxon_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.iconic_taxon_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("iconic_taxon_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"iconic_taxon_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.observation_iconic_taxon_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("observation_iconic_taxon_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"observation_iconic_taxon_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.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.hrank {
req_builder = req_builder.query(&[("hrank", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observation_lrank {
req_builder = req_builder.query(&[("observation_lrank", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observation_hrank {
req_builder = req_builder.query(&[("observation_hrank", ¶m_value.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.without_observation_taxon_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("without_observation_taxon_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"without_observation_taxon_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.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.observation_created_d1 {
req_builder = req_builder.query(&[("observation_created_d1", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observation_created_d2 {
req_builder = req_builder.query(&[("observation_created_d2", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observed_d1 {
req_builder = req_builder.query(&[("observed_d1", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observed_d2 {
req_builder = req_builder.query(&[("observed_d2", ¶m_value.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.page {
req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.per_page {
req_builder = req_builder.query(&[("per_page", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.order {
req_builder = req_builder.query(&[("order", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.order_by {
req_builder = req_builder.query(&[("order_by", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.only_id {
req_builder = req_builder.query(&[("only_id", ¶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();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<IdentificationsGetError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
/// Delete an identification. See description of `PUT /identifications/{id} for notes on withdrawing and restoring identifications.
pub async fn identifications_id_delete(
configuration: &configuration::Configuration,
params: IdentificationsIdDeleteParams,
) -> Result<(), Error<IdentificationsIdDeleteError>> {
let uri_str = format!(
"{}/identifications/{id}",
configuration.base_path,
id = params.id
);
let mut req_builder = configuration
.client
.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<IdentificationsIdDeleteError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
/// Given an ID, or an array of IDs in comma-delimited format, returns corresponding identifications. A maximum of 30 results will be returned
pub async fn identifications_id_get(
configuration: &configuration::Configuration,
params: IdentificationsIdGetParams,
) -> Result<(), Error<IdentificationsIdGetError>> {
let uri_str = format!(
"{}/identifications/{id}",
configuration.base_path,
id = params
.id
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<_>>()
.join(",")
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
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();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<IdentificationsIdGetError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
/// Update an identification. Note that to \"withdraw\" an observation you send a `PUT` request to this endpoint and set the `current` attribute to false. To \"restore\" it you do the same but set `current` to `true`. Only one identification by a given user can be `current` for a given observation, so if you \"restore\" one all the other identifications by the authenticated user for the given observation will be withdrawn.
pub async fn identifications_id_put(
configuration: &configuration::Configuration,
params: IdentificationsIdPutParams,
) -> Result<(), Error<IdentificationsIdPutError>> {
let uri_str = format!(
"{}/identifications/{id}",
configuration.base_path,
id = params.id
);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
req_builder = req_builder.json(¶ms.body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<IdentificationsIdPutError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
/// Given zero to many of following parameters, returns creators of identifications matching the search criteria and the count of matching identifications, ordered by count descending. A maximum of 500 results will be returned
pub async fn identifications_identifiers_get(
configuration: &configuration::Configuration,
params: IdentificationsIdentifiersGetParams,
) -> Result<models::UserCountsResponse, Error<IdentificationsIdentifiersGetError>> {
let uri_str = format!("{}/identifications/identifiers", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = params.current_taxon {
req_builder = req_builder.query(&[("current_taxon", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.own_observation {
req_builder = req_builder.query(&[("own_observation", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.is_change {
req_builder = req_builder.query(&[("is_change", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.taxon_active {
req_builder = req_builder.query(&[("taxon_active", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observation_taxon_active {
req_builder = req_builder.query(&[("observation_taxon_active", ¶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.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.observation_rank {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("observation_rank".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"observation_rank",
¶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.current {
req_builder = req_builder.query(&[("current", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.category {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("category".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"category",
¶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.quality_grade {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("quality_grade".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"quality_grade",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.taxon_change_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("taxon_change_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"taxon_change_id",
¶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.observation_taxon_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("observation_taxon_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"observation_taxon_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.iconic_taxon_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("iconic_taxon_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"iconic_taxon_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.observation_iconic_taxon_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("observation_iconic_taxon_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"observation_iconic_taxon_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.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.hrank {
req_builder = req_builder.query(&[("hrank", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observation_lrank {
req_builder = req_builder.query(&[("observation_lrank", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observation_hrank {
req_builder = req_builder.query(&[("observation_hrank", ¶m_value.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.without_observation_taxon_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("without_observation_taxon_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"without_observation_taxon_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.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.observation_created_d1 {
req_builder = req_builder.query(&[("observation_created_d1", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observation_created_d2 {
req_builder = req_builder.query(&[("observation_created_d2", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observed_d1 {
req_builder = req_builder.query(&[("observed_d1", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observed_d2 {
req_builder = req_builder.query(&[("observed_d2", ¶m_value.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.page {
req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.per_page {
req_builder = req_builder.query(&[("per_page", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.order {
req_builder = req_builder.query(&[("order", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.order_by {
req_builder = req_builder.query(&[("order_by", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.only_id {
req_builder = req_builder.query(&[("only_id", ¶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::UserCountsResponse`"))),
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::UserCountsResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<IdentificationsIdentifiersGetError> =
serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
/// Given zero to many of following parameters, returns creators of observations of identifications matching the search criteria and the count of matching observations, ordered by count descending
pub async fn identifications_observers_get(
configuration: &configuration::Configuration,
params: IdentificationsObserversGetParams,
) -> Result<models::UserCountsResponse, Error<IdentificationsObserversGetError>> {
let uri_str = format!("{}/identifications/observers", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = params.current_taxon {
req_builder = req_builder.query(&[("current_taxon", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.own_observation {
req_builder = req_builder.query(&[("own_observation", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.is_change {
req_builder = req_builder.query(&[("is_change", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.taxon_active {
req_builder = req_builder.query(&[("taxon_active", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observation_taxon_active {
req_builder = req_builder.query(&[("observation_taxon_active", ¶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.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.observation_rank {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("observation_rank".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"observation_rank",
¶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.current {
req_builder = req_builder.query(&[("current", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.category {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("category".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"category",
¶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.quality_grade {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("quality_grade".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"quality_grade",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.taxon_change_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("taxon_change_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"taxon_change_id",
¶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.observation_taxon_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("observation_taxon_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"observation_taxon_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.iconic_taxon_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("iconic_taxon_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"iconic_taxon_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.observation_iconic_taxon_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("observation_iconic_taxon_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"observation_iconic_taxon_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.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.hrank {
req_builder = req_builder.query(&[("hrank", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observation_lrank {
req_builder = req_builder.query(&[("observation_lrank", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observation_hrank {
req_builder = req_builder.query(&[("observation_hrank", ¶m_value.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.without_observation_taxon_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("without_observation_taxon_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"without_observation_taxon_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.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.observation_created_d1 {
req_builder = req_builder.query(&[("observation_created_d1", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observation_created_d2 {
req_builder = req_builder.query(&[("observation_created_d2", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observed_d1 {
req_builder = req_builder.query(&[("observed_d1", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observed_d2 {
req_builder = req_builder.query(&[("observed_d2", ¶m_value.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.page {
req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.per_page {
req_builder = req_builder.query(&[("per_page", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.order {
req_builder = req_builder.query(&[("order", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.order_by {
req_builder = req_builder.query(&[("order_by", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.only_id {
req_builder = req_builder.query(&[("only_id", ¶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::UserCountsResponse`"))),
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::UserCountsResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<IdentificationsObserversGetError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
/// Create an identification
pub async fn identifications_post(
configuration: &configuration::Configuration,
params: IdentificationsPostParams,
) -> Result<(), Error<IdentificationsPostError>> {
let uri_str = format!("{}/identifications", configuration.base_path);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
req_builder = req_builder.json(¶ms.body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<IdentificationsPostError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
/// Returns an array of objects each containing an identification and a taxon. Returns IDs representing the earliest occurrence of taxa associated with identifications in the filtered set of results
pub async fn identifications_recent_taxa_get(
configuration: &configuration::Configuration,
params: IdentificationsRecentTaxaGetParams,
) -> Result<(), Error<IdentificationsRecentTaxaGetError>> {
let uri_str = format!("{}/identifications/recent_taxa", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = params.current_taxon {
req_builder = req_builder.query(&[("current_taxon", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.own_observation {
req_builder = req_builder.query(&[("own_observation", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.is_change {
req_builder = req_builder.query(&[("is_change", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.taxon_active {
req_builder = req_builder.query(&[("taxon_active", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observation_taxon_active {
req_builder = req_builder.query(&[("observation_taxon_active", ¶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.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.observation_rank {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("observation_rank".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"observation_rank",
¶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.current {
req_builder = req_builder.query(&[("current", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.category {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("category".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"category",
¶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.quality_grade {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("quality_grade".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"quality_grade",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.taxon_change_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("taxon_change_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"taxon_change_id",
¶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.observation_taxon_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("observation_taxon_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"observation_taxon_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.iconic_taxon_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("iconic_taxon_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"iconic_taxon_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.observation_iconic_taxon_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("observation_iconic_taxon_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"observation_iconic_taxon_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.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.hrank {
req_builder = req_builder.query(&[("hrank", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observation_lrank {
req_builder = req_builder.query(&[("observation_lrank", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observation_hrank {
req_builder = req_builder.query(&[("observation_hrank", ¶m_value.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.without_observation_taxon_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("without_observation_taxon_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"without_observation_taxon_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.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.observation_created_d1 {
req_builder = req_builder.query(&[("observation_created_d1", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observation_created_d2 {
req_builder = req_builder.query(&[("observation_created_d2", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observed_d1 {
req_builder = req_builder.query(&[("observed_d1", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observed_d2 {
req_builder = req_builder.query(&[("observed_d2", ¶m_value.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.page {
req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.per_page {
req_builder = req_builder.query(&[("per_page", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.order {
req_builder = req_builder.query(&[("order", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.order_by {
req_builder = req_builder.query(&[("order_by", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.only_id {
req_builder = req_builder.query(&[("only_id", ¶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();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<IdentificationsRecentTaxaGetError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
/// Returns species attached to IDs of observations of this taxon, or attached to observations identified as this species, ordered by combined frequency descending. This will only return species in the same iconic taxon, and will never return descendants of the chosen taxon
pub async fn identifications_similar_species_get(
configuration: &configuration::Configuration,
params: IdentificationsSimilarSpeciesGetParams,
) -> Result<(), Error<IdentificationsSimilarSpeciesGetError>> {
let uri_str = format!(
"{}/identifications/similar_species",
configuration.base_path
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
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.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.fails_dqa_accurate {
req_builder = req_builder.query(&[("fails_dqa_accurate", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.fails_dqa_date {
req_builder = req_builder.query(&[("fails_dqa_date", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.fails_dqa_evidence {
req_builder = req_builder.query(&[("fails_dqa_evidence", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.fails_dqa_location {
req_builder = req_builder.query(&[("fails_dqa_location", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.fails_dqa_needs_id {
req_builder = req_builder.query(&[("fails_dqa_needs_id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.fails_dqa_recent {
req_builder = req_builder.query(&[("fails_dqa_recent", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.fails_dqa_subject {
req_builder = req_builder.query(&[("fails_dqa_subject", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.fails_dqa_wild {
req_builder = req_builder.query(&[("fails_dqa_wild", ¶m_value.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())]);
}
req_builder = req_builder.query(&[("taxon_id", ¶ms.taxon_id.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();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<IdentificationsSimilarSpeciesGetError> =
serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
/// Given zero to many of following parameters, returns `leaf taxa` associated with identifications matching the search criteria and the count of identifications they are associated with, ordered by count descending. `Leaf taxa` are the leaves of the taxonomic tree containing only the taxa associated with observations matching the search criteria.
pub async fn identifications_species_counts_get(
configuration: &configuration::Configuration,
params: IdentificationsSpeciesCountsGetParams,
) -> Result<models::SpeciesCountsResponse, Error<IdentificationsSpeciesCountsGetError>> {
let uri_str = format!("{}/identifications/species_counts", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = params.current_taxon {
req_builder = req_builder.query(&[("current_taxon", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.own_observation {
req_builder = req_builder.query(&[("own_observation", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.is_change {
req_builder = req_builder.query(&[("is_change", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.taxon_active {
req_builder = req_builder.query(&[("taxon_active", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observation_taxon_active {
req_builder = req_builder.query(&[("observation_taxon_active", ¶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.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.observation_rank {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("observation_rank".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"observation_rank",
¶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.current {
req_builder = req_builder.query(&[("current", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.category {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("category".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"category",
¶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.quality_grade {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("quality_grade".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"quality_grade",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.taxon_change_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("taxon_change_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"taxon_change_id",
¶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.observation_taxon_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("observation_taxon_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"observation_taxon_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.iconic_taxon_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("iconic_taxon_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"iconic_taxon_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = params.observation_iconic_taxon_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("observation_iconic_taxon_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"observation_iconic_taxon_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.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.hrank {
req_builder = req_builder.query(&[("hrank", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observation_lrank {
req_builder = req_builder.query(&[("observation_lrank", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observation_hrank {
req_builder = req_builder.query(&[("observation_hrank", ¶m_value.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.without_observation_taxon_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("without_observation_taxon_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"without_observation_taxon_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.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.observation_created_d1 {
req_builder = req_builder.query(&[("observation_created_d1", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observation_created_d2 {
req_builder = req_builder.query(&[("observation_created_d2", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observed_d1 {
req_builder = req_builder.query(&[("observed_d1", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.observed_d2 {
req_builder = req_builder.query(&[("observed_d2", ¶m_value.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.page {
req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.per_page {
req_builder = req_builder.query(&[("per_page", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.order_by {
req_builder = req_builder.query(&[("order_by", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.only_id {
req_builder = req_builder.query(&[("only_id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.taxon_of {
req_builder = req_builder.query(&[("taxon_of", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.order {
req_builder = req_builder.query(&[("order", ¶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::SpeciesCountsResponse`"))),
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::SpeciesCountsResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<IdentificationsSpeciesCountsGetError> =
serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}