soilsidekick 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +267 -0
- data/Rakefile +10 -0
- data/docs/AIAnalysis.md +22 -0
- data/docs/AIAnalysisRecommendationsInner.md +22 -0
- data/docs/AIServicesApi.md +327 -0
- data/docs/BeginnerGuidance.md +34 -0
- data/docs/BeginnerGuidanceDetailedExplanation.md +24 -0
- data/docs/BeginnerGuidanceMetadata.md +22 -0
- data/docs/BeginnerGuidanceRequest.md +24 -0
- data/docs/BeginnerGuidanceRequestLocation.md +20 -0
- data/docs/BeginnerGuidanceRequestPlantContext.md +20 -0
- data/docs/CalculateCarbonCreditsRequest.md +26 -0
- data/docs/CalculateEnvironmentalImpactRequest.md +26 -0
- data/docs/CalculateEnvironmentalImpactRequestProposedTreatmentsInner.md +18 -0
- data/docs/CalculateEnvironmentalImpactRequestSoilData.md +28 -0
- data/docs/CalculateEnvironmentalImpactRequestWaterBodyData.md +18 -0
- data/docs/CarbonApi.md +79 -0
- data/docs/CarbonCreditCalculation.md +22 -0
- data/docs/CarbonCreditCalculationCalculationDetails.md +28 -0
- data/docs/CarbonCreditCalculationCalculationDetailsMetadata.md +22 -0
- data/docs/CarbonCreditCalculationCreditRecord.md +26 -0
- data/docs/ConsumerPlantCareApi.md +247 -0
- data/docs/County.md +26 -0
- data/docs/CountyLookup200Response.md +18 -0
- data/docs/CountyLookupRequest.md +18 -0
- data/docs/DynamicCare.md +28 -0
- data/docs/DynamicCareCareRecommendations.md +24 -0
- data/docs/DynamicCareCareRecommendationsHumidity.md +22 -0
- data/docs/DynamicCareCareRecommendationsLight.md +22 -0
- data/docs/DynamicCareCareRecommendationsWatering.md +24 -0
- data/docs/DynamicCareCurrentConditions.md +26 -0
- data/docs/DynamicCareMetadata.md +22 -0
- data/docs/DynamicCarePlant.md +22 -0
- data/docs/DynamicCareRequest.md +28 -0
- data/docs/DynamicCareRequestContainerDetails.md +22 -0
- data/docs/DynamicCareRequestEnvironment.md +20 -0
- data/docs/DynamicCareRequestLocation.md +22 -0
- data/docs/EnvironmentalApi.md +87 -0
- data/docs/EnvironmentalImpact.md +22 -0
- data/docs/EnvironmentalImpactDetailedAnalysis.md +26 -0
- data/docs/EnvironmentalImpactDetailedAnalysisEcoAlternatives.md +18 -0
- data/docs/EnvironmentalImpactDetailedAnalysisEcoAlternativesAlternativesInner.md +26 -0
- data/docs/EnvironmentalImpactDetailedAnalysisRunoffRisk.md +22 -0
- data/docs/EnvironmentalImpactImpactAssessment.md +26 -0
- data/docs/Error.md +22 -0
- data/docs/GenerateSmartReportSummaryRequest.md +20 -0
- data/docs/GenerateVRTPrescriptionRequest.md +22 -0
- data/docs/GeographicApi.md +79 -0
- data/docs/GetAgriculturalIntelligenceRequest.md +20 -0
- data/docs/GetLiveAgriculturalDataRequest.md +24 -0
- data/docs/GetPlantingCalendarRequest.md +20 -0
- data/docs/GetSatelliteDataRequest.md +20 -0
- data/docs/GetSeasonalPlanningAssistantRequest.md +26 -0
- data/docs/GetSeasonalPlanningAssistantRequestLocation.md +22 -0
- data/docs/GetSoilDataRequest.md +18 -0
- data/docs/GetTerritorialWaterAnalyticsRequest.md +22 -0
- data/docs/GetTerritorialWaterAnalyticsRequestDateRange.md +20 -0
- data/docs/LeafEnginesApi.md +87 -0
- data/docs/LeafEnginesCompatibility.md +22 -0
- data/docs/LeafEnginesCompatibilityData.md +32 -0
- data/docs/LeafEnginesCompatibilityDataBreakdown.md +22 -0
- data/docs/LeafEnginesCompatibilityDataBreakdownSoil.md +22 -0
- data/docs/LeafEnginesCompatibilityDataMetadata.md +22 -0
- data/docs/LeafEnginesCompatibilityUsage.md +20 -0
- data/docs/LeafenginesQueryRequest.md +22 -0
- data/docs/LeafenginesQueryRequestLocation.md +24 -0
- data/docs/LeafenginesQueryRequestOptions.md +22 -0
- data/docs/LeafenginesQueryRequestPlant.md +24 -0
- data/docs/LeafenginesQueryRequestPlantCareRequirements.md +22 -0
- data/docs/LeafenginesQueryRequestPlantCareRequirementsSoilPhRange.md +20 -0
- data/docs/LiveAgriculturalData.md +30 -0
- data/docs/LiveAgriculturalDataData.md +24 -0
- data/docs/PlantingCalendar.md +26 -0
- data/docs/SafeIdentification.md +26 -0
- data/docs/SafeIdentificationConfidenceBreakdown.md +24 -0
- data/docs/SafeIdentificationIdentification.md +22 -0
- data/docs/SafeIdentificationIdentificationPrimaryMatch.md +24 -0
- data/docs/SafeIdentificationMetadata.md +22 -0
- data/docs/SafeIdentificationRequest.md +22 -0
- data/docs/SafeIdentificationRequestContext.md +22 -0
- data/docs/SafeIdentificationRequestLocation.md +22 -0
- data/docs/SafeIdentificationRequestLocationCoordinates.md +20 -0
- data/docs/SafeIdentificationSafetyAnalysis.md +24 -0
- data/docs/SafeIdentificationSafetyAnalysisLookalikesInner.md +24 -0
- data/docs/SatelliteData.md +26 -0
- data/docs/SatelliteDataApi.md +79 -0
- data/docs/SeasonalPlanningResponse.md +24 -0
- data/docs/SeasonalPlanningResponseRecommendations.md +22 -0
- data/docs/SeasonalPlanningResponseWeatherData.md +28 -0
- data/docs/SmartReportSummary.md +22 -0
- data/docs/SmartReportSummarySummary.md +24 -0
- data/docs/SoilAnalysisApi.md +231 -0
- data/docs/SoilData.md +38 -0
- data/docs/TerritorialWaterAnalytics.md +22 -0
- data/docs/TerritorialWaterAnalyticsAnalytics.md +24 -0
- data/docs/TurboQuantApi.md +87 -0
- data/docs/TurboQuantCapabilities.md +30 -0
- data/docs/TurboQuantCapabilitiesEstimatedLatencyMs.md +20 -0
- data/docs/TurboQuantCapabilitiesRequest.md +22 -0
- data/docs/VRTApi.md +79 -0
- data/docs/VRTPrescription.md +24 -0
- data/docs/VRTPrescriptionZonesInner.md +22 -0
- data/docs/VisualCropAnalysis.md +24 -0
- data/docs/VisualCropAnalysisAnalysis.md +26 -0
- data/docs/VisualCropAnalysisRequest.md +24 -0
- data/docs/VisualCropAnalysisRequestLocation.md +22 -0
- data/docs/WaterQuality.md +30 -0
- data/docs/WaterQualityApi.md +151 -0
- data/git_push.sh +57 -0
- data/lib/soilsidekick/api/ai_services_api.rb +378 -0
- data/lib/soilsidekick/api/carbon_api.rb +90 -0
- data/lib/soilsidekick/api/consumer_plant_care_api.rb +289 -0
- data/lib/soilsidekick/api/environmental_api.rb +111 -0
- data/lib/soilsidekick/api/geographic_api.rb +90 -0
- data/lib/soilsidekick/api/leaf_engines_api.rb +111 -0
- data/lib/soilsidekick/api/satellite_data_api.rb +90 -0
- data/lib/soilsidekick/api/soil_analysis_api.rb +247 -0
- data/lib/soilsidekick/api/turbo_quant_api.rb +111 -0
- data/lib/soilsidekick/api/vrt_api.rb +90 -0
- data/lib/soilsidekick/api/water_quality_api.rb +158 -0
- data/lib/soilsidekick/api_client.rb +397 -0
- data/lib/soilsidekick/api_error.rb +58 -0
- data/lib/soilsidekick/api_model_base.rb +88 -0
- data/lib/soilsidekick/configuration.rb +312 -0
- data/lib/soilsidekick/models/ai_analysis.rb +167 -0
- data/lib/soilsidekick/models/ai_analysis_recommendations_inner.rb +199 -0
- data/lib/soilsidekick/models/beginner_guidance.rb +228 -0
- data/lib/soilsidekick/models/beginner_guidance_detailed_explanation.rb +179 -0
- data/lib/soilsidekick/models/beginner_guidance_metadata.rb +165 -0
- data/lib/soilsidekick/models/beginner_guidance_request.rb +229 -0
- data/lib/soilsidekick/models/beginner_guidance_request_location.rb +156 -0
- data/lib/soilsidekick/models/beginner_guidance_request_plant_context.rb +158 -0
- data/lib/soilsidekick/models/calculate_carbon_credits_request.rb +264 -0
- data/lib/soilsidekick/models/calculate_environmental_impact_request.rb +247 -0
- data/lib/soilsidekick/models/calculate_environmental_impact_request_proposed_treatments_inner.rb +181 -0
- data/lib/soilsidekick/models/calculate_environmental_impact_request_soil_data.rb +238 -0
- data/lib/soilsidekick/models/calculate_environmental_impact_request_water_body_data.rb +147 -0
- data/lib/soilsidekick/models/carbon_credit_calculation.rb +165 -0
- data/lib/soilsidekick/models/carbon_credit_calculation_calculation_details.rb +192 -0
- data/lib/soilsidekick/models/carbon_credit_calculation_calculation_details_metadata.rb +167 -0
- data/lib/soilsidekick/models/carbon_credit_calculation_credit_record.rb +217 -0
- data/lib/soilsidekick/models/county.rb +183 -0
- data/lib/soilsidekick/models/county_lookup200_response.rb +149 -0
- data/lib/soilsidekick/models/county_lookup_request.rb +183 -0
- data/lib/soilsidekick/models/dynamic_care.rb +196 -0
- data/lib/soilsidekick/models/dynamic_care_care_recommendations.rb +175 -0
- data/lib/soilsidekick/models/dynamic_care_care_recommendations_humidity.rb +165 -0
- data/lib/soilsidekick/models/dynamic_care_care_recommendations_light.rb +165 -0
- data/lib/soilsidekick/models/dynamic_care_care_recommendations_watering.rb +208 -0
- data/lib/soilsidekick/models/dynamic_care_current_conditions.rb +183 -0
- data/lib/soilsidekick/models/dynamic_care_metadata.rb +165 -0
- data/lib/soilsidekick/models/dynamic_care_plant.rb +199 -0
- data/lib/soilsidekick/models/dynamic_care_request.rb +262 -0
- data/lib/soilsidekick/models/dynamic_care_request_container_details.rb +199 -0
- data/lib/soilsidekick/models/dynamic_care_request_environment.rb +203 -0
- data/lib/soilsidekick/models/dynamic_care_request_location.rb +194 -0
- data/lib/soilsidekick/models/environmental_impact.rb +167 -0
- data/lib/soilsidekick/models/environmental_impact_detailed_analysis.rb +183 -0
- data/lib/soilsidekick/models/environmental_impact_detailed_analysis_eco_alternatives.rb +149 -0
- data/lib/soilsidekick/models/environmental_impact_detailed_analysis_eco_alternatives_alternatives_inner.rb +183 -0
- data/lib/soilsidekick/models/environmental_impact_detailed_analysis_runoff_risk.rb +199 -0
- data/lib/soilsidekick/models/environmental_impact_impact_assessment.rb +183 -0
- data/lib/soilsidekick/models/error.rb +165 -0
- data/lib/soilsidekick/models/generate_smart_report_summary_request.rb +215 -0
- data/lib/soilsidekick/models/generate_vrt_prescription_request.rb +223 -0
- data/lib/soilsidekick/models/get_agricultural_intelligence_request.rb +225 -0
- data/lib/soilsidekick/models/get_live_agricultural_data_request.rb +277 -0
- data/lib/soilsidekick/models/get_planting_calendar_request.rb +201 -0
- data/lib/soilsidekick/models/get_satellite_data_request.rb +226 -0
- data/lib/soilsidekick/models/get_seasonal_planning_assistant_request.rb +245 -0
- data/lib/soilsidekick/models/get_seasonal_planning_assistant_request_location.rb +165 -0
- data/lib/soilsidekick/models/get_soil_data_request.rb +176 -0
- data/lib/soilsidekick/models/get_territorial_water_analytics_request.rb +201 -0
- data/lib/soilsidekick/models/get_territorial_water_analytics_request_date_range.rb +156 -0
- data/lib/soilsidekick/models/leaf_engines_compatibility.rb +165 -0
- data/lib/soilsidekick/models/leaf_engines_compatibility_data.rb +247 -0
- data/lib/soilsidekick/models/leaf_engines_compatibility_data_breakdown.rb +165 -0
- data/lib/soilsidekick/models/leaf_engines_compatibility_data_breakdown_soil.rb +169 -0
- data/lib/soilsidekick/models/leaf_engines_compatibility_data_metadata.rb +167 -0
- data/lib/soilsidekick/models/leaf_engines_compatibility_usage.rb +156 -0
- data/lib/soilsidekick/models/leafengines_query_request.rb +199 -0
- data/lib/soilsidekick/models/leafengines_query_request_location.rb +174 -0
- data/lib/soilsidekick/models/leafengines_query_request_options.rb +165 -0
- data/lib/soilsidekick/models/leafengines_query_request_plant.rb +174 -0
- data/lib/soilsidekick/models/leafengines_query_request_plant_care_requirements.rb +211 -0
- data/lib/soilsidekick/models/leafengines_query_request_plant_care_requirements_soil_ph_range.rb +156 -0
- data/lib/soilsidekick/models/live_agricultural_data.rb +237 -0
- data/lib/soilsidekick/models/live_agricultural_data_data.rb +174 -0
- data/lib/soilsidekick/models/planting_calendar.rb +185 -0
- data/lib/soilsidekick/models/safe_identification.rb +184 -0
- data/lib/soilsidekick/models/safe_identification_confidence_breakdown.rb +174 -0
- data/lib/soilsidekick/models/safe_identification_identification.rb +200 -0
- data/lib/soilsidekick/models/safe_identification_identification_primary_match.rb +175 -0
- data/lib/soilsidekick/models/safe_identification_metadata.rb +167 -0
- data/lib/soilsidekick/models/safe_identification_request.rb +183 -0
- data/lib/soilsidekick/models/safe_identification_request_context.rb +223 -0
- data/lib/soilsidekick/models/safe_identification_request_location.rb +205 -0
- data/lib/soilsidekick/models/safe_identification_request_location_coordinates.rb +156 -0
- data/lib/soilsidekick/models/safe_identification_safety_analysis.rb +215 -0
- data/lib/soilsidekick/models/safe_identification_safety_analysis_lookalikes_inner.rb +177 -0
- data/lib/soilsidekick/models/satellite_data.rb +185 -0
- data/lib/soilsidekick/models/seasonal_planning_response.rb +174 -0
- data/lib/soilsidekick/models/seasonal_planning_response_recommendations.rb +169 -0
- data/lib/soilsidekick/models/seasonal_planning_response_weather_data.rb +192 -0
- data/lib/soilsidekick/models/smart_report_summary.rb +165 -0
- data/lib/soilsidekick/models/smart_report_summary_summary.rb +178 -0
- data/lib/soilsidekick/models/soil_data.rb +239 -0
- data/lib/soilsidekick/models/territorial_water_analytics.rb +165 -0
- data/lib/soilsidekick/models/territorial_water_analytics_analytics.rb +174 -0
- data/lib/soilsidekick/models/turbo_quant_capabilities.rb +253 -0
- data/lib/soilsidekick/models/turbo_quant_capabilities_estimated_latency_ms.rb +156 -0
- data/lib/soilsidekick/models/turbo_quant_capabilities_request.rb +201 -0
- data/lib/soilsidekick/models/visual_crop_analysis.rb +174 -0
- data/lib/soilsidekick/models/visual_crop_analysis_analysis.rb +219 -0
- data/lib/soilsidekick/models/visual_crop_analysis_request.rb +234 -0
- data/lib/soilsidekick/models/visual_crop_analysis_request_location.rb +165 -0
- data/lib/soilsidekick/models/vrt_prescription.rb +176 -0
- data/lib/soilsidekick/models/vrt_prescription_zones_inner.rb +165 -0
- data/lib/soilsidekick/models/water_quality.rb +235 -0
- data/lib/soilsidekick/version.rb +15 -0
- data/lib/soilsidekick.rb +146 -0
- data/soilsidekick.gemspec +39 -0
- data/spec/api/ai_services_api_spec.rb +95 -0
- data/spec/api/carbon_api_spec.rb +47 -0
- data/spec/api/consumer_plant_care_api_spec.rb +80 -0
- data/spec/api/environmental_api_spec.rb +50 -0
- data/spec/api/geographic_api_spec.rb +47 -0
- data/spec/api/leaf_engines_api_spec.rb +50 -0
- data/spec/api/satellite_data_api_spec.rb +47 -0
- data/spec/api/soil_analysis_api_spec.rb +74 -0
- data/spec/api/turbo_quant_api_spec.rb +50 -0
- data/spec/api/vrt_api_spec.rb +47 -0
- data/spec/api/water_quality_api_spec.rb +59 -0
- data/spec/models/ai_analysis_recommendations_inner_spec.rb +52 -0
- data/spec/models/ai_analysis_spec.rb +48 -0
- data/spec/models/beginner_guidance_detailed_explanation_spec.rb +54 -0
- data/spec/models/beginner_guidance_metadata_spec.rb +48 -0
- data/spec/models/beginner_guidance_request_location_spec.rb +42 -0
- data/spec/models/beginner_guidance_request_plant_context_spec.rb +42 -0
- data/spec/models/beginner_guidance_request_spec.rb +58 -0
- data/spec/models/beginner_guidance_spec.rb +84 -0
- data/spec/models/calculate_carbon_credits_request_spec.rb +64 -0
- data/spec/models/calculate_environmental_impact_request_proposed_treatments_inner_spec.rb +40 -0
- data/spec/models/calculate_environmental_impact_request_soil_data_spec.rb +74 -0
- data/spec/models/calculate_environmental_impact_request_spec.rb +60 -0
- data/spec/models/calculate_environmental_impact_request_water_body_data_spec.rb +36 -0
- data/spec/models/carbon_credit_calculation_calculation_details_metadata_spec.rb +48 -0
- data/spec/models/carbon_credit_calculation_calculation_details_spec.rb +66 -0
- data/spec/models/carbon_credit_calculation_credit_record_spec.rb +64 -0
- data/spec/models/carbon_credit_calculation_spec.rb +48 -0
- data/spec/models/county_lookup200_response_spec.rb +36 -0
- data/spec/models/county_lookup_request_spec.rb +36 -0
- data/spec/models/county_spec.rb +60 -0
- data/spec/models/dynamic_care_care_recommendations_humidity_spec.rb +48 -0
- data/spec/models/dynamic_care_care_recommendations_light_spec.rb +48 -0
- data/spec/models/dynamic_care_care_recommendations_spec.rb +54 -0
- data/spec/models/dynamic_care_care_recommendations_watering_spec.rb +58 -0
- data/spec/models/dynamic_care_current_conditions_spec.rb +60 -0
- data/spec/models/dynamic_care_metadata_spec.rb +48 -0
- data/spec/models/dynamic_care_plant_spec.rb +52 -0
- data/spec/models/dynamic_care_request_container_details_spec.rb +52 -0
- data/spec/models/dynamic_care_request_environment_spec.rb +50 -0
- data/spec/models/dynamic_care_request_location_spec.rb +48 -0
- data/spec/models/dynamic_care_request_spec.rb +70 -0
- data/spec/models/dynamic_care_spec.rb +66 -0
- data/spec/models/environmental_impact_detailed_analysis_eco_alternatives_alternatives_inner_spec.rb +60 -0
- data/spec/models/environmental_impact_detailed_analysis_eco_alternatives_spec.rb +36 -0
- data/spec/models/environmental_impact_detailed_analysis_runoff_risk_spec.rb +52 -0
- data/spec/models/environmental_impact_detailed_analysis_spec.rb +60 -0
- data/spec/models/environmental_impact_impact_assessment_spec.rb +60 -0
- data/spec/models/environmental_impact_spec.rb +48 -0
- data/spec/models/error_spec.rb +48 -0
- data/spec/models/generate_smart_report_summary_request_spec.rb +46 -0
- data/spec/models/generate_vrt_prescription_request_spec.rb +52 -0
- data/spec/models/get_agricultural_intelligence_request_spec.rb +46 -0
- data/spec/models/get_live_agricultural_data_request_spec.rb +58 -0
- data/spec/models/get_planting_calendar_request_spec.rb +42 -0
- data/spec/models/get_satellite_data_request_spec.rb +42 -0
- data/spec/models/get_seasonal_planning_assistant_request_location_spec.rb +48 -0
- data/spec/models/get_seasonal_planning_assistant_request_spec.rb +64 -0
- data/spec/models/get_soil_data_request_spec.rb +36 -0
- data/spec/models/get_territorial_water_analytics_request_date_range_spec.rb +42 -0
- data/spec/models/get_territorial_water_analytics_request_spec.rb +52 -0
- data/spec/models/leaf_engines_compatibility_data_breakdown_soil_spec.rb +48 -0
- data/spec/models/leaf_engines_compatibility_data_breakdown_spec.rb +48 -0
- data/spec/models/leaf_engines_compatibility_data_metadata_spec.rb +48 -0
- data/spec/models/leaf_engines_compatibility_data_spec.rb +82 -0
- data/spec/models/leaf_engines_compatibility_spec.rb +48 -0
- data/spec/models/leaf_engines_compatibility_usage_spec.rb +42 -0
- data/spec/models/leafengines_query_request_location_spec.rb +54 -0
- data/spec/models/leafengines_query_request_options_spec.rb +48 -0
- data/spec/models/leafengines_query_request_plant_care_requirements_soil_ph_range_spec.rb +42 -0
- data/spec/models/leafengines_query_request_plant_care_requirements_spec.rb +56 -0
- data/spec/models/leafengines_query_request_plant_spec.rb +54 -0
- data/spec/models/leafengines_query_request_spec.rb +48 -0
- data/spec/models/live_agricultural_data_data_spec.rb +54 -0
- data/spec/models/live_agricultural_data_spec.rb +76 -0
- data/spec/models/planting_calendar_spec.rb +60 -0
- data/spec/models/safe_identification_confidence_breakdown_spec.rb +54 -0
- data/spec/models/safe_identification_identification_primary_match_spec.rb +54 -0
- data/spec/models/safe_identification_identification_spec.rb +52 -0
- data/spec/models/safe_identification_metadata_spec.rb +48 -0
- data/spec/models/safe_identification_request_context_spec.rb +60 -0
- data/spec/models/safe_identification_request_location_coordinates_spec.rb +42 -0
- data/spec/models/safe_identification_request_location_spec.rb +48 -0
- data/spec/models/safe_identification_request_spec.rb +48 -0
- data/spec/models/safe_identification_safety_analysis_lookalikes_inner_spec.rb +54 -0
- data/spec/models/safe_identification_safety_analysis_spec.rb +58 -0
- data/spec/models/safe_identification_spec.rb +60 -0
- data/spec/models/satellite_data_spec.rb +60 -0
- data/spec/models/seasonal_planning_response_recommendations_spec.rb +48 -0
- data/spec/models/seasonal_planning_response_spec.rb +54 -0
- data/spec/models/seasonal_planning_response_weather_data_spec.rb +66 -0
- data/spec/models/smart_report_summary_spec.rb +48 -0
- data/spec/models/smart_report_summary_summary_spec.rb +54 -0
- data/spec/models/soil_data_spec.rb +96 -0
- data/spec/models/territorial_water_analytics_analytics_spec.rb +54 -0
- data/spec/models/territorial_water_analytics_spec.rb +48 -0
- data/spec/models/turbo_quant_capabilities_estimated_latency_ms_spec.rb +42 -0
- data/spec/models/turbo_quant_capabilities_request_spec.rb +52 -0
- data/spec/models/turbo_quant_capabilities_spec.rb +80 -0
- data/spec/models/visual_crop_analysis_analysis_spec.rb +64 -0
- data/spec/models/visual_crop_analysis_request_location_spec.rb +48 -0
- data/spec/models/visual_crop_analysis_request_spec.rb +58 -0
- data/spec/models/visual_crop_analysis_spec.rb +54 -0
- data/spec/models/vrt_prescription_spec.rb +54 -0
- data/spec/models/vrt_prescription_zones_inner_spec.rb +48 -0
- data/spec/models/water_quality_spec.rb +76 -0
- data/spec/spec_helper.rb +111 -0
- metadata +543 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#SoilSidekick Pro API
|
|
3
|
+
|
|
4
|
+
#Agricultural intelligence and soil analysis API with tier-based access control. ## What's New in 1.2.0 - **Consumer Plant Care APIs**: Three new endpoints addressing top pain points in plant ID apps: - `/safe-identification`: Toxic lookalike warnings and environmental context - `/dynamic-care`: Hyper-localized, real-time care recommendations - `/beginner-guidance`: Judgment-free, jargon-free plant guidance ## Authentication All endpoints require an API key passed via the `x-api-key` header: ``` x-api-key: ak_your_api_key_here ``` API keys are generated through the dashboard and use the `ak_*` format. ## Rate Limiting Rate limits are enforced based on your subscription tier: - **Free**: 10 req/min, 100 req/hour, 1,000 req/day - **Starter**: 30 req/min, 500 req/hour, 5,000 req/day - **Pro**: 100 req/min, 2,000 req/hour, 25,000 req/day - **Enterprise**: 500 req/min, 10,000 req/hour, 100,000 req/day Rate limit information is returned in response headers: - `X-RateLimit-Limit`: Maximum requests in window - `X-RateLimit-Remaining`: Remaining requests in window - `X-RateLimit-Reset`: Unix timestamp when limit resets ## Response Time SLAs All endpoints return response time headers for performance monitoring: - `X-Response-Time`: Human-readable response time (e.g., \"245ms\") - `X-Response-Time-Ms`: Response time in milliseconds - `X-Response-Time-Target`: Target response time for this endpoint - `X-Response-Time-Max`: Maximum acceptable response time - `X-Response-Time-Status`: Performance status (`optimal`, `acceptable`, `exceeded`) ### Response Time Targets by Category | Category | Target | Maximum | Endpoints | |----------|--------|---------|-----------| | **Fast** | 200ms | 500ms | county-lookup, check-subscription | | **Standard** | 500ms | 1,500ms | get-soil-data, territorial-water-quality | | **Complex** | 2,000ms | 5,000ms | agricultural-intelligence, gpt5-chat, visual-crop-analysis | | **Heavy** | 5,000ms | 15,000ms | live-agricultural-data, generate-vrt-prescription |
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 3.0.0
|
|
7
|
+
Contact: support@soilsidekickpro.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.23.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module SoilSidekick
|
|
16
|
+
class WaterQualityApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Get territorial water analytics
|
|
23
|
+
# Generate territorial water quality analytics across regions
|
|
24
|
+
# @param get_territorial_water_analytics_request [GetTerritorialWaterAnalyticsRequest]
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [TerritorialWaterAnalytics]
|
|
27
|
+
def get_territorial_water_analytics(get_territorial_water_analytics_request, opts = {})
|
|
28
|
+
data, _status_code, _headers = get_territorial_water_analytics_with_http_info(get_territorial_water_analytics_request, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Get territorial water analytics
|
|
33
|
+
# Generate territorial water quality analytics across regions
|
|
34
|
+
# @param get_territorial_water_analytics_request [GetTerritorialWaterAnalyticsRequest]
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(TerritorialWaterAnalytics, Integer, Hash)>] TerritorialWaterAnalytics data, response status code and response headers
|
|
37
|
+
def get_territorial_water_analytics_with_http_info(get_territorial_water_analytics_request, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: WaterQualityApi.get_territorial_water_analytics ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'get_territorial_water_analytics_request' is set
|
|
42
|
+
if @api_client.config.client_side_validation && get_territorial_water_analytics_request.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'get_territorial_water_analytics_request' when calling WaterQualityApi.get_territorial_water_analytics"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/territorial-water-analytics'
|
|
47
|
+
|
|
48
|
+
# query parameters
|
|
49
|
+
query_params = opts[:query_params] || {}
|
|
50
|
+
|
|
51
|
+
# header parameters
|
|
52
|
+
header_params = opts[:header_params] || {}
|
|
53
|
+
# HTTP header 'Accept' (if needed)
|
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
55
|
+
# HTTP header 'Content-Type'
|
|
56
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
57
|
+
if !content_type.nil?
|
|
58
|
+
header_params['Content-Type'] = content_type
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# form parameters
|
|
62
|
+
form_params = opts[:form_params] || {}
|
|
63
|
+
|
|
64
|
+
# http body (model)
|
|
65
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(get_territorial_water_analytics_request)
|
|
66
|
+
|
|
67
|
+
# return_type
|
|
68
|
+
return_type = opts[:debug_return_type] || 'TerritorialWaterAnalytics'
|
|
69
|
+
|
|
70
|
+
# auth_names
|
|
71
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
72
|
+
|
|
73
|
+
new_options = opts.merge(
|
|
74
|
+
:operation => :"WaterQualityApi.get_territorial_water_analytics",
|
|
75
|
+
:header_params => header_params,
|
|
76
|
+
:query_params => query_params,
|
|
77
|
+
:form_params => form_params,
|
|
78
|
+
:body => post_body,
|
|
79
|
+
:auth_names => auth_names,
|
|
80
|
+
:return_type => return_type
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
84
|
+
if @api_client.config.debugging
|
|
85
|
+
@api_client.config.logger.debug "API called: WaterQualityApi#get_territorial_water_analytics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
86
|
+
end
|
|
87
|
+
return data, status_code, headers
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Get water quality data
|
|
91
|
+
# Retrieve water quality metrics for a specific county
|
|
92
|
+
# @param get_soil_data_request [GetSoilDataRequest]
|
|
93
|
+
# @param [Hash] opts the optional parameters
|
|
94
|
+
# @return [WaterQuality]
|
|
95
|
+
def get_water_quality(get_soil_data_request, opts = {})
|
|
96
|
+
data, _status_code, _headers = get_water_quality_with_http_info(get_soil_data_request, opts)
|
|
97
|
+
data
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Get water quality data
|
|
101
|
+
# Retrieve water quality metrics for a specific county
|
|
102
|
+
# @param get_soil_data_request [GetSoilDataRequest]
|
|
103
|
+
# @param [Hash] opts the optional parameters
|
|
104
|
+
# @return [Array<(WaterQuality, Integer, Hash)>] WaterQuality data, response status code and response headers
|
|
105
|
+
def get_water_quality_with_http_info(get_soil_data_request, opts = {})
|
|
106
|
+
if @api_client.config.debugging
|
|
107
|
+
@api_client.config.logger.debug 'Calling API: WaterQualityApi.get_water_quality ...'
|
|
108
|
+
end
|
|
109
|
+
# verify the required parameter 'get_soil_data_request' is set
|
|
110
|
+
if @api_client.config.client_side_validation && get_soil_data_request.nil?
|
|
111
|
+
fail ArgumentError, "Missing the required parameter 'get_soil_data_request' when calling WaterQualityApi.get_water_quality"
|
|
112
|
+
end
|
|
113
|
+
# resource path
|
|
114
|
+
local_var_path = '/territorial-water-quality'
|
|
115
|
+
|
|
116
|
+
# query parameters
|
|
117
|
+
query_params = opts[:query_params] || {}
|
|
118
|
+
|
|
119
|
+
# header parameters
|
|
120
|
+
header_params = opts[:header_params] || {}
|
|
121
|
+
# HTTP header 'Accept' (if needed)
|
|
122
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
123
|
+
# HTTP header 'Content-Type'
|
|
124
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
125
|
+
if !content_type.nil?
|
|
126
|
+
header_params['Content-Type'] = content_type
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# form parameters
|
|
130
|
+
form_params = opts[:form_params] || {}
|
|
131
|
+
|
|
132
|
+
# http body (model)
|
|
133
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(get_soil_data_request)
|
|
134
|
+
|
|
135
|
+
# return_type
|
|
136
|
+
return_type = opts[:debug_return_type] || 'WaterQuality'
|
|
137
|
+
|
|
138
|
+
# auth_names
|
|
139
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
140
|
+
|
|
141
|
+
new_options = opts.merge(
|
|
142
|
+
:operation => :"WaterQualityApi.get_water_quality",
|
|
143
|
+
:header_params => header_params,
|
|
144
|
+
:query_params => query_params,
|
|
145
|
+
:form_params => form_params,
|
|
146
|
+
:body => post_body,
|
|
147
|
+
:auth_names => auth_names,
|
|
148
|
+
:return_type => return_type
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
152
|
+
if @api_client.config.debugging
|
|
153
|
+
@api_client.config.logger.debug "API called: WaterQualityApi#get_water_quality\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
154
|
+
end
|
|
155
|
+
return data, status_code, headers
|
|
156
|
+
end
|
|
157
|
+
end
|
|
158
|
+
end
|
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#SoilSidekick Pro API
|
|
3
|
+
|
|
4
|
+
#Agricultural intelligence and soil analysis API with tier-based access control. ## What's New in 1.2.0 - **Consumer Plant Care APIs**: Three new endpoints addressing top pain points in plant ID apps: - `/safe-identification`: Toxic lookalike warnings and environmental context - `/dynamic-care`: Hyper-localized, real-time care recommendations - `/beginner-guidance`: Judgment-free, jargon-free plant guidance ## Authentication All endpoints require an API key passed via the `x-api-key` header: ``` x-api-key: ak_your_api_key_here ``` API keys are generated through the dashboard and use the `ak_*` format. ## Rate Limiting Rate limits are enforced based on your subscription tier: - **Free**: 10 req/min, 100 req/hour, 1,000 req/day - **Starter**: 30 req/min, 500 req/hour, 5,000 req/day - **Pro**: 100 req/min, 2,000 req/hour, 25,000 req/day - **Enterprise**: 500 req/min, 10,000 req/hour, 100,000 req/day Rate limit information is returned in response headers: - `X-RateLimit-Limit`: Maximum requests in window - `X-RateLimit-Remaining`: Remaining requests in window - `X-RateLimit-Reset`: Unix timestamp when limit resets ## Response Time SLAs All endpoints return response time headers for performance monitoring: - `X-Response-Time`: Human-readable response time (e.g., \"245ms\") - `X-Response-Time-Ms`: Response time in milliseconds - `X-Response-Time-Target`: Target response time for this endpoint - `X-Response-Time-Max`: Maximum acceptable response time - `X-Response-Time-Status`: Performance status (`optimal`, `acceptable`, `exceeded`) ### Response Time Targets by Category | Category | Target | Maximum | Endpoints | |----------|--------|---------|-----------| | **Fast** | 200ms | 500ms | county-lookup, check-subscription | | **Standard** | 500ms | 1,500ms | get-soil-data, territorial-water-quality | | **Complex** | 2,000ms | 5,000ms | agricultural-intelligence, gpt5-chat, visual-crop-analysis | | **Heavy** | 5,000ms | 15,000ms | live-agricultural-data, generate-vrt-prescription |
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 3.0.0
|
|
7
|
+
Contact: support@soilsidekickpro.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.23.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'logger'
|
|
16
|
+
require 'tempfile'
|
|
17
|
+
require 'time'
|
|
18
|
+
require 'typhoeus'
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
module SoilSidekick
|
|
22
|
+
class ApiClient
|
|
23
|
+
# The Configuration object holding settings to be used in the API client.
|
|
24
|
+
attr_accessor :config
|
|
25
|
+
|
|
26
|
+
# Defines the headers to be used in HTTP requests of all API calls by default.
|
|
27
|
+
#
|
|
28
|
+
# @return [Hash]
|
|
29
|
+
attr_accessor :default_headers
|
|
30
|
+
|
|
31
|
+
# Initializes the ApiClient
|
|
32
|
+
# @option config [Configuration] Configuration for initializing the object, default to Configuration.default
|
|
33
|
+
def initialize(config = Configuration.default)
|
|
34
|
+
@config = config
|
|
35
|
+
@user_agent = "OpenAPI-Generator/#{VERSION}/ruby"
|
|
36
|
+
@default_headers = {
|
|
37
|
+
'Content-Type' => 'application/json',
|
|
38
|
+
'User-Agent' => @user_agent
|
|
39
|
+
}
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def self.default
|
|
43
|
+
@@default ||= ApiClient.new
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Call an API with given options.
|
|
47
|
+
#
|
|
48
|
+
# @return [Array<(Object, Integer, Hash)>] an array of 3 elements:
|
|
49
|
+
# the data deserialized from response body (may be a Tempfile or nil), response status code and response headers.
|
|
50
|
+
def call_api(http_method, path, opts = {})
|
|
51
|
+
request = build_request(http_method, path, opts)
|
|
52
|
+
tempfile = nil
|
|
53
|
+
(download_file(request) { tempfile = _1 }) if opts[:return_type] == 'File'
|
|
54
|
+
response = request.run
|
|
55
|
+
|
|
56
|
+
if @config.debugging
|
|
57
|
+
@config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n"
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
unless response.success?
|
|
61
|
+
if response.timed_out?
|
|
62
|
+
fail ApiError.new('Connection timed out')
|
|
63
|
+
elsif response.code == 0
|
|
64
|
+
# Errors from libcurl will be made visible here
|
|
65
|
+
fail ApiError.new(:code => 0,
|
|
66
|
+
:message => response.return_message)
|
|
67
|
+
else
|
|
68
|
+
fail ApiError.new(:code => response.code,
|
|
69
|
+
:response_headers => response.headers,
|
|
70
|
+
:response_body => response.body),
|
|
71
|
+
response.status_message
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
if opts[:return_type] == 'File'
|
|
76
|
+
data = tempfile
|
|
77
|
+
elsif opts[:return_type]
|
|
78
|
+
data = deserialize(response, opts[:return_type])
|
|
79
|
+
else
|
|
80
|
+
data = nil
|
|
81
|
+
end
|
|
82
|
+
return data, response.code, response.headers
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Builds the HTTP request
|
|
86
|
+
#
|
|
87
|
+
# @param [String] http_method HTTP method/verb (e.g. POST)
|
|
88
|
+
# @param [String] path URL path (e.g. /account/new)
|
|
89
|
+
# @option opts [Hash] :header_params Header parameters
|
|
90
|
+
# @option opts [Hash] :query_params Query parameters
|
|
91
|
+
# @option opts [Hash] :form_params Query parameters
|
|
92
|
+
# @option opts [Object] :body HTTP body (JSON/XML)
|
|
93
|
+
# @return [Typhoeus::Request] A Typhoeus Request
|
|
94
|
+
def build_request(http_method, path, opts = {})
|
|
95
|
+
url = build_request_url(path, opts)
|
|
96
|
+
http_method = http_method.to_sym.downcase
|
|
97
|
+
|
|
98
|
+
header_params = @default_headers.merge(opts[:header_params] || {})
|
|
99
|
+
query_params = opts[:query_params] || {}
|
|
100
|
+
form_params = opts[:form_params] || {}
|
|
101
|
+
follow_location = opts[:follow_location] || true
|
|
102
|
+
|
|
103
|
+
update_params_for_auth! header_params, query_params, opts[:auth_names]
|
|
104
|
+
|
|
105
|
+
# set ssl_verifyhosts option based on @config.verify_ssl_host (true/false)
|
|
106
|
+
_verify_ssl_host = @config.verify_ssl_host ? 2 : 0
|
|
107
|
+
|
|
108
|
+
req_opts = {
|
|
109
|
+
:method => http_method,
|
|
110
|
+
:headers => header_params,
|
|
111
|
+
:params => query_params,
|
|
112
|
+
:params_encoding => @config.params_encoding,
|
|
113
|
+
:timeout => @config.timeout,
|
|
114
|
+
:ssl_verifypeer => @config.verify_ssl,
|
|
115
|
+
:ssl_verifyhost => _verify_ssl_host,
|
|
116
|
+
:sslcert => @config.cert_file,
|
|
117
|
+
:sslkey => @config.key_file,
|
|
118
|
+
:verbose => @config.debugging,
|
|
119
|
+
:followlocation => follow_location
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
# set custom cert, if provided
|
|
123
|
+
req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert
|
|
124
|
+
|
|
125
|
+
if [:post, :patch, :put, :delete].include?(http_method)
|
|
126
|
+
req_body = build_request_body(header_params, form_params, opts[:body])
|
|
127
|
+
req_opts.update :body => req_body
|
|
128
|
+
if @config.debugging
|
|
129
|
+
@config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n"
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
Typhoeus::Request.new(url, req_opts)
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# Builds the HTTP request body
|
|
137
|
+
#
|
|
138
|
+
# @param [Hash] header_params Header parameters
|
|
139
|
+
# @param [Hash] form_params Query parameters
|
|
140
|
+
# @param [Object] body HTTP body (JSON/XML)
|
|
141
|
+
# @return [String] HTTP body data in the form of string
|
|
142
|
+
def build_request_body(header_params, form_params, body)
|
|
143
|
+
# http form
|
|
144
|
+
if header_params['Content-Type'] == 'application/x-www-form-urlencoded' ||
|
|
145
|
+
header_params['Content-Type'] == 'multipart/form-data'
|
|
146
|
+
data = {}
|
|
147
|
+
form_params.each do |key, value|
|
|
148
|
+
case value
|
|
149
|
+
when ::File, ::Array, nil
|
|
150
|
+
# let typhoeus handle File, Array and nil parameters
|
|
151
|
+
data[key] = value
|
|
152
|
+
else
|
|
153
|
+
data[key] = value.to_s
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
elsif body
|
|
157
|
+
data = body.is_a?(String) ? body : body.to_json
|
|
158
|
+
else
|
|
159
|
+
data = nil
|
|
160
|
+
end
|
|
161
|
+
data
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Save response body into a file in (the defined) temporary folder, using the filename
|
|
165
|
+
# from the "Content-Disposition" header if provided, otherwise a random filename.
|
|
166
|
+
# The response body is written to the file in chunks in order to handle files which
|
|
167
|
+
# size is larger than maximum Ruby String or even larger than the maximum memory a Ruby
|
|
168
|
+
# process can use.
|
|
169
|
+
#
|
|
170
|
+
# @see Configuration#temp_folder_path
|
|
171
|
+
#
|
|
172
|
+
# @return [Tempfile] the tempfile generated
|
|
173
|
+
def download_file(request)
|
|
174
|
+
tempfile = nil
|
|
175
|
+
encoding = nil
|
|
176
|
+
request.on_headers do |response|
|
|
177
|
+
content_disposition = response.headers['Content-Disposition']
|
|
178
|
+
if content_disposition && content_disposition =~ /filename=/i
|
|
179
|
+
filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
|
|
180
|
+
prefix = sanitize_filename(filename)
|
|
181
|
+
else
|
|
182
|
+
prefix = 'download-'
|
|
183
|
+
end
|
|
184
|
+
prefix = prefix + '-' unless prefix.end_with?('-')
|
|
185
|
+
encoding = response.body.encoding
|
|
186
|
+
tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
|
|
187
|
+
end
|
|
188
|
+
request.on_body do |chunk|
|
|
189
|
+
chunk.force_encoding(encoding)
|
|
190
|
+
tempfile.write(chunk)
|
|
191
|
+
end
|
|
192
|
+
request.on_complete do
|
|
193
|
+
if !tempfile
|
|
194
|
+
fail ApiError.new("Failed to create the tempfile based on the HTTP response from the server: #{request.inspect}")
|
|
195
|
+
end
|
|
196
|
+
tempfile.close
|
|
197
|
+
@config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
|
|
198
|
+
"with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
|
|
199
|
+
"will be deleted automatically with GC. It's also recommended to delete the temp file "\
|
|
200
|
+
"explicitly with `tempfile.delete`"
|
|
201
|
+
yield tempfile if block_given?
|
|
202
|
+
end
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# Check if the given MIME is a JSON MIME.
|
|
206
|
+
# JSON MIME examples:
|
|
207
|
+
# application/json
|
|
208
|
+
# application/json; charset=UTF8
|
|
209
|
+
# APPLICATION/JSON
|
|
210
|
+
# */*
|
|
211
|
+
# @param [String] mime MIME
|
|
212
|
+
# @return [Boolean] True if the MIME is application/json
|
|
213
|
+
def json_mime?(mime)
|
|
214
|
+
(mime == '*/*') || !(mime =~ /^Application\/.*json(?!p)(;.*)?/i).nil?
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
# Deserialize the response to the given return type.
|
|
218
|
+
#
|
|
219
|
+
# @param [Response] response HTTP response
|
|
220
|
+
# @param [String] return_type some examples: "User", "Array<User>", "Hash<String, Integer>"
|
|
221
|
+
def deserialize(response, return_type)
|
|
222
|
+
body = response.body
|
|
223
|
+
return nil if body.nil? || body.empty?
|
|
224
|
+
|
|
225
|
+
# return response body directly for String return type
|
|
226
|
+
return body.to_s if return_type == 'String'
|
|
227
|
+
|
|
228
|
+
# ensuring a default content type
|
|
229
|
+
content_type = response.headers['Content-Type'] || 'application/json'
|
|
230
|
+
|
|
231
|
+
fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type)
|
|
232
|
+
|
|
233
|
+
begin
|
|
234
|
+
data = JSON.parse("[#{body}]", :symbolize_names => true)[0]
|
|
235
|
+
rescue JSON::ParserError => e
|
|
236
|
+
if %w(String Date Time).include?(return_type)
|
|
237
|
+
data = body
|
|
238
|
+
else
|
|
239
|
+
raise e
|
|
240
|
+
end
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
convert_to_type data, return_type
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
# Convert data to the given return type.
|
|
247
|
+
# @param [Object] data Data to be converted
|
|
248
|
+
# @param [String] return_type Return type
|
|
249
|
+
# @return [Mixed] Data in a particular type
|
|
250
|
+
def convert_to_type(data, return_type)
|
|
251
|
+
return nil if data.nil?
|
|
252
|
+
case return_type
|
|
253
|
+
when 'String'
|
|
254
|
+
data.to_s
|
|
255
|
+
when 'Integer'
|
|
256
|
+
data.to_i
|
|
257
|
+
when 'Float'
|
|
258
|
+
data.to_f
|
|
259
|
+
when 'Boolean'
|
|
260
|
+
data == true
|
|
261
|
+
when 'Time'
|
|
262
|
+
# parse date time (expecting ISO 8601 format)
|
|
263
|
+
Time.parse data
|
|
264
|
+
when 'Date'
|
|
265
|
+
# parse date time (expecting ISO 8601 format)
|
|
266
|
+
Date.parse data
|
|
267
|
+
when 'Object'
|
|
268
|
+
# generic object (usually a Hash), return directly
|
|
269
|
+
data
|
|
270
|
+
when /\AArray<(.+)>\z/
|
|
271
|
+
# e.g. Array<Pet>
|
|
272
|
+
sub_type = $1
|
|
273
|
+
data.map { |item| convert_to_type(item, sub_type) }
|
|
274
|
+
when /\AHash\<String, (.+)\>\z/
|
|
275
|
+
# e.g. Hash<String, Integer>
|
|
276
|
+
sub_type = $1
|
|
277
|
+
{}.tap do |hash|
|
|
278
|
+
data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
|
|
279
|
+
end
|
|
280
|
+
else
|
|
281
|
+
# models (e.g. Pet) or oneOf/anyOf
|
|
282
|
+
klass = SoilSidekick.const_get(return_type)
|
|
283
|
+
if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of)
|
|
284
|
+
klass.build(data)
|
|
285
|
+
else
|
|
286
|
+
klass.build_from_hash(data)
|
|
287
|
+
end
|
|
288
|
+
end
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
# Sanitize filename by removing path.
|
|
292
|
+
# e.g. ../../sun.gif becomes sun.gif
|
|
293
|
+
#
|
|
294
|
+
# @param [String] filename the filename to be sanitized
|
|
295
|
+
# @return [String] the sanitized filename
|
|
296
|
+
def sanitize_filename(filename)
|
|
297
|
+
filename.split(/[\/\\]/).last
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
def build_request_url(path, opts = {})
|
|
301
|
+
# Add leading and trailing slashes to path
|
|
302
|
+
path = "/#{path}".gsub(/\/+/, '/')
|
|
303
|
+
@config.base_url(opts[:operation]) + path
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
# Update header and query params based on authentication settings.
|
|
307
|
+
#
|
|
308
|
+
# @param [Hash] header_params Header parameters
|
|
309
|
+
# @param [Hash] query_params Query parameters
|
|
310
|
+
# @param [String] auth_names Authentication scheme name
|
|
311
|
+
def update_params_for_auth!(header_params, query_params, auth_names)
|
|
312
|
+
Array(auth_names).each do |auth_name|
|
|
313
|
+
auth_setting = @config.auth_settings[auth_name]
|
|
314
|
+
next unless auth_setting
|
|
315
|
+
case auth_setting[:in]
|
|
316
|
+
when 'header' then header_params[auth_setting[:key]] = auth_setting[:value]
|
|
317
|
+
when 'query' then query_params[auth_setting[:key]] = auth_setting[:value]
|
|
318
|
+
else fail ArgumentError, 'Authentication token must be in `query` or `header`'
|
|
319
|
+
end
|
|
320
|
+
end
|
|
321
|
+
end
|
|
322
|
+
|
|
323
|
+
# Sets user agent in HTTP header
|
|
324
|
+
#
|
|
325
|
+
# @param [String] user_agent User agent (e.g. openapi-generator/ruby/1.0.0)
|
|
326
|
+
def user_agent=(user_agent)
|
|
327
|
+
@user_agent = user_agent
|
|
328
|
+
@default_headers['User-Agent'] = @user_agent
|
|
329
|
+
end
|
|
330
|
+
|
|
331
|
+
# Return Accept header based on an array of accepts provided.
|
|
332
|
+
# @param [Array] accepts array for Accept
|
|
333
|
+
# @return [String] the Accept header (e.g. application/json)
|
|
334
|
+
def select_header_accept(accepts)
|
|
335
|
+
return nil if accepts.nil? || accepts.empty?
|
|
336
|
+
# use JSON when present, otherwise use all of the provided
|
|
337
|
+
json_accept = accepts.find { |s| json_mime?(s) }
|
|
338
|
+
json_accept || accepts.join(',')
|
|
339
|
+
end
|
|
340
|
+
|
|
341
|
+
# Return Content-Type header based on an array of content types provided.
|
|
342
|
+
# @param [Array] content_types array for Content-Type
|
|
343
|
+
# @return [String] the Content-Type header (e.g. application/json)
|
|
344
|
+
def select_header_content_type(content_types)
|
|
345
|
+
# return nil by default
|
|
346
|
+
return if content_types.nil? || content_types.empty?
|
|
347
|
+
# use JSON when present, otherwise use the first one
|
|
348
|
+
json_content_type = content_types.find { |s| json_mime?(s) }
|
|
349
|
+
json_content_type || content_types.first
|
|
350
|
+
end
|
|
351
|
+
|
|
352
|
+
# Convert object (array, hash, object, etc) to JSON string.
|
|
353
|
+
# @param [Object] model object to be converted into JSON string
|
|
354
|
+
# @return [String] JSON string representation of the object
|
|
355
|
+
def object_to_http_body(model)
|
|
356
|
+
return model if model.nil? || model.is_a?(String)
|
|
357
|
+
local_body = nil
|
|
358
|
+
if model.is_a?(Array)
|
|
359
|
+
local_body = model.map { |m| object_to_hash(m) }
|
|
360
|
+
else
|
|
361
|
+
local_body = object_to_hash(model)
|
|
362
|
+
end
|
|
363
|
+
local_body.to_json
|
|
364
|
+
end
|
|
365
|
+
|
|
366
|
+
# Convert object(non-array) to hash.
|
|
367
|
+
# @param [Object] obj object to be converted into JSON string
|
|
368
|
+
# @return [String] JSON string representation of the object
|
|
369
|
+
def object_to_hash(obj)
|
|
370
|
+
if obj.respond_to?(:to_hash)
|
|
371
|
+
obj.to_hash
|
|
372
|
+
else
|
|
373
|
+
obj
|
|
374
|
+
end
|
|
375
|
+
end
|
|
376
|
+
|
|
377
|
+
# Build parameter value according to the given collection format.
|
|
378
|
+
# @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi
|
|
379
|
+
def build_collection_param(param, collection_format)
|
|
380
|
+
case collection_format
|
|
381
|
+
when :csv
|
|
382
|
+
param.join(',')
|
|
383
|
+
when :ssv
|
|
384
|
+
param.join(' ')
|
|
385
|
+
when :tsv
|
|
386
|
+
param.join("\t")
|
|
387
|
+
when :pipes
|
|
388
|
+
param.join('|')
|
|
389
|
+
when :multi
|
|
390
|
+
# return the array directly as typhoeus will handle it as expected
|
|
391
|
+
param
|
|
392
|
+
else
|
|
393
|
+
fail "unknown collection format: #{collection_format.inspect}"
|
|
394
|
+
end
|
|
395
|
+
end
|
|
396
|
+
end
|
|
397
|
+
end
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#SoilSidekick Pro API
|
|
3
|
+
|
|
4
|
+
#Agricultural intelligence and soil analysis API with tier-based access control. ## What's New in 1.2.0 - **Consumer Plant Care APIs**: Three new endpoints addressing top pain points in plant ID apps: - `/safe-identification`: Toxic lookalike warnings and environmental context - `/dynamic-care`: Hyper-localized, real-time care recommendations - `/beginner-guidance`: Judgment-free, jargon-free plant guidance ## Authentication All endpoints require an API key passed via the `x-api-key` header: ``` x-api-key: ak_your_api_key_here ``` API keys are generated through the dashboard and use the `ak_*` format. ## Rate Limiting Rate limits are enforced based on your subscription tier: - **Free**: 10 req/min, 100 req/hour, 1,000 req/day - **Starter**: 30 req/min, 500 req/hour, 5,000 req/day - **Pro**: 100 req/min, 2,000 req/hour, 25,000 req/day - **Enterprise**: 500 req/min, 10,000 req/hour, 100,000 req/day Rate limit information is returned in response headers: - `X-RateLimit-Limit`: Maximum requests in window - `X-RateLimit-Remaining`: Remaining requests in window - `X-RateLimit-Reset`: Unix timestamp when limit resets ## Response Time SLAs All endpoints return response time headers for performance monitoring: - `X-Response-Time`: Human-readable response time (e.g., \"245ms\") - `X-Response-Time-Ms`: Response time in milliseconds - `X-Response-Time-Target`: Target response time for this endpoint - `X-Response-Time-Max`: Maximum acceptable response time - `X-Response-Time-Status`: Performance status (`optimal`, `acceptable`, `exceeded`) ### Response Time Targets by Category | Category | Target | Maximum | Endpoints | |----------|--------|---------|-----------| | **Fast** | 200ms | 500ms | county-lookup, check-subscription | | **Standard** | 500ms | 1,500ms | get-soil-data, territorial-water-quality | | **Complex** | 2,000ms | 5,000ms | agricultural-intelligence, gpt5-chat, visual-crop-analysis | | **Heavy** | 5,000ms | 15,000ms | live-agricultural-data, generate-vrt-prescription |
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 3.0.0
|
|
7
|
+
Contact: support@soilsidekickpro.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.23.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
module SoilSidekick
|
|
14
|
+
class ApiError < StandardError
|
|
15
|
+
attr_reader :code, :response_headers, :response_body
|
|
16
|
+
|
|
17
|
+
# Usage examples:
|
|
18
|
+
# ApiError.new
|
|
19
|
+
# ApiError.new("message")
|
|
20
|
+
# ApiError.new(:code => 500, :response_headers => {}, :response_body => "")
|
|
21
|
+
# ApiError.new(:code => 404, :message => "Not Found")
|
|
22
|
+
def initialize(arg = nil)
|
|
23
|
+
if arg.is_a? Hash
|
|
24
|
+
if arg.key?(:message) || arg.key?('message')
|
|
25
|
+
super(arg[:message] || arg['message'])
|
|
26
|
+
else
|
|
27
|
+
super arg
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
arg.each do |k, v|
|
|
31
|
+
instance_variable_set "@#{k}", v
|
|
32
|
+
end
|
|
33
|
+
else
|
|
34
|
+
super arg
|
|
35
|
+
@message = arg
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Override to_s to display a friendly error message
|
|
40
|
+
def to_s
|
|
41
|
+
message
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def message
|
|
45
|
+
if @message.nil?
|
|
46
|
+
msg = "Error message: the server returns an error"
|
|
47
|
+
else
|
|
48
|
+
msg = @message
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
msg += "\nHTTP status code: #{code}" if code
|
|
52
|
+
msg += "\nResponse headers: #{response_headers}" if response_headers
|
|
53
|
+
msg += "\nResponse body: #{response_body}" if response_body
|
|
54
|
+
|
|
55
|
+
msg
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|