From 89f88b101920de61023673c90fc79caca47e7e97 Mon Sep 17 00:00:00 2001 From: Alessandra Gherardelli Date: Tue, 10 Sep 2024 14:24:35 +0200 Subject: [PATCH] Removed client --- data_bridges_client/__init__.py | 100 - data_bridges_client/api/__init__.py | 16 - data_bridges_client/api/commodities_api.py | 740 ----- .../api/commodity_units_api.py | 757 ----- data_bridges_client/api/currency_api.py | 724 ----- data_bridges_client/api/economic_data_api.py | 761 ----- data_bridges_client/api/food_security_api.py | 356 --- data_bridges_client/api/gorp_api.py | 1402 --------- data_bridges_client/api/incubation_api.py | 2520 ----------------- data_bridges_client/api/market_prices_api.py | 2394 ---------------- data_bridges_client/api/markets_api.py | 1245 -------- data_bridges_client/api/rpme_api.py | 2049 -------------- data_bridges_client/api/surveys_api.py | 1483 ---------- data_bridges_client/api/xls_forms_api.py | 390 --- data_bridges_client/api_client.py | 771 ----- data_bridges_client/api_response.py | 21 - data_bridges_client/configuration.py | 445 --- data_bridges_client/exceptions.py | 200 -- data_bridges_client/models/__init__.py | 72 - data_bridges_client/models/bad_request_dto.py | 106 - data_bridges_client/models/commodity_dto.py | 171 -- .../models/commodity_price_dto.py | 232 -- .../models/commodity_processing_dto.py | 108 - .../models/commodity_quality_dto.py | 108 - data_bridges_client/models/currency_dto.py | 125 - .../models/economic_data_dto.py | 104 - .../models/economic_indicator_property.py | 141 - ...conomic_indicator_property_paged_result.py | 120 - data_bridges_client/models/feature.py | 127 - data_bridges_client/models/geometry.py | 113 - .../models/gorp_country_api_dto.py | 122 - .../models/gorp_global_api_dto.py | 129 - .../models/gorp_regional_api_dto.py | 129 - .../models/gorp_value_with_changes.py | 132 - .../gorp_value_with_changes_paged_result.py | 120 - .../models/household_survey_list_dto.py | 266 -- .../household_survey_list_dto_paged_result.py | 120 - data_bridges_client/models/ipc_value.py | 221 -- .../models/ipc_value_paged_result.py | 120 - data_bridges_client/models/key_name_dto.py | 108 - data_bridges_client/models/market_dto.py | 157 - .../models/market_geo_json_root.py | 128 - .../models/mfi_processed_data_dto.py | 232 -- .../models/nearby_markets_dto.py | 110 - .../models/paged_commodity_list_dto.py | 118 - .../models/paged_commodity_price_list_dto.py | 118 - ...modity_weekly_aggregated_price_list_dto.py | 118 - .../models/paged_currency_list_dto.py | 118 - .../models/paged_economic_data_dto.py | 139 - .../models/paged_market_list_dto.py | 118 - .../models/paged_processed_data_dto.py | 118 - .../models/paged_survey_list_dto.py | 118 - .../models/paged_survey_responses_dto.py | 110 - .../models/paged_xls_form_list_dto.py | 118 - data_bridges_client/models/problem_details.py | 134 - data_bridges_client/models/properties.py | 106 - data_bridges_client/models/rpme_assessment.py | 203 -- .../models/rpme_assessment_paged_result.py | 120 - .../models/rpme_output_values.py | 108 - data_bridges_client/models/rpme_variable.py | 142 - .../models/rpme_variable_paged_result.py | 120 - data_bridges_client/models/survey_list_dto.py | 186 -- .../models/usd_indirect_quotation.py | 136 - .../usd_indirect_quotation_paged_result.py | 120 - .../models/view_extended_aggregated_price.py | 229 -- ..._extended_aggregated_price_paged_result.py | 120 - .../models/view_extended_alps_value.py | 193 -- .../view_extended_alps_value_paged_result.py | 120 - .../models/weekly_aggregated_price.py | 197 -- .../xls_form_definition_new_schema_dto.py | 163 -- data_bridges_client/models/xls_form_dto.py | 134 - .../models/xls_form_fields_dto.py | 126 - .../models/xls_form_list_choice_dto.py | 113 - .../models/xls_form_list_choices_dto.py | 121 - data_bridges_client/py.typed | 0 data_bridges_client/rest.py | 258 -- data_bridges_client/token.py | 63 - 77 files changed, 24400 deletions(-) delete mode 100644 data_bridges_client/__init__.py delete mode 100644 data_bridges_client/api/__init__.py delete mode 100644 data_bridges_client/api/commodities_api.py delete mode 100644 data_bridges_client/api/commodity_units_api.py delete mode 100644 data_bridges_client/api/currency_api.py delete mode 100644 data_bridges_client/api/economic_data_api.py delete mode 100644 data_bridges_client/api/food_security_api.py delete mode 100644 data_bridges_client/api/gorp_api.py delete mode 100644 data_bridges_client/api/incubation_api.py delete mode 100644 data_bridges_client/api/market_prices_api.py delete mode 100644 data_bridges_client/api/markets_api.py delete mode 100644 data_bridges_client/api/rpme_api.py delete mode 100644 data_bridges_client/api/surveys_api.py delete mode 100644 data_bridges_client/api/xls_forms_api.py delete mode 100644 data_bridges_client/api_client.py delete mode 100644 data_bridges_client/api_response.py delete mode 100644 data_bridges_client/configuration.py delete mode 100644 data_bridges_client/exceptions.py delete mode 100644 data_bridges_client/models/__init__.py delete mode 100644 data_bridges_client/models/bad_request_dto.py delete mode 100644 data_bridges_client/models/commodity_dto.py delete mode 100644 data_bridges_client/models/commodity_price_dto.py delete mode 100644 data_bridges_client/models/commodity_processing_dto.py delete mode 100644 data_bridges_client/models/commodity_quality_dto.py delete mode 100644 data_bridges_client/models/currency_dto.py delete mode 100644 data_bridges_client/models/economic_data_dto.py delete mode 100644 data_bridges_client/models/economic_indicator_property.py delete mode 100644 data_bridges_client/models/economic_indicator_property_paged_result.py delete mode 100644 data_bridges_client/models/feature.py delete mode 100644 data_bridges_client/models/geometry.py delete mode 100644 data_bridges_client/models/gorp_country_api_dto.py delete mode 100644 data_bridges_client/models/gorp_global_api_dto.py delete mode 100644 data_bridges_client/models/gorp_regional_api_dto.py delete mode 100644 data_bridges_client/models/gorp_value_with_changes.py delete mode 100644 data_bridges_client/models/gorp_value_with_changes_paged_result.py delete mode 100644 data_bridges_client/models/household_survey_list_dto.py delete mode 100644 data_bridges_client/models/household_survey_list_dto_paged_result.py delete mode 100644 data_bridges_client/models/ipc_value.py delete mode 100644 data_bridges_client/models/ipc_value_paged_result.py delete mode 100644 data_bridges_client/models/key_name_dto.py delete mode 100644 data_bridges_client/models/market_dto.py delete mode 100644 data_bridges_client/models/market_geo_json_root.py delete mode 100644 data_bridges_client/models/mfi_processed_data_dto.py delete mode 100644 data_bridges_client/models/nearby_markets_dto.py delete mode 100644 data_bridges_client/models/paged_commodity_list_dto.py delete mode 100644 data_bridges_client/models/paged_commodity_price_list_dto.py delete mode 100644 data_bridges_client/models/paged_commodity_weekly_aggregated_price_list_dto.py delete mode 100644 data_bridges_client/models/paged_currency_list_dto.py delete mode 100644 data_bridges_client/models/paged_economic_data_dto.py delete mode 100644 data_bridges_client/models/paged_market_list_dto.py delete mode 100644 data_bridges_client/models/paged_processed_data_dto.py delete mode 100644 data_bridges_client/models/paged_survey_list_dto.py delete mode 100644 data_bridges_client/models/paged_survey_responses_dto.py delete mode 100644 data_bridges_client/models/paged_xls_form_list_dto.py delete mode 100644 data_bridges_client/models/problem_details.py delete mode 100644 data_bridges_client/models/properties.py delete mode 100644 data_bridges_client/models/rpme_assessment.py delete mode 100644 data_bridges_client/models/rpme_assessment_paged_result.py delete mode 100644 data_bridges_client/models/rpme_output_values.py delete mode 100644 data_bridges_client/models/rpme_variable.py delete mode 100644 data_bridges_client/models/rpme_variable_paged_result.py delete mode 100644 data_bridges_client/models/survey_list_dto.py delete mode 100644 data_bridges_client/models/usd_indirect_quotation.py delete mode 100644 data_bridges_client/models/usd_indirect_quotation_paged_result.py delete mode 100644 data_bridges_client/models/view_extended_aggregated_price.py delete mode 100644 data_bridges_client/models/view_extended_aggregated_price_paged_result.py delete mode 100644 data_bridges_client/models/view_extended_alps_value.py delete mode 100644 data_bridges_client/models/view_extended_alps_value_paged_result.py delete mode 100644 data_bridges_client/models/weekly_aggregated_price.py delete mode 100644 data_bridges_client/models/xls_form_definition_new_schema_dto.py delete mode 100644 data_bridges_client/models/xls_form_dto.py delete mode 100644 data_bridges_client/models/xls_form_fields_dto.py delete mode 100644 data_bridges_client/models/xls_form_list_choice_dto.py delete mode 100644 data_bridges_client/models/xls_form_list_choices_dto.py delete mode 100644 data_bridges_client/py.typed delete mode 100644 data_bridges_client/rest.py delete mode 100644 data_bridges_client/token.py diff --git a/data_bridges_client/__init__.py b/data_bridges_client/__init__.py deleted file mode 100644 index eb6553c..0000000 --- a/data_bridges_client/__init__.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -__version__ = "4.1.0" - -# import apis into sdk package -from data_bridges_client.api.commodities_api import CommoditiesApi -from data_bridges_client.api.commodity_units_api import CommodityUnitsApi -from data_bridges_client.api.currency_api import CurrencyApi -from data_bridges_client.api.economic_data_api import EconomicDataApi -from data_bridges_client.api.food_security_api import FoodSecurityApi -from data_bridges_client.api.gorp_api import GorpApi -from data_bridges_client.api.incubation_api import IncubationApi -from data_bridges_client.api.market_prices_api import MarketPricesApi -from data_bridges_client.api.markets_api import MarketsApi -from data_bridges_client.api.rpme_api import RpmeApi -from data_bridges_client.api.surveys_api import SurveysApi -from data_bridges_client.api.xls_forms_api import XlsFormsApi - -# import ApiClient -from data_bridges_client.api_response import ApiResponse -from data_bridges_client.api_client import ApiClient -from data_bridges_client.configuration import Configuration -from data_bridges_client.exceptions import OpenApiException -from data_bridges_client.exceptions import ApiTypeError -from data_bridges_client.exceptions import ApiValueError -from data_bridges_client.exceptions import ApiKeyError -from data_bridges_client.exceptions import ApiAttributeError -from data_bridges_client.exceptions import ApiException - -# import models into sdk package -from data_bridges_client.models.bad_request_dto import BadRequestDTO -from data_bridges_client.models.commodity_dto import CommodityDTO -from data_bridges_client.models.commodity_price_dto import CommodityPriceDTO -from data_bridges_client.models.commodity_processing_dto import CommodityProcessingDTO -from data_bridges_client.models.commodity_quality_dto import CommodityQualityDTO -from data_bridges_client.models.currency_dto import CurrencyDTO -from data_bridges_client.models.economic_data_dto import EconomicDataDTO -from data_bridges_client.models.economic_indicator_property import EconomicIndicatorProperty -from data_bridges_client.models.economic_indicator_property_paged_result import EconomicIndicatorPropertyPagedResult -from data_bridges_client.models.feature import Feature -from data_bridges_client.models.geometry import Geometry -from data_bridges_client.models.gorp_country_api_dto import GorpCountryApiDto -from data_bridges_client.models.gorp_global_api_dto import GorpGlobalApiDto -from data_bridges_client.models.gorp_regional_api_dto import GorpRegionalApiDto -from data_bridges_client.models.gorp_value_with_changes import GorpValueWithChanges -from data_bridges_client.models.gorp_value_with_changes_paged_result import GorpValueWithChangesPagedResult -from data_bridges_client.models.household_survey_list_dto import HouseholdSurveyListDTO -from data_bridges_client.models.household_survey_list_dto_paged_result import HouseholdSurveyListDTOPagedResult -from data_bridges_client.models.ipc_value import IpcValue -from data_bridges_client.models.ipc_value_paged_result import IpcValuePagedResult -from data_bridges_client.models.key_name_dto import KeyNameDto -from data_bridges_client.models.mfi_processed_data_dto import MFIProcessedDataDTO -from data_bridges_client.models.market_dto import MarketDTO -from data_bridges_client.models.market_geo_json_root import MarketGeoJsonRoot -from data_bridges_client.models.nearby_markets_dto import NearbyMarketsDTO -from data_bridges_client.models.paged_commodity_list_dto import PagedCommodityListDTO -from data_bridges_client.models.paged_commodity_price_list_dto import PagedCommodityPriceListDTO -from data_bridges_client.models.paged_commodity_weekly_aggregated_price_list_dto import PagedCommodityWeeklyAggregatedPriceListDTO -from data_bridges_client.models.paged_currency_list_dto import PagedCurrencyListDTO -from data_bridges_client.models.paged_economic_data_dto import PagedEconomicDataDTO -from data_bridges_client.models.paged_market_list_dto import PagedMarketListDTO -from data_bridges_client.models.paged_processed_data_dto import PagedProcessedDataDTO -from data_bridges_client.models.paged_survey_list_dto import PagedSurveyListDTO -from data_bridges_client.models.paged_survey_responses_dto import PagedSurveyResponsesDTO -from data_bridges_client.models.paged_xls_form_list_dto import PagedXlsFormListDTO -from data_bridges_client.models.problem_details import ProblemDetails -from data_bridges_client.models.properties import Properties -from data_bridges_client.models.rpme_assessment import RpmeAssessment -from data_bridges_client.models.rpme_assessment_paged_result import RpmeAssessmentPagedResult -from data_bridges_client.models.rpme_output_values import RpmeOutputValues -from data_bridges_client.models.rpme_variable import RpmeVariable -from data_bridges_client.models.rpme_variable_paged_result import RpmeVariablePagedResult -from data_bridges_client.models.survey_list_dto import SurveyListDTO -from data_bridges_client.models.usd_indirect_quotation import UsdIndirectQuotation -from data_bridges_client.models.usd_indirect_quotation_paged_result import UsdIndirectQuotationPagedResult -from data_bridges_client.models.view_extended_aggregated_price import ViewExtendedAggregatedPrice -from data_bridges_client.models.view_extended_aggregated_price_paged_result import ViewExtendedAggregatedPricePagedResult -from data_bridges_client.models.view_extended_alps_value import ViewExtendedAlpsValue -from data_bridges_client.models.view_extended_alps_value_paged_result import ViewExtendedAlpsValuePagedResult -from data_bridges_client.models.weekly_aggregated_price import WeeklyAggregatedPrice -from data_bridges_client.models.xls_form_dto import XlsFormDTO -from data_bridges_client.models.xls_form_definition_new_schema_dto import XlsFormDefinitionNewSchemaDTO -from data_bridges_client.models.xls_form_fields_dto import XlsFormFieldsDTO -from data_bridges_client.models.xls_form_list_choice_dto import XlsFormListChoiceDTO -from data_bridges_client.models.xls_form_list_choices_dto import XlsFormListChoicesDTO diff --git a/data_bridges_client/api/__init__.py b/data_bridges_client/api/__init__.py deleted file mode 100644 index 8f86505..0000000 --- a/data_bridges_client/api/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -# flake8: noqa - -# import apis into api package -from data_bridges_client.api.commodities_api import CommoditiesApi -from data_bridges_client.api.commodity_units_api import CommodityUnitsApi -from data_bridges_client.api.currency_api import CurrencyApi -from data_bridges_client.api.economic_data_api import EconomicDataApi -from data_bridges_client.api.food_security_api import FoodSecurityApi -from data_bridges_client.api.gorp_api import GorpApi -from data_bridges_client.api.incubation_api import IncubationApi -from data_bridges_client.api.market_prices_api import MarketPricesApi -from data_bridges_client.api.markets_api import MarketsApi -from data_bridges_client.api.rpme_api import RpmeApi -from data_bridges_client.api.surveys_api import SurveysApi -from data_bridges_client.api.xls_forms_api import XlsFormsApi - diff --git a/data_bridges_client/api/commodities_api.py b/data_bridges_client/api/commodities_api.py deleted file mode 100644 index be5fd2d..0000000 --- a/data_bridges_client/api/commodities_api.py +++ /dev/null @@ -1,740 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from pydantic import Field, StrictInt, StrictStr, field_validator -from typing import Optional -from typing_extensions import Annotated -from data_bridges_client.models.paged_commodity_list_dto import PagedCommodityListDTO - -from data_bridges_client.api_client import ApiClient, RequestSerialized -from data_bridges_client.api_response import ApiResponse -from data_bridges_client.rest import RESTResponseType - - -class CommoditiesApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def commodities_categories_list_get( - self, - country_code: Annotated[Optional[StrictStr], Field(description="The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code")] = None, - category_name: Annotated[Optional[StrictStr], Field(description="The name, even partial and case insensitive, of a commodity category.")] = None, - category_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a Commodity, as found in /Commodities/List.")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PagedCommodityListDTO: - """Provides the list of categories. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_commodities-categories-list_get\" Categories are matched with high level WFP commodity classification at level 1. No mandatory parameter. **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param country_code: The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code - :type country_code: str - :param category_name: The name, even partial and case insensitive, of a commodity category. - :type category_name: str - :param category_id: The exact ID of a Commodity, as found in /Commodities/List. - :type category_id: int - :param page: page number for paged results - :type page: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._commodities_categories_list_get_serialize( - country_code=country_code, - category_name=category_name, - category_id=category_id, - page=page, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedCommodityListDTO", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def commodities_categories_list_get_with_http_info( - self, - country_code: Annotated[Optional[StrictStr], Field(description="The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code")] = None, - category_name: Annotated[Optional[StrictStr], Field(description="The name, even partial and case insensitive, of a commodity category.")] = None, - category_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a Commodity, as found in /Commodities/List.")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PagedCommodityListDTO]: - """Provides the list of categories. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_commodities-categories-list_get\" Categories are matched with high level WFP commodity classification at level 1. No mandatory parameter. **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param country_code: The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code - :type country_code: str - :param category_name: The name, even partial and case insensitive, of a commodity category. - :type category_name: str - :param category_id: The exact ID of a Commodity, as found in /Commodities/List. - :type category_id: int - :param page: page number for paged results - :type page: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._commodities_categories_list_get_serialize( - country_code=country_code, - category_name=category_name, - category_id=category_id, - page=page, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedCommodityListDTO", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def commodities_categories_list_get_without_preload_content( - self, - country_code: Annotated[Optional[StrictStr], Field(description="The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code")] = None, - category_name: Annotated[Optional[StrictStr], Field(description="The name, even partial and case insensitive, of a commodity category.")] = None, - category_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a Commodity, as found in /Commodities/List.")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Provides the list of categories. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_commodities-categories-list_get\" Categories are matched with high level WFP commodity classification at level 1. No mandatory parameter. **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param country_code: The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code - :type country_code: str - :param category_name: The name, even partial and case insensitive, of a commodity category. - :type category_name: str - :param category_id: The exact ID of a Commodity, as found in /Commodities/List. - :type category_id: int - :param page: page number for paged results - :type page: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._commodities_categories_list_get_serialize( - country_code=country_code, - category_name=category_name, - category_id=category_id, - page=page, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedCommodityListDTO", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _commodities_categories_list_get_serialize( - self, - country_code, - category_name, - category_id, - page, - format, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if country_code is not None: - - _query_params.append(('countryCode', country_code)) - - if category_name is not None: - - _query_params.append(('categoryName', category_name)) - - if category_id is not None: - - _query_params.append(('categoryID', category_id)) - - if page is not None: - - _query_params.append(('page', page)) - - if format is not None: - - _query_params.append(('format', format)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain', - 'application/json', - 'text/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/Commodities/Categories/List', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def commodities_list_get( - self, - country_code: Annotated[Optional[StrictStr], Field(description="The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code")] = None, - commodity_name: Annotated[Optional[StrictStr], Field(description="The name, even partial and case insensitive, of a commodity")] = None, - commodity_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a commodity")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PagedCommodityListDTO: - """Provide the detailed list of the commodities available in DataBridges platform - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_commodities-list_get\" COICOP 2018 codes are returned to hierarchically matching categories based on [UN-Statistical Division codes](https://unstats.un.org/unsd/classifications/Econ/). No mandatory parameter. **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param country_code: The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code - :type country_code: str - :param commodity_name: The name, even partial and case insensitive, of a commodity - :type commodity_name: str - :param commodity_id: The exact ID of a commodity - :type commodity_id: int - :param page: page number for paged results - :type page: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._commodities_list_get_serialize( - country_code=country_code, - commodity_name=commodity_name, - commodity_id=commodity_id, - page=page, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedCommodityListDTO", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def commodities_list_get_with_http_info( - self, - country_code: Annotated[Optional[StrictStr], Field(description="The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code")] = None, - commodity_name: Annotated[Optional[StrictStr], Field(description="The name, even partial and case insensitive, of a commodity")] = None, - commodity_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a commodity")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PagedCommodityListDTO]: - """Provide the detailed list of the commodities available in DataBridges platform - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_commodities-list_get\" COICOP 2018 codes are returned to hierarchically matching categories based on [UN-Statistical Division codes](https://unstats.un.org/unsd/classifications/Econ/). No mandatory parameter. **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param country_code: The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code - :type country_code: str - :param commodity_name: The name, even partial and case insensitive, of a commodity - :type commodity_name: str - :param commodity_id: The exact ID of a commodity - :type commodity_id: int - :param page: page number for paged results - :type page: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._commodities_list_get_serialize( - country_code=country_code, - commodity_name=commodity_name, - commodity_id=commodity_id, - page=page, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedCommodityListDTO", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def commodities_list_get_without_preload_content( - self, - country_code: Annotated[Optional[StrictStr], Field(description="The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code")] = None, - commodity_name: Annotated[Optional[StrictStr], Field(description="The name, even partial and case insensitive, of a commodity")] = None, - commodity_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a commodity")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Provide the detailed list of the commodities available in DataBridges platform - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_commodities-list_get\" COICOP 2018 codes are returned to hierarchically matching categories based on [UN-Statistical Division codes](https://unstats.un.org/unsd/classifications/Econ/). No mandatory parameter. **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param country_code: The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code - :type country_code: str - :param commodity_name: The name, even partial and case insensitive, of a commodity - :type commodity_name: str - :param commodity_id: The exact ID of a commodity - :type commodity_id: int - :param page: page number for paged results - :type page: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._commodities_list_get_serialize( - country_code=country_code, - commodity_name=commodity_name, - commodity_id=commodity_id, - page=page, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedCommodityListDTO", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _commodities_list_get_serialize( - self, - country_code, - commodity_name, - commodity_id, - page, - format, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if country_code is not None: - - _query_params.append(('countryCode', country_code)) - - if commodity_name is not None: - - _query_params.append(('commodityName', commodity_name)) - - if commodity_id is not None: - - _query_params.append(('commodityID', commodity_id)) - - if page is not None: - - _query_params.append(('page', page)) - - if format is not None: - - _query_params.append(('format', format)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain', - 'application/json', - 'text/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/Commodities/List', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - diff --git a/data_bridges_client/api/commodity_units_api.py b/data_bridges_client/api/commodity_units_api.py deleted file mode 100644 index fb60f4a..0000000 --- a/data_bridges_client/api/commodity_units_api.py +++ /dev/null @@ -1,757 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from pydantic import Field, StrictInt, StrictStr, field_validator -from typing import Optional -from typing_extensions import Annotated -from data_bridges_client.models.paged_commodity_list_dto import PagedCommodityListDTO - -from data_bridges_client.api_client import ApiClient, RequestSerialized -from data_bridges_client.api_response import ApiResponse -from data_bridges_client.rest import RESTResponseType - - -class CommodityUnitsApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def commodity_units_conversion_list_get( - self, - country_code: Annotated[Optional[StrictStr], Field(description="The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code.")] = None, - commodity_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a Commodity, as found in /Commodities/List")] = None, - from_unit_id: Annotated[Optional[StrictInt], Field(description="The exact ID of the original unit of measure of the price of a commodity, as found in /CommodityUnits/List")] = None, - to_unit_id: Annotated[Optional[StrictInt], Field(description="The exact ID of the converted unit of measure of the price of a commodity, as found in /CommodityUnits/List")] = None, - page: Annotated[Optional[StrictInt], Field(description="Page number for paged results")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PagedCommodityListDTO: - """Provides conversion factors to Kilogram or Litres for each convertible unit of measure. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_commodityunits-conversion-list_get\" Some non-standard units of measure might have different a conversion factor based on the country [Adm0Code]; Other non-standard units of measure might have a different conversion factor based on the commodity [CommodityID] being measured. Other cases will have null adm0code and CommodityID. No mandatory parameter. **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param country_code: The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code. - :type country_code: str - :param commodity_id: The exact ID of a Commodity, as found in /Commodities/List - :type commodity_id: int - :param from_unit_id: The exact ID of the original unit of measure of the price of a commodity, as found in /CommodityUnits/List - :type from_unit_id: int - :param to_unit_id: The exact ID of the converted unit of measure of the price of a commodity, as found in /CommodityUnits/List - :type to_unit_id: int - :param page: Page number for paged results - :type page: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._commodity_units_conversion_list_get_serialize( - country_code=country_code, - commodity_id=commodity_id, - from_unit_id=from_unit_id, - to_unit_id=to_unit_id, - page=page, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedCommodityListDTO", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def commodity_units_conversion_list_get_with_http_info( - self, - country_code: Annotated[Optional[StrictStr], Field(description="The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code.")] = None, - commodity_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a Commodity, as found in /Commodities/List")] = None, - from_unit_id: Annotated[Optional[StrictInt], Field(description="The exact ID of the original unit of measure of the price of a commodity, as found in /CommodityUnits/List")] = None, - to_unit_id: Annotated[Optional[StrictInt], Field(description="The exact ID of the converted unit of measure of the price of a commodity, as found in /CommodityUnits/List")] = None, - page: Annotated[Optional[StrictInt], Field(description="Page number for paged results")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PagedCommodityListDTO]: - """Provides conversion factors to Kilogram or Litres for each convertible unit of measure. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_commodityunits-conversion-list_get\" Some non-standard units of measure might have different a conversion factor based on the country [Adm0Code]; Other non-standard units of measure might have a different conversion factor based on the commodity [CommodityID] being measured. Other cases will have null adm0code and CommodityID. No mandatory parameter. **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param country_code: The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code. - :type country_code: str - :param commodity_id: The exact ID of a Commodity, as found in /Commodities/List - :type commodity_id: int - :param from_unit_id: The exact ID of the original unit of measure of the price of a commodity, as found in /CommodityUnits/List - :type from_unit_id: int - :param to_unit_id: The exact ID of the converted unit of measure of the price of a commodity, as found in /CommodityUnits/List - :type to_unit_id: int - :param page: Page number for paged results - :type page: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._commodity_units_conversion_list_get_serialize( - country_code=country_code, - commodity_id=commodity_id, - from_unit_id=from_unit_id, - to_unit_id=to_unit_id, - page=page, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedCommodityListDTO", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def commodity_units_conversion_list_get_without_preload_content( - self, - country_code: Annotated[Optional[StrictStr], Field(description="The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code.")] = None, - commodity_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a Commodity, as found in /Commodities/List")] = None, - from_unit_id: Annotated[Optional[StrictInt], Field(description="The exact ID of the original unit of measure of the price of a commodity, as found in /CommodityUnits/List")] = None, - to_unit_id: Annotated[Optional[StrictInt], Field(description="The exact ID of the converted unit of measure of the price of a commodity, as found in /CommodityUnits/List")] = None, - page: Annotated[Optional[StrictInt], Field(description="Page number for paged results")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Provides conversion factors to Kilogram or Litres for each convertible unit of measure. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_commodityunits-conversion-list_get\" Some non-standard units of measure might have different a conversion factor based on the country [Adm0Code]; Other non-standard units of measure might have a different conversion factor based on the commodity [CommodityID] being measured. Other cases will have null adm0code and CommodityID. No mandatory parameter. **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param country_code: The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code. - :type country_code: str - :param commodity_id: The exact ID of a Commodity, as found in /Commodities/List - :type commodity_id: int - :param from_unit_id: The exact ID of the original unit of measure of the price of a commodity, as found in /CommodityUnits/List - :type from_unit_id: int - :param to_unit_id: The exact ID of the converted unit of measure of the price of a commodity, as found in /CommodityUnits/List - :type to_unit_id: int - :param page: Page number for paged results - :type page: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._commodity_units_conversion_list_get_serialize( - country_code=country_code, - commodity_id=commodity_id, - from_unit_id=from_unit_id, - to_unit_id=to_unit_id, - page=page, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedCommodityListDTO", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _commodity_units_conversion_list_get_serialize( - self, - country_code, - commodity_id, - from_unit_id, - to_unit_id, - page, - format, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if country_code is not None: - - _query_params.append(('countryCode', country_code)) - - if commodity_id is not None: - - _query_params.append(('commodityID', commodity_id)) - - if from_unit_id is not None: - - _query_params.append(('fromUnitID', from_unit_id)) - - if to_unit_id is not None: - - _query_params.append(('toUnitID', to_unit_id)) - - if page is not None: - - _query_params.append(('page', page)) - - if format is not None: - - _query_params.append(('format', format)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain', - 'application/json', - 'text/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/CommodityUnits/Conversion/List', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def commodity_units_list_get( - self, - country_code: Annotated[Optional[StrictStr], Field(description="The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code")] = None, - commodity_unit_name: Annotated[Optional[StrictStr], Field(description="The name, even partial and case insensitive, of a commodity unit")] = None, - commodity_unit_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a commodity unit")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PagedCommodityListDTO: - """Provides the detailed list of the unit of measure available in DataBridges platform - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_commodityunits-list_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param country_code: The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code - :type country_code: str - :param commodity_unit_name: The name, even partial and case insensitive, of a commodity unit - :type commodity_unit_name: str - :param commodity_unit_id: The exact ID of a commodity unit - :type commodity_unit_id: int - :param page: page number for paged results - :type page: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._commodity_units_list_get_serialize( - country_code=country_code, - commodity_unit_name=commodity_unit_name, - commodity_unit_id=commodity_unit_id, - page=page, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedCommodityListDTO", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def commodity_units_list_get_with_http_info( - self, - country_code: Annotated[Optional[StrictStr], Field(description="The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code")] = None, - commodity_unit_name: Annotated[Optional[StrictStr], Field(description="The name, even partial and case insensitive, of a commodity unit")] = None, - commodity_unit_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a commodity unit")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PagedCommodityListDTO]: - """Provides the detailed list of the unit of measure available in DataBridges platform - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_commodityunits-list_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param country_code: The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code - :type country_code: str - :param commodity_unit_name: The name, even partial and case insensitive, of a commodity unit - :type commodity_unit_name: str - :param commodity_unit_id: The exact ID of a commodity unit - :type commodity_unit_id: int - :param page: page number for paged results - :type page: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._commodity_units_list_get_serialize( - country_code=country_code, - commodity_unit_name=commodity_unit_name, - commodity_unit_id=commodity_unit_id, - page=page, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedCommodityListDTO", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def commodity_units_list_get_without_preload_content( - self, - country_code: Annotated[Optional[StrictStr], Field(description="The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code")] = None, - commodity_unit_name: Annotated[Optional[StrictStr], Field(description="The name, even partial and case insensitive, of a commodity unit")] = None, - commodity_unit_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a commodity unit")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Provides the detailed list of the unit of measure available in DataBridges platform - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_commodityunits-list_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param country_code: The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code - :type country_code: str - :param commodity_unit_name: The name, even partial and case insensitive, of a commodity unit - :type commodity_unit_name: str - :param commodity_unit_id: The exact ID of a commodity unit - :type commodity_unit_id: int - :param page: page number for paged results - :type page: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._commodity_units_list_get_serialize( - country_code=country_code, - commodity_unit_name=commodity_unit_name, - commodity_unit_id=commodity_unit_id, - page=page, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedCommodityListDTO", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _commodity_units_list_get_serialize( - self, - country_code, - commodity_unit_name, - commodity_unit_id, - page, - format, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if country_code is not None: - - _query_params.append(('countryCode', country_code)) - - if commodity_unit_name is not None: - - _query_params.append(('commodityUnitName', commodity_unit_name)) - - if commodity_unit_id is not None: - - _query_params.append(('commodityUnitID', commodity_unit_id)) - - if page is not None: - - _query_params.append(('page', page)) - - if format is not None: - - _query_params.append(('format', format)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain', - 'application/json', - 'text/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/CommodityUnits/List', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - diff --git a/data_bridges_client/api/currency_api.py b/data_bridges_client/api/currency_api.py deleted file mode 100644 index 5b68b76..0000000 --- a/data_bridges_client/api/currency_api.py +++ /dev/null @@ -1,724 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from pydantic import Field, StrictInt, StrictStr, field_validator -from typing import Optional -from typing_extensions import Annotated -from data_bridges_client.models.paged_currency_list_dto import PagedCurrencyListDTO -from data_bridges_client.models.usd_indirect_quotation_paged_result import UsdIndirectQuotationPagedResult - -from data_bridges_client.api_client import ApiClient, RequestSerialized -from data_bridges_client.api_response import ApiResponse -from data_bridges_client.rest import RESTResponseType - - -class CurrencyApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def currency_list_get( - self, - country_code: Annotated[Optional[StrictStr], Field(description="The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code.")] = None, - currency_name: Annotated[Optional[StrictStr], Field(description="Currency 3-letter code, matching with ISO 4217.")] = None, - currency_id: Annotated[Optional[StrictInt], Field(description="Unique code to identify the currency in internal VAM currencies.")] = None, - page: Annotated[Optional[StrictInt], Field(description="Page number for paged results")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PagedCurrencyListDTO: - """Returns the list of currencies available in the internal VAM database, with Currency 3-letter code, matching with ISO 4217. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_currency-list_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param country_code: The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code. - :type country_code: str - :param currency_name: Currency 3-letter code, matching with ISO 4217. - :type currency_name: str - :param currency_id: Unique code to identify the currency in internal VAM currencies. - :type currency_id: int - :param page: Page number for paged results - :type page: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._currency_list_get_serialize( - country_code=country_code, - currency_name=currency_name, - currency_id=currency_id, - page=page, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedCurrencyListDTO", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def currency_list_get_with_http_info( - self, - country_code: Annotated[Optional[StrictStr], Field(description="The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code.")] = None, - currency_name: Annotated[Optional[StrictStr], Field(description="Currency 3-letter code, matching with ISO 4217.")] = None, - currency_id: Annotated[Optional[StrictInt], Field(description="Unique code to identify the currency in internal VAM currencies.")] = None, - page: Annotated[Optional[StrictInt], Field(description="Page number for paged results")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PagedCurrencyListDTO]: - """Returns the list of currencies available in the internal VAM database, with Currency 3-letter code, matching with ISO 4217. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_currency-list_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param country_code: The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code. - :type country_code: str - :param currency_name: Currency 3-letter code, matching with ISO 4217. - :type currency_name: str - :param currency_id: Unique code to identify the currency in internal VAM currencies. - :type currency_id: int - :param page: Page number for paged results - :type page: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._currency_list_get_serialize( - country_code=country_code, - currency_name=currency_name, - currency_id=currency_id, - page=page, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedCurrencyListDTO", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def currency_list_get_without_preload_content( - self, - country_code: Annotated[Optional[StrictStr], Field(description="The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code.")] = None, - currency_name: Annotated[Optional[StrictStr], Field(description="Currency 3-letter code, matching with ISO 4217.")] = None, - currency_id: Annotated[Optional[StrictInt], Field(description="Unique code to identify the currency in internal VAM currencies.")] = None, - page: Annotated[Optional[StrictInt], Field(description="Page number for paged results")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Returns the list of currencies available in the internal VAM database, with Currency 3-letter code, matching with ISO 4217. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_currency-list_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param country_code: The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code. - :type country_code: str - :param currency_name: Currency 3-letter code, matching with ISO 4217. - :type currency_name: str - :param currency_id: Unique code to identify the currency in internal VAM currencies. - :type currency_id: int - :param page: Page number for paged results - :type page: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._currency_list_get_serialize( - country_code=country_code, - currency_name=currency_name, - currency_id=currency_id, - page=page, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedCurrencyListDTO", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _currency_list_get_serialize( - self, - country_code, - currency_name, - currency_id, - page, - format, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if country_code is not None: - - _query_params.append(('countryCode', country_code)) - - if currency_name is not None: - - _query_params.append(('currencyName', currency_name)) - - if currency_id is not None: - - _query_params.append(('currencyID', currency_id)) - - if page is not None: - - _query_params.append(('page', page)) - - if format is not None: - - _query_params.append(('format', format)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain', - 'application/json', - 'text/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/Currency/List', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def currency_usd_indirect_quotation_get( - self, - country_iso3: Annotated[Optional[StrictStr], Field(description="The code to identify the country. Must be a ISO-3166 Alpha 3 code.")] = None, - currency_name: Annotated[Optional[StrictStr], Field(description="the ISO3 code for the currency, based on ISO4217")] = None, - page: Annotated[Optional[StrictInt], Field(description="Page number for paged results")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> UsdIndirectQuotationPagedResult: - """Returns the value of the Exchange rates from Trading Economics, for official rates, and DataViz for unofficial rates. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_currency-usdindirectquotation_get\" Returns the time series of values of the Exchange rate of the Local Currency for buying 1 USD in the official market. Original frequency for official rates is daily, non-indicated. Unofficial rates are aggregated at national level by the original frequency of collection. For greater detail on unofficial exchange rates, explore the Exchange Rate (unofficial) commodity in Market Prices Prices. No mandatory parameter. **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param country_iso3: The code to identify the country. Must be a ISO-3166 Alpha 3 code. - :type country_iso3: str - :param currency_name: the ISO3 code for the currency, based on ISO4217 - :type currency_name: str - :param page: Page number for paged results - :type page: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._currency_usd_indirect_quotation_get_serialize( - country_iso3=country_iso3, - currency_name=currency_name, - page=page, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UsdIndirectQuotationPagedResult", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def currency_usd_indirect_quotation_get_with_http_info( - self, - country_iso3: Annotated[Optional[StrictStr], Field(description="The code to identify the country. Must be a ISO-3166 Alpha 3 code.")] = None, - currency_name: Annotated[Optional[StrictStr], Field(description="the ISO3 code for the currency, based on ISO4217")] = None, - page: Annotated[Optional[StrictInt], Field(description="Page number for paged results")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[UsdIndirectQuotationPagedResult]: - """Returns the value of the Exchange rates from Trading Economics, for official rates, and DataViz for unofficial rates. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_currency-usdindirectquotation_get\" Returns the time series of values of the Exchange rate of the Local Currency for buying 1 USD in the official market. Original frequency for official rates is daily, non-indicated. Unofficial rates are aggregated at national level by the original frequency of collection. For greater detail on unofficial exchange rates, explore the Exchange Rate (unofficial) commodity in Market Prices Prices. No mandatory parameter. **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param country_iso3: The code to identify the country. Must be a ISO-3166 Alpha 3 code. - :type country_iso3: str - :param currency_name: the ISO3 code for the currency, based on ISO4217 - :type currency_name: str - :param page: Page number for paged results - :type page: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._currency_usd_indirect_quotation_get_serialize( - country_iso3=country_iso3, - currency_name=currency_name, - page=page, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UsdIndirectQuotationPagedResult", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def currency_usd_indirect_quotation_get_without_preload_content( - self, - country_iso3: Annotated[Optional[StrictStr], Field(description="The code to identify the country. Must be a ISO-3166 Alpha 3 code.")] = None, - currency_name: Annotated[Optional[StrictStr], Field(description="the ISO3 code for the currency, based on ISO4217")] = None, - page: Annotated[Optional[StrictInt], Field(description="Page number for paged results")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Returns the value of the Exchange rates from Trading Economics, for official rates, and DataViz for unofficial rates. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_currency-usdindirectquotation_get\" Returns the time series of values of the Exchange rate of the Local Currency for buying 1 USD in the official market. Original frequency for official rates is daily, non-indicated. Unofficial rates are aggregated at national level by the original frequency of collection. For greater detail on unofficial exchange rates, explore the Exchange Rate (unofficial) commodity in Market Prices Prices. No mandatory parameter. **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param country_iso3: The code to identify the country. Must be a ISO-3166 Alpha 3 code. - :type country_iso3: str - :param currency_name: the ISO3 code for the currency, based on ISO4217 - :type currency_name: str - :param page: Page number for paged results - :type page: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._currency_usd_indirect_quotation_get_serialize( - country_iso3=country_iso3, - currency_name=currency_name, - page=page, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UsdIndirectQuotationPagedResult", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _currency_usd_indirect_quotation_get_serialize( - self, - country_iso3, - currency_name, - page, - format, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if country_iso3 is not None: - - _query_params.append(('countryIso3', country_iso3)) - - if currency_name is not None: - - _query_params.append(('currencyName', currency_name)) - - if page is not None: - - _query_params.append(('page', page)) - - if format is not None: - - _query_params.append(('format', format)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain', - 'application/json', - 'text/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/Currency/UsdIndirectQuotation', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - diff --git a/data_bridges_client/api/economic_data_api.py b/data_bridges_client/api/economic_data_api.py deleted file mode 100644 index 20e2e9a..0000000 --- a/data_bridges_client/api/economic_data_api.py +++ /dev/null @@ -1,761 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from datetime import datetime -from pydantic import Field, StrictInt, StrictStr, field_validator -from typing import Optional -from typing_extensions import Annotated -from data_bridges_client.models.economic_indicator_property_paged_result import EconomicIndicatorPropertyPagedResult -from data_bridges_client.models.paged_economic_data_dto import PagedEconomicDataDTO - -from data_bridges_client.api_client import ApiClient, RequestSerialized -from data_bridges_client.api_response import ApiResponse -from data_bridges_client.rest import RESTResponseType - - -class EconomicDataApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def economic_data_indicator_list_get( - self, - page: Annotated[Optional[StrictInt], Field(description="Page number for paged results")] = None, - indicator_name: Annotated[Optional[StrictStr], Field(description="Unique indicator name.")] = None, - iso3: Annotated[Optional[StrictStr], Field(description="The code to identify the country. Must be a ISO-3166 Alpha 3 code.")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> EconomicIndicatorPropertyPagedResult: - """Returns the lists of indicators. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_economicdata-indicatorlist_get\" Returns the lists of indicators for which Vulnerability Analysis and Mapping - Economic and Market Analysis Unit has redistribution licensing from Trading Economics. No mandatory parameter. **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param page: Page number for paged results - :type page: int - :param indicator_name: Unique indicator name. - :type indicator_name: str - :param iso3: The code to identify the country. Must be a ISO-3166 Alpha 3 code. - :type iso3: str - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._economic_data_indicator_list_get_serialize( - page=page, - indicator_name=indicator_name, - iso3=iso3, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "EconomicIndicatorPropertyPagedResult", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def economic_data_indicator_list_get_with_http_info( - self, - page: Annotated[Optional[StrictInt], Field(description="Page number for paged results")] = None, - indicator_name: Annotated[Optional[StrictStr], Field(description="Unique indicator name.")] = None, - iso3: Annotated[Optional[StrictStr], Field(description="The code to identify the country. Must be a ISO-3166 Alpha 3 code.")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[EconomicIndicatorPropertyPagedResult]: - """Returns the lists of indicators. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_economicdata-indicatorlist_get\" Returns the lists of indicators for which Vulnerability Analysis and Mapping - Economic and Market Analysis Unit has redistribution licensing from Trading Economics. No mandatory parameter. **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param page: Page number for paged results - :type page: int - :param indicator_name: Unique indicator name. - :type indicator_name: str - :param iso3: The code to identify the country. Must be a ISO-3166 Alpha 3 code. - :type iso3: str - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._economic_data_indicator_list_get_serialize( - page=page, - indicator_name=indicator_name, - iso3=iso3, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "EconomicIndicatorPropertyPagedResult", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def economic_data_indicator_list_get_without_preload_content( - self, - page: Annotated[Optional[StrictInt], Field(description="Page number for paged results")] = None, - indicator_name: Annotated[Optional[StrictStr], Field(description="Unique indicator name.")] = None, - iso3: Annotated[Optional[StrictStr], Field(description="The code to identify the country. Must be a ISO-3166 Alpha 3 code.")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Returns the lists of indicators. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_economicdata-indicatorlist_get\" Returns the lists of indicators for which Vulnerability Analysis and Mapping - Economic and Market Analysis Unit has redistribution licensing from Trading Economics. No mandatory parameter. **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param page: Page number for paged results - :type page: int - :param indicator_name: Unique indicator name. - :type indicator_name: str - :param iso3: The code to identify the country. Must be a ISO-3166 Alpha 3 code. - :type iso3: str - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._economic_data_indicator_list_get_serialize( - page=page, - indicator_name=indicator_name, - iso3=iso3, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "EconomicIndicatorPropertyPagedResult", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _economic_data_indicator_list_get_serialize( - self, - page, - indicator_name, - iso3, - format, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if page is not None: - - _query_params.append(('page', page)) - - if indicator_name is not None: - - _query_params.append(('indicatorName', indicator_name)) - - if iso3 is not None: - - _query_params.append(('iso3', iso3)) - - if format is not None: - - _query_params.append(('format', format)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain', - 'application/json', - 'text/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/EconomicData/IndicatorList', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def economic_data_indicator_name_get( - self, - indicator_name: Annotated[StrictStr, Field(description="Name of the indicator as found in /EconomicData/IndicatorList.")], - page: Annotated[Optional[StrictInt], Field(description="Page number for paged results")] = None, - iso3: Annotated[Optional[StrictStr], Field(description="The code to identify the country. Must be a ISO-3166 Alpha 3 code.")] = None, - start_date: Annotated[Optional[datetime], Field(description="Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24)")] = None, - end_date: Annotated[Optional[datetime], Field(description="Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24)")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PagedEconomicDataDTO: - """Returns the time series of values for different indicators. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_economicdata_get\" Indicator name as retrieved from /EconomicData/IndicatorList is mandatory. **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param indicator_name: Name of the indicator as found in /EconomicData/IndicatorList. (required) - :type indicator_name: str - :param page: Page number for paged results - :type page: int - :param iso3: The code to identify the country. Must be a ISO-3166 Alpha 3 code. - :type iso3: str - :param start_date: Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24) - :type start_date: datetime - :param end_date: Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24) - :type end_date: datetime - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._economic_data_indicator_name_get_serialize( - indicator_name=indicator_name, - page=page, - iso3=iso3, - start_date=start_date, - end_date=end_date, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedEconomicDataDTO", - '400': "BadRequestDTO", - '404': "ProblemDetails", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def economic_data_indicator_name_get_with_http_info( - self, - indicator_name: Annotated[StrictStr, Field(description="Name of the indicator as found in /EconomicData/IndicatorList.")], - page: Annotated[Optional[StrictInt], Field(description="Page number for paged results")] = None, - iso3: Annotated[Optional[StrictStr], Field(description="The code to identify the country. Must be a ISO-3166 Alpha 3 code.")] = None, - start_date: Annotated[Optional[datetime], Field(description="Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24)")] = None, - end_date: Annotated[Optional[datetime], Field(description="Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24)")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PagedEconomicDataDTO]: - """Returns the time series of values for different indicators. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_economicdata_get\" Indicator name as retrieved from /EconomicData/IndicatorList is mandatory. **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param indicator_name: Name of the indicator as found in /EconomicData/IndicatorList. (required) - :type indicator_name: str - :param page: Page number for paged results - :type page: int - :param iso3: The code to identify the country. Must be a ISO-3166 Alpha 3 code. - :type iso3: str - :param start_date: Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24) - :type start_date: datetime - :param end_date: Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24) - :type end_date: datetime - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._economic_data_indicator_name_get_serialize( - indicator_name=indicator_name, - page=page, - iso3=iso3, - start_date=start_date, - end_date=end_date, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedEconomicDataDTO", - '400': "BadRequestDTO", - '404': "ProblemDetails", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def economic_data_indicator_name_get_without_preload_content( - self, - indicator_name: Annotated[StrictStr, Field(description="Name of the indicator as found in /EconomicData/IndicatorList.")], - page: Annotated[Optional[StrictInt], Field(description="Page number for paged results")] = None, - iso3: Annotated[Optional[StrictStr], Field(description="The code to identify the country. Must be a ISO-3166 Alpha 3 code.")] = None, - start_date: Annotated[Optional[datetime], Field(description="Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24)")] = None, - end_date: Annotated[Optional[datetime], Field(description="Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24)")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Returns the time series of values for different indicators. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_economicdata_get\" Indicator name as retrieved from /EconomicData/IndicatorList is mandatory. **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param indicator_name: Name of the indicator as found in /EconomicData/IndicatorList. (required) - :type indicator_name: str - :param page: Page number for paged results - :type page: int - :param iso3: The code to identify the country. Must be a ISO-3166 Alpha 3 code. - :type iso3: str - :param start_date: Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24) - :type start_date: datetime - :param end_date: Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24) - :type end_date: datetime - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._economic_data_indicator_name_get_serialize( - indicator_name=indicator_name, - page=page, - iso3=iso3, - start_date=start_date, - end_date=end_date, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedEconomicDataDTO", - '400': "BadRequestDTO", - '404': "ProblemDetails", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _economic_data_indicator_name_get_serialize( - self, - indicator_name, - page, - iso3, - start_date, - end_date, - format, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if indicator_name is not None: - _path_params['indicatorName'] = indicator_name - # process the query parameters - if page is not None: - - _query_params.append(('page', page)) - - if iso3 is not None: - - _query_params.append(('iso3', iso3)) - - if start_date is not None: - if isinstance(start_date, datetime): - _query_params.append( - ( - 'startDate', - start_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('startDate', start_date)) - - if end_date is not None: - if isinstance(end_date, datetime): - _query_params.append( - ( - 'endDate', - end_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('endDate', end_date)) - - if format is not None: - - _query_params.append(('format', format)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain', - 'application/json', - 'text/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/EconomicData/{indicatorName}', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - diff --git a/data_bridges_client/api/food_security_api.py b/data_bridges_client/api/food_security_api.py deleted file mode 100644 index ace1cea..0000000 --- a/data_bridges_client/api/food_security_api.py +++ /dev/null @@ -1,356 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from pydantic import Field, StrictInt, StrictStr, field_validator -from typing import Optional -from typing_extensions import Annotated -from data_bridges_client.models.ipc_value_paged_result import IpcValuePagedResult - -from data_bridges_client.api_client import ApiClient, RequestSerialized -from data_bridges_client.api_response import ApiResponse -from data_bridges_client.rest import RESTResponseType - - -class FoodSecurityApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def food_security_list_get( - self, - iso3: Annotated[Optional[StrictStr], Field(description="The country ISO3 code")] = None, - year: Optional[StrictInt] = None, - page: Optional[StrictInt] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> IpcValuePagedResult: - """food_security_list_get - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_foodsecurity-list_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param iso3: The country ISO3 code - :type iso3: str - :param year: - :type year: int - :param page: - :type page: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._food_security_list_get_serialize( - iso3=iso3, - year=year, - page=page, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "IpcValuePagedResult", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def food_security_list_get_with_http_info( - self, - iso3: Annotated[Optional[StrictStr], Field(description="The country ISO3 code")] = None, - year: Optional[StrictInt] = None, - page: Optional[StrictInt] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[IpcValuePagedResult]: - """food_security_list_get - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_foodsecurity-list_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param iso3: The country ISO3 code - :type iso3: str - :param year: - :type year: int - :param page: - :type page: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._food_security_list_get_serialize( - iso3=iso3, - year=year, - page=page, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "IpcValuePagedResult", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def food_security_list_get_without_preload_content( - self, - iso3: Annotated[Optional[StrictStr], Field(description="The country ISO3 code")] = None, - year: Optional[StrictInt] = None, - page: Optional[StrictInt] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """food_security_list_get - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_foodsecurity-list_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param iso3: The country ISO3 code - :type iso3: str - :param year: - :type year: int - :param page: - :type page: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._food_security_list_get_serialize( - iso3=iso3, - year=year, - page=page, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "IpcValuePagedResult", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _food_security_list_get_serialize( - self, - iso3, - year, - page, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if iso3 is not None: - - _query_params.append(('iso3', iso3)) - - if year is not None: - - _query_params.append(('year', year)) - - if page is not None: - - _query_params.append(('page', page)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain', - 'application/json', - 'text/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/FoodSecurity/List', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - diff --git a/data_bridges_client/api/gorp_api.py b/data_bridges_client/api/gorp_api.py deleted file mode 100644 index df732f8..0000000 --- a/data_bridges_client/api/gorp_api.py +++ /dev/null @@ -1,1402 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from pydantic import Field, StrictInt, StrictStr, field_validator -from typing import List, Optional -from typing_extensions import Annotated -from data_bridges_client.models.gorp_country_api_dto import GorpCountryApiDto -from data_bridges_client.models.gorp_global_api_dto import GorpGlobalApiDto -from data_bridges_client.models.gorp_regional_api_dto import GorpRegionalApiDto -from data_bridges_client.models.gorp_value_with_changes_paged_result import GorpValueWithChangesPagedResult - -from data_bridges_client.api_client import ApiClient, RequestSerialized -from data_bridges_client.api_response import ApiResponse -from data_bridges_client.rest import RESTResponseType - - -class GorpApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def gorp_country_latest_get( - self, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[GorpCountryApiDto]: - """Return the latest country dataset of number of acutely food insecure (in thousands) based on WFP Global Operational Response Plan. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_gorp-countrylatest_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._gorp_country_latest_get_serialize( - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[GorpCountryApiDto]", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def gorp_country_latest_get_with_http_info( - self, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[GorpCountryApiDto]]: - """Return the latest country dataset of number of acutely food insecure (in thousands) based on WFP Global Operational Response Plan. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_gorp-countrylatest_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._gorp_country_latest_get_serialize( - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[GorpCountryApiDto]", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def gorp_country_latest_get_without_preload_content( - self, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Return the latest country dataset of number of acutely food insecure (in thousands) based on WFP Global Operational Response Plan. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_gorp-countrylatest_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._gorp_country_latest_get_serialize( - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[GorpCountryApiDto]", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _gorp_country_latest_get_serialize( - self, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain', - 'application/json', - 'text/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/Gorp/CountryLatest', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def gorp_global_latest_get( - self, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GorpGlobalApiDto: - """Return the latest global dataset of number of acutely food insecure (in millions) based on WFP Global Operational Response Plan. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_gorp-globallatest_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._gorp_global_latest_get_serialize( - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GorpGlobalApiDto", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def gorp_global_latest_get_with_http_info( - self, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GorpGlobalApiDto]: - """Return the latest global dataset of number of acutely food insecure (in millions) based on WFP Global Operational Response Plan. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_gorp-globallatest_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._gorp_global_latest_get_serialize( - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GorpGlobalApiDto", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def gorp_global_latest_get_without_preload_content( - self, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Return the latest global dataset of number of acutely food insecure (in millions) based on WFP Global Operational Response Plan. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_gorp-globallatest_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._gorp_global_latest_get_serialize( - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GorpGlobalApiDto", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _gorp_global_latest_get_serialize( - self, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain', - 'application/json', - 'text/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/Gorp/GlobalLatest', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def gorp_latest_get( - self, - page: Optional[StrictInt] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GorpValueWithChangesPagedResult: - """Return the latest dataset of number of acutely food insecure (in millions) based on WFP Global Operational Response Plan. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_gorp-latest_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param page: - :type page: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._gorp_latest_get_serialize( - page=page, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GorpValueWithChangesPagedResult", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def gorp_latest_get_with_http_info( - self, - page: Optional[StrictInt] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GorpValueWithChangesPagedResult]: - """Return the latest dataset of number of acutely food insecure (in millions) based on WFP Global Operational Response Plan. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_gorp-latest_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param page: - :type page: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._gorp_latest_get_serialize( - page=page, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GorpValueWithChangesPagedResult", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def gorp_latest_get_without_preload_content( - self, - page: Optional[StrictInt] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Return the latest dataset of number of acutely food insecure (in millions) based on WFP Global Operational Response Plan. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_gorp-latest_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param page: - :type page: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._gorp_latest_get_serialize( - page=page, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GorpValueWithChangesPagedResult", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _gorp_latest_get_serialize( - self, - page, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if page is not None: - - _query_params.append(('page', page)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain', - 'application/json', - 'text/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/Gorp/Latest', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def gorp_list_get( - self, - page: Optional[StrictInt] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GorpValueWithChangesPagedResult: - """Return the full dataset of number of acutely food insecure (in millions) based on WFP Global Operational Response Plan. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_gorp-list_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param page: - :type page: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._gorp_list_get_serialize( - page=page, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GorpValueWithChangesPagedResult", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def gorp_list_get_with_http_info( - self, - page: Optional[StrictInt] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GorpValueWithChangesPagedResult]: - """Return the full dataset of number of acutely food insecure (in millions) based on WFP Global Operational Response Plan. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_gorp-list_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param page: - :type page: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._gorp_list_get_serialize( - page=page, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GorpValueWithChangesPagedResult", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def gorp_list_get_without_preload_content( - self, - page: Optional[StrictInt] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Return the full dataset of number of acutely food insecure (in millions) based on WFP Global Operational Response Plan. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_gorp-list_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param page: - :type page: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._gorp_list_get_serialize( - page=page, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "GorpValueWithChangesPagedResult", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _gorp_list_get_serialize( - self, - page, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if page is not None: - - _query_params.append(('page', page)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain', - 'application/json', - 'text/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/Gorp/List', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def gorp_regional_latest_get( - self, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[GorpRegionalApiDto]: - """Return the latest regional dataset of number of acutely food insecure (in millions) based on WFP Global Operational Response Plan. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_gorp-regionallatest_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._gorp_regional_latest_get_serialize( - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[GorpRegionalApiDto]", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def gorp_regional_latest_get_with_http_info( - self, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[GorpRegionalApiDto]]: - """Return the latest regional dataset of number of acutely food insecure (in millions) based on WFP Global Operational Response Plan. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_gorp-regionallatest_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._gorp_regional_latest_get_serialize( - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[GorpRegionalApiDto]", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def gorp_regional_latest_get_without_preload_content( - self, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Return the latest regional dataset of number of acutely food insecure (in millions) based on WFP Global Operational Response Plan. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_gorp-regionallatest_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._gorp_regional_latest_get_serialize( - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[GorpRegionalApiDto]", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _gorp_regional_latest_get_serialize( - self, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain', - 'application/json', - 'text/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/Gorp/RegionalLatest', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - diff --git a/data_bridges_client/api/incubation_api.py b/data_bridges_client/api/incubation_api.py deleted file mode 100644 index fefb369..0000000 --- a/data_bridges_client/api/incubation_api.py +++ /dev/null @@ -1,2520 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from datetime import datetime -from pydantic import Field, StrictInt, StrictStr, field_validator -from typing import List, Optional -from typing_extensions import Annotated -from data_bridges_client.models.household_survey_list_dto_paged_result import HouseholdSurveyListDTOPagedResult -from data_bridges_client.models.paged_survey_responses_dto import PagedSurveyResponsesDTO -from data_bridges_client.models.xls_form_definition_new_schema_dto import XlsFormDefinitionNewSchemaDTO - -from data_bridges_client.api_client import ApiClient, RequestSerialized -from data_bridges_client.api_response import ApiResponse -from data_bridges_client.rest import RESTResponseType - - -class IncubationApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def aims_download_all_analysis_rounds_get( - self, - adm0_code: Annotated[StrictInt, Field(description="The country adm0Code")], - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Each asset has a baseline and several rounds. Each round reflects the number of times the asset has been analysed over time. The number of total rounds changes according to the workstream: Asset Detection (AD) assets can have a total of 5 rounds, while there is no limit to the monitoring of Landscape Impact Assessment (LIA) assets. Assets considered for Site Prioritization (SP) have one round only. Please note that adm0code can be obtained from https://api.vam.wfp.org/geodata/swagger/index.html (VPN access only). - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Incubation-red)]() [![Generic badge](https://img.shields.io/badge/Access%20Policy-TEC_Architecture_+_Service_Owner_approvals_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Official%20Use%20Only-yellow)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_aims-downloadallanalysisrounds_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param adm0_code: The country adm0Code (required) - :type adm0_code: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._aims_download_all_analysis_rounds_get_serialize( - adm0_code=adm0_code, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': None, - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def aims_download_all_analysis_rounds_get_with_http_info( - self, - adm0_code: Annotated[StrictInt, Field(description="The country adm0Code")], - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Each asset has a baseline and several rounds. Each round reflects the number of times the asset has been analysed over time. The number of total rounds changes according to the workstream: Asset Detection (AD) assets can have a total of 5 rounds, while there is no limit to the monitoring of Landscape Impact Assessment (LIA) assets. Assets considered for Site Prioritization (SP) have one round only. Please note that adm0code can be obtained from https://api.vam.wfp.org/geodata/swagger/index.html (VPN access only). - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Incubation-red)]() [![Generic badge](https://img.shields.io/badge/Access%20Policy-TEC_Architecture_+_Service_Owner_approvals_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Official%20Use%20Only-yellow)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_aims-downloadallanalysisrounds_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param adm0_code: The country adm0Code (required) - :type adm0_code: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._aims_download_all_analysis_rounds_get_serialize( - adm0_code=adm0_code, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': None, - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def aims_download_all_analysis_rounds_get_without_preload_content( - self, - adm0_code: Annotated[StrictInt, Field(description="The country adm0Code")], - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Each asset has a baseline and several rounds. Each round reflects the number of times the asset has been analysed over time. The number of total rounds changes according to the workstream: Asset Detection (AD) assets can have a total of 5 rounds, while there is no limit to the monitoring of Landscape Impact Assessment (LIA) assets. Assets considered for Site Prioritization (SP) have one round only. Please note that adm0code can be obtained from https://api.vam.wfp.org/geodata/swagger/index.html (VPN access only). - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Incubation-red)]() [![Generic badge](https://img.shields.io/badge/Access%20Policy-TEC_Architecture_+_Service_Owner_approvals_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Official%20Use%20Only-yellow)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_aims-downloadallanalysisrounds_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param adm0_code: The country adm0Code (required) - :type adm0_code: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._aims_download_all_analysis_rounds_get_serialize( - adm0_code=adm0_code, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': None, - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _aims_download_all_analysis_rounds_get_serialize( - self, - adm0_code, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if adm0_code is not None: - - _query_params.append(('adm0Code', adm0_code)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/Aims/DownloadAllAnalysisRounds', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def aims_download_polygon_files_get( - self, - adm0_code: Annotated[StrictInt, Field(description="The country adm0Code")], - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Polygon files are available for Landscape Impact Assessment (LIA) assets only. The file name corresponds to the “Geotrace” name. Please note that adm0code can be obtained from https://api.vam.wfp.org/geodata/swagger/index.html (VPN access only). - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Incubation-red)]() [![Generic badge](https://img.shields.io/badge/Access%20Policy-TEC_Architecture_+_Service_Owner_approvals_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Official%20Use%20Only-yellow)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_aims-downloadpolygonfiles_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param adm0_code: The country adm0Code (required) - :type adm0_code: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._aims_download_polygon_files_get_serialize( - adm0_code=adm0_code, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': None, - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def aims_download_polygon_files_get_with_http_info( - self, - adm0_code: Annotated[StrictInt, Field(description="The country adm0Code")], - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Polygon files are available for Landscape Impact Assessment (LIA) assets only. The file name corresponds to the “Geotrace” name. Please note that adm0code can be obtained from https://api.vam.wfp.org/geodata/swagger/index.html (VPN access only). - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Incubation-red)]() [![Generic badge](https://img.shields.io/badge/Access%20Policy-TEC_Architecture_+_Service_Owner_approvals_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Official%20Use%20Only-yellow)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_aims-downloadpolygonfiles_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param adm0_code: The country adm0Code (required) - :type adm0_code: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._aims_download_polygon_files_get_serialize( - adm0_code=adm0_code, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': None, - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def aims_download_polygon_files_get_without_preload_content( - self, - adm0_code: Annotated[StrictInt, Field(description="The country adm0Code")], - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Polygon files are available for Landscape Impact Assessment (LIA) assets only. The file name corresponds to the “Geotrace” name. Please note that adm0code can be obtained from https://api.vam.wfp.org/geodata/swagger/index.html (VPN access only). - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Incubation-red)]() [![Generic badge](https://img.shields.io/badge/Access%20Policy-TEC_Architecture_+_Service_Owner_approvals_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Official%20Use%20Only-yellow)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_aims-downloadpolygonfiles_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param adm0_code: The country adm0Code (required) - :type adm0_code: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._aims_download_polygon_files_get_serialize( - adm0_code=adm0_code, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': None, - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _aims_download_polygon_files_get_serialize( - self, - adm0_code, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if adm0_code is not None: - - _query_params.append(('adm0Code', adm0_code)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/Aims/DownloadPolygonFiles', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def household_draft_internal_base_data_get( - self, - survey_id: Annotated[Optional[StrictInt], Field(description="unique identifier for the collected data, as retrieved from /Surveys API.")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - page_size: Annotated[Optional[StrictInt], Field(description="page size for paged results, default value is 20.")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PagedSurveyResponsesDTO: - """Get data that includes the core household fields only by Survey ID - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Incubation-red)]() [![Generic badge](https://img.shields.io/badge/Access%20Policy-TEC_Architecture_+_Service_Owner_approvals_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Official%20Use%20Only-yellow)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_household-draftinternalbasedata_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param survey_id: unique identifier for the collected data, as retrieved from /Surveys API. - :type survey_id: int - :param page: page number for paged results - :type page: int - :param page_size: page size for paged results, default value is 20. - :type page_size: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._household_draft_internal_base_data_get_serialize( - survey_id=survey_id, - page=page, - page_size=page_size, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedSurveyResponsesDTO", - '400': "BadRequestDTO", - '404': "ProblemDetails", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def household_draft_internal_base_data_get_with_http_info( - self, - survey_id: Annotated[Optional[StrictInt], Field(description="unique identifier for the collected data, as retrieved from /Surveys API.")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - page_size: Annotated[Optional[StrictInt], Field(description="page size for paged results, default value is 20.")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PagedSurveyResponsesDTO]: - """Get data that includes the core household fields only by Survey ID - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Incubation-red)]() [![Generic badge](https://img.shields.io/badge/Access%20Policy-TEC_Architecture_+_Service_Owner_approvals_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Official%20Use%20Only-yellow)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_household-draftinternalbasedata_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param survey_id: unique identifier for the collected data, as retrieved from /Surveys API. - :type survey_id: int - :param page: page number for paged results - :type page: int - :param page_size: page size for paged results, default value is 20. - :type page_size: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._household_draft_internal_base_data_get_serialize( - survey_id=survey_id, - page=page, - page_size=page_size, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedSurveyResponsesDTO", - '400': "BadRequestDTO", - '404': "ProblemDetails", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def household_draft_internal_base_data_get_without_preload_content( - self, - survey_id: Annotated[Optional[StrictInt], Field(description="unique identifier for the collected data, as retrieved from /Surveys API.")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - page_size: Annotated[Optional[StrictInt], Field(description="page size for paged results, default value is 20.")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get data that includes the core household fields only by Survey ID - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Incubation-red)]() [![Generic badge](https://img.shields.io/badge/Access%20Policy-TEC_Architecture_+_Service_Owner_approvals_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Official%20Use%20Only-yellow)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_household-draftinternalbasedata_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param survey_id: unique identifier for the collected data, as retrieved from /Surveys API. - :type survey_id: int - :param page: page number for paged results - :type page: int - :param page_size: page size for paged results, default value is 20. - :type page_size: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._household_draft_internal_base_data_get_serialize( - survey_id=survey_id, - page=page, - page_size=page_size, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedSurveyResponsesDTO", - '400': "BadRequestDTO", - '404': "ProblemDetails", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _household_draft_internal_base_data_get_serialize( - self, - survey_id, - page, - page_size, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if survey_id is not None: - - _query_params.append(('surveyID', survey_id)) - - if page is not None: - - _query_params.append(('page', page)) - - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain', - 'application/json', - 'text/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/Household/DraftInternalBaseData', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def household_full_data_get( - self, - survey_id: Annotated[Optional[StrictInt], Field(description="unique identifier for the collected data, as retrieved from /Surveys API.")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - page_size: Annotated[Optional[StrictInt], Field(description="page size for paged results, default value is 20.")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PagedSurveyResponsesDTO: - """Get a full dataset that includes all the fields included in the survey in addition to the core household fields by Survey ID. To access this data, please contact xxxx for authorization. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Incubation-red)]() [![Generic badge](https://img.shields.io/badge/Access%20Policy-TEC_Architecture_+_Service_Owner_approvals_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Official%20Use%20Only-yellow)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_household-fulldata_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param survey_id: unique identifier for the collected data, as retrieved from /Surveys API. - :type survey_id: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param page: page number for paged results - :type page: int - :param page_size: page size for paged results, default value is 20. - :type page_size: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._household_full_data_get_serialize( - survey_id=survey_id, - format=format, - page=page, - page_size=page_size, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedSurveyResponsesDTO", - '400': "BadRequestDTO", - '404': "ProblemDetails", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def household_full_data_get_with_http_info( - self, - survey_id: Annotated[Optional[StrictInt], Field(description="unique identifier for the collected data, as retrieved from /Surveys API.")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - page_size: Annotated[Optional[StrictInt], Field(description="page size for paged results, default value is 20.")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PagedSurveyResponsesDTO]: - """Get a full dataset that includes all the fields included in the survey in addition to the core household fields by Survey ID. To access this data, please contact xxxx for authorization. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Incubation-red)]() [![Generic badge](https://img.shields.io/badge/Access%20Policy-TEC_Architecture_+_Service_Owner_approvals_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Official%20Use%20Only-yellow)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_household-fulldata_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param survey_id: unique identifier for the collected data, as retrieved from /Surveys API. - :type survey_id: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param page: page number for paged results - :type page: int - :param page_size: page size for paged results, default value is 20. - :type page_size: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._household_full_data_get_serialize( - survey_id=survey_id, - format=format, - page=page, - page_size=page_size, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedSurveyResponsesDTO", - '400': "BadRequestDTO", - '404': "ProblemDetails", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def household_full_data_get_without_preload_content( - self, - survey_id: Annotated[Optional[StrictInt], Field(description="unique identifier for the collected data, as retrieved from /Surveys API.")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - page_size: Annotated[Optional[StrictInt], Field(description="page size for paged results, default value is 20.")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get a full dataset that includes all the fields included in the survey in addition to the core household fields by Survey ID. To access this data, please contact xxxx for authorization. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Incubation-red)]() [![Generic badge](https://img.shields.io/badge/Access%20Policy-TEC_Architecture_+_Service_Owner_approvals_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Official%20Use%20Only-yellow)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_household-fulldata_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param survey_id: unique identifier for the collected data, as retrieved from /Surveys API. - :type survey_id: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param page: page number for paged results - :type page: int - :param page_size: page size for paged results, default value is 20. - :type page_size: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._household_full_data_get_serialize( - survey_id=survey_id, - format=format, - page=page, - page_size=page_size, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedSurveyResponsesDTO", - '400': "BadRequestDTO", - '404': "ProblemDetails", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _household_full_data_get_serialize( - self, - survey_id, - format, - page, - page_size, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if survey_id is not None: - - _query_params.append(('surveyID', survey_id)) - - if format is not None: - - _query_params.append(('format', format)) - - if page is not None: - - _query_params.append(('page', page)) - - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain', - 'application/json', - 'text/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/Household/FullData', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def household_official_use_base_data_get( - self, - survey_id: Annotated[Optional[StrictInt], Field(description="unique identifier for the collected data, as retrieved from /Surveys API.")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - page_size: Annotated[Optional[StrictInt], Field(description="page size for paged results, default value is 20.")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PagedSurveyResponsesDTO: - """Get data that includes the core household fields only by Survey ID - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Incubation-red)]() [![Generic badge](https://img.shields.io/badge/Access%20Policy-TEC_Architecture_+_Service_Owner_approvals_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Official%20Use%20Only-yellow)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_household-officialusebasedata_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param survey_id: unique identifier for the collected data, as retrieved from /Surveys API. - :type survey_id: int - :param page: page number for paged results - :type page: int - :param page_size: page size for paged results, default value is 20. - :type page_size: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._household_official_use_base_data_get_serialize( - survey_id=survey_id, - page=page, - page_size=page_size, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedSurveyResponsesDTO", - '400': "BadRequestDTO", - '404': "ProblemDetails", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def household_official_use_base_data_get_with_http_info( - self, - survey_id: Annotated[Optional[StrictInt], Field(description="unique identifier for the collected data, as retrieved from /Surveys API.")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - page_size: Annotated[Optional[StrictInt], Field(description="page size for paged results, default value is 20.")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PagedSurveyResponsesDTO]: - """Get data that includes the core household fields only by Survey ID - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Incubation-red)]() [![Generic badge](https://img.shields.io/badge/Access%20Policy-TEC_Architecture_+_Service_Owner_approvals_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Official%20Use%20Only-yellow)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_household-officialusebasedata_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param survey_id: unique identifier for the collected data, as retrieved from /Surveys API. - :type survey_id: int - :param page: page number for paged results - :type page: int - :param page_size: page size for paged results, default value is 20. - :type page_size: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._household_official_use_base_data_get_serialize( - survey_id=survey_id, - page=page, - page_size=page_size, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedSurveyResponsesDTO", - '400': "BadRequestDTO", - '404': "ProblemDetails", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def household_official_use_base_data_get_without_preload_content( - self, - survey_id: Annotated[Optional[StrictInt], Field(description="unique identifier for the collected data, as retrieved from /Surveys API.")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - page_size: Annotated[Optional[StrictInt], Field(description="page size for paged results, default value is 20.")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get data that includes the core household fields only by Survey ID - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Incubation-red)]() [![Generic badge](https://img.shields.io/badge/Access%20Policy-TEC_Architecture_+_Service_Owner_approvals_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Official%20Use%20Only-yellow)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_household-officialusebasedata_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param survey_id: unique identifier for the collected data, as retrieved from /Surveys API. - :type survey_id: int - :param page: page number for paged results - :type page: int - :param page_size: page size for paged results, default value is 20. - :type page_size: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._household_official_use_base_data_get_serialize( - survey_id=survey_id, - page=page, - page_size=page_size, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedSurveyResponsesDTO", - '400': "BadRequestDTO", - '404': "ProblemDetails", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _household_official_use_base_data_get_serialize( - self, - survey_id, - page, - page_size, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if survey_id is not None: - - _query_params.append(('surveyID', survey_id)) - - if page is not None: - - _query_params.append(('page', page)) - - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain', - 'application/json', - 'text/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/Household/OfficialUseBaseData', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def household_public_base_data_get( - self, - survey_id: Annotated[Optional[StrictInt], Field(description="unique identifier for the collected data, as retrieved from /Surveys API.")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - page_size: Annotated[Optional[StrictInt], Field(description="page size for paged results, default value is 20.")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PagedSurveyResponsesDTO: - """Get data that includes the core household fields only by Survey ID - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Incubation-red)]() [![Generic badge](https://img.shields.io/badge/Access%20Policy-TEC_Architecture_+_Service_Owner_approvals_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_household-publicbasedata_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param survey_id: unique identifier for the collected data, as retrieved from /Surveys API. - :type survey_id: int - :param page: page number for paged results - :type page: int - :param page_size: page size for paged results, default value is 20. - :type page_size: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._household_public_base_data_get_serialize( - survey_id=survey_id, - page=page, - page_size=page_size, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedSurveyResponsesDTO", - '400': "BadRequestDTO", - '404': "ProblemDetails", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def household_public_base_data_get_with_http_info( - self, - survey_id: Annotated[Optional[StrictInt], Field(description="unique identifier for the collected data, as retrieved from /Surveys API.")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - page_size: Annotated[Optional[StrictInt], Field(description="page size for paged results, default value is 20.")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PagedSurveyResponsesDTO]: - """Get data that includes the core household fields only by Survey ID - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Incubation-red)]() [![Generic badge](https://img.shields.io/badge/Access%20Policy-TEC_Architecture_+_Service_Owner_approvals_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_household-publicbasedata_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param survey_id: unique identifier for the collected data, as retrieved from /Surveys API. - :type survey_id: int - :param page: page number for paged results - :type page: int - :param page_size: page size for paged results, default value is 20. - :type page_size: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._household_public_base_data_get_serialize( - survey_id=survey_id, - page=page, - page_size=page_size, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedSurveyResponsesDTO", - '400': "BadRequestDTO", - '404': "ProblemDetails", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def household_public_base_data_get_without_preload_content( - self, - survey_id: Annotated[Optional[StrictInt], Field(description="unique identifier for the collected data, as retrieved from /Surveys API.")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - page_size: Annotated[Optional[StrictInt], Field(description="page size for paged results, default value is 20.")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get data that includes the core household fields only by Survey ID - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Incubation-red)]() [![Generic badge](https://img.shields.io/badge/Access%20Policy-TEC_Architecture_+_Service_Owner_approvals_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_household-publicbasedata_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param survey_id: unique identifier for the collected data, as retrieved from /Surveys API. - :type survey_id: int - :param page: page number for paged results - :type page: int - :param page_size: page size for paged results, default value is 20. - :type page_size: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._household_public_base_data_get_serialize( - survey_id=survey_id, - page=page, - page_size=page_size, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedSurveyResponsesDTO", - '400': "BadRequestDTO", - '404': "ProblemDetails", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _household_public_base_data_get_serialize( - self, - survey_id, - page, - page_size, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if survey_id is not None: - - _query_params.append(('surveyID', survey_id)) - - if page is not None: - - _query_params.append(('page', page)) - - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain', - 'application/json', - 'text/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/Household/PublicBaseData', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def household_surveys_get( - self, - adm0_code: Annotated[Optional[StrictInt], Field(description="code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - start_date: Annotated[Optional[datetime], Field(description="starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24)")] = None, - end_date: Annotated[Optional[datetime], Field(description="ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24)")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> HouseholdSurveyListDTOPagedResult: - """Retrieve 1) Survey IDs, 2) their corresponding XLS Form IDs, and 3) Base XLS Form of all household surveys conducted in a country. A date of reference, SurveyDate, for the data collection is set by the officer responsible for the upload for each survey. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Incubation-red)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_household-surveys_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param adm0_code: code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion - :type adm0_code: int - :param page: page number for paged results - :type page: int - :param start_date: starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24) - :type start_date: datetime - :param end_date: ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24) - :type end_date: datetime - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._household_surveys_get_serialize( - adm0_code=adm0_code, - page=page, - start_date=start_date, - end_date=end_date, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "HouseholdSurveyListDTOPagedResult", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def household_surveys_get_with_http_info( - self, - adm0_code: Annotated[Optional[StrictInt], Field(description="code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - start_date: Annotated[Optional[datetime], Field(description="starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24)")] = None, - end_date: Annotated[Optional[datetime], Field(description="ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24)")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[HouseholdSurveyListDTOPagedResult]: - """Retrieve 1) Survey IDs, 2) their corresponding XLS Form IDs, and 3) Base XLS Form of all household surveys conducted in a country. A date of reference, SurveyDate, for the data collection is set by the officer responsible for the upload for each survey. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Incubation-red)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_household-surveys_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param adm0_code: code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion - :type adm0_code: int - :param page: page number for paged results - :type page: int - :param start_date: starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24) - :type start_date: datetime - :param end_date: ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24) - :type end_date: datetime - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._household_surveys_get_serialize( - adm0_code=adm0_code, - page=page, - start_date=start_date, - end_date=end_date, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "HouseholdSurveyListDTOPagedResult", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def household_surveys_get_without_preload_content( - self, - adm0_code: Annotated[Optional[StrictInt], Field(description="code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - start_date: Annotated[Optional[datetime], Field(description="starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24)")] = None, - end_date: Annotated[Optional[datetime], Field(description="ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24)")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Retrieve 1) Survey IDs, 2) their corresponding XLS Form IDs, and 3) Base XLS Form of all household surveys conducted in a country. A date of reference, SurveyDate, for the data collection is set by the officer responsible for the upload for each survey. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Incubation-red)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_household-surveys_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param adm0_code: code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion - :type adm0_code: int - :param page: page number for paged results - :type page: int - :param start_date: starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24) - :type start_date: datetime - :param end_date: ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24) - :type end_date: datetime - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._household_surveys_get_serialize( - adm0_code=adm0_code, - page=page, - start_date=start_date, - end_date=end_date, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "HouseholdSurveyListDTOPagedResult", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _household_surveys_get_serialize( - self, - adm0_code, - page, - start_date, - end_date, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if adm0_code is not None: - - _query_params.append(('adm0Code', adm0_code)) - - if page is not None: - - _query_params.append(('page', page)) - - if start_date is not None: - if isinstance(start_date, datetime): - _query_params.append( - ( - 'startDate', - start_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('startDate', start_date)) - - if end_date is not None: - if isinstance(end_date, datetime): - _query_params.append( - ( - 'endDate', - end_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('endDate', end_date)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/Household/Surveys', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def xls_forms_definition_get( - self, - xls_form_id: Annotated[Optional[StrictInt], Field(description="unique identifier for the XLS Form, as retrieved from /XLSForms")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[XlsFormDefinitionNewSchemaDTO]: - """Get a complete set of XLS Form definitions of a given XLS Form ID. This is the digital version of the questionnaire used during the data collection exercise. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Incubation-red)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_xlsforms-definition_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param xls_form_id: unique identifier for the XLS Form, as retrieved from /XLSForms - :type xls_form_id: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._xls_forms_definition_get_serialize( - xls_form_id=xls_form_id, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - # HOTFIX!!! - - url = _param[1] - _param = list(_param) - url = url.replace("https://api.vam.wfp.org/","https://api.wfp.org/") - url = url.replace("2.0.0", "4.1.0") - _param[1] = url - _param = tuple(_param) - print(_param) - - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[XlsFormDefinitionNewSchemaDTO]", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - - - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def xls_forms_definition_get_with_http_info( - self, - xls_form_id: Annotated[Optional[StrictInt], Field(description="unique identifier for the XLS Form, as retrieved from /XLSForms")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[XlsFormDefinitionNewSchemaDTO]]: - """Get a complete set of XLS Form definitions of a given XLS Form ID. This is the digital version of the questionnaire used during the data collection exercise. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Incubation-red)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_xlsforms-definition_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param xls_form_id: unique identifier for the XLS Form, as retrieved from /XLSForms - :type xls_form_id: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._xls_forms_definition_get_serialize( - xls_form_id=xls_form_id, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[XlsFormDefinitionNewSchemaDTO]", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def xls_forms_definition_get_without_preload_content( - self, - xls_form_id: Annotated[Optional[StrictInt], Field(description="unique identifier for the XLS Form, as retrieved from /XLSForms")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get a complete set of XLS Form definitions of a given XLS Form ID. This is the digital version of the questionnaire used during the data collection exercise. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Incubation-red)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_xlsforms-definition_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param xls_form_id: unique identifier for the XLS Form, as retrieved from /XLSForms - :type xls_form_id: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._xls_forms_definition_get_serialize( - xls_form_id=xls_form_id, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[XlsFormDefinitionNewSchemaDTO]", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _xls_forms_definition_get_serialize( - self, - xls_form_id, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if xls_form_id is not None: - - _query_params.append(('xlsFormId', xls_form_id)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/XlsForms/definition', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - diff --git a/data_bridges_client/api/market_prices_api.py b/data_bridges_client/api/market_prices_api.py deleted file mode 100644 index 43e83c8..0000000 --- a/data_bridges_client/api/market_prices_api.py +++ /dev/null @@ -1,2394 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from datetime import datetime -from pydantic import Field, StrictBool, StrictInt, StrictStr, field_validator -from typing import Optional -from typing_extensions import Annotated -from data_bridges_client.models.paged_commodity_price_list_dto import PagedCommodityPriceListDTO -from data_bridges_client.models.paged_commodity_weekly_aggregated_price_list_dto import PagedCommodityWeeklyAggregatedPriceListDTO -from data_bridges_client.models.view_extended_aggregated_price_paged_result import ViewExtendedAggregatedPricePagedResult -from data_bridges_client.models.view_extended_alps_value_paged_result import ViewExtendedAlpsValuePagedResult - -from data_bridges_client.api_client import ApiClient, RequestSerialized -from data_bridges_client.api_response import ApiResponse -from data_bridges_client.rest import RESTResponseType - - -class MarketPricesApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def market_prices_alps_get( - self, - country_code: Annotated[Optional[StrictStr], Field(description="The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code.")] = None, - market_id: Annotated[Optional[StrictInt], Field(description="Unique ID of a Market, as found in /Markets/GeoJSONList")] = None, - commodity_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a Commodity, as found in /Commodities/List")] = None, - price_type_name: Annotated[Optional[StrictStr], Field(description="Price type: [retail|wholesale|farmgate]")] = None, - currency_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a currency, as found in /Currency/List")] = None, - price_flag: Annotated[Optional[StrictStr], Field(description="Type of price data: [actual|aggregate|estimated|forecasted]")] = None, - start_date: Annotated[Optional[datetime], Field(description="Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24)")] = None, - end_date: Annotated[Optional[datetime], Field(description="Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24)")] = None, - latest_value_only: Annotated[Optional[StrictBool], Field(description="[TRUE|FALSE]")] = None, - page: Annotated[Optional[StrictInt], Field(description="Page number for paged results")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ViewExtendedAlpsValuePagedResult: - """Returns time series values of ALPS and PEWI. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_marketprices-alps_get\" Returns the full time series of the Alert for Price Spikes (ALPS) and the value of the Price Early Warning Index (PEWI). Methodology is available in [DataViz](https://dataviz.vam.wfp.org/) and [VAM-Resource Centre](https://resources.vam.wfp.org/). Country code, either ISO-3166 Alpha 3 code or the VAM internal admin0code is mandatory. **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param country_code: The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code. - :type country_code: str - :param market_id: Unique ID of a Market, as found in /Markets/GeoJSONList - :type market_id: int - :param commodity_id: The exact ID of a Commodity, as found in /Commodities/List - :type commodity_id: int - :param price_type_name: Price type: [retail|wholesale|farmgate] - :type price_type_name: str - :param currency_id: The exact ID of a currency, as found in /Currency/List - :type currency_id: int - :param price_flag: Type of price data: [actual|aggregate|estimated|forecasted] - :type price_flag: str - :param start_date: Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24) - :type start_date: datetime - :param end_date: Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24) - :type end_date: datetime - :param latest_value_only: [TRUE|FALSE] - :type latest_value_only: bool - :param page: Page number for paged results - :type page: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._market_prices_alps_get_serialize( - country_code=country_code, - market_id=market_id, - commodity_id=commodity_id, - price_type_name=price_type_name, - currency_id=currency_id, - price_flag=price_flag, - start_date=start_date, - end_date=end_date, - latest_value_only=latest_value_only, - page=page, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ViewExtendedAlpsValuePagedResult", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def market_prices_alps_get_with_http_info( - self, - country_code: Annotated[Optional[StrictStr], Field(description="The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code.")] = None, - market_id: Annotated[Optional[StrictInt], Field(description="Unique ID of a Market, as found in /Markets/GeoJSONList")] = None, - commodity_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a Commodity, as found in /Commodities/List")] = None, - price_type_name: Annotated[Optional[StrictStr], Field(description="Price type: [retail|wholesale|farmgate]")] = None, - currency_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a currency, as found in /Currency/List")] = None, - price_flag: Annotated[Optional[StrictStr], Field(description="Type of price data: [actual|aggregate|estimated|forecasted]")] = None, - start_date: Annotated[Optional[datetime], Field(description="Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24)")] = None, - end_date: Annotated[Optional[datetime], Field(description="Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24)")] = None, - latest_value_only: Annotated[Optional[StrictBool], Field(description="[TRUE|FALSE]")] = None, - page: Annotated[Optional[StrictInt], Field(description="Page number for paged results")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ViewExtendedAlpsValuePagedResult]: - """Returns time series values of ALPS and PEWI. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_marketprices-alps_get\" Returns the full time series of the Alert for Price Spikes (ALPS) and the value of the Price Early Warning Index (PEWI). Methodology is available in [DataViz](https://dataviz.vam.wfp.org/) and [VAM-Resource Centre](https://resources.vam.wfp.org/). Country code, either ISO-3166 Alpha 3 code or the VAM internal admin0code is mandatory. **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param country_code: The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code. - :type country_code: str - :param market_id: Unique ID of a Market, as found in /Markets/GeoJSONList - :type market_id: int - :param commodity_id: The exact ID of a Commodity, as found in /Commodities/List - :type commodity_id: int - :param price_type_name: Price type: [retail|wholesale|farmgate] - :type price_type_name: str - :param currency_id: The exact ID of a currency, as found in /Currency/List - :type currency_id: int - :param price_flag: Type of price data: [actual|aggregate|estimated|forecasted] - :type price_flag: str - :param start_date: Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24) - :type start_date: datetime - :param end_date: Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24) - :type end_date: datetime - :param latest_value_only: [TRUE|FALSE] - :type latest_value_only: bool - :param page: Page number for paged results - :type page: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._market_prices_alps_get_serialize( - country_code=country_code, - market_id=market_id, - commodity_id=commodity_id, - price_type_name=price_type_name, - currency_id=currency_id, - price_flag=price_flag, - start_date=start_date, - end_date=end_date, - latest_value_only=latest_value_only, - page=page, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ViewExtendedAlpsValuePagedResult", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def market_prices_alps_get_without_preload_content( - self, - country_code: Annotated[Optional[StrictStr], Field(description="The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code.")] = None, - market_id: Annotated[Optional[StrictInt], Field(description="Unique ID of a Market, as found in /Markets/GeoJSONList")] = None, - commodity_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a Commodity, as found in /Commodities/List")] = None, - price_type_name: Annotated[Optional[StrictStr], Field(description="Price type: [retail|wholesale|farmgate]")] = None, - currency_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a currency, as found in /Currency/List")] = None, - price_flag: Annotated[Optional[StrictStr], Field(description="Type of price data: [actual|aggregate|estimated|forecasted]")] = None, - start_date: Annotated[Optional[datetime], Field(description="Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24)")] = None, - end_date: Annotated[Optional[datetime], Field(description="Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24)")] = None, - latest_value_only: Annotated[Optional[StrictBool], Field(description="[TRUE|FALSE]")] = None, - page: Annotated[Optional[StrictInt], Field(description="Page number for paged results")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Returns time series values of ALPS and PEWI. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_marketprices-alps_get\" Returns the full time series of the Alert for Price Spikes (ALPS) and the value of the Price Early Warning Index (PEWI). Methodology is available in [DataViz](https://dataviz.vam.wfp.org/) and [VAM-Resource Centre](https://resources.vam.wfp.org/). Country code, either ISO-3166 Alpha 3 code or the VAM internal admin0code is mandatory. **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param country_code: The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code. - :type country_code: str - :param market_id: Unique ID of a Market, as found in /Markets/GeoJSONList - :type market_id: int - :param commodity_id: The exact ID of a Commodity, as found in /Commodities/List - :type commodity_id: int - :param price_type_name: Price type: [retail|wholesale|farmgate] - :type price_type_name: str - :param currency_id: The exact ID of a currency, as found in /Currency/List - :type currency_id: int - :param price_flag: Type of price data: [actual|aggregate|estimated|forecasted] - :type price_flag: str - :param start_date: Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24) - :type start_date: datetime - :param end_date: Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24) - :type end_date: datetime - :param latest_value_only: [TRUE|FALSE] - :type latest_value_only: bool - :param page: Page number for paged results - :type page: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._market_prices_alps_get_serialize( - country_code=country_code, - market_id=market_id, - commodity_id=commodity_id, - price_type_name=price_type_name, - currency_id=currency_id, - price_flag=price_flag, - start_date=start_date, - end_date=end_date, - latest_value_only=latest_value_only, - page=page, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ViewExtendedAlpsValuePagedResult", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _market_prices_alps_get_serialize( - self, - country_code, - market_id, - commodity_id, - price_type_name, - currency_id, - price_flag, - start_date, - end_date, - latest_value_only, - page, - format, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if country_code is not None: - - _query_params.append(('countryCode', country_code)) - - if market_id is not None: - - _query_params.append(('marketID', market_id)) - - if commodity_id is not None: - - _query_params.append(('commodityID', commodity_id)) - - if price_type_name is not None: - - _query_params.append(('priceTypeName', price_type_name)) - - if currency_id is not None: - - _query_params.append(('currencyID', currency_id)) - - if price_flag is not None: - - _query_params.append(('priceFlag', price_flag)) - - if start_date is not None: - if isinstance(start_date, datetime): - _query_params.append( - ( - 'startDate', - start_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('startDate', start_date)) - - if end_date is not None: - if isinstance(end_date, datetime): - _query_params.append( - ( - 'endDate', - end_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('endDate', end_date)) - - if latest_value_only is not None: - - _query_params.append(('latestValueOnly', latest_value_only)) - - if page is not None: - - _query_params.append(('page', page)) - - if format is not None: - - _query_params.append(('format', format)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain', - 'application/json', - 'text/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/MarketPrices/Alps', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def market_prices_price_daily_get( - self, - country_code: Annotated[Optional[StrictStr], Field(description="The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code.")] = None, - market_id: Annotated[Optional[StrictInt], Field(description="Unique ID of a Market, as found in /Markets/GeoJSONList")] = None, - commodity_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a Commodity, as found in /Commodities/List")] = None, - price_type_name: Annotated[Optional[StrictStr], Field(description="Price type: [retail|wholesale|farmgate]")] = None, - currency_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a currency, as found in /Currency/List")] = None, - price_flag: Annotated[Optional[StrictStr], Field(description="Type of price data: [actual|aggregate|estimated|forecasted]")] = None, - start_date: Annotated[Optional[datetime], Field(description="Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24)")] = None, - end_date: Annotated[Optional[datetime], Field(description="Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24)")] = None, - latest_value_only: Annotated[Optional[StrictBool], Field(description="[TRUE|FALSE]")] = None, - page: Annotated[Optional[StrictInt], Field(description="Page number for paged results")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ViewExtendedAggregatedPricePagedResult: - """Returns a daily time series of commodity market prices. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_marketprices-pricedaily_get\" This is the highest frequency available. Data is flagged according to its pre-processing characteristics. Actual data is collected originally with daily frequency; aggregated data returns an empty list; imputed data is an estimation of missing values in the time series, obtained through the R Amelia-II package; forecasted data is a six months prediction obtained through different methods, which are reported in the API. For country specific meta-data please refer to documentation available in DataLibrary. For specific methodological notes on forecasts and imputations refer to the dedicated page in DataViz. Country code, either ISO-3166 Alpha 3 code or the VAM internal admin0code is mandatory. **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param country_code: The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code. - :type country_code: str - :param market_id: Unique ID of a Market, as found in /Markets/GeoJSONList - :type market_id: int - :param commodity_id: The exact ID of a Commodity, as found in /Commodities/List - :type commodity_id: int - :param price_type_name: Price type: [retail|wholesale|farmgate] - :type price_type_name: str - :param currency_id: The exact ID of a currency, as found in /Currency/List - :type currency_id: int - :param price_flag: Type of price data: [actual|aggregate|estimated|forecasted] - :type price_flag: str - :param start_date: Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24) - :type start_date: datetime - :param end_date: Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24) - :type end_date: datetime - :param latest_value_only: [TRUE|FALSE] - :type latest_value_only: bool - :param page: Page number for paged results - :type page: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._market_prices_price_daily_get_serialize( - country_code=country_code, - market_id=market_id, - commodity_id=commodity_id, - price_type_name=price_type_name, - currency_id=currency_id, - price_flag=price_flag, - start_date=start_date, - end_date=end_date, - latest_value_only=latest_value_only, - page=page, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ViewExtendedAggregatedPricePagedResult", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def market_prices_price_daily_get_with_http_info( - self, - country_code: Annotated[Optional[StrictStr], Field(description="The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code.")] = None, - market_id: Annotated[Optional[StrictInt], Field(description="Unique ID of a Market, as found in /Markets/GeoJSONList")] = None, - commodity_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a Commodity, as found in /Commodities/List")] = None, - price_type_name: Annotated[Optional[StrictStr], Field(description="Price type: [retail|wholesale|farmgate]")] = None, - currency_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a currency, as found in /Currency/List")] = None, - price_flag: Annotated[Optional[StrictStr], Field(description="Type of price data: [actual|aggregate|estimated|forecasted]")] = None, - start_date: Annotated[Optional[datetime], Field(description="Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24)")] = None, - end_date: Annotated[Optional[datetime], Field(description="Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24)")] = None, - latest_value_only: Annotated[Optional[StrictBool], Field(description="[TRUE|FALSE]")] = None, - page: Annotated[Optional[StrictInt], Field(description="Page number for paged results")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ViewExtendedAggregatedPricePagedResult]: - """Returns a daily time series of commodity market prices. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_marketprices-pricedaily_get\" This is the highest frequency available. Data is flagged according to its pre-processing characteristics. Actual data is collected originally with daily frequency; aggregated data returns an empty list; imputed data is an estimation of missing values in the time series, obtained through the R Amelia-II package; forecasted data is a six months prediction obtained through different methods, which are reported in the API. For country specific meta-data please refer to documentation available in DataLibrary. For specific methodological notes on forecasts and imputations refer to the dedicated page in DataViz. Country code, either ISO-3166 Alpha 3 code or the VAM internal admin0code is mandatory. **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param country_code: The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code. - :type country_code: str - :param market_id: Unique ID of a Market, as found in /Markets/GeoJSONList - :type market_id: int - :param commodity_id: The exact ID of a Commodity, as found in /Commodities/List - :type commodity_id: int - :param price_type_name: Price type: [retail|wholesale|farmgate] - :type price_type_name: str - :param currency_id: The exact ID of a currency, as found in /Currency/List - :type currency_id: int - :param price_flag: Type of price data: [actual|aggregate|estimated|forecasted] - :type price_flag: str - :param start_date: Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24) - :type start_date: datetime - :param end_date: Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24) - :type end_date: datetime - :param latest_value_only: [TRUE|FALSE] - :type latest_value_only: bool - :param page: Page number for paged results - :type page: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._market_prices_price_daily_get_serialize( - country_code=country_code, - market_id=market_id, - commodity_id=commodity_id, - price_type_name=price_type_name, - currency_id=currency_id, - price_flag=price_flag, - start_date=start_date, - end_date=end_date, - latest_value_only=latest_value_only, - page=page, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ViewExtendedAggregatedPricePagedResult", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def market_prices_price_daily_get_without_preload_content( - self, - country_code: Annotated[Optional[StrictStr], Field(description="The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code.")] = None, - market_id: Annotated[Optional[StrictInt], Field(description="Unique ID of a Market, as found in /Markets/GeoJSONList")] = None, - commodity_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a Commodity, as found in /Commodities/List")] = None, - price_type_name: Annotated[Optional[StrictStr], Field(description="Price type: [retail|wholesale|farmgate]")] = None, - currency_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a currency, as found in /Currency/List")] = None, - price_flag: Annotated[Optional[StrictStr], Field(description="Type of price data: [actual|aggregate|estimated|forecasted]")] = None, - start_date: Annotated[Optional[datetime], Field(description="Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24)")] = None, - end_date: Annotated[Optional[datetime], Field(description="Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24)")] = None, - latest_value_only: Annotated[Optional[StrictBool], Field(description="[TRUE|FALSE]")] = None, - page: Annotated[Optional[StrictInt], Field(description="Page number for paged results")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Returns a daily time series of commodity market prices. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_marketprices-pricedaily_get\" This is the highest frequency available. Data is flagged according to its pre-processing characteristics. Actual data is collected originally with daily frequency; aggregated data returns an empty list; imputed data is an estimation of missing values in the time series, obtained through the R Amelia-II package; forecasted data is a six months prediction obtained through different methods, which are reported in the API. For country specific meta-data please refer to documentation available in DataLibrary. For specific methodological notes on forecasts and imputations refer to the dedicated page in DataViz. Country code, either ISO-3166 Alpha 3 code or the VAM internal admin0code is mandatory. **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param country_code: The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code. - :type country_code: str - :param market_id: Unique ID of a Market, as found in /Markets/GeoJSONList - :type market_id: int - :param commodity_id: The exact ID of a Commodity, as found in /Commodities/List - :type commodity_id: int - :param price_type_name: Price type: [retail|wholesale|farmgate] - :type price_type_name: str - :param currency_id: The exact ID of a currency, as found in /Currency/List - :type currency_id: int - :param price_flag: Type of price data: [actual|aggregate|estimated|forecasted] - :type price_flag: str - :param start_date: Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24) - :type start_date: datetime - :param end_date: Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24) - :type end_date: datetime - :param latest_value_only: [TRUE|FALSE] - :type latest_value_only: bool - :param page: Page number for paged results - :type page: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._market_prices_price_daily_get_serialize( - country_code=country_code, - market_id=market_id, - commodity_id=commodity_id, - price_type_name=price_type_name, - currency_id=currency_id, - price_flag=price_flag, - start_date=start_date, - end_date=end_date, - latest_value_only=latest_value_only, - page=page, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ViewExtendedAggregatedPricePagedResult", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _market_prices_price_daily_get_serialize( - self, - country_code, - market_id, - commodity_id, - price_type_name, - currency_id, - price_flag, - start_date, - end_date, - latest_value_only, - page, - format, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if country_code is not None: - - _query_params.append(('countryCode', country_code)) - - if market_id is not None: - - _query_params.append(('marketID', market_id)) - - if commodity_id is not None: - - _query_params.append(('commodityID', commodity_id)) - - if price_type_name is not None: - - _query_params.append(('priceTypeName', price_type_name)) - - if currency_id is not None: - - _query_params.append(('currencyID', currency_id)) - - if price_flag is not None: - - _query_params.append(('priceFlag', price_flag)) - - if start_date is not None: - if isinstance(start_date, datetime): - _query_params.append( - ( - 'startDate', - start_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('startDate', start_date)) - - if end_date is not None: - if isinstance(end_date, datetime): - _query_params.append( - ( - 'endDate', - end_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('endDate', end_date)) - - if latest_value_only is not None: - - _query_params.append(('latestValueOnly', latest_value_only)) - - if page is not None: - - _query_params.append(('page', page)) - - if format is not None: - - _query_params.append(('format', format)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain', - 'application/json', - 'text/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/MarketPrices/PriceDaily', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def market_prices_price_monthly_get( - self, - country_code: Annotated[Optional[StrictStr], Field(description="The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code.")] = None, - market_id: Annotated[Optional[StrictInt], Field(description="Unique ID of a Market, as found in /Markets/GeoJSONList")] = None, - commodity_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a Commodity, as found in /Commodities/List")] = None, - price_type_name: Annotated[Optional[StrictStr], Field(description="Price type: [retail|wholesale|farmgate]")] = None, - currency_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a currency, as found in /Currency/List")] = None, - price_flag: Annotated[Optional[StrictStr], Field(description="Type of price data: [actual|aggregate|estimated|forecasted]")] = None, - start_date: Annotated[Optional[datetime], Field(description="Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24)")] = None, - end_date: Annotated[Optional[datetime], Field(description="Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24)")] = None, - latest_value_only: Annotated[Optional[StrictBool], Field(description="[TRUE|FALSE]")] = None, - page: Annotated[Optional[StrictInt], Field(description="Page number for paged results")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ViewExtendedAggregatedPricePagedResult: - """Returns a monthly time series of commodity market prices. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_marketprices-pricemonthly_get\" This is the lowest frequency available and the most complete data source. Data is flagged according to its pre-processing characteristics. actual data is collected originally with monthly frequency; aggregated data is collected with higher frequency (daily or weekly) averaged through a weighted mean to monthly; imputed data is an estimation of missing values in the time series, obtained through the R Amelia-II package; forecasted data is a six months prediction obtained through different methods, which are reported in the API. For country specific meta-data please refer to documentation available in [DataLibrary](https://datalib.vam.wfp.org/). For specific methodological notes on forecasts and imputations refer to the dedicated page in [DataViz](https://dataviz.vam.wfp.org/). Country code, either ISO-3166 Alpha 3 code or the VAM internal admin0code is mandatory. **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param country_code: The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code. - :type country_code: str - :param market_id: Unique ID of a Market, as found in /Markets/GeoJSONList - :type market_id: int - :param commodity_id: The exact ID of a Commodity, as found in /Commodities/List - :type commodity_id: int - :param price_type_name: Price type: [retail|wholesale|farmgate] - :type price_type_name: str - :param currency_id: The exact ID of a currency, as found in /Currency/List - :type currency_id: int - :param price_flag: Type of price data: [actual|aggregate|estimated|forecasted] - :type price_flag: str - :param start_date: Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24) - :type start_date: datetime - :param end_date: Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24) - :type end_date: datetime - :param latest_value_only: [TRUE|FALSE] - :type latest_value_only: bool - :param page: Page number for paged results - :type page: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._market_prices_price_monthly_get_serialize( - country_code=country_code, - market_id=market_id, - commodity_id=commodity_id, - price_type_name=price_type_name, - currency_id=currency_id, - price_flag=price_flag, - start_date=start_date, - end_date=end_date, - latest_value_only=latest_value_only, - page=page, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ViewExtendedAggregatedPricePagedResult", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def market_prices_price_monthly_get_with_http_info( - self, - country_code: Annotated[Optional[StrictStr], Field(description="The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code.")] = None, - market_id: Annotated[Optional[StrictInt], Field(description="Unique ID of a Market, as found in /Markets/GeoJSONList")] = None, - commodity_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a Commodity, as found in /Commodities/List")] = None, - price_type_name: Annotated[Optional[StrictStr], Field(description="Price type: [retail|wholesale|farmgate]")] = None, - currency_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a currency, as found in /Currency/List")] = None, - price_flag: Annotated[Optional[StrictStr], Field(description="Type of price data: [actual|aggregate|estimated|forecasted]")] = None, - start_date: Annotated[Optional[datetime], Field(description="Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24)")] = None, - end_date: Annotated[Optional[datetime], Field(description="Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24)")] = None, - latest_value_only: Annotated[Optional[StrictBool], Field(description="[TRUE|FALSE]")] = None, - page: Annotated[Optional[StrictInt], Field(description="Page number for paged results")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ViewExtendedAggregatedPricePagedResult]: - """Returns a monthly time series of commodity market prices. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_marketprices-pricemonthly_get\" This is the lowest frequency available and the most complete data source. Data is flagged according to its pre-processing characteristics. actual data is collected originally with monthly frequency; aggregated data is collected with higher frequency (daily or weekly) averaged through a weighted mean to monthly; imputed data is an estimation of missing values in the time series, obtained through the R Amelia-II package; forecasted data is a six months prediction obtained through different methods, which are reported in the API. For country specific meta-data please refer to documentation available in [DataLibrary](https://datalib.vam.wfp.org/). For specific methodological notes on forecasts and imputations refer to the dedicated page in [DataViz](https://dataviz.vam.wfp.org/). Country code, either ISO-3166 Alpha 3 code or the VAM internal admin0code is mandatory. **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param country_code: The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code. - :type country_code: str - :param market_id: Unique ID of a Market, as found in /Markets/GeoJSONList - :type market_id: int - :param commodity_id: The exact ID of a Commodity, as found in /Commodities/List - :type commodity_id: int - :param price_type_name: Price type: [retail|wholesale|farmgate] - :type price_type_name: str - :param currency_id: The exact ID of a currency, as found in /Currency/List - :type currency_id: int - :param price_flag: Type of price data: [actual|aggregate|estimated|forecasted] - :type price_flag: str - :param start_date: Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24) - :type start_date: datetime - :param end_date: Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24) - :type end_date: datetime - :param latest_value_only: [TRUE|FALSE] - :type latest_value_only: bool - :param page: Page number for paged results - :type page: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._market_prices_price_monthly_get_serialize( - country_code=country_code, - market_id=market_id, - commodity_id=commodity_id, - price_type_name=price_type_name, - currency_id=currency_id, - price_flag=price_flag, - start_date=start_date, - end_date=end_date, - latest_value_only=latest_value_only, - page=page, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ViewExtendedAggregatedPricePagedResult", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def market_prices_price_monthly_get_without_preload_content( - self, - country_code: Annotated[Optional[StrictStr], Field(description="The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code.")] = None, - market_id: Annotated[Optional[StrictInt], Field(description="Unique ID of a Market, as found in /Markets/GeoJSONList")] = None, - commodity_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a Commodity, as found in /Commodities/List")] = None, - price_type_name: Annotated[Optional[StrictStr], Field(description="Price type: [retail|wholesale|farmgate]")] = None, - currency_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a currency, as found in /Currency/List")] = None, - price_flag: Annotated[Optional[StrictStr], Field(description="Type of price data: [actual|aggregate|estimated|forecasted]")] = None, - start_date: Annotated[Optional[datetime], Field(description="Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24)")] = None, - end_date: Annotated[Optional[datetime], Field(description="Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24)")] = None, - latest_value_only: Annotated[Optional[StrictBool], Field(description="[TRUE|FALSE]")] = None, - page: Annotated[Optional[StrictInt], Field(description="Page number for paged results")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Returns a monthly time series of commodity market prices. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_marketprices-pricemonthly_get\" This is the lowest frequency available and the most complete data source. Data is flagged according to its pre-processing characteristics. actual data is collected originally with monthly frequency; aggregated data is collected with higher frequency (daily or weekly) averaged through a weighted mean to monthly; imputed data is an estimation of missing values in the time series, obtained through the R Amelia-II package; forecasted data is a six months prediction obtained through different methods, which are reported in the API. For country specific meta-data please refer to documentation available in [DataLibrary](https://datalib.vam.wfp.org/). For specific methodological notes on forecasts and imputations refer to the dedicated page in [DataViz](https://dataviz.vam.wfp.org/). Country code, either ISO-3166 Alpha 3 code or the VAM internal admin0code is mandatory. **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param country_code: The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code. - :type country_code: str - :param market_id: Unique ID of a Market, as found in /Markets/GeoJSONList - :type market_id: int - :param commodity_id: The exact ID of a Commodity, as found in /Commodities/List - :type commodity_id: int - :param price_type_name: Price type: [retail|wholesale|farmgate] - :type price_type_name: str - :param currency_id: The exact ID of a currency, as found in /Currency/List - :type currency_id: int - :param price_flag: Type of price data: [actual|aggregate|estimated|forecasted] - :type price_flag: str - :param start_date: Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24) - :type start_date: datetime - :param end_date: Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24) - :type end_date: datetime - :param latest_value_only: [TRUE|FALSE] - :type latest_value_only: bool - :param page: Page number for paged results - :type page: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._market_prices_price_monthly_get_serialize( - country_code=country_code, - market_id=market_id, - commodity_id=commodity_id, - price_type_name=price_type_name, - currency_id=currency_id, - price_flag=price_flag, - start_date=start_date, - end_date=end_date, - latest_value_only=latest_value_only, - page=page, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ViewExtendedAggregatedPricePagedResult", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _market_prices_price_monthly_get_serialize( - self, - country_code, - market_id, - commodity_id, - price_type_name, - currency_id, - price_flag, - start_date, - end_date, - latest_value_only, - page, - format, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if country_code is not None: - - _query_params.append(('countryCode', country_code)) - - if market_id is not None: - - _query_params.append(('marketID', market_id)) - - if commodity_id is not None: - - _query_params.append(('commodityID', commodity_id)) - - if price_type_name is not None: - - _query_params.append(('priceTypeName', price_type_name)) - - if currency_id is not None: - - _query_params.append(('currencyID', currency_id)) - - if price_flag is not None: - - _query_params.append(('priceFlag', price_flag)) - - if start_date is not None: - if isinstance(start_date, datetime): - _query_params.append( - ( - 'startDate', - start_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('startDate', start_date)) - - if end_date is not None: - if isinstance(end_date, datetime): - _query_params.append( - ( - 'endDate', - end_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('endDate', end_date)) - - if latest_value_only is not None: - - _query_params.append(('latestValueOnly', latest_value_only)) - - if page is not None: - - _query_params.append(('page', page)) - - if format is not None: - - _query_params.append(('format', format)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain', - 'application/json', - 'text/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/MarketPrices/PriceMonthly', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def market_prices_price_raw_get( - self, - country_code: Annotated[Optional[StrictStr], Field(description="The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code.")] = None, - market_id: Annotated[Optional[StrictInt], Field(description="Unique ID of a Market, as found in /Markets/GeoJSONList")] = None, - commodity_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a Commodity, as found in /Commodities/List")] = None, - price_type_name: Annotated[Optional[StrictStr], Field(description="Price type: [retail|wholesale|farmgate]")] = None, - currency_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a currency, as found in /Currency/List")] = None, - price_flag: Annotated[Optional[StrictStr], Field(description="Type of price data: [actual|aggregate|estimated|forecasted]")] = None, - start_date: Annotated[Optional[datetime], Field(description="Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24)")] = None, - end_date: Annotated[Optional[datetime], Field(description="Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24)")] = None, - latest_value_only: Annotated[Optional[StrictBool], Field(description="[TRUE|FALSE]")] = None, - page: Annotated[Optional[StrictInt], Field(description="Page number for paged results")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PagedCommodityPriceListDTO: - """Returns original commodity market prices - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access%20Policy-TEC_Architecture_+_Service_Owner_approvals_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Official%20Use%20Only-yellow)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_marketprices-priceraw_get\" Restricted endpoint. Returns the original data with the entire Commodity Price Metadata as inserted by the focal point, which might contain sensitive or personal informatio. Country code, either ISO-3166 Alpha 3 code or the VAM internal admin0code is mandatory. **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param country_code: The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code. - :type country_code: str - :param market_id: Unique ID of a Market, as found in /Markets/GeoJSONList - :type market_id: int - :param commodity_id: The exact ID of a Commodity, as found in /Commodities/List - :type commodity_id: int - :param price_type_name: Price type: [retail|wholesale|farmgate] - :type price_type_name: str - :param currency_id: The exact ID of a currency, as found in /Currency/List - :type currency_id: int - :param price_flag: Type of price data: [actual|aggregate|estimated|forecasted] - :type price_flag: str - :param start_date: Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24) - :type start_date: datetime - :param end_date: Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24) - :type end_date: datetime - :param latest_value_only: [TRUE|FALSE] - :type latest_value_only: bool - :param page: Page number for paged results - :type page: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._market_prices_price_raw_get_serialize( - country_code=country_code, - market_id=market_id, - commodity_id=commodity_id, - price_type_name=price_type_name, - currency_id=currency_id, - price_flag=price_flag, - start_date=start_date, - end_date=end_date, - latest_value_only=latest_value_only, - page=page, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedCommodityPriceListDTO", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def market_prices_price_raw_get_with_http_info( - self, - country_code: Annotated[Optional[StrictStr], Field(description="The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code.")] = None, - market_id: Annotated[Optional[StrictInt], Field(description="Unique ID of a Market, as found in /Markets/GeoJSONList")] = None, - commodity_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a Commodity, as found in /Commodities/List")] = None, - price_type_name: Annotated[Optional[StrictStr], Field(description="Price type: [retail|wholesale|farmgate]")] = None, - currency_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a currency, as found in /Currency/List")] = None, - price_flag: Annotated[Optional[StrictStr], Field(description="Type of price data: [actual|aggregate|estimated|forecasted]")] = None, - start_date: Annotated[Optional[datetime], Field(description="Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24)")] = None, - end_date: Annotated[Optional[datetime], Field(description="Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24)")] = None, - latest_value_only: Annotated[Optional[StrictBool], Field(description="[TRUE|FALSE]")] = None, - page: Annotated[Optional[StrictInt], Field(description="Page number for paged results")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PagedCommodityPriceListDTO]: - """Returns original commodity market prices - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access%20Policy-TEC_Architecture_+_Service_Owner_approvals_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Official%20Use%20Only-yellow)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_marketprices-priceraw_get\" Restricted endpoint. Returns the original data with the entire Commodity Price Metadata as inserted by the focal point, which might contain sensitive or personal informatio. Country code, either ISO-3166 Alpha 3 code or the VAM internal admin0code is mandatory. **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param country_code: The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code. - :type country_code: str - :param market_id: Unique ID of a Market, as found in /Markets/GeoJSONList - :type market_id: int - :param commodity_id: The exact ID of a Commodity, as found in /Commodities/List - :type commodity_id: int - :param price_type_name: Price type: [retail|wholesale|farmgate] - :type price_type_name: str - :param currency_id: The exact ID of a currency, as found in /Currency/List - :type currency_id: int - :param price_flag: Type of price data: [actual|aggregate|estimated|forecasted] - :type price_flag: str - :param start_date: Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24) - :type start_date: datetime - :param end_date: Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24) - :type end_date: datetime - :param latest_value_only: [TRUE|FALSE] - :type latest_value_only: bool - :param page: Page number for paged results - :type page: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._market_prices_price_raw_get_serialize( - country_code=country_code, - market_id=market_id, - commodity_id=commodity_id, - price_type_name=price_type_name, - currency_id=currency_id, - price_flag=price_flag, - start_date=start_date, - end_date=end_date, - latest_value_only=latest_value_only, - page=page, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedCommodityPriceListDTO", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def market_prices_price_raw_get_without_preload_content( - self, - country_code: Annotated[Optional[StrictStr], Field(description="The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code.")] = None, - market_id: Annotated[Optional[StrictInt], Field(description="Unique ID of a Market, as found in /Markets/GeoJSONList")] = None, - commodity_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a Commodity, as found in /Commodities/List")] = None, - price_type_name: Annotated[Optional[StrictStr], Field(description="Price type: [retail|wholesale|farmgate]")] = None, - currency_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a currency, as found in /Currency/List")] = None, - price_flag: Annotated[Optional[StrictStr], Field(description="Type of price data: [actual|aggregate|estimated|forecasted]")] = None, - start_date: Annotated[Optional[datetime], Field(description="Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24)")] = None, - end_date: Annotated[Optional[datetime], Field(description="Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24)")] = None, - latest_value_only: Annotated[Optional[StrictBool], Field(description="[TRUE|FALSE]")] = None, - page: Annotated[Optional[StrictInt], Field(description="Page number for paged results")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Returns original commodity market prices - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access%20Policy-TEC_Architecture_+_Service_Owner_approvals_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Official%20Use%20Only-yellow)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_marketprices-priceraw_get\" Restricted endpoint. Returns the original data with the entire Commodity Price Metadata as inserted by the focal point, which might contain sensitive or personal informatio. Country code, either ISO-3166 Alpha 3 code or the VAM internal admin0code is mandatory. **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param country_code: The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code. - :type country_code: str - :param market_id: Unique ID of a Market, as found in /Markets/GeoJSONList - :type market_id: int - :param commodity_id: The exact ID of a Commodity, as found in /Commodities/List - :type commodity_id: int - :param price_type_name: Price type: [retail|wholesale|farmgate] - :type price_type_name: str - :param currency_id: The exact ID of a currency, as found in /Currency/List - :type currency_id: int - :param price_flag: Type of price data: [actual|aggregate|estimated|forecasted] - :type price_flag: str - :param start_date: Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24) - :type start_date: datetime - :param end_date: Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24) - :type end_date: datetime - :param latest_value_only: [TRUE|FALSE] - :type latest_value_only: bool - :param page: Page number for paged results - :type page: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._market_prices_price_raw_get_serialize( - country_code=country_code, - market_id=market_id, - commodity_id=commodity_id, - price_type_name=price_type_name, - currency_id=currency_id, - price_flag=price_flag, - start_date=start_date, - end_date=end_date, - latest_value_only=latest_value_only, - page=page, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedCommodityPriceListDTO", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _market_prices_price_raw_get_serialize( - self, - country_code, - market_id, - commodity_id, - price_type_name, - currency_id, - price_flag, - start_date, - end_date, - latest_value_only, - page, - format, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if country_code is not None: - - _query_params.append(('countryCode', country_code)) - - if market_id is not None: - - _query_params.append(('marketID', market_id)) - - if commodity_id is not None: - - _query_params.append(('commodityID', commodity_id)) - - if price_type_name is not None: - - _query_params.append(('priceTypeName', price_type_name)) - - if currency_id is not None: - - _query_params.append(('currencyID', currency_id)) - - if price_flag is not None: - - _query_params.append(('priceFlag', price_flag)) - - if start_date is not None: - if isinstance(start_date, datetime): - _query_params.append( - ( - 'startDate', - start_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('startDate', start_date)) - - if end_date is not None: - if isinstance(end_date, datetime): - _query_params.append( - ( - 'endDate', - end_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('endDate', end_date)) - - if latest_value_only is not None: - - _query_params.append(('latestValueOnly', latest_value_only)) - - if page is not None: - - _query_params.append(('page', page)) - - if format is not None: - - _query_params.append(('format', format)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain', - 'application/json', - 'text/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/MarketPrices/PriceRaw', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def market_prices_price_weekly_get( - self, - country_code: Annotated[Optional[StrictStr], Field(description="The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code.")] = None, - market_id: Annotated[Optional[StrictInt], Field(description="Unique ID of a Market, as found in /Markets/GeoJSONList")] = None, - commodity_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a Commodity, as found in /Commodities/List")] = None, - price_type_name: Annotated[Optional[StrictStr], Field(description="Price type: [retail|wholesale|farmgate]")] = None, - currency_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a currency, as found in /Currency/List")] = None, - price_flag: Annotated[Optional[StrictStr], Field(description="Type of price data: [actual|aggregate|estimated|forecasted]")] = None, - start_date: Annotated[Optional[datetime], Field(description="Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24)")] = None, - end_date: Annotated[Optional[datetime], Field(description="Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24)")] = None, - latest_value_only: Annotated[Optional[StrictBool], Field(description="[TRUE|FALSE]")] = None, - page: Annotated[Optional[StrictInt], Field(description="Page number for paged results")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PagedCommodityWeeklyAggregatedPriceListDTO: - """Returns a weekly time series of commodity market prices. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_marketprices-priceweekly_get\" Weeks used as reference are the International Organization for Standardization (ISO) week-numbering year (ISO-8601). Data is flagged according to its pre-processing characteristics. Aactual data is collected originally with weekly frequency; aggregated data is collected with higher frequency (daily) averaged through a weighted mean to weekly; imputed data is an estimation of missing values in the time series, obtained through the R Amelia-II package; forecasted data is a six months prediction obtained through different methods, which are reported in the API. For country specific meta-data please refer to documentation available in [DataLibrary](https://datalib.vam.wfp.org/). For specific methodological notes on forecasts and imputations refer to the dedicated page in [DataViz](https://dataviz.vam.wfp.org/). Country code, either ISO-3166 Alpha 3 code or the VAM internal admin0code is mandatory. **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param country_code: The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code. - :type country_code: str - :param market_id: Unique ID of a Market, as found in /Markets/GeoJSONList - :type market_id: int - :param commodity_id: The exact ID of a Commodity, as found in /Commodities/List - :type commodity_id: int - :param price_type_name: Price type: [retail|wholesale|farmgate] - :type price_type_name: str - :param currency_id: The exact ID of a currency, as found in /Currency/List - :type currency_id: int - :param price_flag: Type of price data: [actual|aggregate|estimated|forecasted] - :type price_flag: str - :param start_date: Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24) - :type start_date: datetime - :param end_date: Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24) - :type end_date: datetime - :param latest_value_only: [TRUE|FALSE] - :type latest_value_only: bool - :param page: Page number for paged results - :type page: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._market_prices_price_weekly_get_serialize( - country_code=country_code, - market_id=market_id, - commodity_id=commodity_id, - price_type_name=price_type_name, - currency_id=currency_id, - price_flag=price_flag, - start_date=start_date, - end_date=end_date, - latest_value_only=latest_value_only, - page=page, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedCommodityWeeklyAggregatedPriceListDTO", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def market_prices_price_weekly_get_with_http_info( - self, - country_code: Annotated[Optional[StrictStr], Field(description="The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code.")] = None, - market_id: Annotated[Optional[StrictInt], Field(description="Unique ID of a Market, as found in /Markets/GeoJSONList")] = None, - commodity_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a Commodity, as found in /Commodities/List")] = None, - price_type_name: Annotated[Optional[StrictStr], Field(description="Price type: [retail|wholesale|farmgate]")] = None, - currency_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a currency, as found in /Currency/List")] = None, - price_flag: Annotated[Optional[StrictStr], Field(description="Type of price data: [actual|aggregate|estimated|forecasted]")] = None, - start_date: Annotated[Optional[datetime], Field(description="Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24)")] = None, - end_date: Annotated[Optional[datetime], Field(description="Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24)")] = None, - latest_value_only: Annotated[Optional[StrictBool], Field(description="[TRUE|FALSE]")] = None, - page: Annotated[Optional[StrictInt], Field(description="Page number for paged results")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PagedCommodityWeeklyAggregatedPriceListDTO]: - """Returns a weekly time series of commodity market prices. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_marketprices-priceweekly_get\" Weeks used as reference are the International Organization for Standardization (ISO) week-numbering year (ISO-8601). Data is flagged according to its pre-processing characteristics. Aactual data is collected originally with weekly frequency; aggregated data is collected with higher frequency (daily) averaged through a weighted mean to weekly; imputed data is an estimation of missing values in the time series, obtained through the R Amelia-II package; forecasted data is a six months prediction obtained through different methods, which are reported in the API. For country specific meta-data please refer to documentation available in [DataLibrary](https://datalib.vam.wfp.org/). For specific methodological notes on forecasts and imputations refer to the dedicated page in [DataViz](https://dataviz.vam.wfp.org/). Country code, either ISO-3166 Alpha 3 code or the VAM internal admin0code is mandatory. **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param country_code: The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code. - :type country_code: str - :param market_id: Unique ID of a Market, as found in /Markets/GeoJSONList - :type market_id: int - :param commodity_id: The exact ID of a Commodity, as found in /Commodities/List - :type commodity_id: int - :param price_type_name: Price type: [retail|wholesale|farmgate] - :type price_type_name: str - :param currency_id: The exact ID of a currency, as found in /Currency/List - :type currency_id: int - :param price_flag: Type of price data: [actual|aggregate|estimated|forecasted] - :type price_flag: str - :param start_date: Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24) - :type start_date: datetime - :param end_date: Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24) - :type end_date: datetime - :param latest_value_only: [TRUE|FALSE] - :type latest_value_only: bool - :param page: Page number for paged results - :type page: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._market_prices_price_weekly_get_serialize( - country_code=country_code, - market_id=market_id, - commodity_id=commodity_id, - price_type_name=price_type_name, - currency_id=currency_id, - price_flag=price_flag, - start_date=start_date, - end_date=end_date, - latest_value_only=latest_value_only, - page=page, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedCommodityWeeklyAggregatedPriceListDTO", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def market_prices_price_weekly_get_without_preload_content( - self, - country_code: Annotated[Optional[StrictStr], Field(description="The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code.")] = None, - market_id: Annotated[Optional[StrictInt], Field(description="Unique ID of a Market, as found in /Markets/GeoJSONList")] = None, - commodity_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a Commodity, as found in /Commodities/List")] = None, - price_type_name: Annotated[Optional[StrictStr], Field(description="Price type: [retail|wholesale|farmgate]")] = None, - currency_id: Annotated[Optional[StrictInt], Field(description="The exact ID of a currency, as found in /Currency/List")] = None, - price_flag: Annotated[Optional[StrictStr], Field(description="Type of price data: [actual|aggregate|estimated|forecasted]")] = None, - start_date: Annotated[Optional[datetime], Field(description="Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24)")] = None, - end_date: Annotated[Optional[datetime], Field(description="Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24)")] = None, - latest_value_only: Annotated[Optional[StrictBool], Field(description="[TRUE|FALSE]")] = None, - page: Annotated[Optional[StrictInt], Field(description="Page number for paged results")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Returns a weekly time series of commodity market prices. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_marketprices-priceweekly_get\" Weeks used as reference are the International Organization for Standardization (ISO) week-numbering year (ISO-8601). Data is flagged according to its pre-processing characteristics. Aactual data is collected originally with weekly frequency; aggregated data is collected with higher frequency (daily) averaged through a weighted mean to weekly; imputed data is an estimation of missing values in the time series, obtained through the R Amelia-II package; forecasted data is a six months prediction obtained through different methods, which are reported in the API. For country specific meta-data please refer to documentation available in [DataLibrary](https://datalib.vam.wfp.org/). For specific methodological notes on forecasts and imputations refer to the dedicated page in [DataViz](https://dataviz.vam.wfp.org/). Country code, either ISO-3166 Alpha 3 code or the VAM internal admin0code is mandatory. **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param country_code: The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code. - :type country_code: str - :param market_id: Unique ID of a Market, as found in /Markets/GeoJSONList - :type market_id: int - :param commodity_id: The exact ID of a Commodity, as found in /Commodities/List - :type commodity_id: int - :param price_type_name: Price type: [retail|wholesale|farmgate] - :type price_type_name: str - :param currency_id: The exact ID of a currency, as found in /Currency/List - :type currency_id: int - :param price_flag: Type of price data: [actual|aggregate|estimated|forecasted] - :type price_flag: str - :param start_date: Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24) - :type start_date: datetime - :param end_date: Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \\\"-\\\" month \\\"-\\\" day (e.g. 2020/06/24) - :type end_date: datetime - :param latest_value_only: [TRUE|FALSE] - :type latest_value_only: bool - :param page: Page number for paged results - :type page: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._market_prices_price_weekly_get_serialize( - country_code=country_code, - market_id=market_id, - commodity_id=commodity_id, - price_type_name=price_type_name, - currency_id=currency_id, - price_flag=price_flag, - start_date=start_date, - end_date=end_date, - latest_value_only=latest_value_only, - page=page, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedCommodityWeeklyAggregatedPriceListDTO", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _market_prices_price_weekly_get_serialize( - self, - country_code, - market_id, - commodity_id, - price_type_name, - currency_id, - price_flag, - start_date, - end_date, - latest_value_only, - page, - format, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if country_code is not None: - - _query_params.append(('countryCode', country_code)) - - if market_id is not None: - - _query_params.append(('marketID', market_id)) - - if commodity_id is not None: - - _query_params.append(('commodityID', commodity_id)) - - if price_type_name is not None: - - _query_params.append(('priceTypeName', price_type_name)) - - if currency_id is not None: - - _query_params.append(('currencyID', currency_id)) - - if price_flag is not None: - - _query_params.append(('priceFlag', price_flag)) - - if start_date is not None: - if isinstance(start_date, datetime): - _query_params.append( - ( - 'startDate', - start_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('startDate', start_date)) - - if end_date is not None: - if isinstance(end_date, datetime): - _query_params.append( - ( - 'endDate', - end_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('endDate', end_date)) - - if latest_value_only is not None: - - _query_params.append(('latestValueOnly', latest_value_only)) - - if page is not None: - - _query_params.append(('page', page)) - - if format is not None: - - _query_params.append(('format', format)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain', - 'application/json', - 'text/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/MarketPrices/PriceWeekly', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - diff --git a/data_bridges_client/api/markets_api.py b/data_bridges_client/api/markets_api.py deleted file mode 100644 index cbda4aa..0000000 --- a/data_bridges_client/api/markets_api.py +++ /dev/null @@ -1,1245 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from pydantic import Field, StrictBool, StrictBytes, StrictFloat, StrictInt, StrictStr, field_validator -from typing import List, Optional, Union -from typing_extensions import Annotated -from data_bridges_client.models.market_geo_json_root import MarketGeoJsonRoot -from data_bridges_client.models.nearby_markets_dto import NearbyMarketsDTO -from data_bridges_client.models.paged_market_list_dto import PagedMarketListDTO - -from data_bridges_client.api_client import ApiClient, RequestSerialized -from data_bridges_client.api_response import ApiResponse -from data_bridges_client.rest import RESTResponseType - - -class MarketsApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def markets_geo_json_list_get( - self, - adm0code: Annotated[Optional[StrictInt], Field(description="The admin code of the country")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> MarketGeoJsonRoot: - """Provide a list of geo referenced markets in a specific country - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_markets-geojsonlist_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param adm0code: The admin code of the country - :type adm0code: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._markets_geo_json_list_get_serialize( - adm0code=adm0code, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "MarketGeoJsonRoot", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def markets_geo_json_list_get_with_http_info( - self, - adm0code: Annotated[Optional[StrictInt], Field(description="The admin code of the country")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[MarketGeoJsonRoot]: - """Provide a list of geo referenced markets in a specific country - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_markets-geojsonlist_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param adm0code: The admin code of the country - :type adm0code: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._markets_geo_json_list_get_serialize( - adm0code=adm0code, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "MarketGeoJsonRoot", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def markets_geo_json_list_get_without_preload_content( - self, - adm0code: Annotated[Optional[StrictInt], Field(description="The admin code of the country")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Provide a list of geo referenced markets in a specific country - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_markets-geojsonlist_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param adm0code: The admin code of the country - :type adm0code: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._markets_geo_json_list_get_serialize( - adm0code=adm0code, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "MarketGeoJsonRoot", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _markets_geo_json_list_get_serialize( - self, - adm0code, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if adm0code is not None: - - _query_params.append(('adm0code', adm0code)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/geo+json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/Markets/GeoJSONList', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def markets_list_get( - self, - country_code: Annotated[Optional[StrictStr], Field(description="The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PagedMarketListDTO: - """Get a complete list of markets in a country - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_markets-list_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param country_code: The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code - :type country_code: str - :param page: page number for paged results - :type page: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._markets_list_get_serialize( - country_code=country_code, - page=page, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedMarketListDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def markets_list_get_with_http_info( - self, - country_code: Annotated[Optional[StrictStr], Field(description="The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PagedMarketListDTO]: - """Get a complete list of markets in a country - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_markets-list_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param country_code: The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code - :type country_code: str - :param page: page number for paged results - :type page: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._markets_list_get_serialize( - country_code=country_code, - page=page, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedMarketListDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def markets_list_get_without_preload_content( - self, - country_code: Annotated[Optional[StrictStr], Field(description="The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get a complete list of markets in a country - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_markets-list_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param country_code: The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code - :type country_code: str - :param page: page number for paged results - :type page: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._markets_list_get_serialize( - country_code=country_code, - page=page, - format=format, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedMarketListDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _markets_list_get_serialize( - self, - country_code, - page, - format, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if country_code is not None: - - _query_params.append(('countryCode', country_code)) - - if page is not None: - - _query_params.append(('page', page)) - - if format is not None: - - _query_params.append(('format', format)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain', - 'application/json', - 'text/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/Markets/List', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def markets_markets_as_csv_get( - self, - adm0code: Annotated[Optional[StrictInt], Field(description="The admin code of the country")] = None, - local_names: Annotated[Optional[StrictBool], Field(description="If true the name of markets and regions will be localized if available")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> bytearray: - """Get a complete list of markets in a country - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_markets-marketsascsv_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param adm0code: The admin code of the country - :type adm0code: int - :param local_names: If true the name of markets and regions will be localized if available - :type local_names: bool - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._markets_markets_as_csv_get_serialize( - adm0code=adm0code, - local_names=local_names, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "bytearray", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def markets_markets_as_csv_get_with_http_info( - self, - adm0code: Annotated[Optional[StrictInt], Field(description="The admin code of the country")] = None, - local_names: Annotated[Optional[StrictBool], Field(description="If true the name of markets and regions will be localized if available")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[bytearray]: - """Get a complete list of markets in a country - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_markets-marketsascsv_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param adm0code: The admin code of the country - :type adm0code: int - :param local_names: If true the name of markets and regions will be localized if available - :type local_names: bool - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._markets_markets_as_csv_get_serialize( - adm0code=adm0code, - local_names=local_names, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "bytearray", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def markets_markets_as_csv_get_without_preload_content( - self, - adm0code: Annotated[Optional[StrictInt], Field(description="The admin code of the country")] = None, - local_names: Annotated[Optional[StrictBool], Field(description="If true the name of markets and regions will be localized if available")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get a complete list of markets in a country - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_markets-marketsascsv_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param adm0code: The admin code of the country - :type adm0code: int - :param local_names: If true the name of markets and regions will be localized if available - :type local_names: bool - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._markets_markets_as_csv_get_serialize( - adm0code=adm0code, - local_names=local_names, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "bytearray", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _markets_markets_as_csv_get_serialize( - self, - adm0code, - local_names, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if adm0code is not None: - - _query_params.append(('adm0code', adm0code)) - - if local_names is not None: - - _query_params.append(('localNames', local_names)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain', - 'application/json', - 'text/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/Markets/MarketsAsCSV', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def markets_nearby_markets_get( - self, - adm0code: Annotated[Optional[StrictInt], Field(description="code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion")] = None, - lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="latitude of the point that will be used to search for existing nearby markets. Geo-reference standard used for this coordinate is decimal")] = None, - lng: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="longitude of the point that will be used to search for existing nearby markets. Geo-reference standard used for this coordinate is decimal")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[NearbyMarketsDTO]: - """Find markets near a given location by longitude and latitude within a 15Km distance - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_markets-nearbymarkets_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param adm0code: code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion - :type adm0code: int - :param lat: latitude of the point that will be used to search for existing nearby markets. Geo-reference standard used for this coordinate is decimal - :type lat: float - :param lng: longitude of the point that will be used to search for existing nearby markets. Geo-reference standard used for this coordinate is decimal - :type lng: float - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._markets_nearby_markets_get_serialize( - adm0code=adm0code, - lat=lat, - lng=lng, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[NearbyMarketsDTO]", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def markets_nearby_markets_get_with_http_info( - self, - adm0code: Annotated[Optional[StrictInt], Field(description="code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion")] = None, - lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="latitude of the point that will be used to search for existing nearby markets. Geo-reference standard used for this coordinate is decimal")] = None, - lng: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="longitude of the point that will be used to search for existing nearby markets. Geo-reference standard used for this coordinate is decimal")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[NearbyMarketsDTO]]: - """Find markets near a given location by longitude and latitude within a 15Km distance - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_markets-nearbymarkets_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param adm0code: code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion - :type adm0code: int - :param lat: latitude of the point that will be used to search for existing nearby markets. Geo-reference standard used for this coordinate is decimal - :type lat: float - :param lng: longitude of the point that will be used to search for existing nearby markets. Geo-reference standard used for this coordinate is decimal - :type lng: float - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._markets_nearby_markets_get_serialize( - adm0code=adm0code, - lat=lat, - lng=lng, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[NearbyMarketsDTO]", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def markets_nearby_markets_get_without_preload_content( - self, - adm0code: Annotated[Optional[StrictInt], Field(description="code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion")] = None, - lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="latitude of the point that will be used to search for existing nearby markets. Geo-reference standard used for this coordinate is decimal")] = None, - lng: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="longitude of the point that will be used to search for existing nearby markets. Geo-reference standard used for this coordinate is decimal")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Find markets near a given location by longitude and latitude within a 15Km distance - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_markets-nearbymarkets_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param adm0code: code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion - :type adm0code: int - :param lat: latitude of the point that will be used to search for existing nearby markets. Geo-reference standard used for this coordinate is decimal - :type lat: float - :param lng: longitude of the point that will be used to search for existing nearby markets. Geo-reference standard used for this coordinate is decimal - :type lng: float - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._markets_nearby_markets_get_serialize( - adm0code=adm0code, - lat=lat, - lng=lng, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[NearbyMarketsDTO]", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _markets_nearby_markets_get_serialize( - self, - adm0code, - lat, - lng, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if adm0code is not None: - - _query_params.append(('adm0code', adm0code)) - - if lat is not None: - - _query_params.append(('lat', lat)) - - if lng is not None: - - _query_params.append(('lng', lng)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/Markets/NearbyMarkets', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - diff --git a/data_bridges_client/api/rpme_api.py b/data_bridges_client/api/rpme_api.py deleted file mode 100644 index 768f183..0000000 --- a/data_bridges_client/api/rpme_api.py +++ /dev/null @@ -1,2049 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from datetime import datetime -from pydantic import Field, StrictInt, StrictStr, field_validator -from typing import Optional -from typing_extensions import Annotated -from data_bridges_client.models.paged_survey_list_dto import PagedSurveyListDTO -from data_bridges_client.models.paged_survey_responses_dto import PagedSurveyResponsesDTO -from data_bridges_client.models.paged_xls_form_list_dto import PagedXlsFormListDTO -from data_bridges_client.models.rpme_assessment_paged_result import RpmeAssessmentPagedResult -from data_bridges_client.models.rpme_variable_paged_result import RpmeVariablePagedResult - -from data_bridges_client.api_client import ApiClient, RequestSerialized -from data_bridges_client.api_response import ApiResponse -from data_bridges_client.rest import RESTResponseType - - -class RpmeApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def rpme_base_data_get( - self, - survey_id: Annotated[Optional[StrictInt], Field(description="unique identifier for the collected data, as retrieved from /Surveys API.")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - page_size: Annotated[Optional[StrictInt], Field(description="page size for paged results, default value is 20.")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PagedSurveyResponsesDTO: - """Get data that includes the core RPME fields only by Survey ID - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_rpme-basedata_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param survey_id: unique identifier for the collected data, as retrieved from /Surveys API. - :type survey_id: int - :param page: page number for paged results - :type page: int - :param page_size: page size for paged results, default value is 20. - :type page_size: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._rpme_base_data_get_serialize( - survey_id=survey_id, - page=page, - page_size=page_size, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedSurveyResponsesDTO", - '400': "BadRequestDTO", - '404': "ProblemDetails", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def rpme_base_data_get_with_http_info( - self, - survey_id: Annotated[Optional[StrictInt], Field(description="unique identifier for the collected data, as retrieved from /Surveys API.")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - page_size: Annotated[Optional[StrictInt], Field(description="page size for paged results, default value is 20.")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PagedSurveyResponsesDTO]: - """Get data that includes the core RPME fields only by Survey ID - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_rpme-basedata_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param survey_id: unique identifier for the collected data, as retrieved from /Surveys API. - :type survey_id: int - :param page: page number for paged results - :type page: int - :param page_size: page size for paged results, default value is 20. - :type page_size: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._rpme_base_data_get_serialize( - survey_id=survey_id, - page=page, - page_size=page_size, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedSurveyResponsesDTO", - '400': "BadRequestDTO", - '404': "ProblemDetails", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def rpme_base_data_get_without_preload_content( - self, - survey_id: Annotated[Optional[StrictInt], Field(description="unique identifier for the collected data, as retrieved from /Surveys API.")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - page_size: Annotated[Optional[StrictInt], Field(description="page size for paged results, default value is 20.")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get data that includes the core RPME fields only by Survey ID - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_rpme-basedata_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param survey_id: unique identifier for the collected data, as retrieved from /Surveys API. - :type survey_id: int - :param page: page number for paged results - :type page: int - :param page_size: page size for paged results, default value is 20. - :type page_size: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._rpme_base_data_get_serialize( - survey_id=survey_id, - page=page, - page_size=page_size, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedSurveyResponsesDTO", - '400': "BadRequestDTO", - '404': "ProblemDetails", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _rpme_base_data_get_serialize( - self, - survey_id, - page, - page_size, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if survey_id is not None: - - _query_params.append(('surveyID', survey_id)) - - if page is not None: - - _query_params.append(('page', page)) - - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain', - 'application/json', - 'text/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/Rpme/BaseData', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def rpme_full_data_get( - self, - survey_id: Annotated[Optional[StrictInt], Field(description="unique identifier for the collected data, as retrieved from /Surveys API.")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - page_size: Annotated[Optional[StrictInt], Field(description="page size for paged results, default value is 20.")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PagedSurveyResponsesDTO: - """Get a full dataset that includes all the fields included in the survey in addition to the core RPME fields by Survey ID. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access%20Policy-TEC_Architecture_+_Service_Owner_approvals_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Official%20Use%20Only-yellow)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_rpme-fulldata_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param survey_id: unique identifier for the collected data, as retrieved from /Surveys API. - :type survey_id: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param page: page number for paged results - :type page: int - :param page_size: page size for paged results, default value is 20. - :type page_size: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._rpme_full_data_get_serialize( - survey_id=survey_id, - format=format, - page=page, - page_size=page_size, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedSurveyResponsesDTO", - '400': "BadRequestDTO", - '404': "ProblemDetails", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def rpme_full_data_get_with_http_info( - self, - survey_id: Annotated[Optional[StrictInt], Field(description="unique identifier for the collected data, as retrieved from /Surveys API.")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - page_size: Annotated[Optional[StrictInt], Field(description="page size for paged results, default value is 20.")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PagedSurveyResponsesDTO]: - """Get a full dataset that includes all the fields included in the survey in addition to the core RPME fields by Survey ID. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access%20Policy-TEC_Architecture_+_Service_Owner_approvals_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Official%20Use%20Only-yellow)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_rpme-fulldata_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param survey_id: unique identifier for the collected data, as retrieved from /Surveys API. - :type survey_id: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param page: page number for paged results - :type page: int - :param page_size: page size for paged results, default value is 20. - :type page_size: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._rpme_full_data_get_serialize( - survey_id=survey_id, - format=format, - page=page, - page_size=page_size, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedSurveyResponsesDTO", - '400': "BadRequestDTO", - '404': "ProblemDetails", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def rpme_full_data_get_without_preload_content( - self, - survey_id: Annotated[Optional[StrictInt], Field(description="unique identifier for the collected data, as retrieved from /Surveys API.")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - page_size: Annotated[Optional[StrictInt], Field(description="page size for paged results, default value is 20.")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get a full dataset that includes all the fields included in the survey in addition to the core RPME fields by Survey ID. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access%20Policy-TEC_Architecture_+_Service_Owner_approvals_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Official%20Use%20Only-yellow)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_rpme-fulldata_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param survey_id: unique identifier for the collected data, as retrieved from /Surveys API. - :type survey_id: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param page: page number for paged results - :type page: int - :param page_size: page size for paged results, default value is 20. - :type page_size: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._rpme_full_data_get_serialize( - survey_id=survey_id, - format=format, - page=page, - page_size=page_size, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedSurveyResponsesDTO", - '400': "BadRequestDTO", - '404': "ProblemDetails", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _rpme_full_data_get_serialize( - self, - survey_id, - format, - page, - page_size, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if survey_id is not None: - - _query_params.append(('surveyID', survey_id)) - - if format is not None: - - _query_params.append(('format', format)) - - if page is not None: - - _query_params.append(('page', page)) - - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain', - 'application/json', - 'text/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/Rpme/FullData', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def rpme_output_values_get( - self, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - adm0_code: Annotated[Optional[StrictInt], Field(description="Code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion")] = None, - survey_id: Annotated[Optional[StrictInt], Field(description="The ID of the survey")] = None, - shop_id: Annotated[Optional[StrictInt], Field(description="The ID of the shop")] = None, - market_id: Annotated[Optional[StrictInt], Field(description="The ID of the market")] = None, - adm0_code_dots: Optional[StrictStr] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RpmeAssessmentPagedResult: - """Processed values for each variable used in the assessments - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_rpme-outputvalues_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param page: page number for paged results - :type page: int - :param adm0_code: Code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion - :type adm0_code: int - :param survey_id: The ID of the survey - :type survey_id: int - :param shop_id: The ID of the shop - :type shop_id: int - :param market_id: The ID of the market - :type market_id: int - :param adm0_code_dots: - :type adm0_code_dots: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._rpme_output_values_get_serialize( - page=page, - adm0_code=adm0_code, - survey_id=survey_id, - shop_id=shop_id, - market_id=market_id, - adm0_code_dots=adm0_code_dots, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "RpmeAssessmentPagedResult", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def rpme_output_values_get_with_http_info( - self, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - adm0_code: Annotated[Optional[StrictInt], Field(description="Code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion")] = None, - survey_id: Annotated[Optional[StrictInt], Field(description="The ID of the survey")] = None, - shop_id: Annotated[Optional[StrictInt], Field(description="The ID of the shop")] = None, - market_id: Annotated[Optional[StrictInt], Field(description="The ID of the market")] = None, - adm0_code_dots: Optional[StrictStr] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[RpmeAssessmentPagedResult]: - """Processed values for each variable used in the assessments - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_rpme-outputvalues_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param page: page number for paged results - :type page: int - :param adm0_code: Code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion - :type adm0_code: int - :param survey_id: The ID of the survey - :type survey_id: int - :param shop_id: The ID of the shop - :type shop_id: int - :param market_id: The ID of the market - :type market_id: int - :param adm0_code_dots: - :type adm0_code_dots: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._rpme_output_values_get_serialize( - page=page, - adm0_code=adm0_code, - survey_id=survey_id, - shop_id=shop_id, - market_id=market_id, - adm0_code_dots=adm0_code_dots, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "RpmeAssessmentPagedResult", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def rpme_output_values_get_without_preload_content( - self, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - adm0_code: Annotated[Optional[StrictInt], Field(description="Code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion")] = None, - survey_id: Annotated[Optional[StrictInt], Field(description="The ID of the survey")] = None, - shop_id: Annotated[Optional[StrictInt], Field(description="The ID of the shop")] = None, - market_id: Annotated[Optional[StrictInt], Field(description="The ID of the market")] = None, - adm0_code_dots: Optional[StrictStr] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Processed values for each variable used in the assessments - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_rpme-outputvalues_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param page: page number for paged results - :type page: int - :param adm0_code: Code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion - :type adm0_code: int - :param survey_id: The ID of the survey - :type survey_id: int - :param shop_id: The ID of the shop - :type shop_id: int - :param market_id: The ID of the market - :type market_id: int - :param adm0_code_dots: - :type adm0_code_dots: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._rpme_output_values_get_serialize( - page=page, - adm0_code=adm0_code, - survey_id=survey_id, - shop_id=shop_id, - market_id=market_id, - adm0_code_dots=adm0_code_dots, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "RpmeAssessmentPagedResult", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _rpme_output_values_get_serialize( - self, - page, - adm0_code, - survey_id, - shop_id, - market_id, - adm0_code_dots, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if page is not None: - - _query_params.append(('page', page)) - - if adm0_code is not None: - - _query_params.append(('adm0Code', adm0_code)) - - if survey_id is not None: - - _query_params.append(('surveyId', survey_id)) - - if shop_id is not None: - - _query_params.append(('shopId', shop_id)) - - if market_id is not None: - - _query_params.append(('marketId', market_id)) - - if adm0_code_dots is not None: - - _query_params.append(('adm0CodeDots', adm0_code_dots)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain', - 'application/json', - 'text/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/Rpme/OutputValues', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def rpme_surveys_get( - self, - adm0_code: Annotated[Optional[StrictInt], Field(description="code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - start_date: Annotated[Optional[datetime], Field(description="starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24)")] = None, - end_date: Annotated[Optional[datetime], Field(description="ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24)")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PagedSurveyListDTO: - """Retrieve 1) Survey IDs, 2) their corresponding XLS Form IDs, and 3) Base XLS Form of all RPME surveys conducted in a country. The date of reference, SurveyDate, for the data collection is set by the officer responsible for the upload of each survey. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_rpme-surveys_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param adm0_code: code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion - :type adm0_code: int - :param page: page number for paged results - :type page: int - :param start_date: starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24) - :type start_date: datetime - :param end_date: ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24) - :type end_date: datetime - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._rpme_surveys_get_serialize( - adm0_code=adm0_code, - page=page, - start_date=start_date, - end_date=end_date, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedSurveyListDTO", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def rpme_surveys_get_with_http_info( - self, - adm0_code: Annotated[Optional[StrictInt], Field(description="code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - start_date: Annotated[Optional[datetime], Field(description="starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24)")] = None, - end_date: Annotated[Optional[datetime], Field(description="ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24)")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PagedSurveyListDTO]: - """Retrieve 1) Survey IDs, 2) their corresponding XLS Form IDs, and 3) Base XLS Form of all RPME surveys conducted in a country. The date of reference, SurveyDate, for the data collection is set by the officer responsible for the upload of each survey. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_rpme-surveys_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param adm0_code: code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion - :type adm0_code: int - :param page: page number for paged results - :type page: int - :param start_date: starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24) - :type start_date: datetime - :param end_date: ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24) - :type end_date: datetime - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._rpme_surveys_get_serialize( - adm0_code=adm0_code, - page=page, - start_date=start_date, - end_date=end_date, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedSurveyListDTO", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def rpme_surveys_get_without_preload_content( - self, - adm0_code: Annotated[Optional[StrictInt], Field(description="code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - start_date: Annotated[Optional[datetime], Field(description="starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24)")] = None, - end_date: Annotated[Optional[datetime], Field(description="ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24)")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Retrieve 1) Survey IDs, 2) their corresponding XLS Form IDs, and 3) Base XLS Form of all RPME surveys conducted in a country. The date of reference, SurveyDate, for the data collection is set by the officer responsible for the upload of each survey. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_rpme-surveys_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param adm0_code: code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion - :type adm0_code: int - :param page: page number for paged results - :type page: int - :param start_date: starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24) - :type start_date: datetime - :param end_date: ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24) - :type end_date: datetime - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._rpme_surveys_get_serialize( - adm0_code=adm0_code, - page=page, - start_date=start_date, - end_date=end_date, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedSurveyListDTO", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _rpme_surveys_get_serialize( - self, - adm0_code, - page, - start_date, - end_date, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if adm0_code is not None: - - _query_params.append(('adm0Code', adm0_code)) - - if page is not None: - - _query_params.append(('page', page)) - - if start_date is not None: - if isinstance(start_date, datetime): - _query_params.append( - ( - 'startDate', - start_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('startDate', start_date)) - - if end_date is not None: - if isinstance(end_date, datetime): - _query_params.append( - ( - 'endDate', - end_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('endDate', end_date)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain', - 'application/json', - 'text/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/Rpme/Surveys', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def rpme_variables_get( - self, - page: Optional[StrictInt] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RpmeVariablePagedResult: - """List of variables - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_rpme-variables_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param page: - :type page: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._rpme_variables_get_serialize( - page=page, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "RpmeVariablePagedResult", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def rpme_variables_get_with_http_info( - self, - page: Optional[StrictInt] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[RpmeVariablePagedResult]: - """List of variables - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_rpme-variables_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param page: - :type page: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._rpme_variables_get_serialize( - page=page, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "RpmeVariablePagedResult", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def rpme_variables_get_without_preload_content( - self, - page: Optional[StrictInt] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """List of variables - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_rpme-variables_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param page: - :type page: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._rpme_variables_get_serialize( - page=page, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "RpmeVariablePagedResult", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _rpme_variables_get_serialize( - self, - page, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if page is not None: - - _query_params.append(('page', page)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain', - 'application/json', - 'text/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/Rpme/Variables', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def rpme_xls_forms_get( - self, - adm0_code: Annotated[Optional[StrictInt], Field(description="code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - start_date: Annotated[Optional[datetime], Field(description="starting date for the range in which data using this XLSForm was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24)")] = None, - end_date: Annotated[Optional[datetime], Field(description="ending date for the range in which data using this XLSForm was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24)")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PagedXlsFormListDTO: - """Get a complete list of XLS Forms uploaded on the RPME in a given period of data collection. This is the digital version of the questionnaire used during the data collection exercise. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_rpme-xlsforms_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param adm0_code: code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion - :type adm0_code: int - :param page: page number for paged results - :type page: int - :param start_date: starting date for the range in which data using this XLSForm was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24) - :type start_date: datetime - :param end_date: ending date for the range in which data using this XLSForm was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24) - :type end_date: datetime - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._rpme_xls_forms_get_serialize( - adm0_code=adm0_code, - page=page, - start_date=start_date, - end_date=end_date, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedXlsFormListDTO", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def rpme_xls_forms_get_with_http_info( - self, - adm0_code: Annotated[Optional[StrictInt], Field(description="code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - start_date: Annotated[Optional[datetime], Field(description="starting date for the range in which data using this XLSForm was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24)")] = None, - end_date: Annotated[Optional[datetime], Field(description="ending date for the range in which data using this XLSForm was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24)")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PagedXlsFormListDTO]: - """Get a complete list of XLS Forms uploaded on the RPME in a given period of data collection. This is the digital version of the questionnaire used during the data collection exercise. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_rpme-xlsforms_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param adm0_code: code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion - :type adm0_code: int - :param page: page number for paged results - :type page: int - :param start_date: starting date for the range in which data using this XLSForm was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24) - :type start_date: datetime - :param end_date: ending date for the range in which data using this XLSForm was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24) - :type end_date: datetime - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._rpme_xls_forms_get_serialize( - adm0_code=adm0_code, - page=page, - start_date=start_date, - end_date=end_date, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedXlsFormListDTO", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def rpme_xls_forms_get_without_preload_content( - self, - adm0_code: Annotated[Optional[StrictInt], Field(description="code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - start_date: Annotated[Optional[datetime], Field(description="starting date for the range in which data using this XLSForm was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24)")] = None, - end_date: Annotated[Optional[datetime], Field(description="ending date for the range in which data using this XLSForm was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24)")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get a complete list of XLS Forms uploaded on the RPME in a given period of data collection. This is the digital version of the questionnaire used during the data collection exercise. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_rpme-xlsforms_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param adm0_code: code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion - :type adm0_code: int - :param page: page number for paged results - :type page: int - :param start_date: starting date for the range in which data using this XLSForm was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24) - :type start_date: datetime - :param end_date: ending date for the range in which data using this XLSForm was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24) - :type end_date: datetime - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._rpme_xls_forms_get_serialize( - adm0_code=adm0_code, - page=page, - start_date=start_date, - end_date=end_date, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedXlsFormListDTO", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _rpme_xls_forms_get_serialize( - self, - adm0_code, - page, - start_date, - end_date, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if adm0_code is not None: - - _query_params.append(('adm0Code', adm0_code)) - - if page is not None: - - _query_params.append(('page', page)) - - if start_date is not None: - if isinstance(start_date, datetime): - _query_params.append( - ( - 'startDate', - start_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('startDate', start_date)) - - if end_date is not None: - if isinstance(end_date, datetime): - _query_params.append( - ( - 'endDate', - end_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('endDate', end_date)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/Rpme/XLSForms', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - diff --git a/data_bridges_client/api/surveys_api.py b/data_bridges_client/api/surveys_api.py deleted file mode 100644 index ed052a3..0000000 --- a/data_bridges_client/api/surveys_api.py +++ /dev/null @@ -1,1483 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from datetime import datetime -from pydantic import Field, StrictInt, StrictStr, field_validator -from typing import Optional -from typing_extensions import Annotated -from data_bridges_client.models.paged_processed_data_dto import PagedProcessedDataDTO -from data_bridges_client.models.paged_survey_list_dto import PagedSurveyListDTO -from data_bridges_client.models.paged_survey_responses_dto import PagedSurveyResponsesDTO - -from data_bridges_client.api_client import ApiClient, RequestSerialized -from data_bridges_client.api_response import ApiResponse -from data_bridges_client.rest import RESTResponseType - - -class SurveysApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def m_fi_surveys_base_data_get( - self, - survey_id: Annotated[Optional[StrictInt], Field(description="unique identifier for the collected data, as retrieved from /Surveys API.")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - page_size: Annotated[Optional[StrictInt], Field(description="page size for paged results, default value is 20.")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PagedSurveyResponsesDTO: - """Get data that includes the core Market Functionality Index (MFI) fields only by Survey ID - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_mfi-surveys-basedata_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param survey_id: unique identifier for the collected data, as retrieved from /Surveys API. - :type survey_id: int - :param page: page number for paged results - :type page: int - :param page_size: page size for paged results, default value is 20. - :type page_size: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._m_fi_surveys_base_data_get_serialize( - survey_id=survey_id, - page=page, - page_size=page_size, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedSurveyResponsesDTO", - '400': "BadRequestDTO", - '404': "ProblemDetails", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def m_fi_surveys_base_data_get_with_http_info( - self, - survey_id: Annotated[Optional[StrictInt], Field(description="unique identifier for the collected data, as retrieved from /Surveys API.")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - page_size: Annotated[Optional[StrictInt], Field(description="page size for paged results, default value is 20.")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PagedSurveyResponsesDTO]: - """Get data that includes the core Market Functionality Index (MFI) fields only by Survey ID - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_mfi-surveys-basedata_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param survey_id: unique identifier for the collected data, as retrieved from /Surveys API. - :type survey_id: int - :param page: page number for paged results - :type page: int - :param page_size: page size for paged results, default value is 20. - :type page_size: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._m_fi_surveys_base_data_get_serialize( - survey_id=survey_id, - page=page, - page_size=page_size, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedSurveyResponsesDTO", - '400': "BadRequestDTO", - '404': "ProblemDetails", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def m_fi_surveys_base_data_get_without_preload_content( - self, - survey_id: Annotated[Optional[StrictInt], Field(description="unique identifier for the collected data, as retrieved from /Surveys API.")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - page_size: Annotated[Optional[StrictInt], Field(description="page size for paged results, default value is 20.")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get data that includes the core Market Functionality Index (MFI) fields only by Survey ID - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_mfi-surveys-basedata_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param survey_id: unique identifier for the collected data, as retrieved from /Surveys API. - :type survey_id: int - :param page: page number for paged results - :type page: int - :param page_size: page size for paged results, default value is 20. - :type page_size: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._m_fi_surveys_base_data_get_serialize( - survey_id=survey_id, - page=page, - page_size=page_size, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedSurveyResponsesDTO", - '400': "BadRequestDTO", - '404': "ProblemDetails", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _m_fi_surveys_base_data_get_serialize( - self, - survey_id, - page, - page_size, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if survey_id is not None: - - _query_params.append(('surveyID', survey_id)) - - if page is not None: - - _query_params.append(('page', page)) - - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain', - 'application/json', - 'text/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/MFI/Surveys/BaseData', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def m_fi_surveys_full_data_get( - self, - survey_id: Annotated[Optional[StrictInt], Field(description="unique identifier for the collected data, as retrieved from /Surveys API.")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - page_size: Annotated[Optional[StrictInt], Field(description="page size for paged results, default value is 20.")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PagedSurveyResponsesDTO: - """Get a full dataset that includes all the fields included in the survey in addition to the core Market Functionality Index (MFI) fields by Survey ID. To access this data, please contact global.mfi@wfp.org for authorization. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access%20Policy-TEC_Architecture_+_Service_Owner_approvals_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Official%20Use%20Only-yellow)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_mfi-surveys-fulldata_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param survey_id: unique identifier for the collected data, as retrieved from /Surveys API. - :type survey_id: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param page: page number for paged results - :type page: int - :param page_size: page size for paged results, default value is 20. - :type page_size: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._m_fi_surveys_full_data_get_serialize( - survey_id=survey_id, - format=format, - page=page, - page_size=page_size, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedSurveyResponsesDTO", - '400': "BadRequestDTO", - '404': "ProblemDetails", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def m_fi_surveys_full_data_get_with_http_info( - self, - survey_id: Annotated[Optional[StrictInt], Field(description="unique identifier for the collected data, as retrieved from /Surveys API.")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - page_size: Annotated[Optional[StrictInt], Field(description="page size for paged results, default value is 20.")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PagedSurveyResponsesDTO]: - """Get a full dataset that includes all the fields included in the survey in addition to the core Market Functionality Index (MFI) fields by Survey ID. To access this data, please contact global.mfi@wfp.org for authorization. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access%20Policy-TEC_Architecture_+_Service_Owner_approvals_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Official%20Use%20Only-yellow)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_mfi-surveys-fulldata_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param survey_id: unique identifier for the collected data, as retrieved from /Surveys API. - :type survey_id: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param page: page number for paged results - :type page: int - :param page_size: page size for paged results, default value is 20. - :type page_size: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._m_fi_surveys_full_data_get_serialize( - survey_id=survey_id, - format=format, - page=page, - page_size=page_size, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedSurveyResponsesDTO", - '400': "BadRequestDTO", - '404': "ProblemDetails", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def m_fi_surveys_full_data_get_without_preload_content( - self, - survey_id: Annotated[Optional[StrictInt], Field(description="unique identifier for the collected data, as retrieved from /Surveys API.")] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - page_size: Annotated[Optional[StrictInt], Field(description="page size for paged results, default value is 20.")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get a full dataset that includes all the fields included in the survey in addition to the core Market Functionality Index (MFI) fields by Survey ID. To access this data, please contact global.mfi@wfp.org for authorization. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access%20Policy-TEC_Architecture_+_Service_Owner_approvals_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Official%20Use%20Only-yellow)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_mfi-surveys-fulldata_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param survey_id: unique identifier for the collected data, as retrieved from /Surveys API. - :type survey_id: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param page: page number for paged results - :type page: int - :param page_size: page size for paged results, default value is 20. - :type page_size: int - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._m_fi_surveys_full_data_get_serialize( - survey_id=survey_id, - format=format, - page=page, - page_size=page_size, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedSurveyResponsesDTO", - '400': "BadRequestDTO", - '404': "ProblemDetails", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _m_fi_surveys_full_data_get_serialize( - self, - survey_id, - format, - page, - page_size, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if survey_id is not None: - - _query_params.append(('surveyID', survey_id)) - - if format is not None: - - _query_params.append(('format', format)) - - if page is not None: - - _query_params.append(('page', page)) - - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain', - 'application/json', - 'text/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/MFI/Surveys/FullData', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def m_fi_surveys_get( - self, - adm0_code: Annotated[Optional[StrictInt], Field(description="code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - start_date: Annotated[Optional[datetime], Field(description="starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24)")] = None, - end_date: Annotated[Optional[datetime], Field(description="ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24)")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PagedSurveyListDTO: - """Retrieve 1) Survey IDs, 2) their corresponding XLS Form IDs, and 3) Base XLS Form of all MFI surveys conducted in a country. A date of reference, SurveyDate, for the data collection is set by the officer responsible for the upload for each survey. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_mfi-surveys_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param adm0_code: code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion - :type adm0_code: int - :param page: page number for paged results - :type page: int - :param start_date: starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24) - :type start_date: datetime - :param end_date: ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24) - :type end_date: datetime - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._m_fi_surveys_get_serialize( - adm0_code=adm0_code, - page=page, - start_date=start_date, - end_date=end_date, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedSurveyListDTO", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def m_fi_surveys_get_with_http_info( - self, - adm0_code: Annotated[Optional[StrictInt], Field(description="code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - start_date: Annotated[Optional[datetime], Field(description="starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24)")] = None, - end_date: Annotated[Optional[datetime], Field(description="ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24)")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PagedSurveyListDTO]: - """Retrieve 1) Survey IDs, 2) their corresponding XLS Form IDs, and 3) Base XLS Form of all MFI surveys conducted in a country. A date of reference, SurveyDate, for the data collection is set by the officer responsible for the upload for each survey. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_mfi-surveys_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param adm0_code: code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion - :type adm0_code: int - :param page: page number for paged results - :type page: int - :param start_date: starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24) - :type start_date: datetime - :param end_date: ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24) - :type end_date: datetime - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._m_fi_surveys_get_serialize( - adm0_code=adm0_code, - page=page, - start_date=start_date, - end_date=end_date, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedSurveyListDTO", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def m_fi_surveys_get_without_preload_content( - self, - adm0_code: Annotated[Optional[StrictInt], Field(description="code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - start_date: Annotated[Optional[datetime], Field(description="starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24)")] = None, - end_date: Annotated[Optional[datetime], Field(description="ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24)")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Retrieve 1) Survey IDs, 2) their corresponding XLS Form IDs, and 3) Base XLS Form of all MFI surveys conducted in a country. A date of reference, SurveyDate, for the data collection is set by the officer responsible for the upload for each survey. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_mfi-surveys_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param adm0_code: code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion - :type adm0_code: int - :param page: page number for paged results - :type page: int - :param start_date: starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24) - :type start_date: datetime - :param end_date: ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24) - :type end_date: datetime - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._m_fi_surveys_get_serialize( - adm0_code=adm0_code, - page=page, - start_date=start_date, - end_date=end_date, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedSurveyListDTO", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _m_fi_surveys_get_serialize( - self, - adm0_code, - page, - start_date, - end_date, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if adm0_code is not None: - - _query_params.append(('adm0Code', adm0_code)) - - if page is not None: - - _query_params.append(('page', page)) - - if start_date is not None: - if isinstance(start_date, datetime): - _query_params.append( - ( - 'startDate', - start_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('startDate', start_date)) - - if end_date is not None: - if isinstance(end_date, datetime): - _query_params.append( - ( - 'endDate', - end_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('endDate', end_date)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/MFI/Surveys', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def m_fi_surveys_processed_data_get( - self, - survey_id: Annotated[Optional[StrictInt], Field(description="The ID of the survey")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - page_size: Optional[StrictInt] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - start_date: Annotated[Optional[datetime], Field(description="Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24)")] = None, - end_date: Annotated[Optional[datetime], Field(description="Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24)")] = None, - adm0_codes: Annotated[Optional[StrictStr], Field(description="Code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion")] = None, - market_id: Annotated[Optional[StrictInt], Field(description="The ID of the market")] = None, - survey_type: Annotated[Optional[StrictStr], Field(description="The survey type")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PagedProcessedDataDTO: - """Get a MFI processed data in long format; levels indicate the data aggregation level 1) Normalized Score, 2) Trader Aggregate Score, 3) Market Aggregate Score, 4) Trader Median, 5) Trader Mean, 6) Market Mean; each line corresponds to one of the nine dimensions of scores plus the final MFI aggregate score; 1) Assortment, 2) Availability, 3) Price, 4) Resilience, 5) Competition, 6) Infrastructure, 7) Service, 8) Quality, 9) Access and Protection, and 10) MFI final score; the variable label describes each variable and its value range - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_mfi-surveys-processeddata_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param survey_id: The ID of the survey - :type survey_id: int - :param page: page number for paged results - :type page: int - :param page_size: - :type page_size: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param start_date: Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24) - :type start_date: datetime - :param end_date: Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24) - :type end_date: datetime - :param adm0_codes: Code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion - :type adm0_codes: str - :param market_id: The ID of the market - :type market_id: int - :param survey_type: The survey type - :type survey_type: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._m_fi_surveys_processed_data_get_serialize( - survey_id=survey_id, - page=page, - page_size=page_size, - format=format, - start_date=start_date, - end_date=end_date, - adm0_codes=adm0_codes, - market_id=market_id, - survey_type=survey_type, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedProcessedDataDTO", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def m_fi_surveys_processed_data_get_with_http_info( - self, - survey_id: Annotated[Optional[StrictInt], Field(description="The ID of the survey")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - page_size: Optional[StrictInt] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - start_date: Annotated[Optional[datetime], Field(description="Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24)")] = None, - end_date: Annotated[Optional[datetime], Field(description="Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24)")] = None, - adm0_codes: Annotated[Optional[StrictStr], Field(description="Code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion")] = None, - market_id: Annotated[Optional[StrictInt], Field(description="The ID of the market")] = None, - survey_type: Annotated[Optional[StrictStr], Field(description="The survey type")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PagedProcessedDataDTO]: - """Get a MFI processed data in long format; levels indicate the data aggregation level 1) Normalized Score, 2) Trader Aggregate Score, 3) Market Aggregate Score, 4) Trader Median, 5) Trader Mean, 6) Market Mean; each line corresponds to one of the nine dimensions of scores plus the final MFI aggregate score; 1) Assortment, 2) Availability, 3) Price, 4) Resilience, 5) Competition, 6) Infrastructure, 7) Service, 8) Quality, 9) Access and Protection, and 10) MFI final score; the variable label describes each variable and its value range - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_mfi-surveys-processeddata_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param survey_id: The ID of the survey - :type survey_id: int - :param page: page number for paged results - :type page: int - :param page_size: - :type page_size: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param start_date: Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24) - :type start_date: datetime - :param end_date: Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24) - :type end_date: datetime - :param adm0_codes: Code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion - :type adm0_codes: str - :param market_id: The ID of the market - :type market_id: int - :param survey_type: The survey type - :type survey_type: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._m_fi_surveys_processed_data_get_serialize( - survey_id=survey_id, - page=page, - page_size=page_size, - format=format, - start_date=start_date, - end_date=end_date, - adm0_codes=adm0_codes, - market_id=market_id, - survey_type=survey_type, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedProcessedDataDTO", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def m_fi_surveys_processed_data_get_without_preload_content( - self, - survey_id: Annotated[Optional[StrictInt], Field(description="The ID of the survey")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - page_size: Optional[StrictInt] = None, - format: Annotated[Optional[StrictStr], Field(description="Output format: [JSON|CSV] Json is the default value")] = None, - start_date: Annotated[Optional[datetime], Field(description="Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24)")] = None, - end_date: Annotated[Optional[datetime], Field(description="Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24)")] = None, - adm0_codes: Annotated[Optional[StrictStr], Field(description="Code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion")] = None, - market_id: Annotated[Optional[StrictInt], Field(description="The ID of the market")] = None, - survey_type: Annotated[Optional[StrictStr], Field(description="The survey type")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get a MFI processed data in long format; levels indicate the data aggregation level 1) Normalized Score, 2) Trader Aggregate Score, 3) Market Aggregate Score, 4) Trader Median, 5) Trader Mean, 6) Market Mean; each line corresponds to one of the nine dimensions of scores plus the final MFI aggregate score; 1) Assortment, 2) Availability, 3) Price, 4) Resilience, 5) Competition, 6) Infrastructure, 7) Service, 8) Quality, 9) Access and Protection, and 10) MFI final score; the variable label describes each variable and its value range - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_mfi-surveys-processeddata_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param survey_id: The ID of the survey - :type survey_id: int - :param page: page number for paged results - :type page: int - :param page_size: - :type page_size: int - :param format: Output format: [JSON|CSV] Json is the default value - :type format: str - :param start_date: Starting date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24) - :type start_date: datetime - :param end_date: Ending date for the range in which data was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24) - :type end_date: datetime - :param adm0_codes: Code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion - :type adm0_codes: str - :param market_id: The ID of the market - :type market_id: int - :param survey_type: The survey type - :type survey_type: str - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._m_fi_surveys_processed_data_get_serialize( - survey_id=survey_id, - page=page, - page_size=page_size, - format=format, - start_date=start_date, - end_date=end_date, - adm0_codes=adm0_codes, - market_id=market_id, - survey_type=survey_type, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedProcessedDataDTO", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _m_fi_surveys_processed_data_get_serialize( - self, - survey_id, - page, - page_size, - format, - start_date, - end_date, - adm0_codes, - market_id, - survey_type, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if survey_id is not None: - - _query_params.append(('surveyID', survey_id)) - - if page is not None: - - _query_params.append(('page', page)) - - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if format is not None: - - _query_params.append(('format', format)) - - if start_date is not None: - if isinstance(start_date, datetime): - _query_params.append( - ( - 'startDate', - start_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('startDate', start_date)) - - if end_date is not None: - if isinstance(end_date, datetime): - _query_params.append( - ( - 'endDate', - end_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('endDate', end_date)) - - if adm0_codes is not None: - - _query_params.append(('adm0Codes', adm0_codes)) - - if market_id is not None: - - _query_params.append(('marketID', market_id)) - - if survey_type is not None: - - _query_params.append(('surveyType', survey_type)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain', - 'application/json', - 'text/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/MFI/Surveys/ProcessedData', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - diff --git a/data_bridges_client/api/xls_forms_api.py b/data_bridges_client/api/xls_forms_api.py deleted file mode 100644 index baa550e..0000000 --- a/data_bridges_client/api/xls_forms_api.py +++ /dev/null @@ -1,390 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from datetime import datetime -from pydantic import Field, StrictInt, StrictStr, field_validator -from typing import Optional -from typing_extensions import Annotated -from data_bridges_client.models.paged_xls_form_list_dto import PagedXlsFormListDTO - -from data_bridges_client.api_client import ApiClient, RequestSerialized -from data_bridges_client.api_response import ApiResponse -from data_bridges_client.rest import RESTResponseType - - -class XlsFormsApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def m_fi_xls_forms_get( - self, - adm0_code: Annotated[Optional[StrictInt], Field(description="code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - start_date: Annotated[Optional[datetime], Field(description="starting date for the range in which data using this XLSForm was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24)")] = None, - end_date: Annotated[Optional[datetime], Field(description="ending date for the range in which data using this XLSForm was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24)")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PagedXlsFormListDTO: - """Get a complete list of XLS Forms uploaded on the MFI Data Bridge in a given period of data collection. This is the digital version of the questionnaire used during the data collection exercise. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_mfi-xlsforms_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param adm0_code: code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion - :type adm0_code: int - :param page: page number for paged results - :type page: int - :param start_date: starting date for the range in which data using this XLSForm was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24) - :type start_date: datetime - :param end_date: ending date for the range in which data using this XLSForm was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24) - :type end_date: datetime - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._m_fi_xls_forms_get_serialize( - adm0_code=adm0_code, - page=page, - start_date=start_date, - end_date=end_date, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedXlsFormListDTO", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def m_fi_xls_forms_get_with_http_info( - self, - adm0_code: Annotated[Optional[StrictInt], Field(description="code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - start_date: Annotated[Optional[datetime], Field(description="starting date for the range in which data using this XLSForm was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24)")] = None, - end_date: Annotated[Optional[datetime], Field(description="ending date for the range in which data using this XLSForm was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24)")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PagedXlsFormListDTO]: - """Get a complete list of XLS Forms uploaded on the MFI Data Bridge in a given period of data collection. This is the digital version of the questionnaire used during the data collection exercise. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_mfi-xlsforms_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param adm0_code: code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion - :type adm0_code: int - :param page: page number for paged results - :type page: int - :param start_date: starting date for the range in which data using this XLSForm was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24) - :type start_date: datetime - :param end_date: ending date for the range in which data using this XLSForm was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24) - :type end_date: datetime - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._m_fi_xls_forms_get_serialize( - adm0_code=adm0_code, - page=page, - start_date=start_date, - end_date=end_date, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedXlsFormListDTO", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def m_fi_xls_forms_get_without_preload_content( - self, - adm0_code: Annotated[Optional[StrictInt], Field(description="code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion")] = None, - page: Annotated[Optional[StrictInt], Field(description="page number for paged results")] = None, - start_date: Annotated[Optional[datetime], Field(description="starting date for the range in which data using this XLSForm was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24)")] = None, - end_date: Annotated[Optional[datetime], Field(description="ending date for the range in which data using this XLSForm was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24)")] = None, - env: Annotated[Optional[StrictStr], Field(description="Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get a complete list of XLS Forms uploaded on the MFI Data Bridge in a given period of data collection. This is the digital version of the questionnaire used during the data collection exercise. - - [![Generic badge](https://img.shields.io/badge/Maturity%20Level-Production%20Ready-green)]() [![Generic badge](https://img.shields.io/badge/Access_Policy-TEC_Architecture_approval_required-yellow)]() [![Generic badge](https://img.shields.io/badge/Data%20Classification-Public-green)]() ### This endpoint is restricted, it requires the scope: \"vamdatabridges_mfi-xlsforms_get\" **Data Controller** - Wael ATTIA **API Integration Pattern** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - :param adm0_code: code for the country as retrieved from https://api.vam.wfp.org/geodata/CountriesInRegion - :type adm0_code: int - :param page: page number for paged results - :type page: int - :param start_date: starting date for the range in which data using this XLSForm was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24) - :type start_date: datetime - :param end_date: ending date for the range in which data using this XLSForm was collected. Use the date formats defined by RFC 3339 ; use strings matching year \"-\" month \"-\" day (e.g. 2020/06/24) - :type end_date: datetime - :param env: Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org - :type env: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._m_fi_xls_forms_get_serialize( - adm0_code=adm0_code, - page=page, - start_date=start_date, - end_date=end_date, - env=env, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "PagedXlsFormListDTO", - '400': "BadRequestDTO", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _m_fi_xls_forms_get_serialize( - self, - adm0_code, - page, - start_date, - end_date, - env, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if adm0_code is not None: - - _query_params.append(('adm0Code', adm0_code)) - - if page is not None: - - _query_params.append(('page', page)) - - if start_date is not None: - if isinstance(start_date, datetime): - _query_params.append( - ( - 'startDate', - start_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('startDate', start_date)) - - if end_date is not None: - if isinstance(end_date, datetime): - _query_params.append( - ( - 'endDate', - end_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('endDate', end_date)) - - if env is not None: - - _query_params.append(('env', env)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'default' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/MFI/XlsForms', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - diff --git a/data_bridges_client/api_client.py b/data_bridges_client/api_client.py deleted file mode 100644 index dcac202..0000000 --- a/data_bridges_client/api_client.py +++ /dev/null @@ -1,771 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import datetime -from dateutil.parser import parse -from enum import Enum -import json -import mimetypes -import os -import re -import tempfile - -from urllib.parse import quote -from typing import Tuple, Optional, List, Dict, Union -from pydantic import SecretStr - -from data_bridges_client.configuration import Configuration -from data_bridges_client.api_response import ApiResponse, T as ApiResponseT -import data_bridges_client.models -from data_bridges_client import rest -from data_bridges_client.exceptions import ( - ApiValueError, - ApiException, - BadRequestException, - UnauthorizedException, - ForbiddenException, - NotFoundException, - ServiceException -) - -RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] - -class ApiClient: - """Generic API client for OpenAPI client library builds. - - OpenAPI generic API client. This client handles the client- - server communication, and is invariant across implementations. Specifics of - the methods and models for each application are generated from the OpenAPI - templates. - - :param configuration: .Configuration object for this client - :param header_name: a header to pass when making calls to the API. - :param header_value: a header value to pass when making calls to - the API. - :param cookie: a cookie to include in the header when making calls - to the API - """ - - PRIMITIVE_TYPES = (float, bool, bytes, str, int) - NATIVE_TYPES_MAPPING = { - 'int': int, - 'long': int, # TODO remove as only py3 is supported? - 'float': float, - 'str': str, - 'bool': bool, - 'date': datetime.date, - 'datetime': datetime.datetime, - 'object': object, - } - _pool = None - - def __init__( - self, - configuration=None, - header_name=None, - header_value=None, - cookie=None - ) -> None: - # use default configuration if none is provided - if configuration is None: - configuration = Configuration.get_default() - self.configuration = configuration - - self.rest_client = rest.RESTClientObject(configuration) - self.default_headers = {} - if header_name is not None: - self.default_headers[header_name] = header_value - self.cookie = cookie - # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/1.0.0/python' - self.client_side_validation = configuration.client_side_validation - - def __enter__(self): - return self - - def __exit__(self, exc_type, exc_value, traceback): - pass - - @property - def user_agent(self): - """User agent for this API client""" - return self.default_headers['User-Agent'] - - @user_agent.setter - def user_agent(self, value): - self.default_headers['User-Agent'] = value - - def set_default_header(self, header_name, header_value): - self.default_headers[header_name] = header_value - - - _default = None - - @classmethod - def get_default(cls): - """Return new instance of ApiClient. - - This method returns newly created, based on default constructor, - object of ApiClient class or returns a copy of default - ApiClient. - - :return: The ApiClient object. - """ - if cls._default is None: - cls._default = ApiClient() - return cls._default - - @classmethod - def set_default(cls, default): - """Set default instance of ApiClient. - - It stores default ApiClient. - - :param default: object of ApiClient. - """ - cls._default = default - - def param_serialize( - self, - method, - resource_path, - path_params=None, - query_params=None, - header_params=None, - body=None, - post_params=None, - files=None, auth_settings=None, - collection_formats=None, - _host=None, - _request_auth=None - ) -> RequestSerialized: - - """Builds the HTTP request params needed by the request. - :param method: Method to call. - :param resource_path: Path to method endpoint. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param files dict: key -> filename, value -> filepath, - for `multipart/form-data`. - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :return: tuple of form (path, http_method, query_params, header_params, - body, post_params, files) - """ - - config = self.configuration - - # header parameters - header_params = header_params or {} - header_params.update(self.default_headers) - if self.cookie: - header_params['Cookie'] = self.cookie - if header_params: - header_params = self.sanitize_for_serialization(header_params) - header_params = dict( - self.parameters_to_tuples(header_params,collection_formats) - ) - - # path parameters - if path_params: - path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples( - path_params, - collection_formats - ) - for k, v in path_params: - # specified safe chars, encode everything - resource_path = resource_path.replace( - '{%s}' % k, - quote(str(v), safe=config.safe_chars_for_path_param) - ) - - # post parameters - if post_params or files: - post_params = post_params if post_params else [] - post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples( - post_params, - collection_formats - ) - if files: - post_params.extend(self.files_parameters(files)) - - # auth setting - self.update_params_for_auth( - header_params, - query_params, - auth_settings, - resource_path, - method, - body, - request_auth=_request_auth - ) - - # body - if body: - body = self.sanitize_for_serialization(body) - - # request url - if _host is None: - url = self.configuration.host + resource_path - else: - # use server/host defined in path or operation instead - url = _host + resource_path - - # query parameters - if query_params: - query_params = self.sanitize_for_serialization(query_params) - url_query = self.parameters_to_url_query( - query_params, - collection_formats - ) - url += "?" + url_query - - return method, url, header_params, body, post_params - - - def call_api( - self, - method, - url, - header_params=None, - body=None, - post_params=None, - _request_timeout=None - ) -> rest.RESTResponse: - """Makes the HTTP request (synchronous) - :param method: Method to call. - :param url: Path to method endpoint. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param _request_timeout: timeout setting for this request. - :return: RESTResponse - """ - - try: - # perform request and return response - response_data = self.rest_client.request( - method, url, - headers=header_params, - body=body, post_params=post_params, - _request_timeout=_request_timeout - ) - - except ApiException as e: - raise e - - return response_data - - def response_deserialize( - self, - response_data: rest.RESTResponse, - response_types_map: Optional[Dict[str, ApiResponseT]]=None - ) -> ApiResponse[ApiResponseT]: - """Deserializes response into an object. - :param response_data: RESTResponse object to be deserialized. - :param response_types_map: dict of response types. - :return: ApiResponse - """ - - msg = "RESTResponse.read() must be called before passing it to response_deserialize()" - assert response_data.data is not None, msg - - response_type = response_types_map.get(str(response_data.status), None) - if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: - # if not found, look for '1XX', '2XX', etc. - response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) - - # deserialize response data - response_text = None - return_data = None - try: - if response_type == "bytearray": - return_data = response_data.data - elif response_type == "file": - return_data = self.__deserialize_file(response_data) - elif response_type is not None: - match = None - content_type = response_data.getheader('content-type') - if content_type is not None: - match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) - encoding = match.group(1) if match else "utf-8" - response_text = response_data.data.decode(encoding) - if response_type in ["bytearray", "str"]: - return_data = self.__deserialize_primitive(response_text, response_type) - else: - return_data = self.deserialize(response_text, response_type) - finally: - if not 200 <= response_data.status <= 299: - raise ApiException.from_response( - http_resp=response_data, - body=response_text, - data=return_data, - ) - - return ApiResponse( - status_code = response_data.status, - data = return_data, - headers = response_data.getheaders(), - raw_data = response_data.data - ) - - def sanitize_for_serialization(self, obj): - """Builds a JSON POST object. - - If obj is None, return None. - If obj is SecretStr, return obj.get_secret_value() - If obj is str, int, long, float, bool, return directly. - If obj is datetime.datetime, datetime.date - convert to string in iso8601 format. - If obj is list, sanitize each element in the list. - If obj is dict, return the dict. - If obj is OpenAPI model, return the properties dict. - - :param obj: The data to serialize. - :return: The serialized form of data. - """ - if obj is None: - return None - elif isinstance(obj, Enum): - return obj.value - elif isinstance(obj, SecretStr): - return obj.get_secret_value() - elif isinstance(obj, self.PRIMITIVE_TYPES): - return obj - elif isinstance(obj, list): - return [ - self.sanitize_for_serialization(sub_obj) for sub_obj in obj - ] - elif isinstance(obj, tuple): - return tuple( - self.sanitize_for_serialization(sub_obj) for sub_obj in obj - ) - elif isinstance(obj, (datetime.datetime, datetime.date)): - return obj.isoformat() - - elif isinstance(obj, dict): - obj_dict = obj - else: - # Convert model obj to dict except - # attributes `openapi_types`, `attribute_map` - # and attributes which value is not None. - # Convert attribute name to json key in - # model definition for request. - if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): - obj_dict = obj.to_dict() - else: - obj_dict = obj.__dict__ - - return { - key: self.sanitize_for_serialization(val) - for key, val in obj_dict.items() - } - - def deserialize(self, response_text, response_type): - """Deserializes response into an object. - - :param response: RESTResponse object to be deserialized. - :param response_type: class literal for - deserialized object, or string of class name. - - :return: deserialized object. - """ - - # fetch data from response object - try: - data = json.loads(response_text) - except ValueError: - data = response_text - - return self.__deserialize(data, response_type) - - def __deserialize(self, data, klass): - """Deserializes dict, list, str into an object. - - :param data: dict, list or str. - :param klass: class literal, or string of class name. - - :return: object. - """ - if data is None: - return None - - if isinstance(klass, str): - if klass.startswith('List['): - m = re.match(r'List\[(.*)]', klass) - assert m is not None, "Malformed List type definition" - sub_kls = m.group(1) - return [self.__deserialize(sub_data, sub_kls) - for sub_data in data] - - if klass.startswith('Dict['): - m = re.match(r'Dict\[([^,]*), (.*)]', klass) - assert m is not None, "Malformed Dict type definition" - sub_kls = m.group(2) - return {k: self.__deserialize(v, sub_kls) - for k, v in data.items()} - - # convert str to class - if klass in self.NATIVE_TYPES_MAPPING: - klass = self.NATIVE_TYPES_MAPPING[klass] - else: - klass = getattr(data_bridges_client.models, klass) - - if klass in self.PRIMITIVE_TYPES: - return self.__deserialize_primitive(data, klass) - elif klass == object: - return self.__deserialize_object(data) - elif klass == datetime.date: - return self.__deserialize_date(data) - elif klass == datetime.datetime: - return self.__deserialize_datetime(data) - elif issubclass(klass, Enum): - return self.__deserialize_enum(data, klass) - else: - return self.__deserialize_model(data, klass) - - def parameters_to_tuples(self, params, collection_formats): - """Get parameters as list of tuples, formatting collections. - - :param params: Parameters as dict or list of two-tuples - :param dict collection_formats: Parameter collection formats - :return: Parameters as list of tuples, collections formatted - """ - new_params: List[Tuple[str, str]] = [] - if collection_formats is None: - collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: - if k in collection_formats: - collection_format = collection_formats[k] - if collection_format == 'multi': - new_params.extend((k, value) for value in v) - else: - if collection_format == 'ssv': - delimiter = ' ' - elif collection_format == 'tsv': - delimiter = '\t' - elif collection_format == 'pipes': - delimiter = '|' - else: # csv is the default - delimiter = ',' - new_params.append( - (k, delimiter.join(str(value) for value in v))) - else: - new_params.append((k, v)) - return new_params - - def parameters_to_url_query(self, params, collection_formats): - """Get parameters as list of tuples, formatting collections. - - :param params: Parameters as dict or list of two-tuples - :param dict collection_formats: Parameter collection formats - :return: URL query string (e.g. a=Hello%20World&b=123) - """ - new_params: List[Tuple[str, str]] = [] - if collection_formats is None: - collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: - if isinstance(v, bool): - v = str(v).lower() - if isinstance(v, (int, float)): - v = str(v) - if isinstance(v, dict): - v = json.dumps(v) - - if k in collection_formats: - collection_format = collection_formats[k] - if collection_format == 'multi': - new_params.extend((k, str(value)) for value in v) - else: - if collection_format == 'ssv': - delimiter = ' ' - elif collection_format == 'tsv': - delimiter = '\t' - elif collection_format == 'pipes': - delimiter = '|' - else: # csv is the default - delimiter = ',' - new_params.append( - (k, delimiter.join(quote(str(value)) for value in v)) - ) - else: - new_params.append((k, quote(str(v)))) - - return "&".join(["=".join(map(str, item)) for item in new_params]) - - def files_parameters(self, files: Dict[str, Union[str, bytes]]): - """Builds form parameters. - - :param files: File parameters. - :return: Form parameters with files. - """ - params = [] - for k, v in files.items(): - if isinstance(v, str): - with open(v, 'rb') as f: - filename = os.path.basename(f.name) - filedata = f.read() - elif isinstance(v, bytes): - filename = k - filedata = v - else: - raise ValueError("Unsupported file value") - mimetype = ( - mimetypes.guess_type(filename)[0] - or 'application/octet-stream' - ) - params.append( - tuple([k, tuple([filename, filedata, mimetype])]) - ) - return params - - def select_header_accept(self, accepts: List[str]) -> Optional[str]: - """Returns `Accept` based on an array of accepts provided. - - :param accepts: List of headers. - :return: Accept (e.g. application/json). - """ - if not accepts: - return None - - for accept in accepts: - if re.search('json', accept, re.IGNORECASE): - return accept - - return accepts[0] - - def select_header_content_type(self, content_types): - """Returns `Content-Type` based on an array of content_types provided. - - :param content_types: List of content-types. - :return: Content-Type (e.g. application/json). - """ - if not content_types: - return None - - for content_type in content_types: - if re.search('json', content_type, re.IGNORECASE): - return content_type - - return content_types[0] - - def update_params_for_auth( - self, - headers, - queries, - auth_settings, - resource_path, - method, - body, - request_auth=None - ) -> None: - """Updates header and query params based on authentication setting. - - :param headers: Header parameters dict to be updated. - :param queries: Query parameters tuple list to be updated. - :param auth_settings: Authentication setting identifiers list. - :resource_path: A string representation of the HTTP request resource path. - :method: A string representation of the HTTP request method. - :body: A object representing the body of the HTTP request. - The object type is the return value of sanitize_for_serialization(). - :param request_auth: if set, the provided settings will - override the token in the configuration. - """ - if not auth_settings: - return - - if request_auth: - self._apply_auth_params( - headers, - queries, - resource_path, - method, - body, - request_auth - ) - else: - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - self._apply_auth_params( - headers, - queries, - resource_path, - method, - body, - auth_setting - ) - - def _apply_auth_params( - self, - headers, - queries, - resource_path, - method, - body, - auth_setting - ) -> None: - """Updates the request parameters based on a single auth_setting - - :param headers: Header parameters dict to be updated. - :param queries: Query parameters tuple list to be updated. - :resource_path: A string representation of the HTTP request resource path. - :method: A string representation of the HTTP request method. - :body: A object representing the body of the HTTP request. - The object type is the return value of sanitize_for_serialization(). - :param auth_setting: auth settings for the endpoint - """ - if auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['value'] - elif auth_setting['in'] == 'header': - if auth_setting['type'] != 'http-signature': - headers[auth_setting['key']] = auth_setting['value'] - elif auth_setting['in'] == 'query': - queries.append((auth_setting['key'], auth_setting['value'])) - else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' - ) - - def __deserialize_file(self, response): - """Deserializes body to file - - Saves response body into a file in a temporary folder, - using the filename from the `Content-Disposition` header if provided. - - handle file downloading - save response body into a tmp file and return the instance - - :param response: RESTResponse. - :return: file path. - """ - fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) - os.close(fd) - os.remove(path) - - content_disposition = response.getheader("Content-Disposition") - if content_disposition: - m = re.search( - r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition - ) - assert m is not None, "Unexpected 'content-disposition' header value" - filename = m.group(1) - path = os.path.join(os.path.dirname(path), filename) - - with open(path, "wb") as f: - f.write(response.data) - - return path - - def __deserialize_primitive(self, data, klass): - """Deserializes string to primitive type. - - :param data: str. - :param klass: class literal. - - :return: int, long, float, str, bool. - """ - try: - return klass(data) - except UnicodeEncodeError: - return str(data) - except TypeError: - return data - - def __deserialize_object(self, value): - """Return an original value. - - :return: object. - """ - return value - - def __deserialize_date(self, string): - """Deserializes string to date. - - :param string: str. - :return: date. - """ - try: - return parse(string).date() - except ImportError: - return string - except ValueError: - raise rest.ApiException( - status=0, - reason="Failed to parse `{0}` as date object".format(string) - ) - - def __deserialize_datetime(self, string): - """Deserializes string to datetime. - - The string should be in iso8601 datetime format. - - :param string: str. - :return: datetime. - """ - try: - return parse(string) - except ImportError: - return string - except ValueError: - raise rest.ApiException( - status=0, - reason=( - "Failed to parse `{0}` as datetime object" - .format(string) - ) - ) - - def __deserialize_enum(self, data, klass): - """Deserializes primitive type to enum. - - :param data: primitive type. - :param klass: class literal. - :return: enum value. - """ - try: - return klass(data) - except ValueError: - raise rest.ApiException( - status=0, - reason=( - "Failed to parse `{0}` as `{1}`" - .format(data, klass) - ) - ) - - def __deserialize_model(self, data, klass): - """Deserializes list or dict to model. - - :param data: dict, list. - :param klass: class literal. - :return: model object. - """ - - return klass.from_dict(data) diff --git a/data_bridges_client/api_response.py b/data_bridges_client/api_response.py deleted file mode 100644 index 9bc7c11..0000000 --- a/data_bridges_client/api_response.py +++ /dev/null @@ -1,21 +0,0 @@ -"""API response object.""" - -from __future__ import annotations -from typing import Optional, Generic, Mapping, TypeVar -from pydantic import Field, StrictInt, StrictBytes, BaseModel - -T = TypeVar("T") - -class ApiResponse(BaseModel, Generic[T]): - """ - API response object - """ - - status_code: StrictInt = Field(description="HTTP status code") - headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers") - data: T = Field(description="Deserialized data given the data type") - raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") - - model_config = { - "arbitrary_types_allowed": True - } diff --git a/data_bridges_client/configuration.py b/data_bridges_client/configuration.py deleted file mode 100644 index 113c7ed..0000000 --- a/data_bridges_client/configuration.py +++ /dev/null @@ -1,445 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import copy -import logging -from logging import FileHandler -import multiprocessing -import sys -from typing import Optional -import urllib3 - -import http.client as httplib - -JSON_SCHEMA_VALIDATION_KEYWORDS = { - 'multipleOf', 'maximum', 'exclusiveMaximum', - 'minimum', 'exclusiveMinimum', 'maxLength', - 'minLength', 'pattern', 'maxItems', 'minItems' -} - -class Configuration: - """This class contains various settings of the API client. - - :param host: Base url. - :param api_key: Dict to store API key(s). - Each entry in the dict specifies an API key. - The dict key is the name of the security scheme in the OAS specification. - The dict value is the API key secret. - :param api_key_prefix: Dict to store API prefix (e.g. Bearer). - The dict key is the name of the security scheme in the OAS specification. - The dict value is an API key prefix when generating the auth data. - :param username: Username for HTTP basic authentication. - :param password: Password for HTTP basic authentication. - :param access_token: Access token. - :param server_index: Index to servers configuration. - :param server_variables: Mapping with string values to replace variables in - templated server configuration. The validation of enums is performed for - variables with defined enum values before. - :param server_operation_index: Mapping from operation ID to an index to server - configuration. - :param server_operation_variables: Mapping from operation ID to a mapping with - string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum - values before. - :param ssl_ca_cert: str - the path to a file of concatenated CA certificates - in PEM format. - - :Example: - """ - - _default = None - - def __init__(self, host=None, - api_key=None, api_key_prefix=None, - username=None, password=None, - access_token=None, - server_index=None, server_variables=None, - server_operation_index=None, server_operation_variables=None, - ssl_ca_cert=None, - ) -> None: - """Constructor - """ - self._base_path = "https://api.wfp.org/vam-data-bridges/4.1.0" if host is None else host - """Default Base url - """ - self.server_index = 0 if server_index is None and host is None else server_index - self.server_operation_index = server_operation_index or {} - """Default server index - """ - self.server_variables = server_variables or {} - self.server_operation_variables = server_operation_variables or {} - """Default server variables - """ - self.temp_folder_path = None - """Temp file folder for downloading files - """ - # Authentication Settings - self.api_key = {} - if api_key: - self.api_key = api_key - """dict to store API key(s) - """ - self.api_key_prefix = {} - if api_key_prefix: - self.api_key_prefix = api_key_prefix - """dict to store API prefix (e.g. Bearer) - """ - self.refresh_api_key_hook = None - """function hook to refresh API key if expired - """ - self.username = username - """Username for HTTP basic authentication - """ - self.password = password - """Password for HTTP basic authentication - """ - self.access_token = access_token - """Access token - """ - self.logger = {} - """Logging Settings - """ - self.logger["package_logger"] = logging.getLogger("data_bridges_client") - self.logger["urllib3_logger"] = logging.getLogger("urllib3") - self.logger_format = '%(asctime)s %(levelname)s %(message)s' - """Log format - """ - self.logger_stream_handler = None - """Log stream handler - """ - self.logger_file_handler: Optional[FileHandler] = None - """Log file handler - """ - self.logger_file = None - """Debug file location - """ - self.debug = False - """Debug switch - """ - - self.verify_ssl = True - """SSL/TLS verification - Set this to false to skip verifying SSL certificate when calling API - from https server. - """ - self.ssl_ca_cert = ssl_ca_cert - """Set this to customize the certificate file to verify the peer. - """ - self.cert_file = None - """client certificate file - """ - self.key_file = None - """client key file - """ - self.assert_hostname = None - """Set this to True/False to enable/disable SSL hostname verification. - """ - self.tls_server_name = None - """SSL/TLS Server Name Indication (SNI) - Set this to the SNI value expected by the server. - """ - - self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 - """urllib3 connection pool's maximum number of connections saved - per pool. urllib3 uses 1 connection as default value, but this is - not the best value when you are making a lot of possibly parallel - requests to the same host, which is often the case here. - cpu_count * 5 is used as default value to increase performance. - """ - - self.proxy: Optional[str] = None - """Proxy URL - """ - self.proxy_headers = None - """Proxy headers - """ - self.safe_chars_for_path_param = '' - """Safe chars for path_param - """ - self.retries = None - """Adding retries to override urllib3 default value 3 - """ - # Enable client side validation - self.client_side_validation = True - - self.socket_options = None - """Options to pass down to the underlying urllib3 socket - """ - - self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" - """datetime format - """ - - self.date_format = "%Y-%m-%d" - """date format - """ - - def __deepcopy__(self, memo): - cls = self.__class__ - result = cls.__new__(cls) - memo[id(self)] = result - for k, v in self.__dict__.items(): - if k not in ('logger', 'logger_file_handler'): - setattr(result, k, copy.deepcopy(v, memo)) - # shallow copy of loggers - result.logger = copy.copy(self.logger) - # use setters to configure loggers - result.logger_file = self.logger_file - result.debug = self.debug - return result - - def __setattr__(self, name, value): - object.__setattr__(self, name, value) - - @classmethod - def set_default(cls, default): - """Set default instance of configuration. - - It stores default configuration, which can be - returned by get_default_copy method. - - :param default: object of Configuration - """ - cls._default = default - - @classmethod - def get_default_copy(cls): - """Deprecated. Please use `get_default` instead. - - Deprecated. Please use `get_default` instead. - - :return: The configuration object. - """ - return cls.get_default() - - @classmethod - def get_default(cls): - """Return the default configuration. - - This method returns newly created, based on default constructor, - object of Configuration class or returns a copy of default - configuration. - - :return: The configuration object. - """ - if cls._default is None: - cls._default = Configuration() - return cls._default - - @property - def logger_file(self): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - return self.__logger_file - - @logger_file.setter - def logger_file(self, value): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - self.__logger_file = value - if self.__logger_file: - # If set logging file, - # then add file handler and remove stream handler. - self.logger_file_handler = logging.FileHandler(self.__logger_file) - self.logger_file_handler.setFormatter(self.logger_formatter) - for _, logger in self.logger.items(): - logger.addHandler(self.logger_file_handler) - - @property - def debug(self): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - return self.__debug - - @debug.setter - def debug(self, value): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - self.__debug = value - if self.__debug: - # if debug status is True, turn on debug logging - for _, logger in self.logger.items(): - logger.setLevel(logging.DEBUG) - # turn on httplib debug - httplib.HTTPConnection.debuglevel = 1 - else: - # if debug status is False, turn off debug logging, - # setting log level to default `logging.WARNING` - for _, logger in self.logger.items(): - logger.setLevel(logging.WARNING) - # turn off httplib debug - httplib.HTTPConnection.debuglevel = 0 - - @property - def logger_format(self): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - return self.__logger_format - - @logger_format.setter - def logger_format(self, value): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - self.__logger_format = value - self.logger_formatter = logging.Formatter(self.__logger_format) - - def get_api_key_with_prefix(self, identifier, alias=None): - """Gets API key (with prefix if set). - - :param identifier: The identifier of apiKey. - :param alias: The alternative identifier of apiKey. - :return: The token for api key authentication. - """ - if self.refresh_api_key_hook is not None: - self.refresh_api_key_hook(self) - key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) - if key: - prefix = self.api_key_prefix.get(identifier) - if prefix: - return "%s %s" % (prefix, key) - else: - return key - - def get_basic_auth_token(self): - """Gets HTTP basic authentication header (string). - - :return: The token for basic HTTP authentication. - """ - username = "" - if self.username is not None: - username = self.username - password = "" - if self.password is not None: - password = self.password - return urllib3.util.make_headers( - basic_auth=username + ':' + password - ).get('authorization') - - def auth_settings(self): - """Gets Auth Settings dict for api client. - - :return: The Auth Settings information dict. - """ - auth = {} - if self.access_token is not None: - auth['default'] = { - 'type': 'oauth2', - 'in': 'header', - 'key': 'Authorization', - 'value': 'Bearer ' + self.access_token - } - return auth - - def to_debug_report(self): - """Gets the essential information for debugging. - - :return: The report for debugging. - """ - return "Python SDK Debug Report:\n"\ - "OS: {env}\n"\ - "Python Version: {pyversion}\n"\ - "Version of the API: 4.1.0\n"\ - "SDK Package Version: 1.0.0".\ - format(env=sys.platform, pyversion=sys.version) - - def get_host_settings(self): - """Gets an array of host settings - - :return: An array of host settings - """ - return [ - { - 'url': "https://api.wfp.org/vam-data-bridges/4.1.0", - 'description': "No description provided", - } - ] - - def get_host_from_settings(self, index, variables=None, servers=None): - """Gets host URL based on the index and variables - :param index: array index of the host settings - :param variables: hash of variable and the corresponding value - :param servers: an array of host settings or None - :return: URL based on host settings - """ - if index is None: - return self._base_path - - variables = {} if variables is None else variables - servers = self.get_host_settings() if servers is None else servers - - try: - server = servers[index] - except IndexError: - raise ValueError( - "Invalid index {0} when selecting the host settings. " - "Must be less than {1}".format(index, len(servers))) - - url = server['url'] - - # go through variables and replace placeholders - for variable_name, variable in server.get('variables', {}).items(): - used_value = variables.get( - variable_name, variable['default_value']) - - if 'enum_values' in variable \ - and used_value not in variable['enum_values']: - raise ValueError( - "The variable `{0}` in the host URL has invalid value " - "{1}. Must be {2}.".format( - variable_name, variables[variable_name], - variable['enum_values'])) - - url = url.replace("{" + variable_name + "}", used_value) - - return url - - @property - def host(self): - """Return generated host.""" - return self.get_host_from_settings(self.server_index, variables=self.server_variables) - - @host.setter - def host(self, value): - """Fix base path.""" - self._base_path = value - self.server_index = None diff --git a/data_bridges_client/exceptions.py b/data_bridges_client/exceptions.py deleted file mode 100644 index a1f1def..0000000 --- a/data_bridges_client/exceptions.py +++ /dev/null @@ -1,200 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -from typing import Any, Optional -from typing_extensions import Self - -class OpenApiException(Exception): - """The base exception class for all OpenAPIExceptions""" - - -class ApiTypeError(OpenApiException, TypeError): - def __init__(self, msg, path_to_item=None, valid_classes=None, - key_type=None) -> None: - """ Raises an exception for TypeErrors - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list): a list of keys an indices to get to the - current_item - None if unset - valid_classes (tuple): the primitive classes that current item - should be an instance of - None if unset - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a list - None if unset - """ - self.path_to_item = path_to_item - self.valid_classes = valid_classes - self.key_type = key_type - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiTypeError, self).__init__(full_msg) - - -class ApiValueError(OpenApiException, ValueError): - def __init__(self, msg, path_to_item=None) -> None: - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list) the path to the exception in the - received_data dict. None if unset - """ - - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiValueError, self).__init__(full_msg) - - -class ApiAttributeError(OpenApiException, AttributeError): - def __init__(self, msg, path_to_item=None) -> None: - """ - Raised when an attribute reference or assignment fails. - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiAttributeError, self).__init__(full_msg) - - -class ApiKeyError(OpenApiException, KeyError): - def __init__(self, msg, path_to_item=None) -> None: - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiKeyError, self).__init__(full_msg) - - -class ApiException(OpenApiException): - - def __init__( - self, - status=None, - reason=None, - http_resp=None, - *, - body: Optional[str] = None, - data: Optional[Any] = None, - ) -> None: - self.status = status - self.reason = reason - self.body = body - self.data = data - self.headers = None - - if http_resp: - if self.status is None: - self.status = http_resp.status - if self.reason is None: - self.reason = http_resp.reason - if self.body is None: - try: - self.body = http_resp.data.decode('utf-8') - except Exception: - pass - self.headers = http_resp.getheaders() - - @classmethod - def from_response( - cls, - *, - http_resp, - body: Optional[str], - data: Optional[Any], - ) -> Self: - if http_resp.status == 400: - raise BadRequestException(http_resp=http_resp, body=body, data=data) - - if http_resp.status == 401: - raise UnauthorizedException(http_resp=http_resp, body=body, data=data) - - if http_resp.status == 403: - raise ForbiddenException(http_resp=http_resp, body=body, data=data) - - if http_resp.status == 404: - raise NotFoundException(http_resp=http_resp, body=body, data=data) - - if 500 <= http_resp.status <= 599: - raise ServiceException(http_resp=http_resp, body=body, data=data) - raise ApiException(http_resp=http_resp, body=body, data=data) - - def __str__(self): - """Custom error messages for exception""" - error_message = "({0})\n"\ - "Reason: {1}\n".format(self.status, self.reason) - if self.headers: - error_message += "HTTP response headers: {0}\n".format( - self.headers) - - if self.data or self.body: - error_message += "HTTP response body: {0}\n".format(self.data or self.body) - - return error_message - - -class BadRequestException(ApiException): - pass - - -class NotFoundException(ApiException): - pass - - -class UnauthorizedException(ApiException): - pass - - -class ForbiddenException(ApiException): - pass - - -class ServiceException(ApiException): - pass - - -def render_path(path_to_item): - """Returns a string representation of a path""" - result = "" - for pth in path_to_item: - if isinstance(pth, int): - result += "[{0}]".format(pth) - else: - result += "['{0}']".format(pth) - return result diff --git a/data_bridges_client/models/__init__.py b/data_bridges_client/models/__init__.py deleted file mode 100644 index af6282f..0000000 --- a/data_bridges_client/models/__init__.py +++ /dev/null @@ -1,72 +0,0 @@ -# coding: utf-8 - -# flake8: noqa -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -# import models into model package -from data_bridges_client.models.bad_request_dto import BadRequestDTO -from data_bridges_client.models.commodity_dto import CommodityDTO -from data_bridges_client.models.commodity_price_dto import CommodityPriceDTO -from data_bridges_client.models.commodity_processing_dto import CommodityProcessingDTO -from data_bridges_client.models.commodity_quality_dto import CommodityQualityDTO -from data_bridges_client.models.currency_dto import CurrencyDTO -from data_bridges_client.models.economic_data_dto import EconomicDataDTO -from data_bridges_client.models.economic_indicator_property import EconomicIndicatorProperty -from data_bridges_client.models.economic_indicator_property_paged_result import EconomicIndicatorPropertyPagedResult -from data_bridges_client.models.feature import Feature -from data_bridges_client.models.geometry import Geometry -from data_bridges_client.models.gorp_country_api_dto import GorpCountryApiDto -from data_bridges_client.models.gorp_global_api_dto import GorpGlobalApiDto -from data_bridges_client.models.gorp_regional_api_dto import GorpRegionalApiDto -from data_bridges_client.models.gorp_value_with_changes import GorpValueWithChanges -from data_bridges_client.models.gorp_value_with_changes_paged_result import GorpValueWithChangesPagedResult -from data_bridges_client.models.household_survey_list_dto import HouseholdSurveyListDTO -from data_bridges_client.models.household_survey_list_dto_paged_result import HouseholdSurveyListDTOPagedResult -from data_bridges_client.models.ipc_value import IpcValue -from data_bridges_client.models.ipc_value_paged_result import IpcValuePagedResult -from data_bridges_client.models.key_name_dto import KeyNameDto -from data_bridges_client.models.mfi_processed_data_dto import MFIProcessedDataDTO -from data_bridges_client.models.market_dto import MarketDTO -from data_bridges_client.models.market_geo_json_root import MarketGeoJsonRoot -from data_bridges_client.models.nearby_markets_dto import NearbyMarketsDTO -from data_bridges_client.models.paged_commodity_list_dto import PagedCommodityListDTO -from data_bridges_client.models.paged_commodity_price_list_dto import PagedCommodityPriceListDTO -from data_bridges_client.models.paged_commodity_weekly_aggregated_price_list_dto import PagedCommodityWeeklyAggregatedPriceListDTO -from data_bridges_client.models.paged_currency_list_dto import PagedCurrencyListDTO -from data_bridges_client.models.paged_economic_data_dto import PagedEconomicDataDTO -from data_bridges_client.models.paged_market_list_dto import PagedMarketListDTO -from data_bridges_client.models.paged_processed_data_dto import PagedProcessedDataDTO -from data_bridges_client.models.paged_survey_list_dto import PagedSurveyListDTO -from data_bridges_client.models.paged_survey_responses_dto import PagedSurveyResponsesDTO -from data_bridges_client.models.paged_xls_form_list_dto import PagedXlsFormListDTO -from data_bridges_client.models.problem_details import ProblemDetails -from data_bridges_client.models.properties import Properties -from data_bridges_client.models.rpme_assessment import RpmeAssessment -from data_bridges_client.models.rpme_assessment_paged_result import RpmeAssessmentPagedResult -from data_bridges_client.models.rpme_output_values import RpmeOutputValues -from data_bridges_client.models.rpme_variable import RpmeVariable -from data_bridges_client.models.rpme_variable_paged_result import RpmeVariablePagedResult -from data_bridges_client.models.survey_list_dto import SurveyListDTO -from data_bridges_client.models.usd_indirect_quotation import UsdIndirectQuotation -from data_bridges_client.models.usd_indirect_quotation_paged_result import UsdIndirectQuotationPagedResult -from data_bridges_client.models.view_extended_aggregated_price import ViewExtendedAggregatedPrice -from data_bridges_client.models.view_extended_aggregated_price_paged_result import ViewExtendedAggregatedPricePagedResult -from data_bridges_client.models.view_extended_alps_value import ViewExtendedAlpsValue -from data_bridges_client.models.view_extended_alps_value_paged_result import ViewExtendedAlpsValuePagedResult -from data_bridges_client.models.weekly_aggregated_price import WeeklyAggregatedPrice -from data_bridges_client.models.xls_form_dto import XlsFormDTO -from data_bridges_client.models.xls_form_definition_new_schema_dto import XlsFormDefinitionNewSchemaDTO -from data_bridges_client.models.xls_form_fields_dto import XlsFormFieldsDTO -from data_bridges_client.models.xls_form_list_choice_dto import XlsFormListChoiceDTO -from data_bridges_client.models.xls_form_list_choices_dto import XlsFormListChoicesDTO diff --git a/data_bridges_client/models/bad_request_dto.py b/data_bridges_client/models/bad_request_dto.py deleted file mode 100644 index c13cf58..0000000 --- a/data_bridges_client/models/bad_request_dto.py +++ /dev/null @@ -1,106 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class BadRequestDTO(BaseModel): - """ - - """ # noqa: E501 - error: Optional[StrictStr] = Field(default=None, description="The error message returned by the application") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["error"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BadRequestDTO from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if error (nullable) is None - # and model_fields_set contains the field - if self.error is None and "error" in self.model_fields_set: - _dict['error'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BadRequestDTO from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "error": obj.get("error") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/commodity_dto.py b/data_bridges_client/models/commodity_dto.py deleted file mode 100644 index fa37e17..0000000 --- a/data_bridges_client/models/commodity_dto.py +++ /dev/null @@ -1,171 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from data_bridges_client.models.commodity_processing_dto import CommodityProcessingDTO -from data_bridges_client.models.commodity_quality_dto import CommodityQualityDTO -from typing import Optional, Set -from typing_extensions import Self - -class CommodityDTO(BaseModel): - """ - CommodityDTO - """ # noqa: E501 - id: Optional[StrictInt] = Field(default=None, description="The internal ID of the commodity") - parent_id: Optional[StrictInt] = Field(default=None, description="The internal parent ID of the commodity", alias="parentId") - name: Optional[StrictStr] = Field(default=None, description="The name of the commodity") - coicop2018: Optional[StrictStr] = Field(default=None, description="The COICOP 2018 definition") - supply: Optional[StrictInt] = None - category_id: Optional[StrictInt] = Field(default=None, alias="categoryId") - create_date: Optional[datetime] = Field(default=None, alias="createDate") - update_date: Optional[datetime] = Field(default=None, alias="updateDate") - qualities: Optional[List[CommodityQualityDTO]] = None - processing: Optional[List[CommodityProcessingDTO]] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["id", "parentId", "name", "coicop2018", "supply", "categoryId", "createDate", "updateDate", "qualities", "processing"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CommodityDTO from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in qualities (list) - _items = [] - if self.qualities: - for _item in self.qualities: - if _item: - _items.append(_item.to_dict()) - _dict['qualities'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in processing (list) - _items = [] - if self.processing: - for _item in self.processing: - if _item: - _items.append(_item.to_dict()) - _dict['processing'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if parent_id (nullable) is None - # and model_fields_set contains the field - if self.parent_id is None and "parent_id" in self.model_fields_set: - _dict['parentId'] = None - - # set to None if name (nullable) is None - # and model_fields_set contains the field - if self.name is None and "name" in self.model_fields_set: - _dict['name'] = None - - # set to None if coicop2018 (nullable) is None - # and model_fields_set contains the field - if self.coicop2018 is None and "coicop2018" in self.model_fields_set: - _dict['coicop2018'] = None - - # set to None if supply (nullable) is None - # and model_fields_set contains the field - if self.supply is None and "supply" in self.model_fields_set: - _dict['supply'] = None - - # set to None if update_date (nullable) is None - # and model_fields_set contains the field - if self.update_date is None and "update_date" in self.model_fields_set: - _dict['updateDate'] = None - - # set to None if qualities (nullable) is None - # and model_fields_set contains the field - if self.qualities is None and "qualities" in self.model_fields_set: - _dict['qualities'] = None - - # set to None if processing (nullable) is None - # and model_fields_set contains the field - if self.processing is None and "processing" in self.model_fields_set: - _dict['processing'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CommodityDTO from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "parentId": obj.get("parentId"), - "name": obj.get("name"), - "coicop2018": obj.get("coicop2018"), - "supply": obj.get("supply"), - "categoryId": obj.get("categoryId"), - "createDate": obj.get("createDate"), - "updateDate": obj.get("updateDate"), - "qualities": [CommodityQualityDTO.from_dict(_item) for _item in obj["qualities"]] if obj.get("qualities") is not None else None, - "processing": [CommodityProcessingDTO.from_dict(_item) for _item in obj["processing"]] if obj.get("processing") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/commodity_price_dto.py b/data_bridges_client/models/commodity_price_dto.py deleted file mode 100644 index 7bd900c..0000000 --- a/data_bridges_client/models/commodity_price_dto.py +++ /dev/null @@ -1,232 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Union -from typing import Optional, Set -from typing_extensions import Self - -class CommodityPriceDTO(BaseModel): - """ - CommodityPriceDTO - """ # noqa: E501 - id: Optional[StrictInt] = Field(default=None, description="The internal ID of the commodity") - commodity_id: Optional[StrictInt] = Field(default=None, alias="commodityId") - market_id: Optional[StrictInt] = Field(default=None, alias="marketId") - price_type_id: Optional[StrictInt] = Field(default=None, alias="priceTypeId") - commodity_unit_id: Optional[StrictInt] = Field(default=None, alias="commodityUnitId") - currency_id: Optional[StrictInt] = Field(default=None, alias="currencyId") - commodity_name: Optional[StrictStr] = Field(default=None, alias="commodityName") - market_name: Optional[StrictStr] = Field(default=None, alias="marketName") - price_type_name: Optional[StrictStr] = Field(default=None, alias="priceTypeName") - unit_name: Optional[StrictStr] = Field(default=None, alias="unitName") - currency_name: Optional[StrictStr] = Field(default=None, alias="currencyName") - original_frequency: Optional[StrictStr] = Field(default=None, alias="originalFrequency") - adm0_code: Optional[StrictInt] = Field(default=None, alias="adm0Code") - country_iso3: Optional[StrictStr] = Field(default=None, alias="countryISO3") - country_name: Optional[StrictStr] = Field(default=None, alias="countryName") - commodity_price: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="commodityPrice") - commodity_price_source_name: Optional[StrictStr] = Field(default=None, alias="commodityPriceSourceName") - commodity_price_metadata: Optional[Any] = Field(default=None, alias="commodityPriceMetadata") - commodity_price_date: Optional[datetime] = Field(default=None, alias="commodityPriceDate") - commodity_price_observations: Optional[StrictInt] = Field(default=None, alias="commodityPriceObservations") - commodity_price_date_day: Optional[StrictInt] = Field(default=None, alias="commodityPriceDateDay") - commodity_price_date_week: Optional[StrictInt] = Field(default=None, alias="commodityPriceDateWeek") - commodity_price_date_month: Optional[StrictInt] = Field(default=None, alias="commodityPriceDateMonth") - commodity_price_date_year: Optional[StrictInt] = Field(default=None, alias="commodityPriceDateYear") - commodity_price_insert_date: Optional[datetime] = Field(default=None, alias="commodityPriceInsertDate") - commodity_price_flag: Optional[StrictStr] = Field(default=None, alias="commodityPriceFlag") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["id", "commodityId", "marketId", "priceTypeId", "commodityUnitId", "currencyId", "commodityName", "marketName", "priceTypeName", "unitName", "currencyName", "originalFrequency", "adm0Code", "countryISO3", "countryName", "commodityPrice", "commodityPriceSourceName", "commodityPriceMetadata", "commodityPriceDate", "commodityPriceObservations", "commodityPriceDateDay", "commodityPriceDateWeek", "commodityPriceDateMonth", "commodityPriceDateYear", "commodityPriceInsertDate", "commodityPriceFlag"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CommodityPriceDTO from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if commodity_name (nullable) is None - # and model_fields_set contains the field - if self.commodity_name is None and "commodity_name" in self.model_fields_set: - _dict['commodityName'] = None - - # set to None if market_name (nullable) is None - # and model_fields_set contains the field - if self.market_name is None and "market_name" in self.model_fields_set: - _dict['marketName'] = None - - # set to None if price_type_name (nullable) is None - # and model_fields_set contains the field - if self.price_type_name is None and "price_type_name" in self.model_fields_set: - _dict['priceTypeName'] = None - - # set to None if unit_name (nullable) is None - # and model_fields_set contains the field - if self.unit_name is None and "unit_name" in self.model_fields_set: - _dict['unitName'] = None - - # set to None if currency_name (nullable) is None - # and model_fields_set contains the field - if self.currency_name is None and "currency_name" in self.model_fields_set: - _dict['currencyName'] = None - - # set to None if original_frequency (nullable) is None - # and model_fields_set contains the field - if self.original_frequency is None and "original_frequency" in self.model_fields_set: - _dict['originalFrequency'] = None - - # set to None if country_iso3 (nullable) is None - # and model_fields_set contains the field - if self.country_iso3 is None and "country_iso3" in self.model_fields_set: - _dict['countryISO3'] = None - - # set to None if country_name (nullable) is None - # and model_fields_set contains the field - if self.country_name is None and "country_name" in self.model_fields_set: - _dict['countryName'] = None - - # set to None if commodity_price_source_name (nullable) is None - # and model_fields_set contains the field - if self.commodity_price_source_name is None and "commodity_price_source_name" in self.model_fields_set: - _dict['commodityPriceSourceName'] = None - - # set to None if commodity_price_metadata (nullable) is None - # and model_fields_set contains the field - if self.commodity_price_metadata is None and "commodity_price_metadata" in self.model_fields_set: - _dict['commodityPriceMetadata'] = None - - # set to None if commodity_price_observations (nullable) is None - # and model_fields_set contains the field - if self.commodity_price_observations is None and "commodity_price_observations" in self.model_fields_set: - _dict['commodityPriceObservations'] = None - - # set to None if commodity_price_date_day (nullable) is None - # and model_fields_set contains the field - if self.commodity_price_date_day is None and "commodity_price_date_day" in self.model_fields_set: - _dict['commodityPriceDateDay'] = None - - # set to None if commodity_price_date_week (nullable) is None - # and model_fields_set contains the field - if self.commodity_price_date_week is None and "commodity_price_date_week" in self.model_fields_set: - _dict['commodityPriceDateWeek'] = None - - # set to None if commodity_price_date_month (nullable) is None - # and model_fields_set contains the field - if self.commodity_price_date_month is None and "commodity_price_date_month" in self.model_fields_set: - _dict['commodityPriceDateMonth'] = None - - # set to None if commodity_price_insert_date (nullable) is None - # and model_fields_set contains the field - if self.commodity_price_insert_date is None and "commodity_price_insert_date" in self.model_fields_set: - _dict['commodityPriceInsertDate'] = None - - # set to None if commodity_price_flag (nullable) is None - # and model_fields_set contains the field - if self.commodity_price_flag is None and "commodity_price_flag" in self.model_fields_set: - _dict['commodityPriceFlag'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CommodityPriceDTO from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "commodityId": obj.get("commodityId"), - "marketId": obj.get("marketId"), - "priceTypeId": obj.get("priceTypeId"), - "commodityUnitId": obj.get("commodityUnitId"), - "currencyId": obj.get("currencyId"), - "commodityName": obj.get("commodityName"), - "marketName": obj.get("marketName"), - "priceTypeName": obj.get("priceTypeName"), - "unitName": obj.get("unitName"), - "currencyName": obj.get("currencyName"), - "originalFrequency": obj.get("originalFrequency"), - "adm0Code": obj.get("adm0Code"), - "countryISO3": obj.get("countryISO3"), - "countryName": obj.get("countryName"), - "commodityPrice": obj.get("commodityPrice"), - "commodityPriceSourceName": obj.get("commodityPriceSourceName"), - "commodityPriceMetadata": obj.get("commodityPriceMetadata"), - "commodityPriceDate": obj.get("commodityPriceDate"), - "commodityPriceObservations": obj.get("commodityPriceObservations"), - "commodityPriceDateDay": obj.get("commodityPriceDateDay"), - "commodityPriceDateWeek": obj.get("commodityPriceDateWeek"), - "commodityPriceDateMonth": obj.get("commodityPriceDateMonth"), - "commodityPriceDateYear": obj.get("commodityPriceDateYear"), - "commodityPriceInsertDate": obj.get("commodityPriceInsertDate"), - "commodityPriceFlag": obj.get("commodityPriceFlag") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/commodity_processing_dto.py b/data_bridges_client/models/commodity_processing_dto.py deleted file mode 100644 index 36ea260..0000000 --- a/data_bridges_client/models/commodity_processing_dto.py +++ /dev/null @@ -1,108 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class CommodityProcessingDTO(BaseModel): - """ - CommodityProcessingDTO - """ # noqa: E501 - id: Optional[StrictInt] = Field(default=None, description="The internal ID of the commodity") - name: Optional[StrictStr] = Field(default=None, description="The name of the process") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["id", "name"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CommodityProcessingDTO from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if name (nullable) is None - # and model_fields_set contains the field - if self.name is None and "name" in self.model_fields_set: - _dict['name'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CommodityProcessingDTO from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "name": obj.get("name") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/commodity_quality_dto.py b/data_bridges_client/models/commodity_quality_dto.py deleted file mode 100644 index db64ad8..0000000 --- a/data_bridges_client/models/commodity_quality_dto.py +++ /dev/null @@ -1,108 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class CommodityQualityDTO(BaseModel): - """ - CommodityQualityDTO - """ # noqa: E501 - id: Optional[StrictInt] = Field(default=None, description="The internal ID of the commodity") - name: Optional[StrictStr] = Field(default=None, description="The name of the commodity") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["id", "name"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CommodityQualityDTO from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if name (nullable) is None - # and model_fields_set contains the field - if self.name is None and "name" in self.model_fields_set: - _dict['name'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CommodityQualityDTO from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "name": obj.get("name") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/currency_dto.py b/data_bridges_client/models/currency_dto.py deleted file mode 100644 index a16e45c..0000000 --- a/data_bridges_client/models/currency_dto.py +++ /dev/null @@ -1,125 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class CurrencyDTO(BaseModel): - """ - CurrencyDTO - """ # noqa: E501 - id: Optional[StrictInt] = Field(default=None, description="The internal ID of the unit") - name: Optional[StrictStr] = Field(default=None, description="The name of the unit") - extended_name: Optional[StrictStr] = Field(default=None, alias="extendedName") - create_date: Optional[datetime] = Field(default=None, alias="createDate") - update_date: Optional[datetime] = Field(default=None, alias="updateDate") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["id", "name", "extendedName", "createDate", "updateDate"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CurrencyDTO from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if name (nullable) is None - # and model_fields_set contains the field - if self.name is None and "name" in self.model_fields_set: - _dict['name'] = None - - # set to None if extended_name (nullable) is None - # and model_fields_set contains the field - if self.extended_name is None and "extended_name" in self.model_fields_set: - _dict['extendedName'] = None - - # set to None if update_date (nullable) is None - # and model_fields_set contains the field - if self.update_date is None and "update_date" in self.model_fields_set: - _dict['updateDate'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CurrencyDTO from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "name": obj.get("name"), - "extendedName": obj.get("extendedName"), - "createDate": obj.get("createDate"), - "updateDate": obj.get("updateDate") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/economic_data_dto.py b/data_bridges_client/models/economic_data_dto.py deleted file mode 100644 index 43673b8..0000000 --- a/data_bridges_client/models/economic_data_dto.py +++ /dev/null @@ -1,104 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Optional, Union -from typing import Optional, Set -from typing_extensions import Self - -class EconomicDataDTO(BaseModel): - """ - EconomicDataDTO - """ # noqa: E501 - var_date: Optional[datetime] = Field(default=None, alias="date") - value: Optional[Union[StrictFloat, StrictInt]] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["date", "value"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of EconomicDataDTO from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of EconomicDataDTO from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "date": obj.get("date"), - "value": obj.get("value") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/economic_indicator_property.py b/data_bridges_client/models/economic_indicator_property.py deleted file mode 100644 index a087376..0000000 --- a/data_bridges_client/models/economic_indicator_property.py +++ /dev/null @@ -1,141 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Union -from typing import Optional, Set -from typing_extensions import Self - -class EconomicIndicatorProperty(BaseModel): - """ - EconomicIndicatorProperty - """ # noqa: E501 - id: Optional[StrictInt] = None - name: Optional[StrictStr] = None - frequency: Optional[StrictStr] = None - unit: Optional[StrictStr] = None - data_source: Optional[StrictStr] = Field(default=None, alias="dataSource") - country_iso3: Optional[StrictStr] = Field(default=None, alias="countryIso3") - latest_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="latestValue") - latest_value_date: Optional[datetime] = Field(default=None, alias="latestValueDate") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["id", "name", "frequency", "unit", "dataSource", "countryIso3", "latestValue", "latestValueDate"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of EconomicIndicatorProperty from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if name (nullable) is None - # and model_fields_set contains the field - if self.name is None and "name" in self.model_fields_set: - _dict['name'] = None - - # set to None if frequency (nullable) is None - # and model_fields_set contains the field - if self.frequency is None and "frequency" in self.model_fields_set: - _dict['frequency'] = None - - # set to None if unit (nullable) is None - # and model_fields_set contains the field - if self.unit is None and "unit" in self.model_fields_set: - _dict['unit'] = None - - # set to None if data_source (nullable) is None - # and model_fields_set contains the field - if self.data_source is None and "data_source" in self.model_fields_set: - _dict['dataSource'] = None - - # set to None if country_iso3 (nullable) is None - # and model_fields_set contains the field - if self.country_iso3 is None and "country_iso3" in self.model_fields_set: - _dict['countryIso3'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of EconomicIndicatorProperty from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "name": obj.get("name"), - "frequency": obj.get("frequency"), - "unit": obj.get("unit"), - "dataSource": obj.get("dataSource"), - "countryIso3": obj.get("countryIso3"), - "latestValue": obj.get("latestValue"), - "latestValueDate": obj.get("latestValueDate") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/economic_indicator_property_paged_result.py b/data_bridges_client/models/economic_indicator_property_paged_result.py deleted file mode 100644 index 77e2ddb..0000000 --- a/data_bridges_client/models/economic_indicator_property_paged_result.py +++ /dev/null @@ -1,120 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from data_bridges_client.models.economic_indicator_property import EconomicIndicatorProperty -from typing import Optional, Set -from typing_extensions import Self - -class EconomicIndicatorPropertyPagedResult(BaseModel): - """ - EconomicIndicatorPropertyPagedResult - """ # noqa: E501 - items: Optional[List[EconomicIndicatorProperty]] = None - page: Optional[StrictInt] = None - total_items: Optional[StrictInt] = Field(default=None, alias="totalItems") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["items", "page", "totalItems"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of EconomicIndicatorPropertyPagedResult from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * OpenAPI `readOnly` fields are excluded. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "items", - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in items (list) - _items = [] - if self.items: - for _item in self.items: - if _item: - _items.append(_item.to_dict()) - _dict['items'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if items (nullable) is None - # and model_fields_set contains the field - if self.items is None and "items" in self.model_fields_set: - _dict['items'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of EconomicIndicatorPropertyPagedResult from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "items": [EconomicIndicatorProperty.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None, - "page": obj.get("page"), - "totalItems": obj.get("totalItems") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/feature.py b/data_bridges_client/models/feature.py deleted file mode 100644 index f833310..0000000 --- a/data_bridges_client/models/feature.py +++ /dev/null @@ -1,127 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Union -from data_bridges_client.models.geometry import Geometry -from data_bridges_client.models.properties import Properties -from typing import Optional, Set -from typing_extensions import Self - -class Feature(BaseModel): - """ - Feature - """ # noqa: E501 - type: Optional[StrictStr] = None - id: Optional[StrictInt] = None - bbox: Optional[List[Union[StrictFloat, StrictInt]]] = None - geometry: Optional[Geometry] = None - properties: Optional[Properties] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "id", "bbox", "geometry", "properties"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Feature from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of geometry - if self.geometry: - _dict['geometry'] = self.geometry.to_dict() - # override the default output from pydantic by calling `to_dict()` of properties - if self.properties: - _dict['properties'] = self.properties.to_dict() - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if type (nullable) is None - # and model_fields_set contains the field - if self.type is None and "type" in self.model_fields_set: - _dict['type'] = None - - # set to None if bbox (nullable) is None - # and model_fields_set contains the field - if self.bbox is None and "bbox" in self.model_fields_set: - _dict['bbox'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Feature from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type"), - "id": obj.get("id"), - "bbox": obj.get("bbox"), - "geometry": Geometry.from_dict(obj["geometry"]) if obj.get("geometry") is not None else None, - "properties": Properties.from_dict(obj["properties"]) if obj.get("properties") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/geometry.py b/data_bridges_client/models/geometry.py deleted file mode 100644 index 3138f69..0000000 --- a/data_bridges_client/models/geometry.py +++ /dev/null @@ -1,113 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Union -from typing import Optional, Set -from typing_extensions import Self - -class Geometry(BaseModel): - """ - Geometry - """ # noqa: E501 - type: Optional[StrictStr] = None - coordinates: Optional[List[Union[StrictFloat, StrictInt]]] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "coordinates"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Geometry from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if type (nullable) is None - # and model_fields_set contains the field - if self.type is None and "type" in self.model_fields_set: - _dict['type'] = None - - # set to None if coordinates (nullable) is None - # and model_fields_set contains the field - if self.coordinates is None and "coordinates" in self.model_fields_set: - _dict['coordinates'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Geometry from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type"), - "coordinates": obj.get("coordinates") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/gorp_country_api_dto.py b/data_bridges_client/models/gorp_country_api_dto.py deleted file mode 100644 index bd14cb3..0000000 --- a/data_bridges_client/models/gorp_country_api_dto.py +++ /dev/null @@ -1,122 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Union -from typing import Optional, Set -from typing_extensions import Self - -class GorpCountryApiDto(BaseModel): - """ - GorpCountryApiDto - """ # noqa: E501 - gorp_date: Optional[StrictStr] = Field(default=None, alias="gorpDate") - country_office_iso3: Optional[StrictStr] = Field(default=None, alias="countryOfficeIso3") - gorp_total_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="gorpTotalValue") - gorp_comment: Optional[StrictStr] = Field(default=None, alias="gorpComment") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["gorpDate", "countryOfficeIso3", "gorpTotalValue", "gorpComment"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of GorpCountryApiDto from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if gorp_date (nullable) is None - # and model_fields_set contains the field - if self.gorp_date is None and "gorp_date" in self.model_fields_set: - _dict['gorpDate'] = None - - # set to None if country_office_iso3 (nullable) is None - # and model_fields_set contains the field - if self.country_office_iso3 is None and "country_office_iso3" in self.model_fields_set: - _dict['countryOfficeIso3'] = None - - # set to None if gorp_comment (nullable) is None - # and model_fields_set contains the field - if self.gorp_comment is None and "gorp_comment" in self.model_fields_set: - _dict['gorpComment'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of GorpCountryApiDto from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "gorpDate": obj.get("gorpDate"), - "countryOfficeIso3": obj.get("countryOfficeIso3"), - "gorpTotalValue": obj.get("gorpTotalValue"), - "gorpComment": obj.get("gorpComment") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/gorp_global_api_dto.py b/data_bridges_client/models/gorp_global_api_dto.py deleted file mode 100644 index 75c618d..0000000 --- a/data_bridges_client/models/gorp_global_api_dto.py +++ /dev/null @@ -1,129 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Union -from typing import Optional, Set -from typing_extensions import Self - -class GorpGlobalApiDto(BaseModel): - """ - GorpGlobalApiDto - """ # noqa: E501 - gorp_date: Optional[StrictStr] = Field(default=None, alias="gorpDate") - gorp_region_name: Optional[StrictStr] = Field(default=None, alias="gorpRegionName") - gorp_total_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="gorpTotalValue") - number_of_countries: Optional[StrictInt] = Field(default=None, alias="numberOfCountries") - gorp_comment: Optional[StrictStr] = Field(default=None, alias="gorpComment") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["gorpDate", "gorpRegionName", "gorpTotalValue", "numberOfCountries", "gorpComment"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of GorpGlobalApiDto from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if gorp_date (nullable) is None - # and model_fields_set contains the field - if self.gorp_date is None and "gorp_date" in self.model_fields_set: - _dict['gorpDate'] = None - - # set to None if gorp_region_name (nullable) is None - # and model_fields_set contains the field - if self.gorp_region_name is None and "gorp_region_name" in self.model_fields_set: - _dict['gorpRegionName'] = None - - # set to None if number_of_countries (nullable) is None - # and model_fields_set contains the field - if self.number_of_countries is None and "number_of_countries" in self.model_fields_set: - _dict['numberOfCountries'] = None - - # set to None if gorp_comment (nullable) is None - # and model_fields_set contains the field - if self.gorp_comment is None and "gorp_comment" in self.model_fields_set: - _dict['gorpComment'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of GorpGlobalApiDto from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "gorpDate": obj.get("gorpDate"), - "gorpRegionName": obj.get("gorpRegionName"), - "gorpTotalValue": obj.get("gorpTotalValue"), - "numberOfCountries": obj.get("numberOfCountries"), - "gorpComment": obj.get("gorpComment") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/gorp_regional_api_dto.py b/data_bridges_client/models/gorp_regional_api_dto.py deleted file mode 100644 index dfc96d6..0000000 --- a/data_bridges_client/models/gorp_regional_api_dto.py +++ /dev/null @@ -1,129 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Union -from typing import Optional, Set -from typing_extensions import Self - -class GorpRegionalApiDto(BaseModel): - """ - GorpRegionalApiDto - """ # noqa: E501 - gorp_date: Optional[StrictStr] = Field(default=None, alias="gorpDate") - gorp_region_name: Optional[StrictStr] = Field(default=None, alias="gorpRegionName") - gorp_total_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="gorpTotalValue") - number_of_countries: Optional[StrictInt] = Field(default=None, alias="numberOfCountries") - gorp_comment: Optional[StrictStr] = Field(default=None, alias="gorpComment") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["gorpDate", "gorpRegionName", "gorpTotalValue", "numberOfCountries", "gorpComment"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of GorpRegionalApiDto from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if gorp_date (nullable) is None - # and model_fields_set contains the field - if self.gorp_date is None and "gorp_date" in self.model_fields_set: - _dict['gorpDate'] = None - - # set to None if gorp_region_name (nullable) is None - # and model_fields_set contains the field - if self.gorp_region_name is None and "gorp_region_name" in self.model_fields_set: - _dict['gorpRegionName'] = None - - # set to None if number_of_countries (nullable) is None - # and model_fields_set contains the field - if self.number_of_countries is None and "number_of_countries" in self.model_fields_set: - _dict['numberOfCountries'] = None - - # set to None if gorp_comment (nullable) is None - # and model_fields_set contains the field - if self.gorp_comment is None and "gorp_comment" in self.model_fields_set: - _dict['gorpComment'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of GorpRegionalApiDto from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "gorpDate": obj.get("gorpDate"), - "gorpRegionName": obj.get("gorpRegionName"), - "gorpTotalValue": obj.get("gorpTotalValue"), - "numberOfCountries": obj.get("numberOfCountries"), - "gorpComment": obj.get("gorpComment") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/gorp_value_with_changes.py b/data_bridges_client/models/gorp_value_with_changes.py deleted file mode 100644 index 0a282ec..0000000 --- a/data_bridges_client/models/gorp_value_with_changes.py +++ /dev/null @@ -1,132 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Union -from typing import Optional, Set -from typing_extensions import Self - -class GorpValueWithChanges(BaseModel): - """ - GorpValueWithChanges - """ # noqa: E501 - year: Optional[StrictInt] = None - month: Optional[StrictStr] = None - region_name: Optional[StrictStr] = Field(default=None, alias="regionName") - actual_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="actualValue") - baseline_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="baselineValue") - percentage_change: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="percentageChange") - absolute_change: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="absoluteChange") - comments: Optional[StrictStr] = None - number_of_countries: Optional[StrictInt] = Field(default=None, alias="numberOfCountries") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["year", "month", "regionName", "actualValue", "baselineValue", "percentageChange", "absoluteChange", "comments", "numberOfCountries"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of GorpValueWithChanges from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if month (nullable) is None - # and model_fields_set contains the field - if self.month is None and "month" in self.model_fields_set: - _dict['month'] = None - - # set to None if region_name (nullable) is None - # and model_fields_set contains the field - if self.region_name is None and "region_name" in self.model_fields_set: - _dict['regionName'] = None - - # set to None if comments (nullable) is None - # and model_fields_set contains the field - if self.comments is None and "comments" in self.model_fields_set: - _dict['comments'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of GorpValueWithChanges from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "year": obj.get("year"), - "month": obj.get("month"), - "regionName": obj.get("regionName"), - "actualValue": obj.get("actualValue"), - "baselineValue": obj.get("baselineValue"), - "percentageChange": obj.get("percentageChange"), - "absoluteChange": obj.get("absoluteChange"), - "comments": obj.get("comments"), - "numberOfCountries": obj.get("numberOfCountries") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/gorp_value_with_changes_paged_result.py b/data_bridges_client/models/gorp_value_with_changes_paged_result.py deleted file mode 100644 index be6cbe0..0000000 --- a/data_bridges_client/models/gorp_value_with_changes_paged_result.py +++ /dev/null @@ -1,120 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from data_bridges_client.models.gorp_value_with_changes import GorpValueWithChanges -from typing import Optional, Set -from typing_extensions import Self - -class GorpValueWithChangesPagedResult(BaseModel): - """ - GorpValueWithChangesPagedResult - """ # noqa: E501 - items: Optional[List[GorpValueWithChanges]] = None - page: Optional[StrictInt] = None - total_items: Optional[StrictInt] = Field(default=None, alias="totalItems") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["items", "page", "totalItems"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of GorpValueWithChangesPagedResult from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * OpenAPI `readOnly` fields are excluded. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "items", - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in items (list) - _items = [] - if self.items: - for _item in self.items: - if _item: - _items.append(_item.to_dict()) - _dict['items'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if items (nullable) is None - # and model_fields_set contains the field - if self.items is None and "items" in self.model_fields_set: - _dict['items'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of GorpValueWithChangesPagedResult from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "items": [GorpValueWithChanges.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None, - "page": obj.get("page"), - "totalItems": obj.get("totalItems") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/household_survey_list_dto.py b/data_bridges_client/models/household_survey_list_dto.py deleted file mode 100644 index 79d7131..0000000 --- a/data_bridges_client/models/household_survey_list_dto.py +++ /dev/null @@ -1,266 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from data_bridges_client.models.key_name_dto import KeyNameDto -from typing import Optional, Set -from typing_extensions import Self - -class HouseholdSurveyListDTO(BaseModel): - """ - HouseholdSurveyListDTO - """ # noqa: E501 - survey_id: Optional[StrictInt] = Field(default=None, description="The Id of the Survey", alias="surveyID") - survey_status_id: Optional[StrictInt] = Field(default=None, description="The Id of the Survey status", alias="surveyStatusID") - survey_start_date: Optional[datetime] = Field(default=None, description="The date when the survey has started", alias="surveyStartDate") - survey_end_date: Optional[datetime] = Field(default=None, description="The date when the survey has ended", alias="surveyEndDate") - survey_create_date: Optional[datetime] = Field(default=None, description="The date when the survey has been uploaded in the Data Bridges platform", alias="surveyCreateDate") - survey_validation_report: Optional[StrictStr] = Field(default=None, description="The detailed report on the validation performed on the survey schema", alias="surveyValidationReport") - survey_original_filename: Optional[Annotated[str, Field(min_length=0, strict=True, max_length=256)]] = Field(default=None, description="The filename of the survey CSV file", alias="surveyOriginalFilename") - xls_form_name: Optional[StrictStr] = Field(default=None, description="The name of the XLSForm used to collect data", alias="xlsFormName") - base_xls_form_name: Optional[StrictStr] = Field(default=None, description="The name of the base XLSForm used to build the XLSForm", alias="baseXlsFormName") - country_name: Optional[StrictStr] = Field(default=None, description="The name of the country where the survey has taken place", alias="countryName") - adm0_code: Optional[StrictInt] = Field(default=None, description="The internal code of the country where the survey has taken place", alias="adm0Code") - iso3_alpha3: Optional[StrictStr] = Field(default=None, description="The ISO3 alpha code of the country where the survey has taken place", alias="iso3Alpha3") - user_name: Optional[StrictStr] = Field(default=None, description="The name of the user that has uploaded the survey data", alias="userName") - approved_by: Optional[StrictStr] = Field(default=None, alias="approvedBy") - original_csv_file: Optional[StrictStr] = Field(default=None, description="The link to download the original CSV file", alias="originalCsvFile") - base_data: Optional[StrictStr] = Field(default=None, description="The link to the JSON data reshaped on the base XLSForm", alias="baseData") - survey_attributes: Optional[List[KeyNameDto]] = Field(default=None, alias="surveyAttributes") - organizations: Optional[List[KeyNameDto]] = None - survey_modality_name: Optional[StrictStr] = Field(default=None, alias="surveyModalityName") - survey_category_name: Optional[StrictStr] = Field(default=None, alias="surveyCategoryName") - survey_sub_category_name: Optional[StrictStr] = Field(default=None, alias="surveySubCategoryName") - survey_phase_name: Optional[StrictStr] = Field(default=None, alias="surveyPhaseName") - survey_visibilty: Optional[StrictStr] = Field(default=None, alias="surveyVisibilty") - is_continuous_monitoring: Optional[StrictBool] = Field(default=None, alias="isContinuousMonitoring") - survey_name: Optional[StrictStr] = Field(default=None, alias="surveyName") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["surveyID", "surveyStatusID", "surveyStartDate", "surveyEndDate", "surveyCreateDate", "surveyValidationReport", "surveyOriginalFilename", "xlsFormName", "baseXlsFormName", "countryName", "adm0Code", "iso3Alpha3", "userName", "approvedBy", "originalCsvFile", "baseData", "surveyAttributes", "organizations", "surveyModalityName", "surveyCategoryName", "surveySubCategoryName", "surveyPhaseName", "surveyVisibilty", "isContinuousMonitoring", "surveyName"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of HouseholdSurveyListDTO from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in survey_attributes (list) - _items = [] - if self.survey_attributes: - for _item in self.survey_attributes: - if _item: - _items.append(_item.to_dict()) - _dict['surveyAttributes'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in organizations (list) - _items = [] - if self.organizations: - for _item in self.organizations: - if _item: - _items.append(_item.to_dict()) - _dict['organizations'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if survey_start_date (nullable) is None - # and model_fields_set contains the field - if self.survey_start_date is None and "survey_start_date" in self.model_fields_set: - _dict['surveyStartDate'] = None - - # set to None if survey_end_date (nullable) is None - # and model_fields_set contains the field - if self.survey_end_date is None and "survey_end_date" in self.model_fields_set: - _dict['surveyEndDate'] = None - - # set to None if survey_validation_report (nullable) is None - # and model_fields_set contains the field - if self.survey_validation_report is None and "survey_validation_report" in self.model_fields_set: - _dict['surveyValidationReport'] = None - - # set to None if survey_original_filename (nullable) is None - # and model_fields_set contains the field - if self.survey_original_filename is None and "survey_original_filename" in self.model_fields_set: - _dict['surveyOriginalFilename'] = None - - # set to None if xls_form_name (nullable) is None - # and model_fields_set contains the field - if self.xls_form_name is None and "xls_form_name" in self.model_fields_set: - _dict['xlsFormName'] = None - - # set to None if base_xls_form_name (nullable) is None - # and model_fields_set contains the field - if self.base_xls_form_name is None and "base_xls_form_name" in self.model_fields_set: - _dict['baseXlsFormName'] = None - - # set to None if country_name (nullable) is None - # and model_fields_set contains the field - if self.country_name is None and "country_name" in self.model_fields_set: - _dict['countryName'] = None - - # set to None if iso3_alpha3 (nullable) is None - # and model_fields_set contains the field - if self.iso3_alpha3 is None and "iso3_alpha3" in self.model_fields_set: - _dict['iso3Alpha3'] = None - - # set to None if user_name (nullable) is None - # and model_fields_set contains the field - if self.user_name is None and "user_name" in self.model_fields_set: - _dict['userName'] = None - - # set to None if approved_by (nullable) is None - # and model_fields_set contains the field - if self.approved_by is None and "approved_by" in self.model_fields_set: - _dict['approvedBy'] = None - - # set to None if original_csv_file (nullable) is None - # and model_fields_set contains the field - if self.original_csv_file is None and "original_csv_file" in self.model_fields_set: - _dict['originalCsvFile'] = None - - # set to None if base_data (nullable) is None - # and model_fields_set contains the field - if self.base_data is None and "base_data" in self.model_fields_set: - _dict['baseData'] = None - - # set to None if survey_attributes (nullable) is None - # and model_fields_set contains the field - if self.survey_attributes is None and "survey_attributes" in self.model_fields_set: - _dict['surveyAttributes'] = None - - # set to None if organizations (nullable) is None - # and model_fields_set contains the field - if self.organizations is None and "organizations" in self.model_fields_set: - _dict['organizations'] = None - - # set to None if survey_modality_name (nullable) is None - # and model_fields_set contains the field - if self.survey_modality_name is None and "survey_modality_name" in self.model_fields_set: - _dict['surveyModalityName'] = None - - # set to None if survey_category_name (nullable) is None - # and model_fields_set contains the field - if self.survey_category_name is None and "survey_category_name" in self.model_fields_set: - _dict['surveyCategoryName'] = None - - # set to None if survey_sub_category_name (nullable) is None - # and model_fields_set contains the field - if self.survey_sub_category_name is None and "survey_sub_category_name" in self.model_fields_set: - _dict['surveySubCategoryName'] = None - - # set to None if survey_phase_name (nullable) is None - # and model_fields_set contains the field - if self.survey_phase_name is None and "survey_phase_name" in self.model_fields_set: - _dict['surveyPhaseName'] = None - - # set to None if survey_visibilty (nullable) is None - # and model_fields_set contains the field - if self.survey_visibilty is None and "survey_visibilty" in self.model_fields_set: - _dict['surveyVisibilty'] = None - - # set to None if survey_name (nullable) is None - # and model_fields_set contains the field - if self.survey_name is None and "survey_name" in self.model_fields_set: - _dict['surveyName'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of HouseholdSurveyListDTO from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "surveyID": obj.get("surveyID"), - "surveyStatusID": obj.get("surveyStatusID"), - "surveyStartDate": obj.get("surveyStartDate"), - "surveyEndDate": obj.get("surveyEndDate"), - "surveyCreateDate": obj.get("surveyCreateDate"), - "surveyValidationReport": obj.get("surveyValidationReport"), - "surveyOriginalFilename": obj.get("surveyOriginalFilename"), - "xlsFormName": obj.get("xlsFormName"), - "baseXlsFormName": obj.get("baseXlsFormName"), - "countryName": obj.get("countryName"), - "adm0Code": obj.get("adm0Code"), - "iso3Alpha3": obj.get("iso3Alpha3"), - "userName": obj.get("userName"), - "approvedBy": obj.get("approvedBy"), - "originalCsvFile": obj.get("originalCsvFile"), - "baseData": obj.get("baseData"), - "surveyAttributes": [KeyNameDto.from_dict(_item) for _item in obj["surveyAttributes"]] if obj.get("surveyAttributes") is not None else None, - "organizations": [KeyNameDto.from_dict(_item) for _item in obj["organizations"]] if obj.get("organizations") is not None else None, - "surveyModalityName": obj.get("surveyModalityName"), - "surveyCategoryName": obj.get("surveyCategoryName"), - "surveySubCategoryName": obj.get("surveySubCategoryName"), - "surveyPhaseName": obj.get("surveyPhaseName"), - "surveyVisibilty": obj.get("surveyVisibilty"), - "isContinuousMonitoring": obj.get("isContinuousMonitoring"), - "surveyName": obj.get("surveyName") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/household_survey_list_dto_paged_result.py b/data_bridges_client/models/household_survey_list_dto_paged_result.py deleted file mode 100644 index 9b0392b..0000000 --- a/data_bridges_client/models/household_survey_list_dto_paged_result.py +++ /dev/null @@ -1,120 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from data_bridges_client.models.household_survey_list_dto import HouseholdSurveyListDTO -from typing import Optional, Set -from typing_extensions import Self - -class HouseholdSurveyListDTOPagedResult(BaseModel): - """ - HouseholdSurveyListDTOPagedResult - """ # noqa: E501 - items: Optional[List[HouseholdSurveyListDTO]] = None - page: Optional[StrictInt] = None - total_items: Optional[StrictInt] = Field(default=None, alias="totalItems") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["items", "page", "totalItems"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of HouseholdSurveyListDTOPagedResult from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * OpenAPI `readOnly` fields are excluded. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "items", - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in items (list) - _items = [] - if self.items: - for _item in self.items: - if _item: - _items.append(_item.to_dict()) - _dict['items'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if items (nullable) is None - # and model_fields_set contains the field - if self.items is None and "items" in self.model_fields_set: - _dict['items'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of HouseholdSurveyListDTOPagedResult from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "items": [HouseholdSurveyListDTO.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None, - "page": obj.get("page"), - "totalItems": obj.get("totalItems") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/ipc_value.py b/data_bridges_client/models/ipc_value.py deleted file mode 100644 index f4ecb22..0000000 --- a/data_bridges_client/models/ipc_value.py +++ /dev/null @@ -1,221 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Union -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self - -class IpcValue(BaseModel): - """ - IpcValue - """ # noqa: E501 - ipc_id: Optional[StrictInt] = Field(default=None, alias="ipcId") - ipc_year: Optional[StrictInt] = Field(default=None, alias="ipcYear") - iso3_alpha3: Optional[Annotated[str, Field(min_length=0, strict=True, max_length=3)]] = Field(default=None, alias="iso3Alpha3") - ipc_is_latest_value: Optional[StrictBool] = Field(default=None, alias="ipcIsLatestValue") - ipc_country_name: Optional[Annotated[str, Field(min_length=0, strict=True, max_length=128)]] = Field(default=None, alias="ipcCountryName") - ipc_area_name: Optional[Annotated[str, Field(min_length=0, strict=True, max_length=128)]] = Field(default=None, alias="ipcAreaName") - ipc_phase3_population: Optional[StrictInt] = Field(default=None, alias="ipcPhase3Population") - ipc_phase4_population: Optional[StrictInt] = Field(default=None, alias="ipcPhase4Population") - ipc_phase5_population: Optional[StrictInt] = Field(default=None, alias="ipcPhase5Population") - ipc_phase3_percentage: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="ipcPhase3Percentage") - ipc_phase4_percentage: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="ipcPhase4Percentage") - ipc_phase5_percentage: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="ipcPhase5Percentage") - ipc_analysed_population: Optional[StrictInt] = Field(default=None, alias="ipcAnalysedPopulation") - ipc_analysed_percentage: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="ipcAnalysedPercentage") - ipc_analysis_comment: Optional[StrictStr] = Field(default=None, alias="ipcAnalysisComment") - ipc_data_type: Optional[Annotated[str, Field(min_length=0, strict=True, max_length=256)]] = Field(default=None, alias="ipcDataType") - ipc_data_source: Optional[Annotated[str, Field(min_length=0, strict=True, max_length=128)]] = Field(default=None, alias="ipcDataSource") - ipc_reference_period: Optional[Annotated[str, Field(min_length=0, strict=True, max_length=256)]] = Field(default=None, alias="ipcReferencePeriod") - ipc_create_date: Optional[datetime] = Field(default=None, alias="ipcCreateDate") - ipc_update_date: Optional[datetime] = Field(default=None, alias="ipcUpdateDate") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["ipcId", "ipcYear", "iso3Alpha3", "ipcIsLatestValue", "ipcCountryName", "ipcAreaName", "ipcPhase3Population", "ipcPhase4Population", "ipcPhase5Population", "ipcPhase3Percentage", "ipcPhase4Percentage", "ipcPhase5Percentage", "ipcAnalysedPopulation", "ipcAnalysedPercentage", "ipcAnalysisComment", "ipcDataType", "ipcDataSource", "ipcReferencePeriod", "ipcCreateDate", "ipcUpdateDate"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of IpcValue from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if iso3_alpha3 (nullable) is None - # and model_fields_set contains the field - if self.iso3_alpha3 is None and "iso3_alpha3" in self.model_fields_set: - _dict['iso3Alpha3'] = None - - # set to None if ipc_country_name (nullable) is None - # and model_fields_set contains the field - if self.ipc_country_name is None and "ipc_country_name" in self.model_fields_set: - _dict['ipcCountryName'] = None - - # set to None if ipc_area_name (nullable) is None - # and model_fields_set contains the field - if self.ipc_area_name is None and "ipc_area_name" in self.model_fields_set: - _dict['ipcAreaName'] = None - - # set to None if ipc_phase3_population (nullable) is None - # and model_fields_set contains the field - if self.ipc_phase3_population is None and "ipc_phase3_population" in self.model_fields_set: - _dict['ipcPhase3Population'] = None - - # set to None if ipc_phase4_population (nullable) is None - # and model_fields_set contains the field - if self.ipc_phase4_population is None and "ipc_phase4_population" in self.model_fields_set: - _dict['ipcPhase4Population'] = None - - # set to None if ipc_phase5_population (nullable) is None - # and model_fields_set contains the field - if self.ipc_phase5_population is None and "ipc_phase5_population" in self.model_fields_set: - _dict['ipcPhase5Population'] = None - - # set to None if ipc_phase3_percentage (nullable) is None - # and model_fields_set contains the field - if self.ipc_phase3_percentage is None and "ipc_phase3_percentage" in self.model_fields_set: - _dict['ipcPhase3Percentage'] = None - - # set to None if ipc_phase4_percentage (nullable) is None - # and model_fields_set contains the field - if self.ipc_phase4_percentage is None and "ipc_phase4_percentage" in self.model_fields_set: - _dict['ipcPhase4Percentage'] = None - - # set to None if ipc_phase5_percentage (nullable) is None - # and model_fields_set contains the field - if self.ipc_phase5_percentage is None and "ipc_phase5_percentage" in self.model_fields_set: - _dict['ipcPhase5Percentage'] = None - - # set to None if ipc_analysed_population (nullable) is None - # and model_fields_set contains the field - if self.ipc_analysed_population is None and "ipc_analysed_population" in self.model_fields_set: - _dict['ipcAnalysedPopulation'] = None - - # set to None if ipc_analysed_percentage (nullable) is None - # and model_fields_set contains the field - if self.ipc_analysed_percentage is None and "ipc_analysed_percentage" in self.model_fields_set: - _dict['ipcAnalysedPercentage'] = None - - # set to None if ipc_analysis_comment (nullable) is None - # and model_fields_set contains the field - if self.ipc_analysis_comment is None and "ipc_analysis_comment" in self.model_fields_set: - _dict['ipcAnalysisComment'] = None - - # set to None if ipc_data_type (nullable) is None - # and model_fields_set contains the field - if self.ipc_data_type is None and "ipc_data_type" in self.model_fields_set: - _dict['ipcDataType'] = None - - # set to None if ipc_data_source (nullable) is None - # and model_fields_set contains the field - if self.ipc_data_source is None and "ipc_data_source" in self.model_fields_set: - _dict['ipcDataSource'] = None - - # set to None if ipc_reference_period (nullable) is None - # and model_fields_set contains the field - if self.ipc_reference_period is None and "ipc_reference_period" in self.model_fields_set: - _dict['ipcReferencePeriod'] = None - - # set to None if ipc_update_date (nullable) is None - # and model_fields_set contains the field - if self.ipc_update_date is None and "ipc_update_date" in self.model_fields_set: - _dict['ipcUpdateDate'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of IpcValue from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "ipcId": obj.get("ipcId"), - "ipcYear": obj.get("ipcYear"), - "iso3Alpha3": obj.get("iso3Alpha3"), - "ipcIsLatestValue": obj.get("ipcIsLatestValue"), - "ipcCountryName": obj.get("ipcCountryName"), - "ipcAreaName": obj.get("ipcAreaName"), - "ipcPhase3Population": obj.get("ipcPhase3Population"), - "ipcPhase4Population": obj.get("ipcPhase4Population"), - "ipcPhase5Population": obj.get("ipcPhase5Population"), - "ipcPhase3Percentage": obj.get("ipcPhase3Percentage"), - "ipcPhase4Percentage": obj.get("ipcPhase4Percentage"), - "ipcPhase5Percentage": obj.get("ipcPhase5Percentage"), - "ipcAnalysedPopulation": obj.get("ipcAnalysedPopulation"), - "ipcAnalysedPercentage": obj.get("ipcAnalysedPercentage"), - "ipcAnalysisComment": obj.get("ipcAnalysisComment"), - "ipcDataType": obj.get("ipcDataType"), - "ipcDataSource": obj.get("ipcDataSource"), - "ipcReferencePeriod": obj.get("ipcReferencePeriod"), - "ipcCreateDate": obj.get("ipcCreateDate"), - "ipcUpdateDate": obj.get("ipcUpdateDate") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/ipc_value_paged_result.py b/data_bridges_client/models/ipc_value_paged_result.py deleted file mode 100644 index d743ed4..0000000 --- a/data_bridges_client/models/ipc_value_paged_result.py +++ /dev/null @@ -1,120 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from data_bridges_client.models.ipc_value import IpcValue -from typing import Optional, Set -from typing_extensions import Self - -class IpcValuePagedResult(BaseModel): - """ - IpcValuePagedResult - """ # noqa: E501 - items: Optional[List[IpcValue]] = None - page: Optional[StrictInt] = None - total_items: Optional[StrictInt] = Field(default=None, alias="totalItems") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["items", "page", "totalItems"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of IpcValuePagedResult from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * OpenAPI `readOnly` fields are excluded. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "items", - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in items (list) - _items = [] - if self.items: - for _item in self.items: - if _item: - _items.append(_item.to_dict()) - _dict['items'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if items (nullable) is None - # and model_fields_set contains the field - if self.items is None and "items" in self.model_fields_set: - _dict['items'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of IpcValuePagedResult from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "items": [IpcValue.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None, - "page": obj.get("page"), - "totalItems": obj.get("totalItems") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/key_name_dto.py b/data_bridges_client/models/key_name_dto.py deleted file mode 100644 index 3393dc3..0000000 --- a/data_bridges_client/models/key_name_dto.py +++ /dev/null @@ -1,108 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class KeyNameDto(BaseModel): - """ - KeyNameDto - """ # noqa: E501 - id: Optional[StrictInt] = None - name: Optional[StrictStr] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["id", "name"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of KeyNameDto from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if name (nullable) is None - # and model_fields_set contains the field - if self.name is None and "name" in self.model_fields_set: - _dict['name'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of KeyNameDto from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "name": obj.get("name") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/market_dto.py b/data_bridges_client/models/market_dto.py deleted file mode 100644 index 249a816..0000000 --- a/data_bridges_client/models/market_dto.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Union -from typing import Optional, Set -from typing_extensions import Self - -class MarketDTO(BaseModel): - """ - MarketDTO - """ # noqa: E501 - market_id: Optional[StrictInt] = Field(default=None, description="The internal ID of the market", alias="marketId") - market_name: Optional[StrictStr] = Field(default=None, description="The name of the market", alias="marketName") - market_local_name: Optional[StrictStr] = Field(default=None, description="The local name of the market", alias="marketLocalName") - market_latitude: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The decimal latitude", alias="marketLatitude") - market_longitude: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The decimal longitude", alias="marketLongitude") - admin1_name: Optional[StrictStr] = Field(default=None, description="The name of the first level administrative division where the market is placed", alias="admin1Name") - admin1_code: Optional[StrictInt] = Field(default=None, description="The code of the first level administrative division where the market is placed", alias="admin1Code") - admin2_name: Optional[StrictStr] = Field(default=None, description="The name of the second level administrative division where the market is placed", alias="admin2Name") - admin2_code: Optional[StrictInt] = Field(default=None, description="The code of the second level administrative division where the market is placed", alias="admin2Code") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["marketId", "marketName", "marketLocalName", "marketLatitude", "marketLongitude", "admin1Name", "admin1Code", "admin2Name", "admin2Code"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of MarketDTO from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if market_name (nullable) is None - # and model_fields_set contains the field - if self.market_name is None and "market_name" in self.model_fields_set: - _dict['marketName'] = None - - # set to None if market_local_name (nullable) is None - # and model_fields_set contains the field - if self.market_local_name is None and "market_local_name" in self.model_fields_set: - _dict['marketLocalName'] = None - - # set to None if market_latitude (nullable) is None - # and model_fields_set contains the field - if self.market_latitude is None and "market_latitude" in self.model_fields_set: - _dict['marketLatitude'] = None - - # set to None if market_longitude (nullable) is None - # and model_fields_set contains the field - if self.market_longitude is None and "market_longitude" in self.model_fields_set: - _dict['marketLongitude'] = None - - # set to None if admin1_name (nullable) is None - # and model_fields_set contains the field - if self.admin1_name is None and "admin1_name" in self.model_fields_set: - _dict['admin1Name'] = None - - # set to None if admin1_code (nullable) is None - # and model_fields_set contains the field - if self.admin1_code is None and "admin1_code" in self.model_fields_set: - _dict['admin1Code'] = None - - # set to None if admin2_name (nullable) is None - # and model_fields_set contains the field - if self.admin2_name is None and "admin2_name" in self.model_fields_set: - _dict['admin2Name'] = None - - # set to None if admin2_code (nullable) is None - # and model_fields_set contains the field - if self.admin2_code is None and "admin2_code" in self.model_fields_set: - _dict['admin2Code'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of MarketDTO from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "marketId": obj.get("marketId"), - "marketName": obj.get("marketName"), - "marketLocalName": obj.get("marketLocalName"), - "marketLatitude": obj.get("marketLatitude"), - "marketLongitude": obj.get("marketLongitude"), - "admin1Name": obj.get("admin1Name"), - "admin1Code": obj.get("admin1Code"), - "admin2Name": obj.get("admin2Name"), - "admin2Code": obj.get("admin2Code") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/market_geo_json_root.py b/data_bridges_client/models/market_geo_json_root.py deleted file mode 100644 index 8362e06..0000000 --- a/data_bridges_client/models/market_geo_json_root.py +++ /dev/null @@ -1,128 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from data_bridges_client.models.feature import Feature -from typing import Optional, Set -from typing_extensions import Self - -class MarketGeoJsonRoot(BaseModel): - """ - MarketGeoJsonRoot - """ # noqa: E501 - type: Optional[StrictStr] = None - features: Optional[List[Feature]] = None - bbox: Optional[Any] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "features", "bbox"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of MarketGeoJsonRoot from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in features (list) - _items = [] - if self.features: - for _item in self.features: - if _item: - _items.append(_item.to_dict()) - _dict['features'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if type (nullable) is None - # and model_fields_set contains the field - if self.type is None and "type" in self.model_fields_set: - _dict['type'] = None - - # set to None if features (nullable) is None - # and model_fields_set contains the field - if self.features is None and "features" in self.model_fields_set: - _dict['features'] = None - - # set to None if bbox (nullable) is None - # and model_fields_set contains the field - if self.bbox is None and "bbox" in self.model_fields_set: - _dict['bbox'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of MarketGeoJsonRoot from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type"), - "features": [Feature.from_dict(_item) for _item in obj["features"]] if obj.get("features") is not None else None, - "bbox": obj.get("bbox") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/mfi_processed_data_dto.py b/data_bridges_client/models/mfi_processed_data_dto.py deleted file mode 100644 index b05e10e..0000000 --- a/data_bridges_client/models/mfi_processed_data_dto.py +++ /dev/null @@ -1,232 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Union -from typing import Optional, Set -from typing_extensions import Self - -class MFIProcessedDataDTO(BaseModel): - """ - MFIProcessedDataDTO - """ # noqa: E501 - survey_id: Optional[StrictInt] = Field(default=None, description="The Id of the Survey", alias="surveyID") - start_date: Optional[datetime] = Field(default=None, description="The Id of the Survey status", alias="startDate") - end_date: Optional[datetime] = Field(default=None, alias="endDate") - market_id: Optional[StrictInt] = Field(default=None, alias="marketID") - market_name: Optional[StrictStr] = Field(default=None, alias="marketName") - market_latitude: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="marketLatitude") - market_longitude: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="marketLongitude") - regional_bureau_id: Optional[StrictInt] = Field(default=None, alias="regionalBureauID") - regional_bureau_name: Optional[StrictStr] = Field(default=None, alias="regionalBureauName") - adm0_code: Optional[StrictInt] = Field(default=None, alias="adm0Code") - adm0_name: Optional[StrictStr] = Field(default=None, alias="adm0Name") - adm1_code: Optional[StrictInt] = Field(default=None, alias="adm1Code") - adm1_name: Optional[StrictStr] = Field(default=None, alias="adm1Name") - adm2_code: Optional[StrictInt] = Field(default=None, alias="adm2Code") - adm2_name: Optional[StrictStr] = Field(default=None, alias="adm2Name") - level_id: Optional[StrictInt] = Field(default=None, alias="levelID") - level_name: Optional[StrictStr] = Field(default=None, alias="levelName") - dimension_id: Optional[StrictInt] = Field(default=None, alias="dimensionID") - dimension_name: Optional[StrictStr] = Field(default=None, alias="dimensionName") - variable_id: Optional[StrictInt] = Field(default=None, alias="variableID") - variable_name: Optional[StrictStr] = Field(default=None, alias="variableName") - variable_label: Optional[StrictStr] = Field(default=None, alias="variableLabel") - output_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="outputValue") - traders_sample_size: Optional[StrictInt] = Field(default=None, alias="tradersSampleSize") - base_xls_form_id: Optional[StrictInt] = Field(default=None, alias="baseXlsFormID") - base_xls_form_name: Optional[StrictStr] = Field(default=None, alias="baseXlsFormName") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["surveyID", "startDate", "endDate", "marketID", "marketName", "marketLatitude", "marketLongitude", "regionalBureauID", "regionalBureauName", "adm0Code", "adm0Name", "adm1Code", "adm1Name", "adm2Code", "adm2Name", "levelID", "levelName", "dimensionID", "dimensionName", "variableID", "variableName", "variableLabel", "outputValue", "tradersSampleSize", "baseXlsFormID", "baseXlsFormName"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of MFIProcessedDataDTO from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if start_date (nullable) is None - # and model_fields_set contains the field - if self.start_date is None and "start_date" in self.model_fields_set: - _dict['startDate'] = None - - # set to None if end_date (nullable) is None - # and model_fields_set contains the field - if self.end_date is None and "end_date" in self.model_fields_set: - _dict['endDate'] = None - - # set to None if market_name (nullable) is None - # and model_fields_set contains the field - if self.market_name is None and "market_name" in self.model_fields_set: - _dict['marketName'] = None - - # set to None if market_latitude (nullable) is None - # and model_fields_set contains the field - if self.market_latitude is None and "market_latitude" in self.model_fields_set: - _dict['marketLatitude'] = None - - # set to None if market_longitude (nullable) is None - # and model_fields_set contains the field - if self.market_longitude is None and "market_longitude" in self.model_fields_set: - _dict['marketLongitude'] = None - - # set to None if regional_bureau_name (nullable) is None - # and model_fields_set contains the field - if self.regional_bureau_name is None and "regional_bureau_name" in self.model_fields_set: - _dict['regionalBureauName'] = None - - # set to None if adm0_name (nullable) is None - # and model_fields_set contains the field - if self.adm0_name is None and "adm0_name" in self.model_fields_set: - _dict['adm0Name'] = None - - # set to None if adm1_name (nullable) is None - # and model_fields_set contains the field - if self.adm1_name is None and "adm1_name" in self.model_fields_set: - _dict['adm1Name'] = None - - # set to None if adm2_name (nullable) is None - # and model_fields_set contains the field - if self.adm2_name is None and "adm2_name" in self.model_fields_set: - _dict['adm2Name'] = None - - # set to None if level_name (nullable) is None - # and model_fields_set contains the field - if self.level_name is None and "level_name" in self.model_fields_set: - _dict['levelName'] = None - - # set to None if dimension_name (nullable) is None - # and model_fields_set contains the field - if self.dimension_name is None and "dimension_name" in self.model_fields_set: - _dict['dimensionName'] = None - - # set to None if variable_name (nullable) is None - # and model_fields_set contains the field - if self.variable_name is None and "variable_name" in self.model_fields_set: - _dict['variableName'] = None - - # set to None if variable_label (nullable) is None - # and model_fields_set contains the field - if self.variable_label is None and "variable_label" in self.model_fields_set: - _dict['variableLabel'] = None - - # set to None if output_value (nullable) is None - # and model_fields_set contains the field - if self.output_value is None and "output_value" in self.model_fields_set: - _dict['outputValue'] = None - - # set to None if traders_sample_size (nullable) is None - # and model_fields_set contains the field - if self.traders_sample_size is None and "traders_sample_size" in self.model_fields_set: - _dict['tradersSampleSize'] = None - - # set to None if base_xls_form_name (nullable) is None - # and model_fields_set contains the field - if self.base_xls_form_name is None and "base_xls_form_name" in self.model_fields_set: - _dict['baseXlsFormName'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of MFIProcessedDataDTO from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "surveyID": obj.get("surveyID"), - "startDate": obj.get("startDate"), - "endDate": obj.get("endDate"), - "marketID": obj.get("marketID"), - "marketName": obj.get("marketName"), - "marketLatitude": obj.get("marketLatitude"), - "marketLongitude": obj.get("marketLongitude"), - "regionalBureauID": obj.get("regionalBureauID"), - "regionalBureauName": obj.get("regionalBureauName"), - "adm0Code": obj.get("adm0Code"), - "adm0Name": obj.get("adm0Name"), - "adm1Code": obj.get("adm1Code"), - "adm1Name": obj.get("adm1Name"), - "adm2Code": obj.get("adm2Code"), - "adm2Name": obj.get("adm2Name"), - "levelID": obj.get("levelID"), - "levelName": obj.get("levelName"), - "dimensionID": obj.get("dimensionID"), - "dimensionName": obj.get("dimensionName"), - "variableID": obj.get("variableID"), - "variableName": obj.get("variableName"), - "variableLabel": obj.get("variableLabel"), - "outputValue": obj.get("outputValue"), - "tradersSampleSize": obj.get("tradersSampleSize"), - "baseXlsFormID": obj.get("baseXlsFormID"), - "baseXlsFormName": obj.get("baseXlsFormName") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/nearby_markets_dto.py b/data_bridges_client/models/nearby_markets_dto.py deleted file mode 100644 index 7517abe..0000000 --- a/data_bridges_client/models/nearby_markets_dto.py +++ /dev/null @@ -1,110 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Union -from typing import Optional, Set -from typing_extensions import Self - -class NearbyMarketsDTO(BaseModel): - """ - NearbyMarketsDTO - """ # noqa: E501 - market_id: Optional[StrictInt] = Field(default=None, description="The internal ID of the market", alias="marketId") - market_name: Optional[StrictStr] = Field(default=None, description="The name of the market", alias="marketName") - distance: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The distance in meters of the market from the provided point") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["marketId", "marketName", "distance"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of NearbyMarketsDTO from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if market_name (nullable) is None - # and model_fields_set contains the field - if self.market_name is None and "market_name" in self.model_fields_set: - _dict['marketName'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of NearbyMarketsDTO from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "marketId": obj.get("marketId"), - "marketName": obj.get("marketName"), - "distance": obj.get("distance") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/paged_commodity_list_dto.py b/data_bridges_client/models/paged_commodity_list_dto.py deleted file mode 100644 index bcb3922..0000000 --- a/data_bridges_client/models/paged_commodity_list_dto.py +++ /dev/null @@ -1,118 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from data_bridges_client.models.commodity_dto import CommodityDTO -from typing import Optional, Set -from typing_extensions import Self - -class PagedCommodityListDTO(BaseModel): - """ - PagedCommodityListDTO - """ # noqa: E501 - total_items: Optional[StrictInt] = Field(default=None, description="The total number of items", alias="totalItems") - page: Optional[StrictInt] = Field(default=None, description="The current page") - items: Optional[List[CommodityDTO]] = Field(default=None, description="The list of paged items") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["totalItems", "page", "items"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PagedCommodityListDTO from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in items (list) - _items = [] - if self.items: - for _item in self.items: - if _item: - _items.append(_item.to_dict()) - _dict['items'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if items (nullable) is None - # and model_fields_set contains the field - if self.items is None and "items" in self.model_fields_set: - _dict['items'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PagedCommodityListDTO from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "totalItems": obj.get("totalItems"), - "page": obj.get("page"), - "items": [CommodityDTO.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/paged_commodity_price_list_dto.py b/data_bridges_client/models/paged_commodity_price_list_dto.py deleted file mode 100644 index a576dec..0000000 --- a/data_bridges_client/models/paged_commodity_price_list_dto.py +++ /dev/null @@ -1,118 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from data_bridges_client.models.commodity_price_dto import CommodityPriceDTO -from typing import Optional, Set -from typing_extensions import Self - -class PagedCommodityPriceListDTO(BaseModel): - """ - PagedCommodityPriceListDTO - """ # noqa: E501 - total_items: Optional[StrictInt] = Field(default=None, description="The total number of items", alias="totalItems") - page: Optional[StrictInt] = Field(default=None, description="The current page") - items: Optional[List[CommodityPriceDTO]] = Field(default=None, description="The list of paged items") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["totalItems", "page", "items"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PagedCommodityPriceListDTO from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in items (list) - _items = [] - if self.items: - for _item in self.items: - if _item: - _items.append(_item.to_dict()) - _dict['items'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if items (nullable) is None - # and model_fields_set contains the field - if self.items is None and "items" in self.model_fields_set: - _dict['items'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PagedCommodityPriceListDTO from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "totalItems": obj.get("totalItems"), - "page": obj.get("page"), - "items": [CommodityPriceDTO.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/paged_commodity_weekly_aggregated_price_list_dto.py b/data_bridges_client/models/paged_commodity_weekly_aggregated_price_list_dto.py deleted file mode 100644 index 4dcaa8f..0000000 --- a/data_bridges_client/models/paged_commodity_weekly_aggregated_price_list_dto.py +++ /dev/null @@ -1,118 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from data_bridges_client.models.weekly_aggregated_price import WeeklyAggregatedPrice -from typing import Optional, Set -from typing_extensions import Self - -class PagedCommodityWeeklyAggregatedPriceListDTO(BaseModel): - """ - PagedCommodityWeeklyAggregatedPriceListDTO - """ # noqa: E501 - total_items: Optional[StrictInt] = Field(default=None, description="The total number of items", alias="totalItems") - page: Optional[StrictInt] = Field(default=None, description="The current page") - items: Optional[List[WeeklyAggregatedPrice]] = Field(default=None, description="The list of paged items") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["totalItems", "page", "items"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PagedCommodityWeeklyAggregatedPriceListDTO from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in items (list) - _items = [] - if self.items: - for _item in self.items: - if _item: - _items.append(_item.to_dict()) - _dict['items'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if items (nullable) is None - # and model_fields_set contains the field - if self.items is None and "items" in self.model_fields_set: - _dict['items'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PagedCommodityWeeklyAggregatedPriceListDTO from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "totalItems": obj.get("totalItems"), - "page": obj.get("page"), - "items": [WeeklyAggregatedPrice.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/paged_currency_list_dto.py b/data_bridges_client/models/paged_currency_list_dto.py deleted file mode 100644 index d467efd..0000000 --- a/data_bridges_client/models/paged_currency_list_dto.py +++ /dev/null @@ -1,118 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from data_bridges_client.models.currency_dto import CurrencyDTO -from typing import Optional, Set -from typing_extensions import Self - -class PagedCurrencyListDTO(BaseModel): - """ - PagedCurrencyListDTO - """ # noqa: E501 - total_items: Optional[StrictInt] = Field(default=None, description="The total number of items", alias="totalItems") - page: Optional[StrictInt] = Field(default=None, description="The current page") - items: Optional[List[CurrencyDTO]] = Field(default=None, description="The list of paged items") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["totalItems", "page", "items"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PagedCurrencyListDTO from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in items (list) - _items = [] - if self.items: - for _item in self.items: - if _item: - _items.append(_item.to_dict()) - _dict['items'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if items (nullable) is None - # and model_fields_set contains the field - if self.items is None and "items" in self.model_fields_set: - _dict['items'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PagedCurrencyListDTO from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "totalItems": obj.get("totalItems"), - "page": obj.get("page"), - "items": [CurrencyDTO.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/paged_economic_data_dto.py b/data_bridges_client/models/paged_economic_data_dto.py deleted file mode 100644 index dbc3c79..0000000 --- a/data_bridges_client/models/paged_economic_data_dto.py +++ /dev/null @@ -1,139 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from data_bridges_client.models.economic_data_dto import EconomicDataDTO -from typing import Optional, Set -from typing_extensions import Self - -class PagedEconomicDataDTO(BaseModel): - """ - PagedEconomicDataDTO - """ # noqa: E501 - total_items: Optional[StrictInt] = Field(default=None, description="The total number of items", alias="totalItems") - page: Optional[StrictInt] = Field(default=None, description="The current page") - unit: Optional[StrictStr] = None - frequency: Optional[StrictStr] = None - data_source: Optional[StrictStr] = Field(default=None, alias="dataSource") - items: Optional[List[EconomicDataDTO]] = Field(default=None, description="The list of paged items") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["totalItems", "page", "unit", "frequency", "dataSource", "items"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PagedEconomicDataDTO from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in items (list) - _items = [] - if self.items: - for _item in self.items: - if _item: - _items.append(_item.to_dict()) - _dict['items'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if unit (nullable) is None - # and model_fields_set contains the field - if self.unit is None and "unit" in self.model_fields_set: - _dict['unit'] = None - - # set to None if frequency (nullable) is None - # and model_fields_set contains the field - if self.frequency is None and "frequency" in self.model_fields_set: - _dict['frequency'] = None - - # set to None if data_source (nullable) is None - # and model_fields_set contains the field - if self.data_source is None and "data_source" in self.model_fields_set: - _dict['dataSource'] = None - - # set to None if items (nullable) is None - # and model_fields_set contains the field - if self.items is None and "items" in self.model_fields_set: - _dict['items'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PagedEconomicDataDTO from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "totalItems": obj.get("totalItems"), - "page": obj.get("page"), - "unit": obj.get("unit"), - "frequency": obj.get("frequency"), - "dataSource": obj.get("dataSource"), - "items": [EconomicDataDTO.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/paged_market_list_dto.py b/data_bridges_client/models/paged_market_list_dto.py deleted file mode 100644 index 5c47bf3..0000000 --- a/data_bridges_client/models/paged_market_list_dto.py +++ /dev/null @@ -1,118 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from data_bridges_client.models.market_dto import MarketDTO -from typing import Optional, Set -from typing_extensions import Self - -class PagedMarketListDTO(BaseModel): - """ - PagedMarketListDTO - """ # noqa: E501 - total_items: Optional[StrictInt] = Field(default=None, description="The total number of items", alias="totalItems") - page: Optional[StrictInt] = Field(default=None, description="The current page") - items: Optional[List[MarketDTO]] = Field(default=None, description="The list of markets") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["totalItems", "page", "items"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PagedMarketListDTO from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in items (list) - _items = [] - if self.items: - for _item in self.items: - if _item: - _items.append(_item.to_dict()) - _dict['items'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if items (nullable) is None - # and model_fields_set contains the field - if self.items is None and "items" in self.model_fields_set: - _dict['items'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PagedMarketListDTO from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "totalItems": obj.get("totalItems"), - "page": obj.get("page"), - "items": [MarketDTO.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/paged_processed_data_dto.py b/data_bridges_client/models/paged_processed_data_dto.py deleted file mode 100644 index e94b534..0000000 --- a/data_bridges_client/models/paged_processed_data_dto.py +++ /dev/null @@ -1,118 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from data_bridges_client.models.mfi_processed_data_dto import MFIProcessedDataDTO -from typing import Optional, Set -from typing_extensions import Self - -class PagedProcessedDataDTO(BaseModel): - """ - PagedProcessedDataDTO - """ # noqa: E501 - total_items: Optional[StrictInt] = Field(default=None, description="The total number of items", alias="totalItems") - page: Optional[StrictInt] = Field(default=None, description="The current page") - items: Optional[List[MFIProcessedDataDTO]] = Field(default=None, description="The list of processed data") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["totalItems", "page", "items"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PagedProcessedDataDTO from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in items (list) - _items = [] - if self.items: - for _item in self.items: - if _item: - _items.append(_item.to_dict()) - _dict['items'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if items (nullable) is None - # and model_fields_set contains the field - if self.items is None and "items" in self.model_fields_set: - _dict['items'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PagedProcessedDataDTO from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "totalItems": obj.get("totalItems"), - "page": obj.get("page"), - "items": [MFIProcessedDataDTO.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/paged_survey_list_dto.py b/data_bridges_client/models/paged_survey_list_dto.py deleted file mode 100644 index e29021b..0000000 --- a/data_bridges_client/models/paged_survey_list_dto.py +++ /dev/null @@ -1,118 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from data_bridges_client.models.survey_list_dto import SurveyListDTO -from typing import Optional, Set -from typing_extensions import Self - -class PagedSurveyListDTO(BaseModel): - """ - PagedSurveyListDTO - """ # noqa: E501 - total_items: Optional[StrictInt] = Field(default=None, description="The total number of items", alias="totalItems") - page: Optional[StrictInt] = Field(default=None, description="The current page") - items: Optional[List[SurveyListDTO]] = Field(default=None, description="The list of surveys") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["totalItems", "page", "items"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PagedSurveyListDTO from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in items (list) - _items = [] - if self.items: - for _item in self.items: - if _item: - _items.append(_item.to_dict()) - _dict['items'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if items (nullable) is None - # and model_fields_set contains the field - if self.items is None and "items" in self.model_fields_set: - _dict['items'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PagedSurveyListDTO from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "totalItems": obj.get("totalItems"), - "page": obj.get("page"), - "items": [SurveyListDTO.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/paged_survey_responses_dto.py b/data_bridges_client/models/paged_survey_responses_dto.py deleted file mode 100644 index 3307d6e..0000000 --- a/data_bridges_client/models/paged_survey_responses_dto.py +++ /dev/null @@ -1,110 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class PagedSurveyResponsesDTO(BaseModel): - """ - PagedSurveyResponsesDTO - """ # noqa: E501 - total_items: Optional[StrictInt] = Field(default=None, description="The total number of responses", alias="totalItems") - page: Optional[StrictInt] = Field(default=None, description="The current page") - items: Optional[List[Any]] = Field(default=None, description="The list of survey responses") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["totalItems", "page", "items"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PagedSurveyResponsesDTO from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if items (nullable) is None - # and model_fields_set contains the field - if self.items is None and "items" in self.model_fields_set: - _dict['items'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PagedSurveyResponsesDTO from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "totalItems": obj.get("totalItems"), - "page": obj.get("page"), - "items": obj.get("items") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/paged_xls_form_list_dto.py b/data_bridges_client/models/paged_xls_form_list_dto.py deleted file mode 100644 index ae357c4..0000000 --- a/data_bridges_client/models/paged_xls_form_list_dto.py +++ /dev/null @@ -1,118 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from data_bridges_client.models.xls_form_dto import XlsFormDTO -from typing import Optional, Set -from typing_extensions import Self - -class PagedXlsFormListDTO(BaseModel): - """ - PagedXlsFormListDTO - """ # noqa: E501 - total_items: Optional[StrictInt] = Field(default=None, description="The total number of items", alias="totalItems") - page: Optional[StrictInt] = Field(default=None, description="The current page") - items: Optional[List[XlsFormDTO]] = Field(default=None, description="The list of XlsForms") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["totalItems", "page", "items"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PagedXlsFormListDTO from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in items (list) - _items = [] - if self.items: - for _item in self.items: - if _item: - _items.append(_item.to_dict()) - _dict['items'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if items (nullable) is None - # and model_fields_set contains the field - if self.items is None and "items" in self.model_fields_set: - _dict['items'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PagedXlsFormListDTO from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "totalItems": obj.get("totalItems"), - "page": obj.get("page"), - "items": [XlsFormDTO.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/problem_details.py b/data_bridges_client/models/problem_details.py deleted file mode 100644 index 6541400..0000000 --- a/data_bridges_client/models/problem_details.py +++ /dev/null @@ -1,134 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class ProblemDetails(BaseModel): - """ - ProblemDetails - """ # noqa: E501 - type: Optional[StrictStr] = None - title: Optional[StrictStr] = None - status: Optional[StrictInt] = None - detail: Optional[StrictStr] = None - instance: Optional[StrictStr] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "title", "status", "detail", "instance"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProblemDetails from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if type (nullable) is None - # and model_fields_set contains the field - if self.type is None and "type" in self.model_fields_set: - _dict['type'] = None - - # set to None if title (nullable) is None - # and model_fields_set contains the field - if self.title is None and "title" in self.model_fields_set: - _dict['title'] = None - - # set to None if status (nullable) is None - # and model_fields_set contains the field - if self.status is None and "status" in self.model_fields_set: - _dict['status'] = None - - # set to None if detail (nullable) is None - # and model_fields_set contains the field - if self.detail is None and "detail" in self.model_fields_set: - _dict['detail'] = None - - # set to None if instance (nullable) is None - # and model_fields_set contains the field - if self.instance is None and "instance" in self.model_fields_set: - _dict['instance'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProblemDetails from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type"), - "title": obj.get("title"), - "status": obj.get("status"), - "detail": obj.get("detail"), - "instance": obj.get("instance") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/properties.py b/data_bridges_client/models/properties.py deleted file mode 100644 index 12203b2..0000000 --- a/data_bridges_client/models/properties.py +++ /dev/null @@ -1,106 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class Properties(BaseModel): - """ - Properties - """ # noqa: E501 - name: Optional[StrictStr] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["name"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Properties from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if name (nullable) is None - # and model_fields_set contains the field - if self.name is None and "name" in self.model_fields_set: - _dict['name'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Properties from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "name": obj.get("name") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/rpme_assessment.py b/data_bridges_client/models/rpme_assessment.py deleted file mode 100644 index cd69ddd..0000000 --- a/data_bridges_client/models/rpme_assessment.py +++ /dev/null @@ -1,203 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Union -from data_bridges_client.models.rpme_output_values import RpmeOutputValues -from typing import Optional, Set -from typing_extensions import Self - -class RpmeAssessment(BaseModel): - """ - RpmeAssessment - """ # noqa: E501 - survey_id: Optional[StrictInt] = Field(default=None, alias="surveyId") - assessment_date: Optional[datetime] = Field(default=None, alias="assessmentDate") - shop_id: Optional[StrictInt] = Field(default=None, alias="shopId") - adm0_code: Optional[StrictInt] = Field(default=None, alias="adm0Code") - adm1_code: Optional[StrictInt] = Field(default=None, alias="adm1Code") - adm2_code: Optional[StrictInt] = Field(default=None, alias="adm2Code") - adm0_code_dots: Optional[StrictStr] = Field(default=None, alias="adm0CodeDOTS") - adm1_code_dots: Optional[StrictStr] = Field(default=None, alias="adm1CodeDOTS") - adm2_code_dots: Optional[StrictStr] = Field(default=None, alias="adm2CodeDOTS") - market_id: Optional[StrictInt] = Field(default=None, alias="marketId") - sh_latitude: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="shLatitude") - sh_longitude: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="shLongitude") - nb_beneficiaries_interviewed: Optional[StrictInt] = Field(default=None, alias="nbBeneficiariesInterviewed") - price_score_tbu: Optional[StrictBool] = Field(default=None, alias="priceScoreTbu") - price_score_tbd: Optional[StrictBool] = Field(default=None, alias="priceScoreTbd") - beneficiaries_score_tbu: Optional[StrictBool] = Field(default=None, alias="beneficiariesScoreTbu") - trd_name: Optional[StrictStr] = Field(default=None, alias="trdName") - sev_cntr_dev: Optional[StrictStr] = Field(default=None, alias="sevCntrDev") - ben_sev_cntr_dev: Optional[StrictStr] = Field(default=None, alias="benSevCntrDev") - output_values: Optional[List[RpmeOutputValues]] = Field(default=None, alias="outputValues") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["surveyId", "assessmentDate", "shopId", "adm0Code", "adm1Code", "adm2Code", "adm0CodeDOTS", "adm1CodeDOTS", "adm2CodeDOTS", "marketId", "shLatitude", "shLongitude", "nbBeneficiariesInterviewed", "priceScoreTbu", "priceScoreTbd", "beneficiariesScoreTbu", "trdName", "sevCntrDev", "benSevCntrDev", "outputValues"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of RpmeAssessment from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in output_values (list) - _items = [] - if self.output_values: - for _item in self.output_values: - if _item: - _items.append(_item.to_dict()) - _dict['outputValues'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if adm0_code_dots (nullable) is None - # and model_fields_set contains the field - if self.adm0_code_dots is None and "adm0_code_dots" in self.model_fields_set: - _dict['adm0CodeDOTS'] = None - - # set to None if adm1_code_dots (nullable) is None - # and model_fields_set contains the field - if self.adm1_code_dots is None and "adm1_code_dots" in self.model_fields_set: - _dict['adm1CodeDOTS'] = None - - # set to None if adm2_code_dots (nullable) is None - # and model_fields_set contains the field - if self.adm2_code_dots is None and "adm2_code_dots" in self.model_fields_set: - _dict['adm2CodeDOTS'] = None - - # set to None if market_id (nullable) is None - # and model_fields_set contains the field - if self.market_id is None and "market_id" in self.model_fields_set: - _dict['marketId'] = None - - # set to None if sh_latitude (nullable) is None - # and model_fields_set contains the field - if self.sh_latitude is None and "sh_latitude" in self.model_fields_set: - _dict['shLatitude'] = None - - # set to None if sh_longitude (nullable) is None - # and model_fields_set contains the field - if self.sh_longitude is None and "sh_longitude" in self.model_fields_set: - _dict['shLongitude'] = None - - # set to None if nb_beneficiaries_interviewed (nullable) is None - # and model_fields_set contains the field - if self.nb_beneficiaries_interviewed is None and "nb_beneficiaries_interviewed" in self.model_fields_set: - _dict['nbBeneficiariesInterviewed'] = None - - # set to None if trd_name (nullable) is None - # and model_fields_set contains the field - if self.trd_name is None and "trd_name" in self.model_fields_set: - _dict['trdName'] = None - - # set to None if sev_cntr_dev (nullable) is None - # and model_fields_set contains the field - if self.sev_cntr_dev is None and "sev_cntr_dev" in self.model_fields_set: - _dict['sevCntrDev'] = None - - # set to None if ben_sev_cntr_dev (nullable) is None - # and model_fields_set contains the field - if self.ben_sev_cntr_dev is None and "ben_sev_cntr_dev" in self.model_fields_set: - _dict['benSevCntrDev'] = None - - # set to None if output_values (nullable) is None - # and model_fields_set contains the field - if self.output_values is None and "output_values" in self.model_fields_set: - _dict['outputValues'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of RpmeAssessment from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "surveyId": obj.get("surveyId"), - "assessmentDate": obj.get("assessmentDate"), - "shopId": obj.get("shopId"), - "adm0Code": obj.get("adm0Code"), - "adm1Code": obj.get("adm1Code"), - "adm2Code": obj.get("adm2Code"), - "adm0CodeDOTS": obj.get("adm0CodeDOTS"), - "adm1CodeDOTS": obj.get("adm1CodeDOTS"), - "adm2CodeDOTS": obj.get("adm2CodeDOTS"), - "marketId": obj.get("marketId"), - "shLatitude": obj.get("shLatitude"), - "shLongitude": obj.get("shLongitude"), - "nbBeneficiariesInterviewed": obj.get("nbBeneficiariesInterviewed"), - "priceScoreTbu": obj.get("priceScoreTbu"), - "priceScoreTbd": obj.get("priceScoreTbd"), - "beneficiariesScoreTbu": obj.get("beneficiariesScoreTbu"), - "trdName": obj.get("trdName"), - "sevCntrDev": obj.get("sevCntrDev"), - "benSevCntrDev": obj.get("benSevCntrDev"), - "outputValues": [RpmeOutputValues.from_dict(_item) for _item in obj["outputValues"]] if obj.get("outputValues") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/rpme_assessment_paged_result.py b/data_bridges_client/models/rpme_assessment_paged_result.py deleted file mode 100644 index 7d993bc..0000000 --- a/data_bridges_client/models/rpme_assessment_paged_result.py +++ /dev/null @@ -1,120 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from data_bridges_client.models.rpme_assessment import RpmeAssessment -from typing import Optional, Set -from typing_extensions import Self - -class RpmeAssessmentPagedResult(BaseModel): - """ - RpmeAssessmentPagedResult - """ # noqa: E501 - items: Optional[List[RpmeAssessment]] = None - page: Optional[StrictInt] = None - total_items: Optional[StrictInt] = Field(default=None, alias="totalItems") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["items", "page", "totalItems"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of RpmeAssessmentPagedResult from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * OpenAPI `readOnly` fields are excluded. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "items", - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in items (list) - _items = [] - if self.items: - for _item in self.items: - if _item: - _items.append(_item.to_dict()) - _dict['items'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if items (nullable) is None - # and model_fields_set contains the field - if self.items is None and "items" in self.model_fields_set: - _dict['items'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of RpmeAssessmentPagedResult from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "items": [RpmeAssessment.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None, - "page": obj.get("page"), - "totalItems": obj.get("totalItems") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/rpme_output_values.py b/data_bridges_client/models/rpme_output_values.py deleted file mode 100644 index ba41cfa..0000000 --- a/data_bridges_client/models/rpme_output_values.py +++ /dev/null @@ -1,108 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Optional, Union -from typing import Optional, Set -from typing_extensions import Self - -class RpmeOutputValues(BaseModel): - """ - RpmeOutputValues - """ # noqa: E501 - variable_id: Optional[StrictInt] = Field(default=None, alias="variableId") - output_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="outputValue") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["variableId", "outputValue"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of RpmeOutputValues from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if output_value (nullable) is None - # and model_fields_set contains the field - if self.output_value is None and "output_value" in self.model_fields_set: - _dict['outputValue'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of RpmeOutputValues from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "variableId": obj.get("variableId"), - "outputValue": obj.get("outputValue") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/rpme_variable.py b/data_bridges_client/models/rpme_variable.py deleted file mode 100644 index 3259475..0000000 --- a/data_bridges_client/models/rpme_variable.py +++ /dev/null @@ -1,142 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class RpmeVariable(BaseModel): - """ - RpmeVariable - """ # noqa: E501 - variable_id: Optional[StrictInt] = Field(default=None, alias="variableId") - variable_name: Optional[StrictStr] = Field(default=None, alias="variableName") - variable_description: Optional[StrictStr] = Field(default=None, alias="variableDescription") - dimension_id: Optional[StrictInt] = Field(default=None, alias="dimensionId") - dimension_name: Optional[StrictStr] = Field(default=None, alias="dimensionName") - level_id: Optional[StrictInt] = Field(default=None, alias="levelId") - level_name: Optional[StrictStr] = Field(default=None, alias="levelName") - survey_mode_id: Optional[StrictInt] = Field(default=None, alias="surveyModeId") - survey_mode_name: Optional[StrictStr] = Field(default=None, alias="surveyModeName") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["variableId", "variableName", "variableDescription", "dimensionId", "dimensionName", "levelId", "levelName", "surveyModeId", "surveyModeName"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of RpmeVariable from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if variable_name (nullable) is None - # and model_fields_set contains the field - if self.variable_name is None and "variable_name" in self.model_fields_set: - _dict['variableName'] = None - - # set to None if variable_description (nullable) is None - # and model_fields_set contains the field - if self.variable_description is None and "variable_description" in self.model_fields_set: - _dict['variableDescription'] = None - - # set to None if dimension_name (nullable) is None - # and model_fields_set contains the field - if self.dimension_name is None and "dimension_name" in self.model_fields_set: - _dict['dimensionName'] = None - - # set to None if level_name (nullable) is None - # and model_fields_set contains the field - if self.level_name is None and "level_name" in self.model_fields_set: - _dict['levelName'] = None - - # set to None if survey_mode_name (nullable) is None - # and model_fields_set contains the field - if self.survey_mode_name is None and "survey_mode_name" in self.model_fields_set: - _dict['surveyModeName'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of RpmeVariable from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "variableId": obj.get("variableId"), - "variableName": obj.get("variableName"), - "variableDescription": obj.get("variableDescription"), - "dimensionId": obj.get("dimensionId"), - "dimensionName": obj.get("dimensionName"), - "levelId": obj.get("levelId"), - "levelName": obj.get("levelName"), - "surveyModeId": obj.get("surveyModeId"), - "surveyModeName": obj.get("surveyModeName") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/rpme_variable_paged_result.py b/data_bridges_client/models/rpme_variable_paged_result.py deleted file mode 100644 index 77412ae..0000000 --- a/data_bridges_client/models/rpme_variable_paged_result.py +++ /dev/null @@ -1,120 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from data_bridges_client.models.rpme_variable import RpmeVariable -from typing import Optional, Set -from typing_extensions import Self - -class RpmeVariablePagedResult(BaseModel): - """ - RpmeVariablePagedResult - """ # noqa: E501 - items: Optional[List[RpmeVariable]] = None - page: Optional[StrictInt] = None - total_items: Optional[StrictInt] = Field(default=None, alias="totalItems") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["items", "page", "totalItems"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of RpmeVariablePagedResult from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * OpenAPI `readOnly` fields are excluded. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "items", - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in items (list) - _items = [] - if self.items: - for _item in self.items: - if _item: - _items.append(_item.to_dict()) - _dict['items'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if items (nullable) is None - # and model_fields_set contains the field - if self.items is None and "items" in self.model_fields_set: - _dict['items'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of RpmeVariablePagedResult from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "items": [RpmeVariable.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None, - "page": obj.get("page"), - "totalItems": obj.get("totalItems") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/survey_list_dto.py b/data_bridges_client/models/survey_list_dto.py deleted file mode 100644 index 53c9111..0000000 --- a/data_bridges_client/models/survey_list_dto.py +++ /dev/null @@ -1,186 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self - -class SurveyListDTO(BaseModel): - """ - SurveyListDTO - """ # noqa: E501 - survey_id: Optional[StrictInt] = Field(default=None, description="The Id of the Survey", alias="surveyID") - survey_status_id: Optional[StrictInt] = Field(default=None, description="The Id of the Survey status", alias="surveyStatusID") - survey_start_date: Optional[datetime] = Field(default=None, description="The date when the survey has started", alias="surveyStartDate") - survey_end_date: Optional[datetime] = Field(default=None, description="The date when the survey has ended", alias="surveyEndDate") - survey_create_date: Optional[datetime] = Field(default=None, description="The date when the survey has been uploaded in the Data Bridges platform", alias="surveyCreateDate") - survey_validation_report: Optional[StrictStr] = Field(default=None, description="The detailed report on the validation performed on the survey schema", alias="surveyValidationReport") - survey_original_filename: Optional[Annotated[str, Field(min_length=0, strict=True, max_length=256)]] = Field(default=None, description="The filename of the survey CSV file", alias="surveyOriginalFilename") - xls_form_name: Optional[StrictStr] = Field(default=None, description="The name of the XLSForm used to collect data", alias="xlsFormName") - base_xls_form_name: Optional[StrictStr] = Field(default=None, description="The name of the base XLSForm used to build the XLSForm", alias="baseXlsFormName") - country_name: Optional[StrictStr] = Field(default=None, description="The name of the country where the survey has taken place", alias="countryName") - adm0_code: Optional[StrictInt] = Field(default=None, description="The internal code of the country where the survey has taken place", alias="adm0Code") - iso3_alpha3: Optional[StrictStr] = Field(default=None, description="The ISO3 alpha code of the country where the survey has taken place", alias="iso3Alpha3") - user_name: Optional[StrictStr] = Field(default=None, description="The name of the user that has uploaded the survey data", alias="userName") - original_csv_file: Optional[StrictStr] = Field(default=None, description="The link to download the original CSV file", alias="originalCsvFile") - base_data: Optional[StrictStr] = Field(default=None, description="The link to the JSON data reshaped on the base XLSForm", alias="baseData") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["surveyID", "surveyStatusID", "surveyStartDate", "surveyEndDate", "surveyCreateDate", "surveyValidationReport", "surveyOriginalFilename", "xlsFormName", "baseXlsFormName", "countryName", "adm0Code", "iso3Alpha3", "userName", "originalCsvFile", "baseData"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SurveyListDTO from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if survey_start_date (nullable) is None - # and model_fields_set contains the field - if self.survey_start_date is None and "survey_start_date" in self.model_fields_set: - _dict['surveyStartDate'] = None - - # set to None if survey_end_date (nullable) is None - # and model_fields_set contains the field - if self.survey_end_date is None and "survey_end_date" in self.model_fields_set: - _dict['surveyEndDate'] = None - - # set to None if survey_validation_report (nullable) is None - # and model_fields_set contains the field - if self.survey_validation_report is None and "survey_validation_report" in self.model_fields_set: - _dict['surveyValidationReport'] = None - - # set to None if survey_original_filename (nullable) is None - # and model_fields_set contains the field - if self.survey_original_filename is None and "survey_original_filename" in self.model_fields_set: - _dict['surveyOriginalFilename'] = None - - # set to None if xls_form_name (nullable) is None - # and model_fields_set contains the field - if self.xls_form_name is None and "xls_form_name" in self.model_fields_set: - _dict['xlsFormName'] = None - - # set to None if base_xls_form_name (nullable) is None - # and model_fields_set contains the field - if self.base_xls_form_name is None and "base_xls_form_name" in self.model_fields_set: - _dict['baseXlsFormName'] = None - - # set to None if country_name (nullable) is None - # and model_fields_set contains the field - if self.country_name is None and "country_name" in self.model_fields_set: - _dict['countryName'] = None - - # set to None if iso3_alpha3 (nullable) is None - # and model_fields_set contains the field - if self.iso3_alpha3 is None and "iso3_alpha3" in self.model_fields_set: - _dict['iso3Alpha3'] = None - - # set to None if user_name (nullable) is None - # and model_fields_set contains the field - if self.user_name is None and "user_name" in self.model_fields_set: - _dict['userName'] = None - - # set to None if original_csv_file (nullable) is None - # and model_fields_set contains the field - if self.original_csv_file is None and "original_csv_file" in self.model_fields_set: - _dict['originalCsvFile'] = None - - # set to None if base_data (nullable) is None - # and model_fields_set contains the field - if self.base_data is None and "base_data" in self.model_fields_set: - _dict['baseData'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SurveyListDTO from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "surveyID": obj.get("surveyID"), - "surveyStatusID": obj.get("surveyStatusID"), - "surveyStartDate": obj.get("surveyStartDate"), - "surveyEndDate": obj.get("surveyEndDate"), - "surveyCreateDate": obj.get("surveyCreateDate"), - "surveyValidationReport": obj.get("surveyValidationReport"), - "surveyOriginalFilename": obj.get("surveyOriginalFilename"), - "xlsFormName": obj.get("xlsFormName"), - "baseXlsFormName": obj.get("baseXlsFormName"), - "countryName": obj.get("countryName"), - "adm0Code": obj.get("adm0Code"), - "iso3Alpha3": obj.get("iso3Alpha3"), - "userName": obj.get("userName"), - "originalCsvFile": obj.get("originalCsvFile"), - "baseData": obj.get("baseData") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/usd_indirect_quotation.py b/data_bridges_client/models/usd_indirect_quotation.py deleted file mode 100644 index d5a6670..0000000 --- a/data_bridges_client/models/usd_indirect_quotation.py +++ /dev/null @@ -1,136 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Union -from typing import Optional, Set -from typing_extensions import Self - -class UsdIndirectQuotation(BaseModel): - """ - UsdIndirectQuotation - """ # noqa: E501 - id: Optional[StrictInt] = None - name: Optional[StrictStr] = Field(default=None, description="the ISO3 code for the currency, based on ISO4217") - adm0_code: Optional[StrictInt] = Field(default=None, alias="adm0Code") - country_iso3: Optional[StrictStr] = Field(default=None, alias="countryISO3") - is_official: Optional[StrictBool] = Field(default=None, description="The field IsOfficial is a boolean which can be set to true for the Trading Economics data and to false for the data coming from a commodity saved in the DataBridges database", alias="isOfficial") - frequency: Optional[StrictStr] = Field(default=None, description="(it’s from the reporting commodity named Exchange Rate") - value: Optional[Union[StrictFloat, StrictInt]] = None - var_date: Optional[datetime] = Field(default=None, alias="date") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["id", "name", "adm0Code", "countryISO3", "isOfficial", "frequency", "value", "date"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UsdIndirectQuotation from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if name (nullable) is None - # and model_fields_set contains the field - if self.name is None and "name" in self.model_fields_set: - _dict['name'] = None - - # set to None if country_iso3 (nullable) is None - # and model_fields_set contains the field - if self.country_iso3 is None and "country_iso3" in self.model_fields_set: - _dict['countryISO3'] = None - - # set to None if frequency (nullable) is None - # and model_fields_set contains the field - if self.frequency is None and "frequency" in self.model_fields_set: - _dict['frequency'] = None - - # set to None if value (nullable) is None - # and model_fields_set contains the field - if self.value is None and "value" in self.model_fields_set: - _dict['value'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UsdIndirectQuotation from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "name": obj.get("name"), - "adm0Code": obj.get("adm0Code"), - "countryISO3": obj.get("countryISO3"), - "isOfficial": obj.get("isOfficial"), - "frequency": obj.get("frequency"), - "value": obj.get("value"), - "date": obj.get("date") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/usd_indirect_quotation_paged_result.py b/data_bridges_client/models/usd_indirect_quotation_paged_result.py deleted file mode 100644 index f8a6067..0000000 --- a/data_bridges_client/models/usd_indirect_quotation_paged_result.py +++ /dev/null @@ -1,120 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from data_bridges_client.models.usd_indirect_quotation import UsdIndirectQuotation -from typing import Optional, Set -from typing_extensions import Self - -class UsdIndirectQuotationPagedResult(BaseModel): - """ - UsdIndirectQuotationPagedResult - """ # noqa: E501 - items: Optional[List[UsdIndirectQuotation]] = None - page: Optional[StrictInt] = None - total_items: Optional[StrictInt] = Field(default=None, alias="totalItems") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["items", "page", "totalItems"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UsdIndirectQuotationPagedResult from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * OpenAPI `readOnly` fields are excluded. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "items", - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in items (list) - _items = [] - if self.items: - for _item in self.items: - if _item: - _items.append(_item.to_dict()) - _dict['items'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if items (nullable) is None - # and model_fields_set contains the field - if self.items is None and "items" in self.model_fields_set: - _dict['items'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UsdIndirectQuotationPagedResult from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "items": [UsdIndirectQuotation.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None, - "page": obj.get("page"), - "totalItems": obj.get("totalItems") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/view_extended_aggregated_price.py b/data_bridges_client/models/view_extended_aggregated_price.py deleted file mode 100644 index 0f72977..0000000 --- a/data_bridges_client/models/view_extended_aggregated_price.py +++ /dev/null @@ -1,229 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Union -from typing import Optional, Set -from typing_extensions import Self - -class ViewExtendedAggregatedPrice(BaseModel): - """ - ViewExtendedAggregatedPrice - """ # noqa: E501 - commodity_id: Optional[StrictInt] = Field(default=None, alias="commodityID") - market_id: Optional[StrictInt] = Field(default=None, alias="marketID") - price_type_id: Optional[StrictInt] = Field(default=None, alias="priceTypeID") - commodity_unit_id: Optional[StrictInt] = Field(default=None, alias="commodityUnitID") - currency_id: Optional[StrictInt] = Field(default=None, alias="currencyID") - adm0_code: Optional[StrictInt] = Field(default=None, alias="adm0Code") - commodity_date_week: Optional[StrictInt] = Field(default=None, alias="commodityDateWeek") - commodity_date_month: Optional[StrictInt] = Field(default=None, alias="commodityDateMonth") - commodity_date_year: Optional[StrictInt] = Field(default=None, alias="commodityDateYear") - commodity_price_date: Optional[datetime] = Field(default=None, alias="commodityPriceDate") - commodity_name: Optional[StrictStr] = Field(default=None, alias="commodityName") - market_name: Optional[StrictStr] = Field(default=None, alias="marketName") - price_type_name: Optional[StrictStr] = Field(default=None, alias="priceTypeName") - commodity_unit_name: Optional[StrictStr] = Field(default=None, alias="commodityUnitName") - currency_name: Optional[StrictStr] = Field(default=None, alias="currencyName") - country_iso3: Optional[StrictStr] = Field(default=None, alias="countryISO3") - country_name: Optional[StrictStr] = Field(default=None, alias="countryName") - commodity_price_source_name: Optional[StrictStr] = Field(default=None, alias="commodityPriceSourceName") - original_frequency: Optional[StrictStr] = Field(default=None, alias="originalFrequency") - commodity_price: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="commodityPrice") - commodity_price_observations: Optional[StrictInt] = Field(default=None, alias="commodityPriceObservations") - commodity_price_flag: Optional[StrictStr] = Field(default=None, alias="commodityPriceFlag") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["commodityID", "marketID", "priceTypeID", "commodityUnitID", "currencyID", "adm0Code", "commodityDateWeek", "commodityDateMonth", "commodityDateYear", "commodityPriceDate", "commodityName", "marketName", "priceTypeName", "commodityUnitName", "currencyName", "countryISO3", "countryName", "commodityPriceSourceName", "originalFrequency", "commodityPrice", "commodityPriceObservations", "commodityPriceFlag"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ViewExtendedAggregatedPrice from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if adm0_code (nullable) is None - # and model_fields_set contains the field - if self.adm0_code is None and "adm0_code" in self.model_fields_set: - _dict['adm0Code'] = None - - # set to None if commodity_date_week (nullable) is None - # and model_fields_set contains the field - if self.commodity_date_week is None and "commodity_date_week" in self.model_fields_set: - _dict['commodityDateWeek'] = None - - # set to None if commodity_date_month (nullable) is None - # and model_fields_set contains the field - if self.commodity_date_month is None and "commodity_date_month" in self.model_fields_set: - _dict['commodityDateMonth'] = None - - # set to None if commodity_date_year (nullable) is None - # and model_fields_set contains the field - if self.commodity_date_year is None and "commodity_date_year" in self.model_fields_set: - _dict['commodityDateYear'] = None - - # set to None if commodity_price_date (nullable) is None - # and model_fields_set contains the field - if self.commodity_price_date is None and "commodity_price_date" in self.model_fields_set: - _dict['commodityPriceDate'] = None - - # set to None if commodity_name (nullable) is None - # and model_fields_set contains the field - if self.commodity_name is None and "commodity_name" in self.model_fields_set: - _dict['commodityName'] = None - - # set to None if market_name (nullable) is None - # and model_fields_set contains the field - if self.market_name is None and "market_name" in self.model_fields_set: - _dict['marketName'] = None - - # set to None if price_type_name (nullable) is None - # and model_fields_set contains the field - if self.price_type_name is None and "price_type_name" in self.model_fields_set: - _dict['priceTypeName'] = None - - # set to None if commodity_unit_name (nullable) is None - # and model_fields_set contains the field - if self.commodity_unit_name is None and "commodity_unit_name" in self.model_fields_set: - _dict['commodityUnitName'] = None - - # set to None if currency_name (nullable) is None - # and model_fields_set contains the field - if self.currency_name is None and "currency_name" in self.model_fields_set: - _dict['currencyName'] = None - - # set to None if country_iso3 (nullable) is None - # and model_fields_set contains the field - if self.country_iso3 is None and "country_iso3" in self.model_fields_set: - _dict['countryISO3'] = None - - # set to None if country_name (nullable) is None - # and model_fields_set contains the field - if self.country_name is None and "country_name" in self.model_fields_set: - _dict['countryName'] = None - - # set to None if commodity_price_source_name (nullable) is None - # and model_fields_set contains the field - if self.commodity_price_source_name is None and "commodity_price_source_name" in self.model_fields_set: - _dict['commodityPriceSourceName'] = None - - # set to None if original_frequency (nullable) is None - # and model_fields_set contains the field - if self.original_frequency is None and "original_frequency" in self.model_fields_set: - _dict['originalFrequency'] = None - - # set to None if commodity_price (nullable) is None - # and model_fields_set contains the field - if self.commodity_price is None and "commodity_price" in self.model_fields_set: - _dict['commodityPrice'] = None - - # set to None if commodity_price_observations (nullable) is None - # and model_fields_set contains the field - if self.commodity_price_observations is None and "commodity_price_observations" in self.model_fields_set: - _dict['commodityPriceObservations'] = None - - # set to None if commodity_price_flag (nullable) is None - # and model_fields_set contains the field - if self.commodity_price_flag is None and "commodity_price_flag" in self.model_fields_set: - _dict['commodityPriceFlag'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ViewExtendedAggregatedPrice from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "commodityID": obj.get("commodityID"), - "marketID": obj.get("marketID"), - "priceTypeID": obj.get("priceTypeID"), - "commodityUnitID": obj.get("commodityUnitID"), - "currencyID": obj.get("currencyID"), - "adm0Code": obj.get("adm0Code"), - "commodityDateWeek": obj.get("commodityDateWeek"), - "commodityDateMonth": obj.get("commodityDateMonth"), - "commodityDateYear": obj.get("commodityDateYear"), - "commodityPriceDate": obj.get("commodityPriceDate"), - "commodityName": obj.get("commodityName"), - "marketName": obj.get("marketName"), - "priceTypeName": obj.get("priceTypeName"), - "commodityUnitName": obj.get("commodityUnitName"), - "currencyName": obj.get("currencyName"), - "countryISO3": obj.get("countryISO3"), - "countryName": obj.get("countryName"), - "commodityPriceSourceName": obj.get("commodityPriceSourceName"), - "originalFrequency": obj.get("originalFrequency"), - "commodityPrice": obj.get("commodityPrice"), - "commodityPriceObservations": obj.get("commodityPriceObservations"), - "commodityPriceFlag": obj.get("commodityPriceFlag") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/view_extended_aggregated_price_paged_result.py b/data_bridges_client/models/view_extended_aggregated_price_paged_result.py deleted file mode 100644 index b4d2d33..0000000 --- a/data_bridges_client/models/view_extended_aggregated_price_paged_result.py +++ /dev/null @@ -1,120 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from data_bridges_client.models.view_extended_aggregated_price import ViewExtendedAggregatedPrice -from typing import Optional, Set -from typing_extensions import Self - -class ViewExtendedAggregatedPricePagedResult(BaseModel): - """ - ViewExtendedAggregatedPricePagedResult - """ # noqa: E501 - items: Optional[List[ViewExtendedAggregatedPrice]] = None - page: Optional[StrictInt] = None - total_items: Optional[StrictInt] = Field(default=None, alias="totalItems") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["items", "page", "totalItems"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ViewExtendedAggregatedPricePagedResult from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * OpenAPI `readOnly` fields are excluded. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "items", - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in items (list) - _items = [] - if self.items: - for _item in self.items: - if _item: - _items.append(_item.to_dict()) - _dict['items'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if items (nullable) is None - # and model_fields_set contains the field - if self.items is None and "items" in self.model_fields_set: - _dict['items'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ViewExtendedAggregatedPricePagedResult from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "items": [ViewExtendedAggregatedPrice.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None, - "page": obj.get("page"), - "totalItems": obj.get("totalItems") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/view_extended_alps_value.py b/data_bridges_client/models/view_extended_alps_value.py deleted file mode 100644 index 859141b..0000000 --- a/data_bridges_client/models/view_extended_alps_value.py +++ /dev/null @@ -1,193 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Union -from typing import Optional, Set -from typing_extensions import Self - -class ViewExtendedAlpsValue(BaseModel): - """ - ViewExtendedAlpsValue - """ # noqa: E501 - commodity_id: Optional[StrictInt] = Field(default=None, alias="commodityID") - market_id: Optional[StrictInt] = Field(default=None, alias="marketID") - price_type_id: Optional[StrictInt] = Field(default=None, alias="priceTypeID") - commodity_unit_id: Optional[StrictInt] = Field(default=None, alias="commodityUnitID") - currency_id: Optional[StrictInt] = Field(default=None, alias="currencyID") - adm0_code: Optional[StrictInt] = Field(default=None, alias="adm0Code") - country_name: Optional[StrictStr] = Field(default=None, alias="countryName") - commodity_price_date_year: Optional[StrictInt] = Field(default=None, alias="commodityPriceDateYear") - commodity_price_date_month: Optional[StrictInt] = Field(default=None, alias="commodityPriceDateMonth") - commodity_price_date_week: Optional[StrictInt] = Field(default=None, alias="commodityPriceDateWeek") - commodity_price_date: Optional[datetime] = Field(default=None, alias="commodityPriceDate") - commodity_name: Optional[StrictStr] = Field(default=None, alias="commodityName") - market_name: Optional[StrictStr] = Field(default=None, alias="marketName") - price_type_name: Optional[StrictStr] = Field(default=None, alias="priceTypeName") - commodity_unit_name: Optional[StrictStr] = Field(default=None, alias="commodityUnitName") - currency_name: Optional[StrictStr] = Field(default=None, alias="currencyName") - analysis_value_estimated_price: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="analysisValueEstimatedPrice") - analysis_value_pewi_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="analysisValuePewiValue") - analysis_value_price_flag: Optional[StrictStr] = Field(default=None, alias="analysisValuePriceFlag") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["commodityID", "marketID", "priceTypeID", "commodityUnitID", "currencyID", "adm0Code", "countryName", "commodityPriceDateYear", "commodityPriceDateMonth", "commodityPriceDateWeek", "commodityPriceDate", "commodityName", "marketName", "priceTypeName", "commodityUnitName", "currencyName", "analysisValueEstimatedPrice", "analysisValuePewiValue", "analysisValuePriceFlag"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ViewExtendedAlpsValue from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if adm0_code (nullable) is None - # and model_fields_set contains the field - if self.adm0_code is None and "adm0_code" in self.model_fields_set: - _dict['adm0Code'] = None - - # set to None if country_name (nullable) is None - # and model_fields_set contains the field - if self.country_name is None and "country_name" in self.model_fields_set: - _dict['countryName'] = None - - # set to None if commodity_price_date_month (nullable) is None - # and model_fields_set contains the field - if self.commodity_price_date_month is None and "commodity_price_date_month" in self.model_fields_set: - _dict['commodityPriceDateMonth'] = None - - # set to None if commodity_price_date_week (nullable) is None - # and model_fields_set contains the field - if self.commodity_price_date_week is None and "commodity_price_date_week" in self.model_fields_set: - _dict['commodityPriceDateWeek'] = None - - # set to None if commodity_price_date (nullable) is None - # and model_fields_set contains the field - if self.commodity_price_date is None and "commodity_price_date" in self.model_fields_set: - _dict['commodityPriceDate'] = None - - # set to None if commodity_name (nullable) is None - # and model_fields_set contains the field - if self.commodity_name is None and "commodity_name" in self.model_fields_set: - _dict['commodityName'] = None - - # set to None if market_name (nullable) is None - # and model_fields_set contains the field - if self.market_name is None and "market_name" in self.model_fields_set: - _dict['marketName'] = None - - # set to None if price_type_name (nullable) is None - # and model_fields_set contains the field - if self.price_type_name is None and "price_type_name" in self.model_fields_set: - _dict['priceTypeName'] = None - - # set to None if commodity_unit_name (nullable) is None - # and model_fields_set contains the field - if self.commodity_unit_name is None and "commodity_unit_name" in self.model_fields_set: - _dict['commodityUnitName'] = None - - # set to None if currency_name (nullable) is None - # and model_fields_set contains the field - if self.currency_name is None and "currency_name" in self.model_fields_set: - _dict['currencyName'] = None - - # set to None if analysis_value_price_flag (nullable) is None - # and model_fields_set contains the field - if self.analysis_value_price_flag is None and "analysis_value_price_flag" in self.model_fields_set: - _dict['analysisValuePriceFlag'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ViewExtendedAlpsValue from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "commodityID": obj.get("commodityID"), - "marketID": obj.get("marketID"), - "priceTypeID": obj.get("priceTypeID"), - "commodityUnitID": obj.get("commodityUnitID"), - "currencyID": obj.get("currencyID"), - "adm0Code": obj.get("adm0Code"), - "countryName": obj.get("countryName"), - "commodityPriceDateYear": obj.get("commodityPriceDateYear"), - "commodityPriceDateMonth": obj.get("commodityPriceDateMonth"), - "commodityPriceDateWeek": obj.get("commodityPriceDateWeek"), - "commodityPriceDate": obj.get("commodityPriceDate"), - "commodityName": obj.get("commodityName"), - "marketName": obj.get("marketName"), - "priceTypeName": obj.get("priceTypeName"), - "commodityUnitName": obj.get("commodityUnitName"), - "currencyName": obj.get("currencyName"), - "analysisValueEstimatedPrice": obj.get("analysisValueEstimatedPrice"), - "analysisValuePewiValue": obj.get("analysisValuePewiValue"), - "analysisValuePriceFlag": obj.get("analysisValuePriceFlag") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/view_extended_alps_value_paged_result.py b/data_bridges_client/models/view_extended_alps_value_paged_result.py deleted file mode 100644 index 4571921..0000000 --- a/data_bridges_client/models/view_extended_alps_value_paged_result.py +++ /dev/null @@ -1,120 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from data_bridges_client.models.view_extended_alps_value import ViewExtendedAlpsValue -from typing import Optional, Set -from typing_extensions import Self - -class ViewExtendedAlpsValuePagedResult(BaseModel): - """ - ViewExtendedAlpsValuePagedResult - """ # noqa: E501 - items: Optional[List[ViewExtendedAlpsValue]] = None - page: Optional[StrictInt] = None - total_items: Optional[StrictInt] = Field(default=None, alias="totalItems") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["items", "page", "totalItems"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ViewExtendedAlpsValuePagedResult from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * OpenAPI `readOnly` fields are excluded. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "items", - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in items (list) - _items = [] - if self.items: - for _item in self.items: - if _item: - _items.append(_item.to_dict()) - _dict['items'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if items (nullable) is None - # and model_fields_set contains the field - if self.items is None and "items" in self.model_fields_set: - _dict['items'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ViewExtendedAlpsValuePagedResult from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "items": [ViewExtendedAlpsValue.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None, - "page": obj.get("page"), - "totalItems": obj.get("totalItems") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/weekly_aggregated_price.py b/data_bridges_client/models/weekly_aggregated_price.py deleted file mode 100644 index 047f0ab..0000000 --- a/data_bridges_client/models/weekly_aggregated_price.py +++ /dev/null @@ -1,197 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Union -from typing import Optional, Set -from typing_extensions import Self - -class WeeklyAggregatedPrice(BaseModel): - """ - WeeklyAggregatedPrice - """ # noqa: E501 - commodity_id: Optional[StrictInt] = Field(default=None, alias="commodityId") - market_id: Optional[StrictInt] = Field(default=None, alias="marketId") - price_type_id: Optional[StrictInt] = Field(default=None, alias="priceTypeId") - commodity_unit_id: Optional[StrictInt] = Field(default=None, alias="commodityUnitId") - currency_id: Optional[StrictInt] = Field(default=None, alias="currencyId") - commodity_name: Optional[StrictStr] = Field(default=None, alias="commodityName") - market_name: Optional[StrictStr] = Field(default=None, alias="marketName") - price_type_name: Optional[StrictStr] = Field(default=None, alias="priceTypeName") - commodity_unit_name: Optional[StrictStr] = Field(default=None, alias="commodityUnitName") - currency_name: Optional[StrictStr] = Field(default=None, alias="currencyName") - adm0_code: Optional[StrictInt] = Field(default=None, alias="adm0Code") - country_iso3: Optional[StrictStr] = Field(default=None, alias="countryISO3") - country_name: Optional[StrictStr] = Field(default=None, alias="countryName") - commodity_price: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="commodityPrice") - original_frequency: Optional[StrictStr] = Field(default=None, alias="originalFrequency") - commodity_price_source_name: Optional[StrictStr] = Field(default=None, alias="commodityPriceSourceName") - commodity_price_observations: Optional[StrictInt] = Field(default=None, alias="commodityPriceObservations") - commodity_date_month: Optional[StrictInt] = Field(default=None, alias="commodityDateMonth") - commodity_date_year: Optional[StrictInt] = Field(default=None, alias="commodityDateYear") - commodity_price_date: Optional[datetime] = Field(default=None, alias="commodityPriceDate") - commodity_price_flag: Optional[StrictStr] = Field(default=None, alias="commodityPriceFlag") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["commodityId", "marketId", "priceTypeId", "commodityUnitId", "currencyId", "commodityName", "marketName", "priceTypeName", "commodityUnitName", "currencyName", "adm0Code", "countryISO3", "countryName", "commodityPrice", "originalFrequency", "commodityPriceSourceName", "commodityPriceObservations", "commodityDateMonth", "commodityDateYear", "commodityPriceDate", "commodityPriceFlag"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of WeeklyAggregatedPrice from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if commodity_name (nullable) is None - # and model_fields_set contains the field - if self.commodity_name is None and "commodity_name" in self.model_fields_set: - _dict['commodityName'] = None - - # set to None if market_name (nullable) is None - # and model_fields_set contains the field - if self.market_name is None and "market_name" in self.model_fields_set: - _dict['marketName'] = None - - # set to None if price_type_name (nullable) is None - # and model_fields_set contains the field - if self.price_type_name is None and "price_type_name" in self.model_fields_set: - _dict['priceTypeName'] = None - - # set to None if commodity_unit_name (nullable) is None - # and model_fields_set contains the field - if self.commodity_unit_name is None and "commodity_unit_name" in self.model_fields_set: - _dict['commodityUnitName'] = None - - # set to None if currency_name (nullable) is None - # and model_fields_set contains the field - if self.currency_name is None and "currency_name" in self.model_fields_set: - _dict['currencyName'] = None - - # set to None if country_iso3 (nullable) is None - # and model_fields_set contains the field - if self.country_iso3 is None and "country_iso3" in self.model_fields_set: - _dict['countryISO3'] = None - - # set to None if country_name (nullable) is None - # and model_fields_set contains the field - if self.country_name is None and "country_name" in self.model_fields_set: - _dict['countryName'] = None - - # set to None if original_frequency (nullable) is None - # and model_fields_set contains the field - if self.original_frequency is None and "original_frequency" in self.model_fields_set: - _dict['originalFrequency'] = None - - # set to None if commodity_price_source_name (nullable) is None - # and model_fields_set contains the field - if self.commodity_price_source_name is None and "commodity_price_source_name" in self.model_fields_set: - _dict['commodityPriceSourceName'] = None - - # set to None if commodity_price_observations (nullable) is None - # and model_fields_set contains the field - if self.commodity_price_observations is None and "commodity_price_observations" in self.model_fields_set: - _dict['commodityPriceObservations'] = None - - # set to None if commodity_price_flag (nullable) is None - # and model_fields_set contains the field - if self.commodity_price_flag is None and "commodity_price_flag" in self.model_fields_set: - _dict['commodityPriceFlag'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of WeeklyAggregatedPrice from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "commodityId": obj.get("commodityId"), - "marketId": obj.get("marketId"), - "priceTypeId": obj.get("priceTypeId"), - "commodityUnitId": obj.get("commodityUnitId"), - "currencyId": obj.get("currencyId"), - "commodityName": obj.get("commodityName"), - "marketName": obj.get("marketName"), - "priceTypeName": obj.get("priceTypeName"), - "commodityUnitName": obj.get("commodityUnitName"), - "currencyName": obj.get("currencyName"), - "adm0Code": obj.get("adm0Code"), - "countryISO3": obj.get("countryISO3"), - "countryName": obj.get("countryName"), - "commodityPrice": obj.get("commodityPrice"), - "originalFrequency": obj.get("originalFrequency"), - "commodityPriceSourceName": obj.get("commodityPriceSourceName"), - "commodityPriceObservations": obj.get("commodityPriceObservations"), - "commodityDateMonth": obj.get("commodityDateMonth"), - "commodityDateYear": obj.get("commodityDateYear"), - "commodityPriceDate": obj.get("commodityPriceDate"), - "commodityPriceFlag": obj.get("commodityPriceFlag") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/xls_form_definition_new_schema_dto.py b/data_bridges_client/models/xls_form_definition_new_schema_dto.py deleted file mode 100644 index c2d577c..0000000 --- a/data_bridges_client/models/xls_form_definition_new_schema_dto.py +++ /dev/null @@ -1,163 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from data_bridges_client.models.xls_form_fields_dto import XlsFormFieldsDTO -from typing import Optional, Set -from typing_extensions import Self - -class XlsFormDefinitionNewSchemaDTO(BaseModel): - """ - XlsFormDefinitionNewSchemaDTO - """ # noqa: E501 - form_name: Optional[StrictStr] = Field(default=None, alias="formName") - form_description: Optional[StrictStr] = Field(default=None, alias="formDescription") - form_type: Optional[StrictStr] = Field(default=None, alias="formType") - adm0_code: Optional[StrictInt] = Field(default=None, alias="adm0Code") - base_schema_id: Optional[StrictInt] = Field(default=None, alias="baseSchemaId") - category: Optional[StrictStr] = None - type: Optional[StrictStr] = None - fields: Optional[List[XlsFormFieldsDTO]] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["formName", "formDescription", "formType", "adm0Code", "baseSchemaId", "category", "type", "fields"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of XlsFormDefinitionNewSchemaDTO from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in fields (list) - _items = [] - if self.fields: - for _item in self.fields: - if _item: - _items.append(_item.to_dict()) - _dict['fields'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if form_name (nullable) is None - # and model_fields_set contains the field - if self.form_name is None and "form_name" in self.model_fields_set: - _dict['formName'] = None - - # set to None if form_description (nullable) is None - # and model_fields_set contains the field - if self.form_description is None and "form_description" in self.model_fields_set: - _dict['formDescription'] = None - - # set to None if form_type (nullable) is None - # and model_fields_set contains the field - if self.form_type is None and "form_type" in self.model_fields_set: - _dict['formType'] = None - - # set to None if adm0_code (nullable) is None - # and model_fields_set contains the field - if self.adm0_code is None and "adm0_code" in self.model_fields_set: - _dict['adm0Code'] = None - - # set to None if base_schema_id (nullable) is None - # and model_fields_set contains the field - if self.base_schema_id is None and "base_schema_id" in self.model_fields_set: - _dict['baseSchemaId'] = None - - # set to None if category (nullable) is None - # and model_fields_set contains the field - if self.category is None and "category" in self.model_fields_set: - _dict['category'] = None - - # set to None if type (nullable) is None - # and model_fields_set contains the field - if self.type is None and "type" in self.model_fields_set: - _dict['type'] = None - - # set to None if fields (nullable) is None - # and model_fields_set contains the field - if self.fields is None and "fields" in self.model_fields_set: - _dict['fields'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of XlsFormDefinitionNewSchemaDTO from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "formName": obj.get("formName"), - "formDescription": obj.get("formDescription"), - "formType": obj.get("formType"), - "adm0Code": obj.get("adm0Code"), - "baseSchemaId": obj.get("baseSchemaId"), - "category": obj.get("category"), - "type": obj.get("type"), - "fields": [XlsFormFieldsDTO.from_dict(_item) for _item in obj["fields"]] if obj.get("fields") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/xls_form_dto.py b/data_bridges_client/models/xls_form_dto.py deleted file mode 100644 index cdde2cf..0000000 --- a/data_bridges_client/models/xls_form_dto.py +++ /dev/null @@ -1,134 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class XlsFormDTO(BaseModel): - """ - XlsFormDTO - """ # noqa: E501 - xls_form_id: Optional[StrictInt] = Field(default=None, alias="xlsFormID") - xls_form_name: Optional[StrictStr] = Field(default=None, alias="xlsFormName") - xls_form_create_date: Optional[datetime] = Field(default=None, alias="xlsFormCreateDate") - user_name: Optional[StrictStr] = Field(default=None, alias="userName") - xls_form_source_file: Optional[StrictStr] = Field(default=None, alias="xlsFormSourceFile") - xls_form_is_base_schema: Optional[StrictBool] = Field(default=None, alias="xlsFormIsBaseSchema") - adm0_code: Optional[StrictInt] = Field(default=None, alias="adm0Code") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["xlsFormID", "xlsFormName", "xlsFormCreateDate", "userName", "xlsFormSourceFile", "xlsFormIsBaseSchema", "adm0Code"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of XlsFormDTO from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if xls_form_name (nullable) is None - # and model_fields_set contains the field - if self.xls_form_name is None and "xls_form_name" in self.model_fields_set: - _dict['xlsFormName'] = None - - # set to None if user_name (nullable) is None - # and model_fields_set contains the field - if self.user_name is None and "user_name" in self.model_fields_set: - _dict['userName'] = None - - # set to None if xls_form_source_file (nullable) is None - # and model_fields_set contains the field - if self.xls_form_source_file is None and "xls_form_source_file" in self.model_fields_set: - _dict['xlsFormSourceFile'] = None - - # set to None if adm0_code (nullable) is None - # and model_fields_set contains the field - if self.adm0_code is None and "adm0_code" in self.model_fields_set: - _dict['adm0Code'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of XlsFormDTO from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "xlsFormID": obj.get("xlsFormID"), - "xlsFormName": obj.get("xlsFormName"), - "xlsFormCreateDate": obj.get("xlsFormCreateDate"), - "userName": obj.get("userName"), - "xlsFormSourceFile": obj.get("xlsFormSourceFile"), - "xlsFormIsBaseSchema": obj.get("xlsFormIsBaseSchema"), - "adm0Code": obj.get("adm0Code") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/xls_form_fields_dto.py b/data_bridges_client/models/xls_form_fields_dto.py deleted file mode 100644 index e065957..0000000 --- a/data_bridges_client/models/xls_form_fields_dto.py +++ /dev/null @@ -1,126 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from data_bridges_client.models.xls_form_list_choices_dto import XlsFormListChoicesDTO -from typing import Optional, Set -from typing_extensions import Self - -class XlsFormFieldsDTO(BaseModel): - """ - XlsFormFieldsDTO - """ # noqa: E501 - name: Optional[StrictStr] = None - label: Optional[StrictStr] = None - type: Optional[StrictStr] = None - choice_list: Optional[XlsFormListChoicesDTO] = Field(default=None, alias="choiceList") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["name", "label", "type", "choiceList"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of XlsFormFieldsDTO from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of choice_list - if self.choice_list: - _dict['choiceList'] = self.choice_list.to_dict() - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if name (nullable) is None - # and model_fields_set contains the field - if self.name is None and "name" in self.model_fields_set: - _dict['name'] = None - - # set to None if label (nullable) is None - # and model_fields_set contains the field - if self.label is None and "label" in self.model_fields_set: - _dict['label'] = None - - # set to None if type (nullable) is None - # and model_fields_set contains the field - if self.type is None and "type" in self.model_fields_set: - _dict['type'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of XlsFormFieldsDTO from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "name": obj.get("name"), - "label": obj.get("label"), - "type": obj.get("type"), - "choiceList": XlsFormListChoicesDTO.from_dict(obj["choiceList"]) if obj.get("choiceList") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/xls_form_list_choice_dto.py b/data_bridges_client/models/xls_form_list_choice_dto.py deleted file mode 100644 index 9a5445b..0000000 --- a/data_bridges_client/models/xls_form_list_choice_dto.py +++ /dev/null @@ -1,113 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class XlsFormListChoiceDTO(BaseModel): - """ - XlsFormListChoiceDTO - """ # noqa: E501 - name: Optional[StrictStr] = None - label: Optional[StrictStr] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["name", "label"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of XlsFormListChoiceDTO from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if name (nullable) is None - # and model_fields_set contains the field - if self.name is None and "name" in self.model_fields_set: - _dict['name'] = None - - # set to None if label (nullable) is None - # and model_fields_set contains the field - if self.label is None and "label" in self.model_fields_set: - _dict['label'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of XlsFormListChoiceDTO from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "name": obj.get("name"), - "label": obj.get("label") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/models/xls_form_list_choices_dto.py b/data_bridges_client/models/xls_form_list_choices_dto.py deleted file mode 100644 index ca1fb0c..0000000 --- a/data_bridges_client/models/xls_form_list_choices_dto.py +++ /dev/null @@ -1,121 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from data_bridges_client.models.xls_form_list_choice_dto import XlsFormListChoiceDTO -from typing import Optional, Set -from typing_extensions import Self - -class XlsFormListChoicesDTO(BaseModel): - """ - XlsFormListChoicesDTO - """ # noqa: E501 - name: Optional[StrictStr] = None - choices: Optional[List[XlsFormListChoiceDTO]] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["name", "choices"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of XlsFormListChoicesDTO from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in choices (list) - _items = [] - if self.choices: - for _item in self.choices: - if _item: - _items.append(_item.to_dict()) - _dict['choices'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if name (nullable) is None - # and model_fields_set contains the field - if self.name is None and "name" in self.model_fields_set: - _dict['name'] = None - - # set to None if choices (nullable) is None - # and model_fields_set contains the field - if self.choices is None and "choices" in self.model_fields_set: - _dict['choices'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of XlsFormListChoicesDTO from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "name": obj.get("name"), - "choices": [XlsFormListChoiceDTO.from_dict(_item) for _item in obj["choices"]] if obj.get("choices") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/data_bridges_client/py.typed b/data_bridges_client/py.typed deleted file mode 100644 index e69de29..0000000 diff --git a/data_bridges_client/rest.py b/data_bridges_client/rest.py deleted file mode 100644 index 1304927..0000000 --- a/data_bridges_client/rest.py +++ /dev/null @@ -1,258 +0,0 @@ -# coding: utf-8 - -""" - VAM-Data-Bridges - - API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern - - The version of the OpenAPI document: 4.1.0 - Contact: wfp.economicanalysis@wfp.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import io -import json -import re -import ssl - -import urllib3 - -from data_bridges_client.exceptions import ApiException, ApiValueError - -SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"} -RESTResponseType = urllib3.HTTPResponse - - -def is_socks_proxy_url(url): - if url is None: - return False - split_section = url.split("://") - if len(split_section) < 2: - return False - else: - return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES - - -class RESTResponse(io.IOBase): - - def __init__(self, resp) -> None: - self.response = resp - self.status = resp.status - self.reason = resp.reason - self.data = None - - def read(self): - if self.data is None: - self.data = self.response.data - return self.data - - def getheaders(self): - """Returns a dictionary of the response headers.""" - return self.response.headers - - def getheader(self, name, default=None): - """Returns a given response header.""" - return self.response.headers.get(name, default) - - -class RESTClientObject: - - def __init__(self, configuration) -> None: - # urllib3.PoolManager will pass all kw parameters to connectionpool - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 - # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 - - # cert_reqs - if configuration.verify_ssl: - cert_reqs = ssl.CERT_REQUIRED - else: - cert_reqs = ssl.CERT_NONE - - pool_args = { - "cert_reqs": cert_reqs, - "ca_certs": configuration.ssl_ca_cert, - "cert_file": configuration.cert_file, - "key_file": configuration.key_file, - } - if configuration.assert_hostname is not None: - pool_args['assert_hostname'] = ( - configuration.assert_hostname - ) - - if configuration.retries is not None: - pool_args['retries'] = configuration.retries - - if configuration.tls_server_name: - pool_args['server_hostname'] = configuration.tls_server_name - - - if configuration.socket_options is not None: - pool_args['socket_options'] = configuration.socket_options - - if configuration.connection_pool_maxsize is not None: - pool_args['maxsize'] = configuration.connection_pool_maxsize - - # https pool manager - self.pool_manager: urllib3.PoolManager - - if configuration.proxy: - if is_socks_proxy_url(configuration.proxy): - from urllib3.contrib.socks import SOCKSProxyManager - pool_args["proxy_url"] = configuration.proxy - pool_args["headers"] = configuration.proxy_headers - self.pool_manager = SOCKSProxyManager(**pool_args) - else: - pool_args["proxy_url"] = configuration.proxy - pool_args["proxy_headers"] = configuration.proxy_headers - self.pool_manager = urllib3.ProxyManager(**pool_args) - else: - self.pool_manager = urllib3.PoolManager(**pool_args) - - def request( - self, - method, - url, - headers=None, - body=None, - post_params=None, - _request_timeout=None - ): - """Perform requests. - - :param method: http request method - :param url: http request url - :param headers: http request headers - :param body: request json body, for `application/json` - :param post_params: request post parameters, - `application/x-www-form-urlencoded` - and `multipart/form-data` - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - """ - method = method.upper() - assert method in [ - 'GET', - 'HEAD', - 'DELETE', - 'POST', - 'PUT', - 'PATCH', - 'OPTIONS' - ] - - if post_params and body: - raise ApiValueError( - "body parameter cannot be used with post_params parameter." - ) - - post_params = post_params or {} - headers = headers or {} - - timeout = None - if _request_timeout: - if isinstance(_request_timeout, (int, float)): - timeout = urllib3.Timeout(total=_request_timeout) - elif ( - isinstance(_request_timeout, tuple) - and len(_request_timeout) == 2 - ): - timeout = urllib3.Timeout( - connect=_request_timeout[0], - read=_request_timeout[1] - ) - - try: - # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - - # no content type provided or payload is json - content_type = headers.get('Content-Type') - if ( - not content_type - or re.search('json', content_type, re.IGNORECASE) - ): - request_body = None - if body is not None: - request_body = json.dumps(body) - r = self.pool_manager.request( - method, - url, - body=request_body, - timeout=timeout, - headers=headers, - preload_content=False - ) - elif content_type == 'application/x-www-form-urlencoded': - r = self.pool_manager.request( - method, - url, - fields=post_params, - encode_multipart=False, - timeout=timeout, - headers=headers, - preload_content=False - ) - elif content_type == 'multipart/form-data': - # must del headers['Content-Type'], or the correct - # Content-Type which generated by urllib3 will be - # overwritten. - del headers['Content-Type'] - # Ensures that dict objects are serialized - post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a,b) for a, b in post_params] - r = self.pool_manager.request( - method, - url, - fields=post_params, - encode_multipart=True, - timeout=timeout, - headers=headers, - preload_content=False - ) - # Pass a `string` parameter directly in the body to support - # other content types than JSON when `body` argument is - # provided in serialized form. - elif isinstance(body, str) or isinstance(body, bytes): - r = self.pool_manager.request( - method, - url, - body=body, - timeout=timeout, - headers=headers, - preload_content=False - ) - elif headers['Content-Type'] == 'text/plain' and isinstance(body, bool): - request_body = "true" if body else "false" - r = self.pool_manager.request( - method, - url, - body=request_body, - preload_content=False, - timeout=timeout, - headers=headers) - else: - # Cannot generate the request from given parameters - msg = """Cannot prepare a request message for provided - arguments. Please check that your arguments match - declared content type.""" - raise ApiException(status=0, reason=msg) - # For `GET`, `HEAD` - else: - r = self.pool_manager.request( - method, - url, - fields={}, - timeout=timeout, - headers=headers, - preload_content=False - ) - except urllib3.exceptions.SSLError as e: - msg = "\n".join([type(e).__name__, str(e)]) - raise ApiException(status=0, reason=msg) - - return RESTResponse(r) diff --git a/data_bridges_client/token.py b/data_bridges_client/token.py deleted file mode 100644 index 41416eb..0000000 --- a/data_bridges_client/token.py +++ /dev/null @@ -1,63 +0,0 @@ -import httpx -import datetime -from typing import Optional, Any, List, Dict -import data_bridges_client -import urllib3 -import json - - -class WfpApiToken: - BASE_URL = "https://api.wfp.org" - - def __init__(self, api_key: str, api_secret: str): - """ - Args: - api_key: API key credential to make API requests - api_secret: API secrets credential to make API requests - """ - self.api_key = api_key - self.api_secret = api_secret - - def refresh(self, scopes: Optional[str] = None): - """ - Refreshes token to make API requests - Args: - scopes: API scopes. The default is None - """ - if scopes is None: - scopes = [] - resp = httpx.post( - f"{self.BASE_URL}/token", - data={"grant_type": "client_credentials", "scope": " ".join(scopes)}, - auth=(self.api_key, self.api_secret), - ) - resp.raise_for_status() - resp_data = resp.json() - received_scopes = set(resp_data["scope"].split(" ")) - if not set(scopes).issubset(received_scopes): - raise ValueError(f"Could not acquire requested scopes: {scopes}") - return resp_data["access_token"] - - def refresh_urllib3(self, scopes: Optional[str] = None): - """ - Refreshes token to make API requests - Same function as self.refresh but uses urllib3 - """ - - if scopes is None: - scopes = [] - resp = urllib3.request( - "POST", - f"{self.BASE_URL}/token", - body={"grant_type": "client_credentials", "scope": " ".join(scopes)}, - headers=urllib3.make_headers(basic_auth=f"{self.api_key}:{self.api_secret}"), - ) - return resp - - def refresh_configuration(self): - """ - Instantiate new client.Configuration with fresh OAuth2 access token - """ - configuration = data_bridges_client.Configuration() - configuration.access_token = self.refresh() - return configuration