From 12e8c4959deb8f7f15e21a3e1f0446d046397a9b Mon Sep 17 00:00:00 2001 From: "Jacob S. Zelko" Date: Mon, 1 Apr 2024 02:17:46 -0400 Subject: [PATCH] Initial OpenAPI NHGIS Implementation (#8) * Added some new deps for OpenAPI integration * Added OpenAPI integrations * Yo ho, oh no, a piratin' we go * Generated functions by OpenAPI * Placedholder documentation for generated OpenAPI commands * Handy model includes file * YAML used to generate NHGIS OpenAPI commands * Error with the typing for basis; changed to Int64 * Forgive me, a sinner --- Project.toml | 5 + docs/src/DataExtract.md | 15 + docs/src/DataExtractDownloadLinks.md | 14 + docs/src/DataExtractExtractDefinition.md | 21 + docs/src/DataExtractPost.md | 19 + docs/src/DataExtractPostResponse.md | 15 + docs/src/DataTableFull.md | 18 + docs/src/DataTableFullVariablesInner.md | 13 + docs/src/DataTableSimple.md | 15 + docs/src/Dataset.md | 15 + docs/src/DatasetFull.md | 19 + docs/src/DatasetFullBreakdowns.md | 17 + ...tasetFullBreakdownsBreakdownValuesInner.md | 13 + docs/src/DatasetFullGeogLevelsInner.md | 14 + docs/src/DatasetSimple.md | 15 + docs/src/DefaultApi.md | 347 ++++++++ docs/src/Error.md | 14 + docs/src/Shapefile.md | 17 + docs/src/TimeSeriesTable.md | 13 + docs/src/TimeSeriesTableFull.md | 17 + .../src/TimeSeriesTableFullTimeSeriesInner.md | 14 + docs/src/TimeSeriesTableSimple.md | 17 + nhgis.yml | 833 ++++++++++++++++++ src/IPUMS.jl | 62 +- src/apis/api_DefaultApi.jl | 375 ++++++++ src/modelincludes.jl | 23 + src/models/model_DataExtract.jl | 45 + src/models/model_DataExtractDownloadLinks.jl | 38 + .../model_DataExtractExtractDefinition.jl | 78 ++ src/models/model_DataExtractPost.jl | 67 ++ src/models/model_DataExtractPostResponse.jl | 45 + src/models/model_DataTableFull.jl | 55 ++ .../model_DataTableFullVariablesInner.jl | 34 + src/models/model_DataTableSimple.jl | 42 + src/models/model_Dataset.jl | 44 + src/models/model_DatasetFull.jl | 58 ++ src/models/model_DatasetFullBreakdowns.jl | 50 ++ ...tasetFullBreakdownsBreakdownValuesInner.jl | 34 + .../model_DatasetFullGeogLevelsInner.jl | 38 + src/models/model_DatasetSimple.jl | 42 + src/models/model_Error.jl | 44 + src/models/model_Shapefile.jl | 50 ++ src/models/model_TimeSeriesTable.jl | 35 + src/models/model_TimeSeriesTableFull.jl | 50 ++ ...odel_TimeSeriesTableFullTimeSeriesInner.jl | 38 + src/models/model_TimeSeriesTableSimple.jl | 50 ++ src/piracy.jl | 22 + 47 files changed, 2912 insertions(+), 7 deletions(-) create mode 100644 docs/src/DataExtract.md create mode 100644 docs/src/DataExtractDownloadLinks.md create mode 100644 docs/src/DataExtractExtractDefinition.md create mode 100644 docs/src/DataExtractPost.md create mode 100644 docs/src/DataExtractPostResponse.md create mode 100644 docs/src/DataTableFull.md create mode 100644 docs/src/DataTableFullVariablesInner.md create mode 100644 docs/src/DataTableSimple.md create mode 100644 docs/src/Dataset.md create mode 100644 docs/src/DatasetFull.md create mode 100644 docs/src/DatasetFullBreakdowns.md create mode 100644 docs/src/DatasetFullBreakdownsBreakdownValuesInner.md create mode 100644 docs/src/DatasetFullGeogLevelsInner.md create mode 100644 docs/src/DatasetSimple.md create mode 100644 docs/src/DefaultApi.md create mode 100644 docs/src/Error.md create mode 100644 docs/src/Shapefile.md create mode 100644 docs/src/TimeSeriesTable.md create mode 100644 docs/src/TimeSeriesTableFull.md create mode 100644 docs/src/TimeSeriesTableFullTimeSeriesInner.md create mode 100644 docs/src/TimeSeriesTableSimple.md create mode 100644 nhgis.yml create mode 100644 src/apis/api_DefaultApi.jl create mode 100644 src/modelincludes.jl create mode 100644 src/models/model_DataExtract.jl create mode 100644 src/models/model_DataExtractDownloadLinks.jl create mode 100644 src/models/model_DataExtractExtractDefinition.jl create mode 100644 src/models/model_DataExtractPost.jl create mode 100644 src/models/model_DataExtractPostResponse.jl create mode 100644 src/models/model_DataTableFull.jl create mode 100644 src/models/model_DataTableFullVariablesInner.jl create mode 100644 src/models/model_DataTableSimple.jl create mode 100644 src/models/model_Dataset.jl create mode 100644 src/models/model_DatasetFull.jl create mode 100644 src/models/model_DatasetFullBreakdowns.jl create mode 100644 src/models/model_DatasetFullBreakdownsBreakdownValuesInner.jl create mode 100644 src/models/model_DatasetFullGeogLevelsInner.jl create mode 100644 src/models/model_DatasetSimple.jl create mode 100644 src/models/model_Error.jl create mode 100644 src/models/model_Shapefile.jl create mode 100644 src/models/model_TimeSeriesTable.jl create mode 100644 src/models/model_TimeSeriesTableFull.jl create mode 100644 src/models/model_TimeSeriesTableFullTimeSeriesInner.jl create mode 100644 src/models/model_TimeSeriesTableSimple.jl create mode 100644 src/piracy.jl diff --git a/Project.toml b/Project.toml index f4490ee..b9887b6 100644 --- a/Project.toml +++ b/Project.toml @@ -5,7 +5,12 @@ version = "0.0.1" [deps] DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" +Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3" +JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" +OpenAPI = "d5e62ea6-ddf3-4d43-8e4c-ad5e6c8bfd7d" +TimeZones = "f269a46b-ccf7-5d73-abea-4c690281aa53" +URIs = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4" [compat] julia = "1.6" diff --git a/docs/src/DataExtract.md b/docs/src/DataExtract.md new file mode 100644 index 0000000..60e20e0 --- /dev/null +++ b/docs/src/DataExtract.md @@ -0,0 +1,15 @@ +# DataExtract + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**extractDefinition** | [***DataExtractExtractDefinition**](DataExtractExtractDefinition.md) | | [optional] [default to nothing] +**number** | **Int64** | | [optional] [default to nothing] +**status** | **String** | | [optional] [default to nothing] +**downloadLinks** | [***DataExtractDownloadLinks**](DataExtractDownloadLinks.md) | | [optional] [default to nothing] + + +[[Back to Model list]](../README.md#models) [[Back to API list]](../README.md#api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/src/DataExtractDownloadLinks.md b/docs/src/DataExtractDownloadLinks.md new file mode 100644 index 0000000..d4a27bc --- /dev/null +++ b/docs/src/DataExtractDownloadLinks.md @@ -0,0 +1,14 @@ +# DataExtractDownloadLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**codebookPreview** | **String** | | [optional] [default to nothing] +**tableData** | **String** | | [optional] [default to nothing] +**gisData** | **String** | | [optional] [default to nothing] + + +[[Back to Model list]](../README.md#models) [[Back to API list]](../README.md#api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/src/DataExtractExtractDefinition.md b/docs/src/DataExtractExtractDefinition.md new file mode 100644 index 0000000..018818b --- /dev/null +++ b/docs/src/DataExtractExtractDefinition.md @@ -0,0 +1,21 @@ +# DataExtractExtractDefinition + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**datasets** | [**Dict{String, Dataset}**](Dataset.md) | | [optional] [default to nothing] +**timeSeriesTables** | [**Dict{String, TimeSeriesTable}**](TimeSeriesTable.md) | | [optional] [default to nothing] +**dataFormat** | **String** | | [optional] [default to nothing] +**timeSeriesTableLayout** | **String** | | [optional] [default to nothing] +**breakdownAndDataTypeLayout** | **String** | | [optional] [default to nothing] +**shapefiles** | **Vector{String}** | | [optional] [default to nothing] +**geographicExtents** | **Vector{String}** | | [optional] [default to nothing] +**description** | **String** | | [optional] [default to nothing] +**version** | **Int64** | | [optional] [default to nothing] +**collection** | **String** | | [optional] [default to nothing] + + +[[Back to Model list]](../README.md#models) [[Back to API list]](../README.md#api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/src/DataExtractPost.md b/docs/src/DataExtractPost.md new file mode 100644 index 0000000..7cfad1a --- /dev/null +++ b/docs/src/DataExtractPost.md @@ -0,0 +1,19 @@ +# DataExtractPost + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**datasets** | [**Dict{String, Dataset}**](Dataset.md) | | [optional] [default to nothing] +**timeSeriesTables** | [**Dict{String, TimeSeriesTable}**](TimeSeriesTable.md) | | [optional] [default to nothing] +**dataFormat** | **String** | | [optional] [default to nothing] +**timeSeriesTableLayout** | **String** | | [optional] [default to nothing] +**breakdownAndDataTypeLayout** | **String** | | [optional] [default to nothing] +**shapefiles** | **Vector{String}** | | [optional] [default to nothing] +**geographicExtents** | **Vector{String}** | | [optional] [default to nothing] +**description** | **String** | | [optional] [default to nothing] + + +[[Back to Model list]](../README.md#models) [[Back to API list]](../README.md#api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/src/DataExtractPostResponse.md b/docs/src/DataExtractPostResponse.md new file mode 100644 index 0000000..9f3e6f1 --- /dev/null +++ b/docs/src/DataExtractPostResponse.md @@ -0,0 +1,15 @@ +# DataExtractPostResponse + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**extractDefinition** | [***DataExtractExtractDefinition**](DataExtractExtractDefinition.md) | | [optional] [default to nothing] +**number** | **Int64** | | [optional] [default to nothing] +**status** | **String** | | [optional] [default to nothing] +**downloadLinks** | [***DataExtractDownloadLinks**](DataExtractDownloadLinks.md) | | [optional] [default to nothing] + + +[[Back to Model list]](../README.md#models) [[Back to API list]](../README.md#api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/src/DataTableFull.md b/docs/src/DataTableFull.md new file mode 100644 index 0000000..bad0184 --- /dev/null +++ b/docs/src/DataTableFull.md @@ -0,0 +1,18 @@ +# DataTableFull + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] [default to nothing] +**nhgisCode** | **String** | | [optional] [default to nothing] +**description** | **String** | | [optional] [default to nothing] +**universe** | **String** | | [optional] [default to nothing] +**sequence** | **Int64** | | [optional] [default to nothing] +**datasetName** | **String** | | [optional] [default to nothing] +**variables** | [**Vector{DataTableFullVariablesInner}**](DataTableFullVariablesInner.md) | | [optional] [default to nothing] + + +[[Back to Model list]](../README.md#models) [[Back to API list]](../README.md#api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/src/DataTableFullVariablesInner.md b/docs/src/DataTableFullVariablesInner.md new file mode 100644 index 0000000..615b9c6 --- /dev/null +++ b/docs/src/DataTableFullVariablesInner.md @@ -0,0 +1,13 @@ +# DataTableFullVariablesInner + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] [default to nothing] +**nhgisCode** | **String** | | [optional] [default to nothing] + + +[[Back to Model list]](../README.md#models) [[Back to API list]](../README.md#api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/src/DataTableSimple.md b/docs/src/DataTableSimple.md new file mode 100644 index 0000000..d43a184 --- /dev/null +++ b/docs/src/DataTableSimple.md @@ -0,0 +1,15 @@ +# DataTableSimple + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] [default to nothing] +**nhgisCode** | **String** | | [optional] [default to nothing] +**description** | **String** | | [optional] [default to nothing] +**sequence** | **Int64** | | [optional] [default to nothing] + + +[[Back to Model list]](../README.md#models) [[Back to API list]](../README.md#api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/src/Dataset.md b/docs/src/Dataset.md new file mode 100644 index 0000000..3eade38 --- /dev/null +++ b/docs/src/Dataset.md @@ -0,0 +1,15 @@ +# Dataset + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dataTables** | **Vector{String}** | | [default to nothing] +**geogLevels** | **Vector{String}** | | [default to nothing] +**breakdownValues** | **Vector{String}** | | [optional] [default to nothing] +**years** | **Vector{String}** | | [optional] [default to nothing] + + +[[Back to Model list]](../README.md#models) [[Back to API list]](../README.md#api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/src/DatasetFull.md b/docs/src/DatasetFull.md new file mode 100644 index 0000000..dbe91ae --- /dev/null +++ b/docs/src/DatasetFull.md @@ -0,0 +1,19 @@ +# DatasetFull + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] [default to nothing] +**description** | **String** | | [optional] [default to nothing] +**group** | **String** | | [optional] [default to nothing] +**sequence** | **Int64** | | [optional] [default to nothing] +**dataTables** | [**Vector{DataTableSimple}**](DataTableSimple.md) | | [optional] [default to nothing] +**geogLevels** | [**Vector{DatasetFullGeogLevelsInner}**](DatasetFullGeogLevelsInner.md) | | [optional] [default to nothing] +**hasMultipleDataTypes** | **Bool** | | [optional] [default to nothing] +**breakdowns** | [***DatasetFullBreakdowns**](DatasetFullBreakdowns.md) | | [optional] [default to nothing] + + +[[Back to Model list]](../README.md#models) [[Back to API list]](../README.md#api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/src/DatasetFullBreakdowns.md b/docs/src/DatasetFullBreakdowns.md new file mode 100644 index 0000000..01f87a5 --- /dev/null +++ b/docs/src/DatasetFullBreakdowns.md @@ -0,0 +1,17 @@ +# DatasetFullBreakdowns + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] [default to nothing] +**type** | **String** | | [optional] [default to nothing] +**description** | **String** | | [optional] [default to nothing] +**breakdownValues** | [**Vector{DatasetFullBreakdownsBreakdownValuesInner}**](DatasetFullBreakdownsBreakdownValuesInner.md) | | [optional] [default to nothing] +**years** | **Vector{String}** | | [optional] [default to nothing] +**geographicInstances** | [**Vector{DatasetFullBreakdownsBreakdownValuesInner}**](DatasetFullBreakdownsBreakdownValuesInner.md) | | [optional] [default to nothing] + + +[[Back to Model list]](../README.md#models) [[Back to API list]](../README.md#api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/src/DatasetFullBreakdownsBreakdownValuesInner.md b/docs/src/DatasetFullBreakdownsBreakdownValuesInner.md new file mode 100644 index 0000000..28968b0 --- /dev/null +++ b/docs/src/DatasetFullBreakdownsBreakdownValuesInner.md @@ -0,0 +1,13 @@ +# DatasetFullBreakdownsBreakdownValuesInner + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] [default to nothing] +**description** | **String** | | [optional] [default to nothing] + + +[[Back to Model list]](../README.md#models) [[Back to API list]](../README.md#api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/src/DatasetFullGeogLevelsInner.md b/docs/src/DatasetFullGeogLevelsInner.md new file mode 100644 index 0000000..9ca0d28 --- /dev/null +++ b/docs/src/DatasetFullGeogLevelsInner.md @@ -0,0 +1,14 @@ +# DatasetFullGeogLevelsInner + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] [default to nothing] +**description** | **String** | | [optional] [default to nothing] +**hasGeogExtentSelection** | **Bool** | | [optional] [default to nothing] + + +[[Back to Model list]](../README.md#models) [[Back to API list]](../README.md#api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/src/DatasetSimple.md b/docs/src/DatasetSimple.md new file mode 100644 index 0000000..8b0aabd --- /dev/null +++ b/docs/src/DatasetSimple.md @@ -0,0 +1,15 @@ +# DatasetSimple + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] [default to nothing] +**description** | **String** | | [optional] [default to nothing] +**group** | **String** | | [optional] [default to nothing] +**sequence** | **Int64** | | [optional] [default to nothing] + + +[[Back to Model list]](../README.md#models) [[Back to API list]](../README.md#api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/src/DefaultApi.md b/docs/src/DefaultApi.md new file mode 100644 index 0000000..82e2704 --- /dev/null +++ b/docs/src/DefaultApi.md @@ -0,0 +1,347 @@ +# DefaultApi + +All URIs are relative to *https://api.ipums.org* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**extracts_extract_number_get**](DefaultApi.md#extracts_extract_number_get) | **GET** /extracts/{extractNumber} | Get a specific data extract. +[**extracts_get**](DefaultApi.md#extracts_get) | **GET** /extracts | Get a list of recent data extracts. +[**extracts_post**](DefaultApi.md#extracts_post) | **POST** /extracts | Create a data extract +[**metadata_nhgis_data_tables_get**](DefaultApi.md#metadata_nhgis_data_tables_get) | **GET** /metadata/nhgis/data_tables | List all data_tables +[**metadata_nhgis_datasets_dataset_data_tables_data_table_get**](DefaultApi.md#metadata_nhgis_datasets_dataset_data_tables_data_table_get) | **GET** /metadata/nhgis/datasets/{dataset}/data_tables/{dataTable} | Detailed data table view +[**metadata_nhgis_datasets_dataset_get**](DefaultApi.md#metadata_nhgis_datasets_dataset_get) | **GET** /metadata/nhgis/datasets/{dataset} | Detailed dataset view +[**metadata_nhgis_datasets_get**](DefaultApi.md#metadata_nhgis_datasets_get) | **GET** /metadata/nhgis/datasets | List all datasets +[**metadata_nhgis_shapefiles_get**](DefaultApi.md#metadata_nhgis_shapefiles_get) | **GET** /metadata/nhgis/shapefiles | List all the shapefiles. +[**metadata_nhgis_time_series_tables_get**](DefaultApi.md#metadata_nhgis_time_series_tables_get) | **GET** /metadata/nhgis/time_series_tables | List all time series tables +[**metadata_nhgis_time_series_tables_time_series_table_get**](DefaultApi.md#metadata_nhgis_time_series_tables_time_series_table_get) | **GET** /metadata/nhgis/time_series_tables/{timeSeriesTable} | Detailed time series table view + + +# **extracts_extract_number_get** +> extracts_extract_number_get(_api::DefaultApi, extract_number::Int64, collection::String, version::String; _mediaType=nothing) -> DataExtract, OpenAPI.Clients.ApiResponse
+> extracts_extract_number_get(_api::DefaultApi, response_stream::Channel, extract_number::Int64, collection::String, version::String; _mediaType=nothing) -> Channel{ DataExtract }, OpenAPI.Clients.ApiResponse + +Get a specific data extract. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_api** | **DefaultApi** | API context | +**extract_number** | **Int64**| Number of extract to get. | [default to nothing] +**collection** | **String**| The data collection. This parameter was previously called \"product\". Using \"product\" as an alias for \"collection\" is still valid but may be deprecated in a future version of the API. | [default to nothing] +**version** | **String**| The api version. | [default to nothing] + +### Return type + +[**DataExtract**](DataExtract.md) + +### Authorization + +[APIKeyHeader](../README.md#APIKeyHeader) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +# **extracts_get** +> extracts_get(_api::DefaultApi, collection::String, version::String; page_number=nothing, page_size=nothing, _mediaType=nothing) -> Vector{DataExtract}, OpenAPI.Clients.ApiResponse
+> extracts_get(_api::DefaultApi, response_stream::Channel, collection::String, version::String; page_number=nothing, page_size=nothing, _mediaType=nothing) -> Channel{ Vector{DataExtract} }, OpenAPI.Clients.ApiResponse + +Get a list of recent data extracts. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_api** | **DefaultApi** | API context | +**collection** | **String**| The data collection. This parameter was previously called \"product\". Using \"product\" as an alias for \"collection\" is still valid but may be deprecated in a future version of the API. | [default to nothing] +**version** | **String**| The api version. | [default to nothing] + +### Optional Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page_number** | **Int64**| The page number. | [default to nothing] + **page_size** | **Int64**| The number of records to return per page. | [default to nothing] + +### Return type + +[**Vector{DataExtract}**](DataExtract.md) + +### Authorization + +[APIKeyHeader](../README.md#APIKeyHeader) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +# **extracts_post** +> extracts_post(_api::DefaultApi, collection::String, version::String; data_extract_post=nothing, _mediaType=nothing) -> DataExtractPostResponse, OpenAPI.Clients.ApiResponse
+> extracts_post(_api::DefaultApi, response_stream::Channel, collection::String, version::String; data_extract_post=nothing, _mediaType=nothing) -> Channel{ DataExtractPostResponse }, OpenAPI.Clients.ApiResponse + +Create a data extract + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_api** | **DefaultApi** | API context | +**collection** | **String**| The data collection. This parameter was previously called \"product\". Using \"product\" as an alias for \"collection\" is still valid but may be deprecated in a future version of the API. | [default to nothing] +**version** | **String**| The api version. | [default to nothing] + +### Optional Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **data_extract_post** | [**DataExtractPost**](DataExtractPost.md)| | + +### Return type + +[**DataExtractPostResponse**](DataExtractPostResponse.md) + +### Authorization + +[APIKeyHeader](../README.md#APIKeyHeader) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +# **metadata_nhgis_data_tables_get** +> metadata_nhgis_data_tables_get(_api::DefaultApi, version::String; page_number=nothing, page_size=nothing, _mediaType=nothing) -> DataTableFull, OpenAPI.Clients.ApiResponse
+> metadata_nhgis_data_tables_get(_api::DefaultApi, response_stream::Channel, version::String; page_number=nothing, page_size=nothing, _mediaType=nothing) -> Channel{ DataTableFull }, OpenAPI.Clients.ApiResponse + +List all data_tables + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_api** | **DefaultApi** | API context | +**version** | **String**| The api version. | [default to nothing] + +### Optional Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page_number** | **Int64**| The page number. | [default to nothing] + **page_size** | **Int64**| The number of records to return per page. | [default to nothing] + +### Return type + +[**DataTableFull**](DataTableFull.md) + +### Authorization + +[APIKeyHeader](../README.md#APIKeyHeader) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +# **metadata_nhgis_datasets_dataset_data_tables_data_table_get** +> metadata_nhgis_datasets_dataset_data_tables_data_table_get(_api::DefaultApi, dataset::String, data_table::String, version::String; _mediaType=nothing) -> DataTableFull, OpenAPI.Clients.ApiResponse
+> metadata_nhgis_datasets_dataset_data_tables_data_table_get(_api::DefaultApi, response_stream::Channel, dataset::String, data_table::String, version::String; _mediaType=nothing) -> Channel{ DataTableFull }, OpenAPI.Clients.ApiResponse + +Detailed data table view + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_api** | **DefaultApi** | API context | +**dataset** | **String**| The name of the dataset. | [default to nothing] +**data_table** | **String**| The name of the data table. | [default to nothing] +**version** | **String**| The api version. | [default to nothing] + +### Return type + +[**DataTableFull**](DataTableFull.md) + +### Authorization + +[APIKeyHeader](../README.md#APIKeyHeader) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +# **metadata_nhgis_datasets_dataset_get** +> metadata_nhgis_datasets_dataset_get(_api::DefaultApi, dataset::String, version::String; _mediaType=nothing) -> DatasetFull, OpenAPI.Clients.ApiResponse
+> metadata_nhgis_datasets_dataset_get(_api::DefaultApi, response_stream::Channel, dataset::String, version::String; _mediaType=nothing) -> Channel{ DatasetFull }, OpenAPI.Clients.ApiResponse + +Detailed dataset view + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_api** | **DefaultApi** | API context | +**dataset** | **String**| The name of the dataset. | [default to nothing] +**version** | **String**| The api version. | [default to nothing] + +### Return type + +[**DatasetFull**](DatasetFull.md) + +### Authorization + +[APIKeyHeader](../README.md#APIKeyHeader) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +# **metadata_nhgis_datasets_get** +> metadata_nhgis_datasets_get(_api::DefaultApi, version::String; page_number=nothing, page_size=nothing, _mediaType=nothing) -> Vector{DatasetSimple}, OpenAPI.Clients.ApiResponse
+> metadata_nhgis_datasets_get(_api::DefaultApi, response_stream::Channel, version::String; page_number=nothing, page_size=nothing, _mediaType=nothing) -> Channel{ Vector{DatasetSimple} }, OpenAPI.Clients.ApiResponse + +List all datasets + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_api** | **DefaultApi** | API context | +**version** | **String**| The api version. | [default to nothing] + +### Optional Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page_number** | **Int64**| The page number. | [default to nothing] + **page_size** | **Int64**| The number of records to return per page. | [default to nothing] + +### Return type + +[**Vector{DatasetSimple}**](DatasetSimple.md) + +### Authorization + +[APIKeyHeader](../README.md#APIKeyHeader) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +# **metadata_nhgis_shapefiles_get** +> metadata_nhgis_shapefiles_get(_api::DefaultApi, version::String; page_number=nothing, page_size=nothing, _mediaType=nothing) -> Vector{Shapefile}, OpenAPI.Clients.ApiResponse
+> metadata_nhgis_shapefiles_get(_api::DefaultApi, response_stream::Channel, version::String; page_number=nothing, page_size=nothing, _mediaType=nothing) -> Channel{ Vector{Shapefile} }, OpenAPI.Clients.ApiResponse + +List all the shapefiles. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_api** | **DefaultApi** | API context | +**version** | **String**| The api version. | [default to nothing] + +### Optional Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page_number** | **Int64**| The page number. | [default to nothing] + **page_size** | **Int64**| The number of records to return per page. | [default to nothing] + +### Return type + +[**Vector{Shapefile}**](Shapefile.md) + +### Authorization + +[APIKeyHeader](../README.md#APIKeyHeader) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +# **metadata_nhgis_time_series_tables_get** +> metadata_nhgis_time_series_tables_get(_api::DefaultApi, version::String; page_number=nothing, page_size=nothing, _mediaType=nothing) -> Vector{TimeSeriesTableSimple}, OpenAPI.Clients.ApiResponse
+> metadata_nhgis_time_series_tables_get(_api::DefaultApi, response_stream::Channel, version::String; page_number=nothing, page_size=nothing, _mediaType=nothing) -> Channel{ Vector{TimeSeriesTableSimple} }, OpenAPI.Clients.ApiResponse + +List all time series tables + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_api** | **DefaultApi** | API context | +**version** | **String**| The api version. | [default to nothing] + +### Optional Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page_number** | **Int64**| The page number. | [default to nothing] + **page_size** | **Int64**| The number of records to return per page. | [default to nothing] + +### Return type + +[**Vector{TimeSeriesTableSimple}**](TimeSeriesTableSimple.md) + +### Authorization + +[APIKeyHeader](../README.md#APIKeyHeader) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +# **metadata_nhgis_time_series_tables_time_series_table_get** +> metadata_nhgis_time_series_tables_time_series_table_get(_api::DefaultApi, time_series_table::String, version::String; _mediaType=nothing) -> Vector{TimeSeriesTableFull}, OpenAPI.Clients.ApiResponse
+> metadata_nhgis_time_series_tables_time_series_table_get(_api::DefaultApi, response_stream::Channel, time_series_table::String, version::String; _mediaType=nothing) -> Channel{ Vector{TimeSeriesTableFull} }, OpenAPI.Clients.ApiResponse + +Detailed time series table view + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_api** | **DefaultApi** | API context | +**time_series_table** | **String**| The name of the time series table. | [default to nothing] +**version** | **String**| The api version. | [default to nothing] + +### Return type + +[**Vector{TimeSeriesTableFull}**](TimeSeriesTableFull.md) + +### Authorization + +[APIKeyHeader](../README.md#APIKeyHeader) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/docs/src/Error.md b/docs/src/Error.md new file mode 100644 index 0000000..6daae29 --- /dev/null +++ b/docs/src/Error.md @@ -0,0 +1,14 @@ +# Error + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **Int64** | | [default to nothing] +**status** | **String** | | [default to nothing] +**detail** | **String** | | [default to nothing] + + +[[Back to Model list]](../README.md#models) [[Back to API list]](../README.md#api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/src/Shapefile.md b/docs/src/Shapefile.md new file mode 100644 index 0000000..2b4e792 --- /dev/null +++ b/docs/src/Shapefile.md @@ -0,0 +1,17 @@ +# Shapefile + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] [default to nothing] +**year** | **String** | | [optional] [default to nothing] +**geographicLevel** | **String** | | [optional] [default to nothing] +**extent** | **String** | | [optional] [default to nothing] +**basis** | **Int64** | | [optional] [default to nothing] +**sequence** | **Int64** | | [optional] [default to nothing] + + +[[Back to Model list]](../README.md#models) [[Back to API list]](../README.md#api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/src/TimeSeriesTable.md b/docs/src/TimeSeriesTable.md new file mode 100644 index 0000000..d1a29e0 --- /dev/null +++ b/docs/src/TimeSeriesTable.md @@ -0,0 +1,13 @@ +# TimeSeriesTable + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**geogLevels** | **Vector{String}** | | [default to nothing] +**years** | **Vector{String}** | | [optional] [default to nothing] + + +[[Back to Model list]](../README.md#models) [[Back to API list]](../README.md#api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/src/TimeSeriesTableFull.md b/docs/src/TimeSeriesTableFull.md new file mode 100644 index 0000000..0e7b682 --- /dev/null +++ b/docs/src/TimeSeriesTableFull.md @@ -0,0 +1,17 @@ +# TimeSeriesTableFull + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] [default to nothing] +**description** | **String** | | [optional] [default to nothing] +**geographicIntegration** | **String** | | [optional] [default to nothing] +**sequence** | **Float32** | | [optional] [default to nothing] +**timeSeries** | [**Vector{TimeSeriesTableFullTimeSeriesInner}**](TimeSeriesTableFullTimeSeriesInner.md) | | [optional] [default to nothing] +**geogLevels** | [**Vector{TimeSeriesTableFullTimeSeriesInner}**](TimeSeriesTableFullTimeSeriesInner.md) | | [optional] [default to nothing] + + +[[Back to Model list]](../README.md#models) [[Back to API list]](../README.md#api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/src/TimeSeriesTableFullTimeSeriesInner.md b/docs/src/TimeSeriesTableFullTimeSeriesInner.md new file mode 100644 index 0000000..0a7ca8a --- /dev/null +++ b/docs/src/TimeSeriesTableFullTimeSeriesInner.md @@ -0,0 +1,14 @@ +# TimeSeriesTableFullTimeSeriesInner + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] [default to nothing] +**description** | **String** | | [optional] [default to nothing] +**sequence** | **Int64** | | [optional] [default to nothing] + + +[[Back to Model list]](../README.md#models) [[Back to API list]](../README.md#api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/src/TimeSeriesTableSimple.md b/docs/src/TimeSeriesTableSimple.md new file mode 100644 index 0000000..4e7d317 --- /dev/null +++ b/docs/src/TimeSeriesTableSimple.md @@ -0,0 +1,17 @@ +# TimeSeriesTableSimple + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] [default to nothing] +**description** | **String** | | [optional] [default to nothing] +**geographicIntegration** | **String** | | [optional] [default to nothing] +**sequence** | **Float32** | | [optional] [default to nothing] +**timeSeries** | **Vector{String}** | | [optional] [default to nothing] +**geogLevels** | **Vector{String}** | | [optional] [default to nothing] + + +[[Back to Model list]](../README.md#models) [[Back to API list]](../README.md#api-endpoints) [[Back to README]](../README.md) + + diff --git a/nhgis.yml b/nhgis.yml new file mode 100644 index 0000000..052647d --- /dev/null +++ b/nhgis.yml @@ -0,0 +1,833 @@ +openapi: "3.0.0" +info: + version: "v2" + title: IPUMS API for NHGIS +servers: + - url: https://api.ipums.org +security: + - APIKeyHeader: [] +paths: + /metadata/nhgis/data_tables: + get: + summary: List all data_tables + parameters: + - in: query + name: version + schema: + type: string + required: true + description: The api version. + - in: query + name: pageNumber + schema: + type: integer + required: false + description: The page number. + - in: query + name: pageSize + schema: + type: integer + required: false + description: The number of records to return per page. + responses: + '200': + description: An array of data_tables + content: + application/json: + schema: + $ref: "#/components/schemas/DataTableFull" + /metadata/nhgis/datasets: + get: + summary: List all datasets + parameters: + - in: query + name: version + schema: + type: string + required: true + description: The api version. + - in: query + name: pageNumber + schema: + type: integer + required: false + description: The page number. + - in: query + name: pageSize + schema: + type: integer + required: false + description: The number of records to return per page. + responses: + '200': + description: An array of datasets + content: + application/json: + schema: + $ref: "#/components/schemas/Datasets" + example: [ + { + "name": "1790_cPop", + "description": "1790 Census: Population Data [US, States & Counties" + }] + /metadata/nhgis/datasets/{dataset}: + get: + summary: Detailed dataset view + parameters: + - in: path + name: dataset + schema: + type: string + required: true + description: The name of the dataset. + - in: query + name: version + schema: + type: string + required: true + description: The api version. + responses: + '200': + description: A dataset + content: + application/json: + schema: + $ref: "#/components/schemas/DatasetFull" + /metadata/nhgis/datasets/{dataset}/data_tables/{dataTable}: + get: + summary: Detailed data table view + parameters: + - in: path + name: dataset + schema: + type: string + required: true + description: The name of the dataset. + - in: path + name: dataTable + schema: + type: string + required: true + description: The name of the data table. + - in: query + name: version + schema: + type: string + required: true + description: The api version. + responses: + '200': + description: A data table + content: + application/json: + schema: + $ref: "#/components/schemas/DataTableFull" + /metadata/nhgis/time_series_tables: + get: + summary: List all time series tables + parameters: + - in: query + name: version + schema: + type: string + required: true + description: The api version. + - in: query + name: pageNumber + schema: + type: integer + required: false + description: The page number. + - in: query + name: pageSize + schema: + type: integer + required: false + description: The number of records to return per page. + responses: + '200': + description: An array of time series tables + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/TimeSeriesTableSimple" + /metadata/nhgis/time_series_tables/{timeSeriesTable}: + get: + summary: Detailed time series table view + parameters: + - in: path + name: timeSeriesTable + schema: + type: string + required: true + description: The name of the time series table. + - in: query + name: version + schema: + type: string + required: true + description: The api version. + responses: + '200': + description: A time series table + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/TimeSeriesTableFull" + /metadata/nhgis/shapefiles: + get: + summary: List all the shapefiles. + parameters: + - in: query + name: version + schema: + type: string + required: true + description: The api version. + - in: query + name: pageNumber + schema: + type: integer + required: false + description: The page number. + - in: query + name: pageSize + schema: + type: integer + required: false + description: The number of records to return per page. + responses: + '200': + description: An array of shapefiles. + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Shapefile" + example: [{ + "name": "base.tl2000.nongen.us_state_1790", + "year": "1790", + "geographicLevel": "state", + "extent": "united states", + "basis": "2000 tiger/line +", + "sequence": 1 + } + ] + /extracts/{extractNumber}: + get: + summary: Get a specific data extract. + parameters: + - in: path + name: extractNumber + schema: + type: integer + required: true + description: Number of extract to get. + - in: query + name: collection + schema: + type: string + required: true + description: The data collection. This parameter was previously called "product". Using "product" as an alias for "collection" is still valid but may be deprecated in a future version of the API. + - in: query + name: version + schema: + type: string + required: true + description: The api version. + responses: + '200': + description: A data extract. + content: + application/json: + schema: + $ref: "#/components/schemas/DataExtract" + /extracts: + get: + summary: Get a list of recent data extracts. + parameters: + - in: query + name: collection + schema: + type: string + required: true + description: The data collection. This parameter was previously called "product". Using "product" as an alias for "collection" is still valid but may be deprecated in a future version of the API. + - in: query + name: version + schema: + type: string + required: true + description: The api version. + - in: query + name: pageNumber + schema: + type: integer + required: false + description: The page number. + - in: query + name: pageSize + schema: + type: integer + required: false + description: The number of records to return per page. + responses: + '200': + description: An array of data extracts. + content: + application/json: + schema: + $ref: "#/components/schemas/DataExtracts" + post: + summary: Create a data extract + parameters: + - in: query + name: collection + schema: + type: string + required: true + description: The data collection. This parameter was previously called "product". Using "product" as an alias for "collection" is still valid but may be deprecated in a future version of the API. + - in: query + name: version + schema: + type: string + required: true + description: The api version. + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/DataExtractPost" + responses: + '200': + description: Created data extract + content: + application/json: + + schema: + $ref: "#/components/schemas/DataExtractPostResponse" +components: + schemas: + TimeSeriesTableFull: + example: { + "name": "A00", + "description": "Total Population", + "geographicIntegration": "Nominal", + "sequence": 0.01, + "timeSeries": [ + { + "name": "AA", + "description": "Persons: Total", + "sequence": 1 + } + ], + "geogLevels": [ + { + "name": "state", + "description": "State", + "sequence": 4 + }, + { + "name": "county", + "description": "State--County", + "sequence": 25 + } + ]} + properties: + name: + type: string + description: + type: string + geographicIntegration: + type: string + sequence: + type: float + timeSeries: + type: array + items: + properties: + name: + type: string + description: + type: string + sequence: + type: integer + geogLevels: + type: array + items: + properties: + name: + type: string + description: + type: string + sequence: + type: integer + TimeSeriesTableSimple: + example: { + "name": "A00", + "description": "Total Population", + "geographicIntegration": "Nominal", + "sequence": 0.01, + "years": [ + "1790", + "1800", + "1810", + "1820", + "1830", + "1840", + "1850", + "1860", + "1870", + "1880", + "1890", + "1900", + "1910", + "1920", + "1930", + "1940", + "1950", + "1960", + "1970", + "1980", + "1990", + "2000", + "2010" + ], + "geogLevels": [ + "state", + "county" + ] + } + properties: + name: + type: string + description: + type: string + geographicIntegration: + type: string + sequence: + type: float + timeSeries: + type: array + items: + type: string + geogLevels: + type: array + items: + type: string + DataTableFull: + example: { + "name": "NT1", + "description": "Total Population", + "universe": "Persons", + "nhgisCode": "AAA", + "sequence": 1, + "datasetName": "1790_cPop", + "variables": [ {"description": "Total", "nhgisCode": "AAA001" } ] + } + properties: + name: + type: string + nhgisCode: + type: string + description: + type: string + universe: + type: string + sequence: + type: integer + datasetName: + type: string + variables: + type: array + items: + properties: + name: + type: string + nhgisCode: + type: string + DataTableSimple: + example: { + "name": "NT1", + "nhgisCode": "AAA", + "description": "Total Population", + "sequence": 1 + } + properties: + name: + type: string + nhgisCode: + type: string + description: + type: string + sequence: + type: integer + DatasetFull: + example: { + "name": "2010_SF1a", + "group": "2010 Census", + "description": "SF 1a - P & H Tables [Blocks & Larger Areas]", + "sequence": 4802, + "hasMultipleDataTypes": false, + "dataTables": [ + { + "name": "P1", + "nhgisCode": "H7V", + "description": "Total Population", + "sequence": 1 + } + ], + "geogLevels": [ + { + "name": "nation", + "description": "Nation", + "hasGeogExtentSelection": false, + "sequence": 1 + } + ], + "geographicInstances": [ + { + "name": "010", + "description": "Alabama" + } + ], + "breakdowns": [ + { + "name": "bs32", + "type": "Spatial", + "description": "Geographic Subarea (2010 Census and American Community Survey)", + "breakdownValues": [ + { + "name": "bs32.ge00", + "description": "Total area" + } + ] + } + ] + } + properties: + name: + type: string + description: + type: string + group: + type: string + sequence: + type: integer + dataTables: + type: array + items: + $ref: "#/components/schemas/DataTableSimple" + geogLevels: + type: array + items: + type: object + properties: + name: + type: string + description: + type: string + hasGeogExtentSelection: + type: boolean + hasMultipleDataTypes: + type: boolean + breakdowns: + type: object + properties: + name: + type: string + type: + type: string + description: + type: string + breakdownValues: + type: array + items: + type: object + properties: + name: + type: string + description: + type: string + years: + type: array + items: + type: string + geographicInstances: + type: array + items: + type: object + properties: + name: + type: string + description: + type: string + DatasetSimple: + example: { + "name": "1790_cPop", + "description": "1790 Census: Population Data [US, States & Counties", + "group": "1790 Census", + "sequence": 101 + } + properties: + name: + type: string + description: + type: string + group: + type: string + sequence: + type: integer + Datasets: + type: array + items: + $ref: "#/components/schemas/DatasetSimple" + Shapefile: + example: { + "name": "base.tl2000.nongen.us_state_1790", + "year": "1790", + "geographicLevel": "state", + "extent": "united states", + "basis": "2000 tiger/line +", + "sequence": 1 + } + properties: + name: + type: string + year: + type: string + geographicLevel: + type: string + extent: + type: string + basis: + type: integer + sequence: + type: integer + DataExtract: &DataExtract + example: { + "extractDefinition": { + "datasets": { + "1790_cPop": {"dataTables":[ "NT1" ], "geogLevels":[ "place_00498" ] }, + "1800_cPop": {"dataTables":[ "NT3" ], "geogLevels":[ "state" ] } + }, + "timeSeriesTables": { + "A00": { "geogLevels": ["state"] } + }, + "timeSeriesTableLayout": "time_by_row_layout", + "dataFormat": "csv_no_header", + "description": "abc", + "version": 2, + "collection": "nhgis" + }, + "number": 2, + "status": "complete", + "downloadLinks": { + "codebookPreview": "https://api.ipums.org/downloads/nhgis/api/v1/extracts/1234567/nhgis0007_csv_PREVIEW.zip", + "tableData": "https://api.ipums.org/downloads/nhgis/api/v1/extracts/1234567/nhgis0007_csv.zip", + "gisData": "https://api.ipums.org/downloads/nhgis/api/v1/extracts/1234567/nhgis0007_shape.zip" + } + } + properties: + extractDefinition: + type: object + properties: + datasets: + type: object + additionalProperties: + $ref: "#/components/schemas/Dataset" + timeSeriesTables: + type: object + additionalProperties: + $ref: "#/components/schemas/TimeSeriesTable" + dataFormat: + type: string + enum: [ csv_no_header, csv_header, fixed_width ] + timeSeriesTableLayout: + type: string + enum: [ time_by_column_layout, time_by_row_layout, time_by_file_layout ] + breakdownAndDataTypeLayout: + type: string + enum: [ separate_files, single_file ] + shapefiles: + type: array + items: + type: string + geographicExtents: + type: array + items: + type: string + description: + type: string + version: + type: integer + format: int32 + collection: + type: string + number: + type: integer + format: int64 + status: + type: string + downloadLinks: + type: object + properties: + codebookPreview: + type: string + tableData: + type: string + gisData: + type: string + DataExtractPost: + <<: *DataExtract + example: { + "datasets": { + "1790_cPop": { + "dataTables": [ + "NT1" + ], + "geogLevels": [ + "state" + ] + } + }, + "timeSeriesTables": { + "A00": { + "geogLevels": [ + "state" + ], + "years": [ + "1990" + ] + } + }, + "timeSeriesTableLayout": "time_by_row_layout", + "dataFormat": "csv_no_header", + "description": "abc" + } + properties: + datasets: + type: object + additionalProperties: + $ref: "#/components/schemas/Dataset" + timeSeriesTables: + type: object + additionalProperties: + $ref: "#/components/schemas/TimeSeriesTable" + dataFormat: + type: string + enum: [csv_no_header, csv_header, fixed_width] + timeSeriesTableLayout: + type: string + enum: [time_by_column_layout, time_by_row_layout, time_by_file_layout] + breakdownAndDataTypeLayout: + type: string + enum: [separate_files, single_file] + shapefiles: + type: array + items: + type: string + geographicExtents: + type: array + items: + type: string + description: + type: string + DataExtractPostResponse: + <<: *DataExtract + example: { + "number": 90, + "status": "queued", + "downloadLinks": {}, + "extractDefinition": { + "dataFormat": "csv_no_header", + "description": "abc", + "datasets": { + "1790_cPop": { + "dataTables": [ + "NT1" + ], + "geogLevels": [ + "state" + ] + } + }, + "timeSeriesTables": { + "A00": { + "geogLevels": [ + "state" + ], + "years": [ + "1990" + ] + } + }, + "timeSeriesTableLayout": "time_by_row_layout", + "version": 2, + "collection": "nhgis" + }, + "errors": {} + } + DataExtracts: + type: array + items: + $ref: "#/components/schemas/DataExtract" + Dataset: + type: object + required: + - geogLevels + - dataTables + properties: + dataTables: + type: array + items: + type: string + geogLevels: + type: array + items: + type: string + breakdownValues: + type: array + items: + type: string + years: + type: array + items: + type: string + TimeSeriesTable: + type: object + required: + - geogLevels + properties: + geogLevels: + type: array + items: + type: string + years: + type: array + items: + type: string + Error: + required: + - type + - status + - detail + properties: + type: + type: integer + format: int32 + status: + type: string + detail: + type: string + securitySchemes: + APIKeyHeader: + type: apiKey + in: header + name: Authorization + + diff --git a/src/IPUMS.jl b/src/IPUMS.jl index 169d0fc..eb415b2 100644 --- a/src/IPUMS.jl +++ b/src/IPUMS.jl @@ -1,13 +1,61 @@ module IPUMS -import Base: - @kwdef + import Base: + @kwdef -using DataFrames -using HTTP + using DataFrames + using Dates + using HTTP + using JSON3 + using OpenAPI + using OpenAPI.Clients + import OpenAPI: + Client + using TimeZones + using URIs -include("structs.jl") -include("constants.jl") -include("helpers.jl") + include("structs.jl") + include("constants.jl") + include("helpers.jl") + + #= + + This information was generated by the OpenAPI documentation and + subsequently better incorporated into the whole of the package + + =# + + const API_VERSION = "v2" + + include("modelincludes.jl") + include("apis/api_DefaultApi.jl") + include("piracy.jl") + + #= + export from_json + export DataExtract + export DataExtractDownloadLinks + export DataExtractExtractDefinition + export DataExtractPost + export DataExtractPostResponse + export DataTableFull + export DataTableFullVariablesInner + export DataTableSimple + export Dataset + export DatasetFull + export DatasetFullBreakdowns + export DatasetFullBreakdownsBreakdownValuesInner + export DatasetFullGeogLevelsInner + export DatasetSimple + export Error + export Shapefile + export TimeSeriesTable + export TimeSeriesTableFull + export TimeSeriesTableFullTimeSeriesInner + export TimeSeriesTableSimple + =# + + export Client + export DefaultApi end diff --git a/src/apis/api_DefaultApi.jl b/src/apis/api_DefaultApi.jl new file mode 100644 index 0000000..8c0256f --- /dev/null +++ b/src/apis/api_DefaultApi.jl @@ -0,0 +1,375 @@ +# This file was generated by the Julia OpenAPI Code Generator +# Do not modify this file directly. Modify the OpenAPI specification instead. + +struct DefaultApi <: OpenAPI.APIClientImpl + client::OpenAPI.Clients.Client +end + +""" +The default API base path for APIs in `DefaultApi`. +This can be used to construct the `OpenAPI.Clients.Client` instance. +""" +basepath(::Type{ DefaultApi }) = "https://api.ipums.org" + +const _returntypes_extracts_extract_number_get_DefaultApi = Dict{Regex,Type}( + Regex("^" * replace("200", "x"=>".") * "\$") => DataExtract, +) + +function _oacinternal_extracts_extract_number_get(_api::DefaultApi, extract_number::Int64, collection::String, version::String; _mediaType=nothing) + _ctx = OpenAPI.Clients.Ctx(_api.client, "GET", _returntypes_extracts_extract_number_get_DefaultApi, "/extracts/{extractNumber}", ["APIKeyHeader", ]) + OpenAPI.Clients.set_param(_ctx.path, "extractNumber", extract_number) # type Int64 + OpenAPI.Clients.set_param(_ctx.query, "collection", collection) # type String + OpenAPI.Clients.set_param(_ctx.query, "version", version) # type String + OpenAPI.Clients.set_header_accept(_ctx, ["application/json", ]) + OpenAPI.Clients.set_header_content_type(_ctx, (_mediaType === nothing) ? [] : [_mediaType]) + return _ctx +end + +@doc raw"""Get a specific data extract. + +Params: +- extract_number::Int64 (required) +- collection::String (required) +- version::String (required) + +Return: DataExtract, OpenAPI.Clients.ApiResponse +""" +function extracts_extract_number_get(_api::DefaultApi, extract_number::Int64, collection::String, version::String; _mediaType=nothing) + _ctx = _oacinternal_extracts_extract_number_get(_api, extract_number, collection, version; _mediaType=_mediaType) + return OpenAPI.Clients.exec(_ctx) +end + +function extracts_extract_number_get(_api::DefaultApi, response_stream::Channel, extract_number::Int64, collection::String, version::String; _mediaType=nothing) + _ctx = _oacinternal_extracts_extract_number_get(_api, extract_number, collection, version; _mediaType=_mediaType) + return OpenAPI.Clients.exec(_ctx, response_stream) +end + +const _returntypes_extracts_get_DefaultApi = Dict{Regex,Type}( + Regex("^" * replace("200", "x"=>".") * "\$") => Vector{DataExtract}, +) + +function _oacinternal_extracts_get(_api::DefaultApi, collection::String, version::String; page_number=nothing, page_size=nothing, _mediaType=nothing) + _ctx = OpenAPI.Clients.Ctx(_api.client, "GET", _returntypes_extracts_get_DefaultApi, "/extracts", ["APIKeyHeader", ]) + OpenAPI.Clients.set_param(_ctx.query, "collection", collection) # type String + OpenAPI.Clients.set_param(_ctx.query, "version", version) # type String + OpenAPI.Clients.set_param(_ctx.query, "pageNumber", page_number) # type Int64 + OpenAPI.Clients.set_param(_ctx.query, "pageSize", page_size) # type Int64 + OpenAPI.Clients.set_header_accept(_ctx, ["application/json", ]) + OpenAPI.Clients.set_header_content_type(_ctx, (_mediaType === nothing) ? [] : [_mediaType]) + return _ctx +end + +@doc raw"""Get a list of recent data extracts. + +Params: +- collection::String (required) +- version::String (required) +- page_number::Int64 +- page_size::Int64 + +Return: Vector{DataExtract}, OpenAPI.Clients.ApiResponse +""" +function extracts_get(_api::DefaultApi, collection::String, version::String; page_number=nothing, page_size=nothing, _mediaType=nothing) + _ctx = _oacinternal_extracts_get(_api, collection, version; page_number=page_number, page_size=page_size, _mediaType=_mediaType) + return OpenAPI.Clients.exec(_ctx) +end + +function extracts_get(_api::DefaultApi, response_stream::Channel, collection::String, version::String; page_number=nothing, page_size=nothing, _mediaType=nothing) + _ctx = _oacinternal_extracts_get(_api, collection, version; page_number=page_number, page_size=page_size, _mediaType=_mediaType) + return OpenAPI.Clients.exec(_ctx, response_stream) +end + +const _returntypes_extracts_post_DefaultApi = Dict{Regex,Type}( + Regex("^" * replace("200", "x"=>".") * "\$") => DataExtractPostResponse, +) + +function _oacinternal_extracts_post(_api::DefaultApi, collection::String, version::String; data_extract_post=nothing, _mediaType=nothing) + _ctx = OpenAPI.Clients.Ctx(_api.client, "POST", _returntypes_extracts_post_DefaultApi, "/extracts", ["APIKeyHeader", ], data_extract_post) + OpenAPI.Clients.set_param(_ctx.query, "collection", collection) # type String + OpenAPI.Clients.set_param(_ctx.query, "version", version) # type String + OpenAPI.Clients.set_header_accept(_ctx, ["application/json", ]) + OpenAPI.Clients.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/json", ] : [_mediaType]) + return _ctx +end + +@doc raw"""Create a data extract + +Params: +- collection::String (required) +- version::String (required) +- data_extract_post::DataExtractPost + +Return: DataExtractPostResponse, OpenAPI.Clients.ApiResponse +""" +function extracts_post(_api::DefaultApi, collection::String, version::String; data_extract_post=nothing, _mediaType=nothing) + _ctx = _oacinternal_extracts_post(_api, collection, version; data_extract_post=data_extract_post, _mediaType=_mediaType) + return OpenAPI.Clients.exec(_ctx) +end + +function extracts_post(_api::DefaultApi, response_stream::Channel, collection::String, version::String; data_extract_post=nothing, _mediaType=nothing) + _ctx = _oacinternal_extracts_post(_api, collection, version; data_extract_post=data_extract_post, _mediaType=_mediaType) + return OpenAPI.Clients.exec(_ctx, response_stream) +end + +const _returntypes_metadata_nhgis_data_tables_get_DefaultApi = Dict{Regex,Type}( + Regex("^" * replace("200", "x"=>".") * "\$") => DataTableFull, +) + +function _oacinternal_metadata_nhgis_data_tables_get(_api::DefaultApi, version::String; page_number=nothing, page_size=nothing, _mediaType=nothing) + _ctx = OpenAPI.Clients.Ctx(_api.client, "GET", _returntypes_metadata_nhgis_data_tables_get_DefaultApi, "/metadata/nhgis/data_tables", ["APIKeyHeader", ]) + OpenAPI.Clients.set_param(_ctx.query, "version", version) # type String + OpenAPI.Clients.set_param(_ctx.query, "pageNumber", page_number) # type Int64 + OpenAPI.Clients.set_param(_ctx.query, "pageSize", page_size) # type Int64 + OpenAPI.Clients.set_header_accept(_ctx, ["application/json", ]) + OpenAPI.Clients.set_header_content_type(_ctx, (_mediaType === nothing) ? [] : [_mediaType]) + return _ctx +end + +@doc raw"""List all data_tables + +Params: +- version::String (required) +- page_number::Int64 +- page_size::Int64 + +Return: DataTableFull, OpenAPI.Clients.ApiResponse +""" +function metadata_nhgis_data_tables_get(_api::DefaultApi, version::String; page_number=nothing, page_size=nothing, _mediaType=nothing) + _ctx = _oacinternal_metadata_nhgis_data_tables_get(_api, version; page_number=page_number, page_size=page_size, _mediaType=_mediaType) + intermediate = OpenAPI.Clients.exec(_ctx)[2] + HTTP.request(_ctx.method, intermediate.raw.url, _ctx.header) |> + x -> String(x.body) |> + JSON3.read |> + x -> [DataTableFull(d.name, + d.nhgisCode, + d.description, + d.universe, + d.sequence, + d.datasetName, + [d.nVariables]) + for d in x[:data]] + + # NOTE: I had to manually do a hack here to get this working +end + +function metadata_nhgis_data_tables_get(_api::DefaultApi, response_stream::Channel, version::String; page_number=nothing, page_size=nothing, _mediaType=nothing) + _ctx = _oacinternal_metadata_nhgis_data_tables_get(_api, version; page_number=page_number, page_size=page_size, _mediaType=_mediaType) + return OpenAPI.Clients.exec(_ctx, response_stream) +end + +const _returntypes_metadata_nhgis_datasets_dataset_data_tables_data_table_get_DefaultApi = Dict{Regex,Type}( + Regex("^" * replace("200", "x"=>".") * "\$") => DataTableFull, +) + +function _oacinternal_metadata_nhgis_datasets_dataset_data_tables_data_table_get(_api::DefaultApi, dataset::String, data_table::String, version::String; _mediaType=nothing) + _ctx = OpenAPI.Clients.Ctx(_api.client, "GET", _returntypes_metadata_nhgis_datasets_dataset_data_tables_data_table_get_DefaultApi, "/metadata/nhgis/datasets/{dataset}/data_tables/{dataTable}", ["APIKeyHeader", ]) + OpenAPI.Clients.set_param(_ctx.path, "dataset", dataset) # type String + OpenAPI.Clients.set_param(_ctx.path, "dataTable", data_table) # type String + OpenAPI.Clients.set_param(_ctx.query, "version", version) # type String + OpenAPI.Clients.set_header_accept(_ctx, ["application/json", ]) + OpenAPI.Clients.set_header_content_type(_ctx, (_mediaType === nothing) ? [] : [_mediaType]) + return _ctx +end + +@doc raw"""Detailed data table view + +Params: +- dataset::String (required) +- data_table::String (required) +- version::String (required) + +Return: DataTableFull, OpenAPI.Clients.ApiResponse +""" +function metadata_nhgis_datasets_dataset_data_tables_data_table_get(_api::DefaultApi, dataset::String, data_table::String, version::String; _mediaType=nothing) + _ctx = _oacinternal_metadata_nhgis_datasets_dataset_data_tables_data_table_get(_api, dataset, data_table, version; _mediaType=_mediaType) + return OpenAPI.Clients.exec(_ctx) +end + +function metadata_nhgis_datasets_dataset_data_tables_data_table_get(_api::DefaultApi, response_stream::Channel, dataset::String, data_table::String, version::String; _mediaType=nothing) + _ctx = _oacinternal_metadata_nhgis_datasets_dataset_data_tables_data_table_get(_api, dataset, data_table, version; _mediaType=_mediaType) + return OpenAPI.Clients.exec(_ctx, response_stream) +end + +const _returntypes_metadata_nhgis_datasets_dataset_get_DefaultApi = Dict{Regex,Type}( + Regex("^" * replace("200", "x"=>".") * "\$") => DatasetFull, +) + +function _oacinternal_metadata_nhgis_datasets_dataset_get(_api::DefaultApi, dataset::String, version::String; _mediaType=nothing) + _ctx = OpenAPI.Clients.Ctx(_api.client, "GET", _returntypes_metadata_nhgis_datasets_dataset_get_DefaultApi, "/metadata/nhgis/datasets/{dataset}", ["APIKeyHeader", ]) + OpenAPI.Clients.set_param(_ctx.path, "dataset", dataset) # type String + OpenAPI.Clients.set_param(_ctx.query, "version", version) # type String + OpenAPI.Clients.set_header_accept(_ctx, ["application/json", ]) + OpenAPI.Clients.set_header_content_type(_ctx, (_mediaType === nothing) ? [] : [_mediaType]) + return _ctx +end + +@doc raw"""Detailed dataset view + +Params: +- dataset::String (required) +- version::String (required) + +Return: DatasetFull, OpenAPI.Clients.ApiResponse +""" +function metadata_nhgis_datasets_dataset_get(_api::DefaultApi, dataset::String, version::String; _mediaType=nothing) + _ctx = _oacinternal_metadata_nhgis_datasets_dataset_get(_api, dataset, version; _mediaType=_mediaType) + println(_ctx |> OpenAPI.Clients.prep_args) + println(_ctx) + resource_path = replace(_ctx.resource, "{format}"=>"json") + for (k,v) in _ctx.path + esc_v = _ctx.escape_path_params ? escapeuri(v) : v + resource_path = replace(resource_path, "{$k}"=>esc_v) + end + # append query params if needed + if !isempty(_ctx.query) + resource_path = string(URIs.URI(URIs.URI(resource_path); query=escapeuri(_ctx.query))) + end + HTTP.request(_ctx.method, resource_path, _ctx.header) + # return OpenAPI.Clients.exec(_ctx) +end + +function metadata_nhgis_datasets_dataset_get(_api::DefaultApi, response_stream::Channel, dataset::String, version::String; _mediaType=nothing) + _ctx = _oacinternal_metadata_nhgis_datasets_dataset_get(_api, dataset, version; _mediaType=_mediaType) + return OpenAPI.Clients.exec(_ctx, response_stream) +end + +const _returntypes_metadata_nhgis_datasets_get_DefaultApi = Dict{Regex,Type}( + Regex("^" * replace("200", "x"=>".") * "\$") => Vector{DatasetSimple}, +) + +function _oacinternal_metadata_nhgis_datasets_get(_api::DefaultApi, version::String; page_number=nothing, page_size=nothing, _mediaType=nothing) + _ctx = OpenAPI.Clients.Ctx(_api.client, "GET", _returntypes_metadata_nhgis_datasets_get_DefaultApi, "/metadata/nhgis/datasets", ["APIKeyHeader", ]) + OpenAPI.Clients.set_param(_ctx.query, "version", version) # type String + OpenAPI.Clients.set_param(_ctx.query, "pageNumber", page_number) # type Int64 + OpenAPI.Clients.set_param(_ctx.query, "pageSize", page_size) # type Int64 + OpenAPI.Clients.set_header_accept(_ctx, ["application/json", ]) + OpenAPI.Clients.set_header_content_type(_ctx, (_mediaType === nothing) ? [] : [_mediaType]) + return _ctx +end + +@doc raw"""List all datasets + +Params: +- version::String (required) +- page_number::Int64 +- page_size::Int64 + +Return: Vector{DatasetSimple}, OpenAPI.Clients.ApiResponse +""" +function metadata_nhgis_datasets_get(_api::DefaultApi, version::String; page_number=nothing, page_size=nothing, _mediaType=nothing) + _ctx = _oacinternal_metadata_nhgis_datasets_get(_api, version; page_number=page_number, page_size=page_size, _mediaType=_mediaType) + return OpenAPI.Clients.exec(_ctx) +end + +function metadata_nhgis_datasets_get(_api::DefaultApi, response_stream::Channel, version::String; page_number=nothing, page_size=nothing, _mediaType=nothing) + _ctx = _oacinternal_metadata_nhgis_datasets_get(_api, version; page_number=page_number, page_size=page_size, _mediaType=_mediaType) + return OpenAPI.Clients.exec(_ctx, response_stream) +end + +const _returntypes_metadata_nhgis_shapefiles_get_DefaultApi = Dict{Regex,Type}( + Regex("^" * replace("200", "x"=>".") * "\$") => Vector{Shapefile}, +) + +function _oacinternal_metadata_nhgis_shapefiles_get(_api::DefaultApi, version::String; page_number=nothing, page_size=nothing, _mediaType=nothing) + _ctx = OpenAPI.Clients.Ctx(_api.client, "GET", _returntypes_metadata_nhgis_shapefiles_get_DefaultApi, "/metadata/nhgis/shapefiles", ["APIKeyHeader", ]) + OpenAPI.Clients.set_param(_ctx.query, "version", version) # type String + OpenAPI.Clients.set_param(_ctx.query, "pageNumber", page_number) # type Int64 + OpenAPI.Clients.set_param(_ctx.query, "pageSize", page_size) # type Int64 + OpenAPI.Clients.set_header_accept(_ctx, ["application/json", ]) + OpenAPI.Clients.set_header_content_type(_ctx, (_mediaType === nothing) ? [] : [_mediaType]) + return _ctx +end + +@doc raw"""List all the shapefiles. + +Params: +- version::String (required) +- page_number::Int64 +- page_size::Int64 + +Return: Vector{Shapefile}, OpenAPI.Clients.ApiResponse +""" +function metadata_nhgis_shapefiles_get(_api::DefaultApi, version::String; page_number=nothing, page_size=nothing, _mediaType=nothing) + _ctx = _oacinternal_metadata_nhgis_shapefiles_get(_api, version; page_number=page_number, page_size=page_size, _mediaType=_mediaType) + return OpenAPI.Clients.exec(_ctx) +end + +function metadata_nhgis_shapefiles_get(_api::DefaultApi, response_stream::Channel, version::String; page_number=nothing, page_size=nothing, _mediaType=nothing) + _ctx = _oacinternal_metadata_nhgis_shapefiles_get(_api, version; page_number=page_number, page_size=page_size, _mediaType=_mediaType) + return OpenAPI.Clients.exec(_ctx, response_stream) +end + +const _returntypes_metadata_nhgis_time_series_tables_get_DefaultApi = Dict{Regex,Type}( + Regex("^" * replace("200", "x"=>".") * "\$") => Vector{TimeSeriesTableSimple}, +) + +function _oacinternal_metadata_nhgis_time_series_tables_get(_api::DefaultApi, version::String; page_number=nothing, page_size=nothing, _mediaType=nothing) + _ctx = OpenAPI.Clients.Ctx(_api.client, "GET", _returntypes_metadata_nhgis_time_series_tables_get_DefaultApi, "/metadata/nhgis/time_series_tables", ["APIKeyHeader", ]) + OpenAPI.Clients.set_param(_ctx.query, "version", version) # type String + OpenAPI.Clients.set_param(_ctx.query, "pageNumber", page_number) # type Int64 + OpenAPI.Clients.set_param(_ctx.query, "pageSize", page_size) # type Int64 + OpenAPI.Clients.set_header_accept(_ctx, ["application/json", ]) + OpenAPI.Clients.set_header_content_type(_ctx, (_mediaType === nothing) ? [] : [_mediaType]) + return _ctx +end + +@doc raw"""List all time series tables + +Params: +- version::String (required) +- page_number::Int64 +- page_size::Int64 + +Return: Vector{TimeSeriesTableSimple}, OpenAPI.Clients.ApiResponse +""" +function metadata_nhgis_time_series_tables_get(_api::DefaultApi, version::String; page_number=nothing, page_size=nothing, _mediaType=nothing) + _ctx = _oacinternal_metadata_nhgis_time_series_tables_get(_api, version; page_number=page_number, page_size=page_size, _mediaType=_mediaType) + return OpenAPI.Clients.exec(_ctx) +end + +function metadata_nhgis_time_series_tables_get(_api::DefaultApi, response_stream::Channel, version::String; page_number=nothing, page_size=nothing, _mediaType=nothing) + _ctx = _oacinternal_metadata_nhgis_time_series_tables_get(_api, version; page_number=page_number, page_size=page_size, _mediaType=_mediaType) + return OpenAPI.Clients.exec(_ctx, response_stream) +end + +const _returntypes_metadata_nhgis_time_series_tables_time_series_table_get_DefaultApi = Dict{Regex,Type}( + Regex("^" * replace("200", "x"=>".") * "\$") => Vector{TimeSeriesTableFull}, +) + +function _oacinternal_metadata_nhgis_time_series_tables_time_series_table_get(_api::DefaultApi, time_series_table::String, version::String; _mediaType=nothing) + _ctx = OpenAPI.Clients.Ctx(_api.client, "GET", _returntypes_metadata_nhgis_time_series_tables_time_series_table_get_DefaultApi, "/metadata/nhgis/time_series_tables/{timeSeriesTable}", ["APIKeyHeader", ]) + OpenAPI.Clients.set_param(_ctx.path, "timeSeriesTable", time_series_table) # type String + OpenAPI.Clients.set_param(_ctx.query, "version", version) # type String + OpenAPI.Clients.set_header_accept(_ctx, ["application/json", ]) + OpenAPI.Clients.set_header_content_type(_ctx, (_mediaType === nothing) ? [] : [_mediaType]) + return _ctx +end + +@doc raw"""Detailed time series table view + +Params: +- time_series_table::String (required) +- version::String (required) + +Return: Vector{TimeSeriesTableFull}, OpenAPI.Clients.ApiResponse +""" +function metadata_nhgis_time_series_tables_time_series_table_get(_api::DefaultApi, time_series_table::String, version::String; _mediaType=nothing) + _ctx = _oacinternal_metadata_nhgis_time_series_tables_time_series_table_get(_api, time_series_table, version; _mediaType=_mediaType) + return OpenAPI.Clients.exec(_ctx) +end + +function metadata_nhgis_time_series_tables_time_series_table_get(_api::DefaultApi, response_stream::Channel, time_series_table::String, version::String; _mediaType=nothing) + _ctx = _oacinternal_metadata_nhgis_time_series_tables_time_series_table_get(_api, time_series_table, version; _mediaType=_mediaType) + return OpenAPI.Clients.exec(_ctx, response_stream) +end + +export extracts_extract_number_get +export extracts_get +export extracts_post +export metadata_nhgis_data_tables_get +export metadata_nhgis_datasets_dataset_data_tables_data_table_get +export metadata_nhgis_datasets_dataset_get +export metadata_nhgis_datasets_get +export metadata_nhgis_shapefiles_get +export metadata_nhgis_time_series_tables_get +export metadata_nhgis_time_series_tables_time_series_table_get diff --git a/src/modelincludes.jl b/src/modelincludes.jl new file mode 100644 index 0000000..48e4821 --- /dev/null +++ b/src/modelincludes.jl @@ -0,0 +1,23 @@ +# This file was generated by the Julia OpenAPI Code Generator +# Do not modify this file directly. Modify the OpenAPI specification instead. + +include("models/model_DataExtract.jl") +include("models/model_DataExtractDownloadLinks.jl") +include("models/model_DataExtractExtractDefinition.jl") +include("models/model_DataExtractPost.jl") +include("models/model_DataExtractPostResponse.jl") +include("models/model_DataTableFull.jl") +include("models/model_DataTableFullVariablesInner.jl") +include("models/model_DataTableSimple.jl") +include("models/model_Dataset.jl") +include("models/model_DatasetFull.jl") +include("models/model_DatasetFullBreakdowns.jl") +include("models/model_DatasetFullBreakdownsBreakdownValuesInner.jl") +include("models/model_DatasetFullGeogLevelsInner.jl") +include("models/model_DatasetSimple.jl") +include("models/model_Error.jl") +include("models/model_Shapefile.jl") +include("models/model_TimeSeriesTable.jl") +include("models/model_TimeSeriesTableFull.jl") +include("models/model_TimeSeriesTableFullTimeSeriesInner.jl") +include("models/model_TimeSeriesTableSimple.jl") diff --git a/src/models/model_DataExtract.jl b/src/models/model_DataExtract.jl new file mode 100644 index 0000000..a91cb21 --- /dev/null +++ b/src/models/model_DataExtract.jl @@ -0,0 +1,45 @@ +# This file was generated by the Julia OpenAPI Code Generator +# Do not modify this file directly. Modify the OpenAPI specification instead. + + +@doc raw"""DataExtract + + DataExtract(; + extractDefinition=nothing, + number=nothing, + status=nothing, + downloadLinks=nothing, + ) + + - extractDefinition::DataExtractExtractDefinition + - number::Int64 + - status::String + - downloadLinks::DataExtractDownloadLinks +""" +Base.@kwdef mutable struct DataExtract <: OpenAPI.APIModel + extractDefinition = nothing # spec type: Union{ Nothing, DataExtractExtractDefinition } + number::Union{Nothing, Int64} = nothing + status::Union{Nothing, String} = nothing + downloadLinks = nothing # spec type: Union{ Nothing, DataExtractDownloadLinks } + + function DataExtract(extractDefinition, number, status, downloadLinks, ) + OpenAPI.validate_property(DataExtract, Symbol("extractDefinition"), extractDefinition) + OpenAPI.validate_property(DataExtract, Symbol("number"), number) + OpenAPI.validate_property(DataExtract, Symbol("status"), status) + OpenAPI.validate_property(DataExtract, Symbol("downloadLinks"), downloadLinks) + return new(extractDefinition, number, status, downloadLinks, ) + end +end # type DataExtract + +const _property_types_DataExtract = Dict{Symbol,String}(Symbol("extractDefinition")=>"DataExtractExtractDefinition", Symbol("number")=>"Int64", Symbol("status")=>"String", Symbol("downloadLinks")=>"DataExtractDownloadLinks", ) +OpenAPI.property_type(::Type{ DataExtract }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_DataExtract[name]))} + +function check_required(o::DataExtract) + true +end + +function OpenAPI.validate_property(::Type{ DataExtract }, name::Symbol, val) + if name === Symbol("number") + OpenAPI.validate_param(name, "DataExtract", :format, val, "int64") + end +end diff --git a/src/models/model_DataExtractDownloadLinks.jl b/src/models/model_DataExtractDownloadLinks.jl new file mode 100644 index 0000000..3b1e0e3 --- /dev/null +++ b/src/models/model_DataExtractDownloadLinks.jl @@ -0,0 +1,38 @@ +# This file was generated by the Julia OpenAPI Code Generator +# Do not modify this file directly. Modify the OpenAPI specification instead. + + +@doc raw"""DataExtract_downloadLinks + + DataExtractDownloadLinks(; + codebookPreview=nothing, + tableData=nothing, + gisData=nothing, + ) + + - codebookPreview::String + - tableData::String + - gisData::String +""" +Base.@kwdef mutable struct DataExtractDownloadLinks <: OpenAPI.APIModel + codebookPreview::Union{Nothing, String} = nothing + tableData::Union{Nothing, String} = nothing + gisData::Union{Nothing, String} = nothing + + function DataExtractDownloadLinks(codebookPreview, tableData, gisData, ) + OpenAPI.validate_property(DataExtractDownloadLinks, Symbol("codebookPreview"), codebookPreview) + OpenAPI.validate_property(DataExtractDownloadLinks, Symbol("tableData"), tableData) + OpenAPI.validate_property(DataExtractDownloadLinks, Symbol("gisData"), gisData) + return new(codebookPreview, tableData, gisData, ) + end +end # type DataExtractDownloadLinks + +const _property_types_DataExtractDownloadLinks = Dict{Symbol,String}(Symbol("codebookPreview")=>"String", Symbol("tableData")=>"String", Symbol("gisData")=>"String", ) +OpenAPI.property_type(::Type{ DataExtractDownloadLinks }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_DataExtractDownloadLinks[name]))} + +function check_required(o::DataExtractDownloadLinks) + true +end + +function OpenAPI.validate_property(::Type{ DataExtractDownloadLinks }, name::Symbol, val) +end diff --git a/src/models/model_DataExtractExtractDefinition.jl b/src/models/model_DataExtractExtractDefinition.jl new file mode 100644 index 0000000..ab207e1 --- /dev/null +++ b/src/models/model_DataExtractExtractDefinition.jl @@ -0,0 +1,78 @@ +# This file was generated by the Julia OpenAPI Code Generator +# Do not modify this file directly. Modify the OpenAPI specification instead. + + +@doc raw"""DataExtract_extractDefinition + + DataExtractExtractDefinition(; + datasets=nothing, + timeSeriesTables=nothing, + dataFormat=nothing, + timeSeriesTableLayout=nothing, + breakdownAndDataTypeLayout=nothing, + shapefiles=nothing, + geographicExtents=nothing, + description=nothing, + version=nothing, + collection=nothing, + ) + + - datasets::Dict{String, Dataset} + - timeSeriesTables::Dict{String, TimeSeriesTable} + - dataFormat::String + - timeSeriesTableLayout::String + - breakdownAndDataTypeLayout::String + - shapefiles::Vector{String} + - geographicExtents::Vector{String} + - description::String + - version::Int64 + - collection::String +""" +Base.@kwdef mutable struct DataExtractExtractDefinition <: OpenAPI.APIModel + datasets::Union{Nothing, Dict} = nothing # spec type: Union{ Nothing, Dict{String, Dataset} } + timeSeriesTables::Union{Nothing, Dict} = nothing # spec type: Union{ Nothing, Dict{String, TimeSeriesTable} } + dataFormat::Union{Nothing, String} = nothing + timeSeriesTableLayout::Union{Nothing, String} = nothing + breakdownAndDataTypeLayout::Union{Nothing, String} = nothing + shapefiles::Union{Nothing, Vector{String}} = nothing + geographicExtents::Union{Nothing, Vector{String}} = nothing + description::Union{Nothing, String} = nothing + version::Union{Nothing, Int64} = nothing + collection::Union{Nothing, String} = nothing + + function DataExtractExtractDefinition(datasets, timeSeriesTables, dataFormat, timeSeriesTableLayout, breakdownAndDataTypeLayout, shapefiles, geographicExtents, description, version, collection, ) + OpenAPI.validate_property(DataExtractExtractDefinition, Symbol("datasets"), datasets) + OpenAPI.validate_property(DataExtractExtractDefinition, Symbol("timeSeriesTables"), timeSeriesTables) + OpenAPI.validate_property(DataExtractExtractDefinition, Symbol("dataFormat"), dataFormat) + OpenAPI.validate_property(DataExtractExtractDefinition, Symbol("timeSeriesTableLayout"), timeSeriesTableLayout) + OpenAPI.validate_property(DataExtractExtractDefinition, Symbol("breakdownAndDataTypeLayout"), breakdownAndDataTypeLayout) + OpenAPI.validate_property(DataExtractExtractDefinition, Symbol("shapefiles"), shapefiles) + OpenAPI.validate_property(DataExtractExtractDefinition, Symbol("geographicExtents"), geographicExtents) + OpenAPI.validate_property(DataExtractExtractDefinition, Symbol("description"), description) + OpenAPI.validate_property(DataExtractExtractDefinition, Symbol("version"), version) + OpenAPI.validate_property(DataExtractExtractDefinition, Symbol("collection"), collection) + return new(datasets, timeSeriesTables, dataFormat, timeSeriesTableLayout, breakdownAndDataTypeLayout, shapefiles, geographicExtents, description, version, collection, ) + end +end # type DataExtractExtractDefinition + +const _property_types_DataExtractExtractDefinition = Dict{Symbol,String}(Symbol("datasets")=>"Dict{String, Dataset}", Symbol("timeSeriesTables")=>"Dict{String, TimeSeriesTable}", Symbol("dataFormat")=>"String", Symbol("timeSeriesTableLayout")=>"String", Symbol("breakdownAndDataTypeLayout")=>"String", Symbol("shapefiles")=>"Vector{String}", Symbol("geographicExtents")=>"Vector{String}", Symbol("description")=>"String", Symbol("version")=>"Int64", Symbol("collection")=>"String", ) +OpenAPI.property_type(::Type{ DataExtractExtractDefinition }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_DataExtractExtractDefinition[name]))} + +function check_required(o::DataExtractExtractDefinition) + true +end + +function OpenAPI.validate_property(::Type{ DataExtractExtractDefinition }, name::Symbol, val) + if name === Symbol("dataFormat") + OpenAPI.validate_param(name, "DataExtractExtractDefinition", :enum, val, ["csv_no_header", "csv_header", "fixed_width"]) + end + if name === Symbol("timeSeriesTableLayout") + OpenAPI.validate_param(name, "DataExtractExtractDefinition", :enum, val, ["time_by_column_layout", "time_by_row_layout", "time_by_file_layout"]) + end + if name === Symbol("breakdownAndDataTypeLayout") + OpenAPI.validate_param(name, "DataExtractExtractDefinition", :enum, val, ["separate_files", "single_file"]) + end + if name === Symbol("version") + OpenAPI.validate_param(name, "DataExtractExtractDefinition", :format, val, "int32") + end +end diff --git a/src/models/model_DataExtractPost.jl b/src/models/model_DataExtractPost.jl new file mode 100644 index 0000000..6d5da62 --- /dev/null +++ b/src/models/model_DataExtractPost.jl @@ -0,0 +1,67 @@ +# This file was generated by the Julia OpenAPI Code Generator +# Do not modify this file directly. Modify the OpenAPI specification instead. + + +@doc raw"""DataExtractPost + + DataExtractPost(; + datasets=nothing, + timeSeriesTables=nothing, + dataFormat=nothing, + timeSeriesTableLayout=nothing, + breakdownAndDataTypeLayout=nothing, + shapefiles=nothing, + geographicExtents=nothing, + description=nothing, + ) + + - datasets::Dict{String, Dataset} + - timeSeriesTables::Dict{String, TimeSeriesTable} + - dataFormat::String + - timeSeriesTableLayout::String + - breakdownAndDataTypeLayout::String + - shapefiles::Vector{String} + - geographicExtents::Vector{String} + - description::String +""" +Base.@kwdef mutable struct DataExtractPost <: OpenAPI.APIModel + datasets::Union{Nothing, Dict} = nothing # spec type: Union{ Nothing, Dict{String, Dataset} } + timeSeriesTables::Union{Nothing, Dict} = nothing # spec type: Union{ Nothing, Dict{String, TimeSeriesTable} } + dataFormat::Union{Nothing, String} = nothing + timeSeriesTableLayout::Union{Nothing, String} = nothing + breakdownAndDataTypeLayout::Union{Nothing, String} = nothing + shapefiles::Union{Nothing, Vector{String}} = nothing + geographicExtents::Union{Nothing, Vector{String}} = nothing + description::Union{Nothing, String} = nothing + + function DataExtractPost(datasets, timeSeriesTables, dataFormat, timeSeriesTableLayout, breakdownAndDataTypeLayout, shapefiles, geographicExtents, description, ) + OpenAPI.validate_property(DataExtractPost, Symbol("datasets"), datasets) + OpenAPI.validate_property(DataExtractPost, Symbol("timeSeriesTables"), timeSeriesTables) + OpenAPI.validate_property(DataExtractPost, Symbol("dataFormat"), dataFormat) + OpenAPI.validate_property(DataExtractPost, Symbol("timeSeriesTableLayout"), timeSeriesTableLayout) + OpenAPI.validate_property(DataExtractPost, Symbol("breakdownAndDataTypeLayout"), breakdownAndDataTypeLayout) + OpenAPI.validate_property(DataExtractPost, Symbol("shapefiles"), shapefiles) + OpenAPI.validate_property(DataExtractPost, Symbol("geographicExtents"), geographicExtents) + OpenAPI.validate_property(DataExtractPost, Symbol("description"), description) + return new(datasets, timeSeriesTables, dataFormat, timeSeriesTableLayout, breakdownAndDataTypeLayout, shapefiles, geographicExtents, description, ) + end +end # type DataExtractPost + +const _property_types_DataExtractPost = Dict{Symbol,String}(Symbol("datasets")=>"Dict{String, Dataset}", Symbol("timeSeriesTables")=>"Dict{String, TimeSeriesTable}", Symbol("dataFormat")=>"String", Symbol("timeSeriesTableLayout")=>"String", Symbol("breakdownAndDataTypeLayout")=>"String", Symbol("shapefiles")=>"Vector{String}", Symbol("geographicExtents")=>"Vector{String}", Symbol("description")=>"String", ) +OpenAPI.property_type(::Type{ DataExtractPost }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_DataExtractPost[name]))} + +function check_required(o::DataExtractPost) + true +end + +function OpenAPI.validate_property(::Type{ DataExtractPost }, name::Symbol, val) + if name === Symbol("dataFormat") + OpenAPI.validate_param(name, "DataExtractPost", :enum, val, ["csv_no_header", "csv_header", "fixed_width"]) + end + if name === Symbol("timeSeriesTableLayout") + OpenAPI.validate_param(name, "DataExtractPost", :enum, val, ["time_by_column_layout", "time_by_row_layout", "time_by_file_layout"]) + end + if name === Symbol("breakdownAndDataTypeLayout") + OpenAPI.validate_param(name, "DataExtractPost", :enum, val, ["separate_files", "single_file"]) + end +end diff --git a/src/models/model_DataExtractPostResponse.jl b/src/models/model_DataExtractPostResponse.jl new file mode 100644 index 0000000..5b9407b --- /dev/null +++ b/src/models/model_DataExtractPostResponse.jl @@ -0,0 +1,45 @@ +# This file was generated by the Julia OpenAPI Code Generator +# Do not modify this file directly. Modify the OpenAPI specification instead. + + +@doc raw"""DataExtractPostResponse + + DataExtractPostResponse(; + extractDefinition=nothing, + number=nothing, + status=nothing, + downloadLinks=nothing, + ) + + - extractDefinition::DataExtractExtractDefinition + - number::Int64 + - status::String + - downloadLinks::DataExtractDownloadLinks +""" +Base.@kwdef mutable struct DataExtractPostResponse <: OpenAPI.APIModel + extractDefinition = nothing # spec type: Union{ Nothing, DataExtractExtractDefinition } + number::Union{Nothing, Int64} = nothing + status::Union{Nothing, String} = nothing + downloadLinks = nothing # spec type: Union{ Nothing, DataExtractDownloadLinks } + + function DataExtractPostResponse(extractDefinition, number, status, downloadLinks, ) + OpenAPI.validate_property(DataExtractPostResponse, Symbol("extractDefinition"), extractDefinition) + OpenAPI.validate_property(DataExtractPostResponse, Symbol("number"), number) + OpenAPI.validate_property(DataExtractPostResponse, Symbol("status"), status) + OpenAPI.validate_property(DataExtractPostResponse, Symbol("downloadLinks"), downloadLinks) + return new(extractDefinition, number, status, downloadLinks, ) + end +end # type DataExtractPostResponse + +const _property_types_DataExtractPostResponse = Dict{Symbol,String}(Symbol("extractDefinition")=>"DataExtractExtractDefinition", Symbol("number")=>"Int64", Symbol("status")=>"String", Symbol("downloadLinks")=>"DataExtractDownloadLinks", ) +OpenAPI.property_type(::Type{ DataExtractPostResponse }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_DataExtractPostResponse[name]))} + +function check_required(o::DataExtractPostResponse) + true +end + +function OpenAPI.validate_property(::Type{ DataExtractPostResponse }, name::Symbol, val) + if name === Symbol("number") + OpenAPI.validate_param(name, "DataExtractPostResponse", :format, val, "int64") + end +end diff --git a/src/models/model_DataTableFull.jl b/src/models/model_DataTableFull.jl new file mode 100644 index 0000000..55881ee --- /dev/null +++ b/src/models/model_DataTableFull.jl @@ -0,0 +1,55 @@ +# This file was generated by the Julia OpenAPI Code Generator +# Do not modify this file directly. Modify the OpenAPI specification instead. + + +@doc raw"""DataTableFull + + DataTableFull(; + name=nothing, + nhgisCode=nothing, + description=nothing, + universe=nothing, + sequence=nothing, + datasetName=nothing, + nVariables=nothing, + ) + + - name::String + - nhgisCode::String + - description::String + - universe::String + - sequence::Int64 + - datasetName::String + - nVariables::Int64 +""" +Base.@kwdef mutable struct DataTableFull <: OpenAPI.APIModel + name::Union{Nothing, String} = nothing + nhgisCode::Union{Nothing, String} = nothing + description::Union{Nothing, String} = nothing + universe::Union{Nothing, String} = nothing + sequence::Union{Nothing, Int64} = nothing + datasetName::Union{Nothing, String} = nothing + nVariables::Union{Nothing, Any} = nothing # spec type: Union{ Nothing, Vector{DataTableFullVariablesInner} } + + function DataTableFull(name, nhgisCode, description, universe, sequence, datasetName, nVariables, ) + OpenAPI.validate_property(DataTableFull, Symbol("name"), name) + OpenAPI.validate_property(DataTableFull, Symbol("nhgisCode"), nhgisCode) + OpenAPI.validate_property(DataTableFull, Symbol("description"), description) + OpenAPI.validate_property(DataTableFull, Symbol("universe"), universe) + OpenAPI.validate_property(DataTableFull, Symbol("sequence"), sequence) + OpenAPI.validate_property(DataTableFull, Symbol("datasetName"), datasetName) + OpenAPI.validate_property(DataTableFull, Symbol("nVariables"), nVariables) + return new(name, nhgisCode, description, universe, sequence, datasetName, nVariables) + end +end # type DataTableFull + +const _property_types_DataTableFull = Dict{Symbol,String}(Symbol("name")=>"String", Symbol("nhgisCode")=>"String", Symbol("description")=>"String", Symbol("universe")=>"String", Symbol("sequence")=>"Int64", Symbol("datasetName")=>"String", Symbol("nVariables")=>"Vector{DataTableFullVariablesInner}", ) +OpenAPI.property_type(::Type{ DataTableFull }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_DataTableFull[name]))} + +function check_required(o::DataTableFull) + true +end + +function OpenAPI.validate_property(a::Type{ DataTableFull }, name::Symbol, val) + +end diff --git a/src/models/model_DataTableFullVariablesInner.jl b/src/models/model_DataTableFullVariablesInner.jl new file mode 100644 index 0000000..9405e29 --- /dev/null +++ b/src/models/model_DataTableFullVariablesInner.jl @@ -0,0 +1,34 @@ +# This file was generated by the Julia OpenAPI Code Generator +# Do not modify this file directly. Modify the OpenAPI specification instead. + + +@doc raw"""DataTableFull_variables_inner + + DataTableFullVariablesInner(; + name=nothing, + nhgisCode=nothing, + ) + + - name::String + - nhgisCode::String +""" +Base.@kwdef mutable struct DataTableFullVariablesInner <: OpenAPI.APIModel + name::Union{Nothing, String} = nothing + nhgisCode::Union{Nothing, String} = nothing + + function DataTableFullVariablesInner(name, nhgisCode, ) + OpenAPI.validate_property(DataTableFullVariablesInner, Symbol("name"), name) + OpenAPI.validate_property(DataTableFullVariablesInner, Symbol("nhgisCode"), nhgisCode) + return new(name, nhgisCode, ) + end +end # type DataTableFullVariablesInner + +const _property_types_DataTableFullVariablesInner = Dict{Symbol,String}(Symbol("name")=>"String", Symbol("nhgisCode")=>"String", ) +OpenAPI.property_type(::Type{ DataTableFullVariablesInner }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_DataTableFullVariablesInner[name]))} + +function check_required(o::DataTableFullVariablesInner) + true +end + +function OpenAPI.validate_property(::Type{ DataTableFullVariablesInner }, name::Symbol, val) +end diff --git a/src/models/model_DataTableSimple.jl b/src/models/model_DataTableSimple.jl new file mode 100644 index 0000000..f818d60 --- /dev/null +++ b/src/models/model_DataTableSimple.jl @@ -0,0 +1,42 @@ +# This file was generated by the Julia OpenAPI Code Generator +# Do not modify this file directly. Modify the OpenAPI specification instead. + + +@doc raw"""DataTableSimple + + DataTableSimple(; + name=nothing, + nhgisCode=nothing, + description=nothing, + sequence=nothing, + ) + + - name::String + - nhgisCode::String + - description::String + - sequence::Int64 +""" +Base.@kwdef mutable struct DataTableSimple <: OpenAPI.APIModel + name::Union{Nothing, String} = nothing + nhgisCode::Union{Nothing, String} = nothing + description::Union{Nothing, String} = nothing + sequence::Union{Nothing, Int64} = nothing + + function DataTableSimple(name, nhgisCode, description, sequence, ) + OpenAPI.validate_property(DataTableSimple, Symbol("name"), name) + OpenAPI.validate_property(DataTableSimple, Symbol("nhgisCode"), nhgisCode) + OpenAPI.validate_property(DataTableSimple, Symbol("description"), description) + OpenAPI.validate_property(DataTableSimple, Symbol("sequence"), sequence) + return new(name, nhgisCode, description, sequence, ) + end +end # type DataTableSimple + +const _property_types_DataTableSimple = Dict{Symbol,String}(Symbol("name")=>"String", Symbol("nhgisCode")=>"String", Symbol("description")=>"String", Symbol("sequence")=>"Int64", ) +OpenAPI.property_type(::Type{ DataTableSimple }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_DataTableSimple[name]))} + +function check_required(o::DataTableSimple) + true +end + +function OpenAPI.validate_property(::Type{ DataTableSimple }, name::Symbol, val) +end diff --git a/src/models/model_Dataset.jl b/src/models/model_Dataset.jl new file mode 100644 index 0000000..57bb2cb --- /dev/null +++ b/src/models/model_Dataset.jl @@ -0,0 +1,44 @@ +# This file was generated by the Julia OpenAPI Code Generator +# Do not modify this file directly. Modify the OpenAPI specification instead. + + +@doc raw"""Dataset + + Dataset(; + dataTables=nothing, + geogLevels=nothing, + breakdownValues=nothing, + years=nothing, + ) + + - dataTables::Vector{String} + - geogLevels::Vector{String} + - breakdownValues::Vector{String} + - years::Vector{String} +""" +Base.@kwdef mutable struct Dataset <: OpenAPI.APIModel + dataTables::Union{Nothing, Vector{String}} = nothing + geogLevels::Union{Nothing, Vector{String}} = nothing + breakdownValues::Union{Nothing, Vector{String}} = nothing + years::Union{Nothing, Vector{String}} = nothing + + function Dataset(dataTables, geogLevels, breakdownValues, years, ) + OpenAPI.validate_property(Dataset, Symbol("dataTables"), dataTables) + OpenAPI.validate_property(Dataset, Symbol("geogLevels"), geogLevels) + OpenAPI.validate_property(Dataset, Symbol("breakdownValues"), breakdownValues) + OpenAPI.validate_property(Dataset, Symbol("years"), years) + return new(dataTables, geogLevels, breakdownValues, years, ) + end +end # type Dataset + +const _property_types_Dataset = Dict{Symbol,String}(Symbol("dataTables")=>"Vector{String}", Symbol("geogLevels")=>"Vector{String}", Symbol("breakdownValues")=>"Vector{String}", Symbol("years")=>"Vector{String}", ) +OpenAPI.property_type(::Type{ Dataset }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_Dataset[name]))} + +function check_required(o::Dataset) + o.dataTables === nothing && (return false) + o.geogLevels === nothing && (return false) + true +end + +function OpenAPI.validate_property(::Type{ Dataset }, name::Symbol, val) +end diff --git a/src/models/model_DatasetFull.jl b/src/models/model_DatasetFull.jl new file mode 100644 index 0000000..1e9e9da --- /dev/null +++ b/src/models/model_DatasetFull.jl @@ -0,0 +1,58 @@ +# This file was generated by the Julia OpenAPI Code Generator +# Do not modify this file directly. Modify the OpenAPI specification instead. + + +@doc raw"""DatasetFull + + DatasetFull(; + name=nothing, + description=nothing, + group=nothing, + sequence=nothing, + dataTables=nothing, + geogLevels=nothing, + hasMultipleDataTypes=nothing, + breakdowns=nothing, + ) + + - name::String + - description::String + - group::String + - sequence::Int64 + - dataTables::Vector{DataTableSimple} + - geogLevels::Vector{DatasetFullGeogLevelsInner} + - hasMultipleDataTypes::Bool + - breakdowns::DatasetFullBreakdowns +""" +Base.@kwdef mutable struct DatasetFull <: OpenAPI.APIModel + name::Union{Nothing, String} = nothing + description::Union{Nothing, String} = nothing + group::Union{Nothing, String} = nothing + sequence::Union{Nothing, Int64} = nothing + dataTables::Union{Nothing, Vector} = nothing # spec type: Union{ Nothing, Vector{DataTableSimple} } + geogLevels::Union{Nothing, Vector} = nothing # spec type: Union{ Nothing, Vector{DatasetFullGeogLevelsInner} } + hasMultipleDataTypes::Union{Nothing, Bool} = nothing + breakdowns = nothing # spec type: Union{ Nothing, DatasetFullBreakdowns } + + function DatasetFull(name, description, group, sequence, dataTables, geogLevels, hasMultipleDataTypes, breakdowns, ) + OpenAPI.validate_property(DatasetFull, Symbol("name"), name) + OpenAPI.validate_property(DatasetFull, Symbol("description"), description) + OpenAPI.validate_property(DatasetFull, Symbol("group"), group) + OpenAPI.validate_property(DatasetFull, Symbol("sequence"), sequence) + OpenAPI.validate_property(DatasetFull, Symbol("dataTables"), dataTables) + OpenAPI.validate_property(DatasetFull, Symbol("geogLevels"), geogLevels) + OpenAPI.validate_property(DatasetFull, Symbol("hasMultipleDataTypes"), hasMultipleDataTypes) + OpenAPI.validate_property(DatasetFull, Symbol("breakdowns"), breakdowns) + return new(name, description, group, sequence, dataTables, geogLevels, hasMultipleDataTypes, breakdowns, ) + end +end # type DatasetFull + +const _property_types_DatasetFull = Dict{Symbol,String}(Symbol("name")=>"String", Symbol("description")=>"String", Symbol("group")=>"String", Symbol("sequence")=>"Int64", Symbol("dataTables")=>"Vector{DataTableSimple}", Symbol("geogLevels")=>"Vector{DatasetFullGeogLevelsInner}", Symbol("hasMultipleDataTypes")=>"Bool", Symbol("breakdowns")=>"DatasetFullBreakdowns", ) +OpenAPI.property_type(::Type{ DatasetFull }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_DatasetFull[name]))} + +function check_required(o::DatasetFull) + true +end + +function OpenAPI.validate_property(::Type{ DatasetFull }, name::Symbol, val) +end diff --git a/src/models/model_DatasetFullBreakdowns.jl b/src/models/model_DatasetFullBreakdowns.jl new file mode 100644 index 0000000..aed6044 --- /dev/null +++ b/src/models/model_DatasetFullBreakdowns.jl @@ -0,0 +1,50 @@ +# This file was generated by the Julia OpenAPI Code Generator +# Do not modify this file directly. Modify the OpenAPI specification instead. + + +@doc raw"""DatasetFull_breakdowns + + DatasetFullBreakdowns(; + name=nothing, + type=nothing, + description=nothing, + breakdownValues=nothing, + years=nothing, + geographicInstances=nothing, + ) + + - name::String + - type::String + - description::String + - breakdownValues::Vector{DatasetFullBreakdownsBreakdownValuesInner} + - years::Vector{String} + - geographicInstances::Vector{DatasetFullBreakdownsBreakdownValuesInner} +""" +Base.@kwdef mutable struct DatasetFullBreakdowns <: OpenAPI.APIModel + name::Union{Nothing, String} = nothing + type::Union{Nothing, String} = nothing + description::Union{Nothing, String} = nothing + breakdownValues::Union{Nothing, Vector} = nothing # spec type: Union{ Nothing, Vector{DatasetFullBreakdownsBreakdownValuesInner} } + years::Union{Nothing, Vector{String}} = nothing + geographicInstances::Union{Nothing, Vector} = nothing # spec type: Union{ Nothing, Vector{DatasetFullBreakdownsBreakdownValuesInner} } + + function DatasetFullBreakdowns(name, type, description, breakdownValues, years, geographicInstances, ) + OpenAPI.validate_property(DatasetFullBreakdowns, Symbol("name"), name) + OpenAPI.validate_property(DatasetFullBreakdowns, Symbol("type"), type) + OpenAPI.validate_property(DatasetFullBreakdowns, Symbol("description"), description) + OpenAPI.validate_property(DatasetFullBreakdowns, Symbol("breakdownValues"), breakdownValues) + OpenAPI.validate_property(DatasetFullBreakdowns, Symbol("years"), years) + OpenAPI.validate_property(DatasetFullBreakdowns, Symbol("geographicInstances"), geographicInstances) + return new(name, type, description, breakdownValues, years, geographicInstances, ) + end +end # type DatasetFullBreakdowns + +const _property_types_DatasetFullBreakdowns = Dict{Symbol,String}(Symbol("name")=>"String", Symbol("type")=>"String", Symbol("description")=>"String", Symbol("breakdownValues")=>"Vector{DatasetFullBreakdownsBreakdownValuesInner}", Symbol("years")=>"Vector{String}", Symbol("geographicInstances")=>"Vector{DatasetFullBreakdownsBreakdownValuesInner}", ) +OpenAPI.property_type(::Type{ DatasetFullBreakdowns }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_DatasetFullBreakdowns[name]))} + +function check_required(o::DatasetFullBreakdowns) + true +end + +function OpenAPI.validate_property(::Type{ DatasetFullBreakdowns }, name::Symbol, val) +end diff --git a/src/models/model_DatasetFullBreakdownsBreakdownValuesInner.jl b/src/models/model_DatasetFullBreakdownsBreakdownValuesInner.jl new file mode 100644 index 0000000..4aac2d4 --- /dev/null +++ b/src/models/model_DatasetFullBreakdownsBreakdownValuesInner.jl @@ -0,0 +1,34 @@ +# This file was generated by the Julia OpenAPI Code Generator +# Do not modify this file directly. Modify the OpenAPI specification instead. + + +@doc raw"""DatasetFull_breakdowns_breakdownValues_inner + + DatasetFullBreakdownsBreakdownValuesInner(; + name=nothing, + description=nothing, + ) + + - name::String + - description::String +""" +Base.@kwdef mutable struct DatasetFullBreakdownsBreakdownValuesInner <: OpenAPI.APIModel + name::Union{Nothing, String} = nothing + description::Union{Nothing, String} = nothing + + function DatasetFullBreakdownsBreakdownValuesInner(name, description, ) + OpenAPI.validate_property(DatasetFullBreakdownsBreakdownValuesInner, Symbol("name"), name) + OpenAPI.validate_property(DatasetFullBreakdownsBreakdownValuesInner, Symbol("description"), description) + return new(name, description, ) + end +end # type DatasetFullBreakdownsBreakdownValuesInner + +const _property_types_DatasetFullBreakdownsBreakdownValuesInner = Dict{Symbol,String}(Symbol("name")=>"String", Symbol("description")=>"String", ) +OpenAPI.property_type(::Type{ DatasetFullBreakdownsBreakdownValuesInner }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_DatasetFullBreakdownsBreakdownValuesInner[name]))} + +function check_required(o::DatasetFullBreakdownsBreakdownValuesInner) + true +end + +function OpenAPI.validate_property(::Type{ DatasetFullBreakdownsBreakdownValuesInner }, name::Symbol, val) +end diff --git a/src/models/model_DatasetFullGeogLevelsInner.jl b/src/models/model_DatasetFullGeogLevelsInner.jl new file mode 100644 index 0000000..ae0abd6 --- /dev/null +++ b/src/models/model_DatasetFullGeogLevelsInner.jl @@ -0,0 +1,38 @@ +# This file was generated by the Julia OpenAPI Code Generator +# Do not modify this file directly. Modify the OpenAPI specification instead. + + +@doc raw"""DatasetFull_geogLevels_inner + + DatasetFullGeogLevelsInner(; + name=nothing, + description=nothing, + hasGeogExtentSelection=nothing, + ) + + - name::String + - description::String + - hasGeogExtentSelection::Bool +""" +Base.@kwdef mutable struct DatasetFullGeogLevelsInner <: OpenAPI.APIModel + name::Union{Nothing, String} = nothing + description::Union{Nothing, String} = nothing + hasGeogExtentSelection::Union{Nothing, Bool} = nothing + + function DatasetFullGeogLevelsInner(name, description, hasGeogExtentSelection, ) + OpenAPI.validate_property(DatasetFullGeogLevelsInner, Symbol("name"), name) + OpenAPI.validate_property(DatasetFullGeogLevelsInner, Symbol("description"), description) + OpenAPI.validate_property(DatasetFullGeogLevelsInner, Symbol("hasGeogExtentSelection"), hasGeogExtentSelection) + return new(name, description, hasGeogExtentSelection, ) + end +end # type DatasetFullGeogLevelsInner + +const _property_types_DatasetFullGeogLevelsInner = Dict{Symbol,String}(Symbol("name")=>"String", Symbol("description")=>"String", Symbol("hasGeogExtentSelection")=>"Bool", ) +OpenAPI.property_type(::Type{ DatasetFullGeogLevelsInner }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_DatasetFullGeogLevelsInner[name]))} + +function check_required(o::DatasetFullGeogLevelsInner) + true +end + +function OpenAPI.validate_property(::Type{ DatasetFullGeogLevelsInner }, name::Symbol, val) +end diff --git a/src/models/model_DatasetSimple.jl b/src/models/model_DatasetSimple.jl new file mode 100644 index 0000000..c1e5afa --- /dev/null +++ b/src/models/model_DatasetSimple.jl @@ -0,0 +1,42 @@ +# This file was generated by the Julia OpenAPI Code Generator +# Do not modify this file directly. Modify the OpenAPI specification instead. + + +@doc raw"""DatasetSimple + + DatasetSimple(; + name=nothing, + description=nothing, + group=nothing, + sequence=nothing, + ) + + - name::String + - description::String + - group::String + - sequence::Int64 +""" +Base.@kwdef mutable struct DatasetSimple <: OpenAPI.APIModel + name::Union{Nothing, String} = nothing + description::Union{Nothing, String} = nothing + group::Union{Nothing, String} = nothing + sequence::Union{Nothing, Int64} = nothing + + function DatasetSimple(name, description, group, sequence, ) + OpenAPI.validate_property(DatasetSimple, Symbol("name"), name) + OpenAPI.validate_property(DatasetSimple, Symbol("description"), description) + OpenAPI.validate_property(DatasetSimple, Symbol("group"), group) + OpenAPI.validate_property(DatasetSimple, Symbol("sequence"), sequence) + return new(name, description, group, sequence, ) + end +end # type DatasetSimple + +const _property_types_DatasetSimple = Dict{Symbol,String}(Symbol("name")=>"String", Symbol("description")=>"String", Symbol("group")=>"String", Symbol("sequence")=>"Int64", ) +OpenAPI.property_type(::Type{ DatasetSimple }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_DatasetSimple[name]))} + +function check_required(o::DatasetSimple) + true +end + +function OpenAPI.validate_property(::Type{ DatasetSimple }, name::Symbol, val) +end diff --git a/src/models/model_Error.jl b/src/models/model_Error.jl new file mode 100644 index 0000000..fcd9c7b --- /dev/null +++ b/src/models/model_Error.jl @@ -0,0 +1,44 @@ +# This file was generated by the Julia OpenAPI Code Generator +# Do not modify this file directly. Modify the OpenAPI specification instead. + + +@doc raw"""Error + + Error(; + type=nothing, + status=nothing, + detail=nothing, + ) + + - type::Int64 + - status::String + - detail::String +""" +Base.@kwdef mutable struct Error <: OpenAPI.APIModel + type::Union{Nothing, Int64} = nothing + status::Union{Nothing, String} = nothing + detail::Union{Nothing, String} = nothing + + function Error(type, status, detail, ) + OpenAPI.validate_property(Error, Symbol("type"), type) + OpenAPI.validate_property(Error, Symbol("status"), status) + OpenAPI.validate_property(Error, Symbol("detail"), detail) + return new(type, status, detail, ) + end +end # type Error + +const _property_types_Error = Dict{Symbol,String}(Symbol("type")=>"Int64", Symbol("status")=>"String", Symbol("detail")=>"String", ) +OpenAPI.property_type(::Type{ Error }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_Error[name]))} + +function check_required(o::Error) + o.type === nothing && (return false) + o.status === nothing && (return false) + o.detail === nothing && (return false) + true +end + +function OpenAPI.validate_property(::Type{ Error }, name::Symbol, val) + if name === Symbol("type") + OpenAPI.validate_param(name, "Error", :format, val, "int32") + end +end diff --git a/src/models/model_Shapefile.jl b/src/models/model_Shapefile.jl new file mode 100644 index 0000000..65894c4 --- /dev/null +++ b/src/models/model_Shapefile.jl @@ -0,0 +1,50 @@ +# This file was generated by the Julia OpenAPI Code Generator +# Do not modify this file directly. Modify the OpenAPI specification instead. + + +@doc raw"""Shapefile + + Shapefile(; + name=nothing, + year=nothing, + geographicLevel=nothing, + extent=nothing, + basis=nothing, + sequence=nothing, + ) + + - name::String + - year::String + - geographicLevel::String + - extent::String + - basis::String + - sequence::Int64 +""" +Base.@kwdef mutable struct Shapefile <: OpenAPI.APIModel + name::Union{Nothing, String} = nothing + year::Union{Nothing, String} = nothing + geographicLevel::Union{Nothing, String} = nothing + extent::Union{Nothing, String} = nothing + basis::Union{Nothing, String} = nothing + sequence::Union{Nothing, Int64} = nothing + + function Shapefile(name, year, geographicLevel, extent, basis, sequence, ) + OpenAPI.validate_property(Shapefile, Symbol("name"), name) + OpenAPI.validate_property(Shapefile, Symbol("year"), year) + OpenAPI.validate_property(Shapefile, Symbol("geographicLevel"), geographicLevel) + OpenAPI.validate_property(Shapefile, Symbol("extent"), extent) + OpenAPI.validate_property(Shapefile, Symbol("basis"), basis) + OpenAPI.validate_property(Shapefile, Symbol("sequence"), sequence) + return new(name, year, geographicLevel, extent, basis, sequence, ) + end +end # type Shapefile + +const _property_types_Shapefile = Dict{Symbol,String}(Symbol("name")=>"String", Symbol("year")=>"String", Symbol("geographicLevel")=>"String", Symbol("extent")=>"String", Symbol("basis")=>"String", Symbol("sequence")=>"Int64", ) +OpenAPI.property_type(::Type{ Shapefile }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_Shapefile[name]))} + +function check_required(o::Shapefile) + true +end + +function OpenAPI.validate_property(::Type{ Shapefile }, name::Symbol, val) +end diff --git a/src/models/model_TimeSeriesTable.jl b/src/models/model_TimeSeriesTable.jl new file mode 100644 index 0000000..a282759 --- /dev/null +++ b/src/models/model_TimeSeriesTable.jl @@ -0,0 +1,35 @@ +# This file was generated by the Julia OpenAPI Code Generator +# Do not modify this file directly. Modify the OpenAPI specification instead. + + +@doc raw"""TimeSeriesTable + + TimeSeriesTable(; + geogLevels=nothing, + years=nothing, + ) + + - geogLevels::Vector{String} + - years::Vector{String} +""" +Base.@kwdef mutable struct TimeSeriesTable <: OpenAPI.APIModel + geogLevels::Union{Nothing, Vector{String}} = nothing + years::Union{Nothing, Vector{String}} = nothing + + function TimeSeriesTable(geogLevels, years, ) + OpenAPI.validate_property(TimeSeriesTable, Symbol("geogLevels"), geogLevels) + OpenAPI.validate_property(TimeSeriesTable, Symbol("years"), years) + return new(geogLevels, years, ) + end +end # type TimeSeriesTable + +const _property_types_TimeSeriesTable = Dict{Symbol,String}(Symbol("geogLevels")=>"Vector{String}", Symbol("years")=>"Vector{String}", ) +OpenAPI.property_type(::Type{ TimeSeriesTable }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_TimeSeriesTable[name]))} + +function check_required(o::TimeSeriesTable) + o.geogLevels === nothing && (return false) + true +end + +function OpenAPI.validate_property(::Type{ TimeSeriesTable }, name::Symbol, val) +end diff --git a/src/models/model_TimeSeriesTableFull.jl b/src/models/model_TimeSeriesTableFull.jl new file mode 100644 index 0000000..75c0aef --- /dev/null +++ b/src/models/model_TimeSeriesTableFull.jl @@ -0,0 +1,50 @@ +# This file was generated by the Julia OpenAPI Code Generator +# Do not modify this file directly. Modify the OpenAPI specification instead. + + +@doc raw"""TimeSeriesTableFull + + TimeSeriesTableFull(; + name=nothing, + description=nothing, + geographicIntegration=nothing, + sequence=nothing, + timeSeries=nothing, + geogLevels=nothing, + ) + + - name::String + - description::String + - geographicIntegration::String + - sequence::Float32 + - timeSeries::Vector{TimeSeriesTableFullTimeSeriesInner} + - geogLevels::Vector{TimeSeriesTableFullTimeSeriesInner} +""" +Base.@kwdef mutable struct TimeSeriesTableFull <: OpenAPI.APIModel + name::Union{Nothing, String} = nothing + description::Union{Nothing, String} = nothing + geographicIntegration::Union{Nothing, String} = nothing + sequence::Union{Nothing, Float32} = nothing + timeSeries::Union{Nothing, Vector} = nothing # spec type: Union{ Nothing, Vector{TimeSeriesTableFullTimeSeriesInner} } + geogLevels::Union{Nothing, Vector} = nothing # spec type: Union{ Nothing, Vector{TimeSeriesTableFullTimeSeriesInner} } + + function TimeSeriesTableFull(name, description, geographicIntegration, sequence, timeSeries, geogLevels, ) + OpenAPI.validate_property(TimeSeriesTableFull, Symbol("name"), name) + OpenAPI.validate_property(TimeSeriesTableFull, Symbol("description"), description) + OpenAPI.validate_property(TimeSeriesTableFull, Symbol("geographicIntegration"), geographicIntegration) + OpenAPI.validate_property(TimeSeriesTableFull, Symbol("sequence"), sequence) + OpenAPI.validate_property(TimeSeriesTableFull, Symbol("timeSeries"), timeSeries) + OpenAPI.validate_property(TimeSeriesTableFull, Symbol("geogLevels"), geogLevels) + return new(name, description, geographicIntegration, sequence, timeSeries, geogLevels, ) + end +end # type TimeSeriesTableFull + +const _property_types_TimeSeriesTableFull = Dict{Symbol,String}(Symbol("name")=>"String", Symbol("description")=>"String", Symbol("geographicIntegration")=>"String", Symbol("sequence")=>"Float32", Symbol("timeSeries")=>"Vector{TimeSeriesTableFullTimeSeriesInner}", Symbol("geogLevels")=>"Vector{TimeSeriesTableFullTimeSeriesInner}", ) +OpenAPI.property_type(::Type{ TimeSeriesTableFull }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_TimeSeriesTableFull[name]))} + +function check_required(o::TimeSeriesTableFull) + true +end + +function OpenAPI.validate_property(::Type{ TimeSeriesTableFull }, name::Symbol, val) +end diff --git a/src/models/model_TimeSeriesTableFullTimeSeriesInner.jl b/src/models/model_TimeSeriesTableFullTimeSeriesInner.jl new file mode 100644 index 0000000..9fd6774 --- /dev/null +++ b/src/models/model_TimeSeriesTableFullTimeSeriesInner.jl @@ -0,0 +1,38 @@ +# This file was generated by the Julia OpenAPI Code Generator +# Do not modify this file directly. Modify the OpenAPI specification instead. + + +@doc raw"""TimeSeriesTableFull_timeSeries_inner + + TimeSeriesTableFullTimeSeriesInner(; + name=nothing, + description=nothing, + sequence=nothing, + ) + + - name::String + - description::String + - sequence::Int64 +""" +Base.@kwdef mutable struct TimeSeriesTableFullTimeSeriesInner <: OpenAPI.APIModel + name::Union{Nothing, String} = nothing + description::Union{Nothing, String} = nothing + sequence::Union{Nothing, Int64} = nothing + + function TimeSeriesTableFullTimeSeriesInner(name, description, sequence, ) + OpenAPI.validate_property(TimeSeriesTableFullTimeSeriesInner, Symbol("name"), name) + OpenAPI.validate_property(TimeSeriesTableFullTimeSeriesInner, Symbol("description"), description) + OpenAPI.validate_property(TimeSeriesTableFullTimeSeriesInner, Symbol("sequence"), sequence) + return new(name, description, sequence, ) + end +end # type TimeSeriesTableFullTimeSeriesInner + +const _property_types_TimeSeriesTableFullTimeSeriesInner = Dict{Symbol,String}(Symbol("name")=>"String", Symbol("description")=>"String", Symbol("sequence")=>"Int64", ) +OpenAPI.property_type(::Type{ TimeSeriesTableFullTimeSeriesInner }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_TimeSeriesTableFullTimeSeriesInner[name]))} + +function check_required(o::TimeSeriesTableFullTimeSeriesInner) + true +end + +function OpenAPI.validate_property(::Type{ TimeSeriesTableFullTimeSeriesInner }, name::Symbol, val) +end diff --git a/src/models/model_TimeSeriesTableSimple.jl b/src/models/model_TimeSeriesTableSimple.jl new file mode 100644 index 0000000..a100612 --- /dev/null +++ b/src/models/model_TimeSeriesTableSimple.jl @@ -0,0 +1,50 @@ +# This file was generated by the Julia OpenAPI Code Generator +# Do not modify this file directly. Modify the OpenAPI specification instead. + + +@doc raw"""TimeSeriesTableSimple + + TimeSeriesTableSimple(; + name=nothing, + description=nothing, + geographicIntegration=nothing, + sequence=nothing, + timeSeries=nothing, + geogLevels=nothing, + ) + + - name::String + - description::String + - geographicIntegration::String + - sequence::Float32 + - timeSeries::Vector{String} + - geogLevels::Vector{String} +""" +Base.@kwdef mutable struct TimeSeriesTableSimple <: OpenAPI.APIModel + name::Union{Nothing, String} = nothing + description::Union{Nothing, String} = nothing + geographicIntegration::Union{Nothing, String} = nothing + sequence::Union{Nothing, Float32} = nothing + timeSeries::Union{Nothing, Vector{String}} = nothing + geogLevels::Union{Nothing, Vector{String}} = nothing + + function TimeSeriesTableSimple(name, description, geographicIntegration, sequence, timeSeries, geogLevels, ) + OpenAPI.validate_property(TimeSeriesTableSimple, Symbol("name"), name) + OpenAPI.validate_property(TimeSeriesTableSimple, Symbol("description"), description) + OpenAPI.validate_property(TimeSeriesTableSimple, Symbol("geographicIntegration"), geographicIntegration) + OpenAPI.validate_property(TimeSeriesTableSimple, Symbol("sequence"), sequence) + OpenAPI.validate_property(TimeSeriesTableSimple, Symbol("timeSeries"), timeSeries) + OpenAPI.validate_property(TimeSeriesTableSimple, Symbol("geogLevels"), geogLevels) + return new(name, description, geographicIntegration, sequence, timeSeries, geogLevels, ) + end +end # type TimeSeriesTableSimple + +const _property_types_TimeSeriesTableSimple = Dict{Symbol,String}(Symbol("name")=>"String", Symbol("description")=>"String", Symbol("geographicIntegration")=>"String", Symbol("sequence")=>"Float32", Symbol("timeSeries")=>"Vector{String}", Symbol("geogLevels")=>"Vector{String}", ) +OpenAPI.property_type(::Type{ TimeSeriesTableSimple }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_TimeSeriesTableSimple[name]))} + +function check_required(o::TimeSeriesTableSimple) + true +end + +function OpenAPI.validate_property(::Type{ TimeSeriesTableSimple }, name::Symbol, val) +end diff --git a/src/piracy.jl b/src/piracy.jl new file mode 100644 index 0000000..8d01fc1 --- /dev/null +++ b/src/piracy.jl @@ -0,0 +1,22 @@ +#= + +Behold you Julians, the sins of a blasphemer. + +=# + + +function OpenAPI.from_json(a::Vector{DatasetSimple}, b) + convert.(DatasetSimple, b["data"]) +end + +function OpenAPI.from_json(a::Vector{TimeSeriesTableSimple}, b) + convert.(TimeSeriesTableSimple, b["data"]) +end + +function OpenAPI.from_json(a::Vector{TimeSeriesTableFull}, b) + [convert(TimeSeriesTableFull, b)] +end + +function OpenAPI.from_json(a::Vector{IPUMS.Shapefile}, b) + [IPUMS.Shapefile(s["name"], s["year"], s["geographicLevel"], s["extent"], s["basis"], s["sequence"]) for s in b["data"]] +end