diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index 6328c54..2540a3a 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -7.17.0 +7.20.0 diff --git a/Cargo.toml b/Cargo.toml index 96cb785..973694d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,11 +1,11 @@ [package] -repository="https://github.com/vrchatapi/vrchatapi-rust" name = "vrchatapi" -version = "1.20.8-nightly.9.1" +version = "1.20.8-nightly.9" authors = ["vrchatapi.lpv0t@aries.fyi"] description = "VRChat API Client for Rust" license = "MIT" edition = "2021" +repository = "https://github.com/vrchatapi/vrchatapi-rust" [dependencies] serde = { version = "^1.0", features = ["derive"] } @@ -13,13 +13,15 @@ serde_with = { version = "^3.8", default-features = false, features = ["base64", serde_json = "^1.0" serde_repr = "^0.1" url = "^2.5" -reqwest = { version = "^0.12", default-features = false, features = ["json", "multipart"] } -reqwest-middleware = { version = "^0.4", features = ["json", "multipart"] } +tokio = { version = "^1.46.0", features = ["fs"] } +tokio-util = { version = "^0.7", features = ["codec"] } +reqwest = { version = "^0.13", default-features = false, features = ["json", "multipart", "cookies", "stream", "query", "form"] } +reqwest-middleware = { version = "^0.5", features = ["json", "multipart", "query", "form"] } [features] default = ["reqwest/cookies"] native-tls = ["reqwest/native-tls"] -rustls-tls = ["reqwest/rustls-tls"] +rustls = ["reqwest/rustls"] [dev-dependencies] tokio = { version = '1', features = ['macros', 'rt-multi-thread'] } \ No newline at end of file diff --git a/docs/AdminAssetBundle.md b/docs/AdminAssetBundle.md index b974784..e18da86 100644 --- a/docs/AdminAssetBundle.md +++ b/docs/AdminAssetBundle.md @@ -16,7 +16,7 @@ Name | Type | Description | Notes **tags** | **Vec** | | **thumbnail_image_url** | **String** | | **unity_package_url** | Option<**String**> | | -**unity_packages** | [**Vec**](AdminUnityPackage.md) | | +**unity_packages** | [**HashSet**](AdminUnityPackage.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ApiConfig.md b/docs/ApiConfig.md index 9f5f88e..97351cb 100644 --- a/docs/ApiConfig.md +++ b/docs/ApiConfig.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **location_gifting_non_sub_prio_enabled** | **bool** | Toggles whether users without a current VRC+ subscription are priority recipients for gift drops | [default to true] **voice_enable_degradation** | **bool** | Unknown, probably voice optimization testing | [default to false] **voice_enable_receiver_limiting** | **bool** | Unknown, probably voice optimization testing | [default to true] -**access_logs_urls** | [**models::ApiConfigAccessLogsUrls**](APIConfig_accessLogsUrls.md) | | +**access_logs_urls** | [**models::ApiConfigAccessLogsUrls**](APIConfigAccessLogsUrls.md) | | **address** | **String** | VRChat's office address | **age_verification_invite_visible** | **bool** | | **age_verification_p** | **bool** | | @@ -18,11 +18,11 @@ Name | Type | Description | Notes **analysis_retry_interval** | **i32** | Interval between retries for avatar analysis requests | **analytics_segment_new_ui_pct_of_users** | **i32** | Unknown | **analytics_segment_new_ui_salt** | **String** | Unknown | -**announcements** | [**Vec**](APIConfigAnnouncement.md) | Public Announcements | +**announcements** | [**HashSet**](APIConfigAnnouncement.md) | Public Announcements | **audio_config** | Option<[**models::ApiConfigAudioConfig**](APIConfigAudioConfig.md)> | | [optional] **available_language_codes** | **Vec** | List of supported Languages | **available_languages** | **Vec** | List of supported Languages | -**avatar_perf_limiter** | [**models::ApiConfigAvatarPerfLimiter**](APIConfig_avatarPerfLimiter.md) | | +**avatar_perf_limiter** | [**models::ApiConfigAvatarPerfLimiter**](APIConfigAvatarPerfLimiter.md) | | **chatbox_log_buffer_seconds** | **i32** | Unknown | [default to 40] **client_api_key** | **String** | apiKey to be used for all other requests | **client_bps_ceiling** | **i32** | Unknown | [default to 18432] @@ -72,7 +72,7 @@ Name | Type | Description | Notes **disable_upgrade_account** | **bool** | Toggles if account upgrading \"linking with Steam/Oculus\" should be disabled. | [default to false] **download_link_windows** | **String** | Download link for game on the Oculus Rift website. | **download_urls** | [**models::ApiConfigDownloadUrlList**](APIConfigDownloadURLList.md) | | -**dynamic_world_rows** | [**Vec**](DynamicContentRow.md) | Array of DynamicWorldRow objects, used by the game to display the list of world rows | +**dynamic_world_rows** | [**HashSet**](DynamicContentRow.md) | Array of DynamicWorldRow objects, used by the game to display the list of world rows | **economy_ledger_backfill** | **bool** | Unknown | **economy_ledger_migration_stop** | **String** | Unknown | **economy_ledger_mode** | **String** | Unknown | @@ -89,15 +89,15 @@ Name | Type | Description | Notes **hub_world_id** | **String** | WorldID be \"offline\" on User profiles if you are not friends with that user. | **image_host_url_list** | **Vec** | A list of explicitly allowed origins that worlds can request images from via the Udon's [VRCImageDownloader#DownloadImage](https://creators.vrchat.com/worlds/udon/image-loading/#downloadimage). | **ios_app_version** | **Vec** | Current app version for iOS | -**ios_version** | [**models::ApiConfigIosVersion**](APIConfig_iosVersion.md) | | +**ios_version** | [**models::ApiConfigIosVersion**](APIConfigIosVersion.md) | | **jobs_email** | **String** | VRChat's job application email | **max_user_emoji** | **i32** | The maximum number of custom emoji each user may have at a given time. | [default to 18] **max_user_stickers** | **i32** | The maximum number of custom stickers each user may have at a given time. | [default to 18] -**min_supported_client_build_number** | [**models::ApiConfigMinSupportedClientBuildNumber**](APIConfig_minSupportedClientBuildNumber.md) | | +**min_supported_client_build_number** | [**models::ApiConfigMinSupportedClientBuildNumber**](APIConfigMinSupportedClientBuildNumber.md) | | **minimum_unity_version_for_uploads** | **String** | Minimum Unity version required for uploading assets | [default to 2019.0.0f1] **moderation_email** | **String** | VRChat's moderation related email | **not_allowed_to_select_avatar_in_private_world_message** | **String** | Used in-game to notify a user they aren't allowed to select avatars in private worlds | -**offline_analysis** | [**models::ApiConfigOfflineAnalysis**](APIConfig_offlineAnalysis.md) | | +**offline_analysis** | [**models::ApiConfigOfflineAnalysis**](APIConfigOfflineAnalysis.md) | | **photon_nameserver_overrides** | **Vec** | Unknown | **photon_public_keys** | **Vec** | Unknown | **player_url_resolver_sha1** | **String** | Currently used youtube-dl.exe hash in SHA1-delimited format | @@ -105,7 +105,7 @@ Name | Type | Description | Notes **public_key** | **String** | Public key, hex encoded | **report_categories** | [**std::collections::HashMap**](ReportCategory.md) | Categories available for reporting objectionable content | **report_form_url** | **String** | URL to the report form | [default to https://help.vrchat.com/hc/en-us/requests/new?ticket_form_id=1500000182242&tf_360056455174=user_report&tf_360057451993={userId}&tf_1500001445142={reportedId}&tf_subject={reason} {category} By {contentType} {reportedName}&tf_description={description}] -**report_options** | [**std::collections::HashMap>>**](std::collections::HashMap.md) | Options for reporting content. Select a key+value from this mapping as the `type` of the report. Select one key+value from the object at reportOptions[type] as the `category` of the report. reportCategories[category] contains user-facing text to display for all possible categories. Select one value from the array at reportOptions[type][category] as the `reason` of the report. reportReasons[reason] contains user-facing text to display for all possible categories. | +**report_options** | **std::collections::HashMap>>** | Options for reporting content. Select a key+value from this mapping as the `type` of the report. Select one key+value from the object at reportOptions[type] as the `category` of the report. reportCategories[category] contains user-facing text to display for all possible categories. Select one value from the array at reportOptions[type][category] as the `reason` of the report. reportReasons[reason] contains user-facing text to display for all possible categories. | **report_reasons** | [**std::collections::HashMap**](ReportReason.md) | Reasons available for submitting a report | **require_age_verification_beta_tag** | **bool** | | **sdk_developer_faq_url** | **String** | Link to the developer FAQ | diff --git a/docs/ApiConfigConstants.md b/docs/ApiConfigConstants.md index e5bd83b..08d1138 100644 --- a/docs/ApiConfigConstants.md +++ b/docs/ApiConfigConstants.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**groups** | [**models::ApiConfigConstantsGroups**](APIConfigConstants_GROUPS.md) | | -**instance** | [**models::ApiConfigConstantsInstance**](APIConfigConstants_INSTANCE.md) | | -**language** | [**models::ApiConfigConstantsLanguage**](APIConfigConstants_LANGUAGE.md) | | +**groups** | [**models::ApiConfigConstantsGroups**](APIConfigConstantsGROUPS.md) | | +**instance** | [**models::ApiConfigConstantsInstance**](APIConfigConstantsINSTANCE.md) | | +**language** | [**models::ApiConfigConstantsLanguage**](APIConfigConstantsLANGUAGE.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ApiConfigConstantsInstance.md b/docs/ApiConfigConstantsInstance.md index 29207ea..2805d7f 100644 --- a/docs/ApiConfigConstantsInstance.md +++ b/docs/ApiConfigConstantsInstance.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**population_brackets** | Option<[**models::ApiConfigConstantsInstancePopulationBrackets**](APIConfigConstants_INSTANCE_POPULATION_BRACKETS.md)> | | [optional] +**population_brackets** | Option<[**models::ApiConfigConstantsInstancePopulationBrackets**](APIConfigConstantsINSTANCEPOPULATIONBRACKETS.md)> | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ApiConfigConstantsInstancePopulationBrackets.md b/docs/ApiConfigConstantsInstancePopulationBrackets.md index c28a411..234c255 100644 --- a/docs/ApiConfigConstantsInstancePopulationBrackets.md +++ b/docs/ApiConfigConstantsInstancePopulationBrackets.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**crowded** | Option<[**models::ApiConfigConstantsInstancePopulationBracketsCrowded**](APIConfigConstants_INSTANCE_POPULATION_BRACKETS_CROWDED.md)> | | [optional] -**few** | Option<[**models::ApiConfigConstantsInstancePopulationBracketsFew**](APIConfigConstants_INSTANCE_POPULATION_BRACKETS_FEW.md)> | | [optional] -**many** | Option<[**models::ApiConfigConstantsInstancePopulationBracketsMany**](APIConfigConstants_INSTANCE_POPULATION_BRACKETS_MANY.md)> | | [optional] +**crowded** | Option<[**models::ApiConfigConstantsInstancePopulationBracketsCrowded**](APIConfigConstantsINSTANCEPOPULATIONBRACKETSCROWDED.md)> | | [optional] +**few** | Option<[**models::ApiConfigConstantsInstancePopulationBracketsFew**](APIConfigConstantsINSTANCEPOPULATIONBRACKETSFEW.md)> | | [optional] +**many** | Option<[**models::ApiConfigConstantsInstancePopulationBracketsMany**](APIConfigConstantsINSTANCEPOPULATIONBRACKETSMANY.md)> | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/AuthenticationApi.md b/docs/AuthenticationApi.md index 04afd6e..2a48ad3 100644 --- a/docs/AuthenticationApi.md +++ b/docs/AuthenticationApi.md @@ -164,7 +164,7 @@ Globally unmoderates an avatar. Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **target_avatar_id** | **String** | Must be a valid avatar ID. | [required] | -**avatar_moderation_type** | [**AvatarModerationType**](.md) | The avatar moderation type associated with the avatar. | [required] | +**avatar_moderation_type** | [**AvatarModerationType**](AvatarModerationType.md) | The avatar moderation type associated with the avatar. | [required] | ### Return type diff --git a/docs/Avatar.md b/docs/Avatar.md index 628f5ce..7724ead 100644 --- a/docs/Avatar.md +++ b/docs/Avatar.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **acknowledgements** | Option<**String**> | | [optional] **active_asset_review_id** | Option<**String**> | Only present for the avatar author on avatars under active review. | [optional] **asset_url** | Option<**String**> | Not present from general search `/avatars`, only on specific requests `/avatars/{avatarId}`. | [optional] -**asset_url_object** | Option<[**serde_json::Value**](.md)> | Not present from general search `/avatars`, only on specific requests `/avatars/{avatarId}`. **Deprecation:** `Object` has unknown usage/fields, and is always empty. Use normal `Url` field instead. | [optional] +**asset_url_object** | Option<**serde_json::Value**> | Not present from general search `/avatars`, only on specific requests `/avatars/{avatarId}`. **Deprecation:** `Object` has unknown usage/fields, and is always empty. Use normal `Url` field instead. | [optional] **author_id** | **String** | A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. | **author_name** | **String** | | **created_at** | **String** | | @@ -21,17 +21,17 @@ Name | Type | Description | Notes **lowest_price** | Option<**i32**> | | [optional] **name** | **String** | | **pending_upload** | Option<**bool**> | | [optional][default to false] -**performance** | [**models::AvatarPerformance**](Avatar_performance.md) | | +**performance** | [**models::AvatarPerformance**](AvatarPerformance.md) | | **product_id** | Option<**String**> | | [optional] -**published_listings** | Option<[**Vec**](Avatar_publishedListings_inner.md)> | | [optional] +**published_listings** | Option<[**Vec**](AvatarPublishedListingsInner.md)> | | [optional] **release_status** | [**models::ReleaseStatus**](ReleaseStatus.md) | | **searchable** | Option<**bool**> | | [optional][default to false] -**styles** | [**models::AvatarStyles**](Avatar_styles.md) | | +**styles** | [**models::AvatarStyles**](AvatarStyles.md) | | **tags** | **Vec** | | **thumbnail_image_url** | **String** | | **unity_package_url** | **String** | | -**unity_package_url_object** | [**models::AvatarUnityPackageUrlObject**](Avatar_unityPackageUrlObject.md) | | -**unity_packages** | [**Vec**](UnityPackage.md) | | +**unity_package_url_object** | [**models::AvatarUnityPackageUrlObject**](AvatarUnityPackageUrlObject.md) | | +**unity_packages** | [**HashSet**](UnityPackage.md) | | **updated_at** | **String** | | **version** | **i32** | | [default to 0] diff --git a/docs/AvatarsApi.md b/docs/AvatarsApi.md index dc39267..44f8bb0 100644 --- a/docs/AvatarsApi.md +++ b/docs/AvatarsApi.md @@ -211,14 +211,14 @@ Search and list favorited avatars by query filters. Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **featured** | Option<**bool**> | Filters on featured results. | | -**sort** | Option<[**SortOption**](.md)> | The sort order of the results. | | +**sort** | Option<[**SortOption**](SortOption.md)> | The sort order of the results. | | **n** | Option<**i32**> | The number of objects to return. | |[default to 60] -**order** | Option<[**OrderOption**](.md)> | Result ordering | | +**order** | Option<[**OrderOption**](OrderOption.md)> | Result ordering | | **offset** | Option<**i32**> | A zero-based offset from the default object sorting from where search results start. | | **search** | Option<**String**> | Filters by world name. | | **tag** | Option<**String**> | Tags to include (comma-separated). Any of the tags needs to be present. | | **notag** | Option<**String**> | Tags to exclude (comma-separated). | | -**release_status** | Option<[**ReleaseStatus**](.md)> | Filter by ReleaseStatus. | | +**release_status** | Option<[**ReleaseStatus**](ReleaseStatus.md)> | Filter by ReleaseStatus. | | **max_unity_version** | Option<**String**> | The maximum Unity version supported by the asset. | | **min_unity_version** | Option<**String**> | The minimum Unity version supported by the asset. | | **platform** | Option<**String**> | The platform the asset supports. | | @@ -341,15 +341,15 @@ Search and list avatars by query filters. You can only search your own or featur Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **featured** | Option<**bool**> | Filters on featured results. | | -**sort** | Option<[**SortOption**](.md)> | The sort order of the results. | | +**sort** | Option<[**SortOption**](SortOption.md)> | The sort order of the results. | | **user** | Option<**String**> | Set to `me` for searching own avatars. | | **user_id** | Option<**String**> | Filter by UserID. | | **n** | Option<**i32**> | The number of objects to return. | |[default to 60] -**order** | Option<[**OrderOption**](.md)> | Result ordering | | +**order** | Option<[**OrderOption**](OrderOption.md)> | Result ordering | | **offset** | Option<**i32**> | A zero-based offset from the default object sorting from where search results start. | | **tag** | Option<**String**> | Tags to include (comma-separated). Any of the tags needs to be present. | | **notag** | Option<**String**> | Tags to exclude (comma-separated). | | -**release_status** | Option<[**ReleaseStatus**](.md)> | Filter by ReleaseStatus. | | +**release_status** | Option<[**ReleaseStatus**](ReleaseStatus.md)> | Filter by ReleaseStatus. | | **max_unity_version** | Option<**String**> | The maximum Unity version supported by the asset. | | **min_unity_version** | Option<**String**> | The minimum Unity version supported by the asset. | | **platform** | Option<**String**> | The platform the asset supports. | | diff --git a/docs/CalendarApi.md b/docs/CalendarApi.md index 60d9321..01b775e 100644 --- a/docs/CalendarApi.md +++ b/docs/CalendarApi.md @@ -94,12 +94,12 @@ Get a list of calendar events Initially, call without a `nextCursor` parameter F Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**scope** | Option<[**CalendarEventDiscoveryScope**](.md)> | Scope for calendar event discovery. | | +**scope** | Option<[**CalendarEventDiscoveryScope**](CalendarEventDiscoveryScope.md)> | Scope for calendar event discovery. | | **categories** | Option<**String**> | Filter for calendar event discovery. | | **tags** | Option<**String**> | Filter for calendar event discovery. | | -**featured_results** | Option<[**CalendarEventDiscoveryInclusion**](.md)> | Filter for calendar event discovery. | | -**non_featured_results** | Option<[**CalendarEventDiscoveryInclusion**](.md)> | Filter for calendar event discovery. | | -**personalized_results** | Option<[**CalendarEventDiscoveryInclusion**](.md)> | Filter for calendar event discovery. | | +**featured_results** | Option<[**CalendarEventDiscoveryInclusion**](CalendarEventDiscoveryInclusion.md)> | Filter for calendar event discovery. | | +**non_featured_results** | Option<[**CalendarEventDiscoveryInclusion**](CalendarEventDiscoveryInclusion.md)> | Filter for calendar event discovery. | | +**personalized_results** | Option<[**CalendarEventDiscoveryInclusion**](CalendarEventDiscoveryInclusion.md)> | Filter for calendar event discovery. | | **minimum_interest_count** | Option<**i32**> | Filter for calendar event discovery. | | **minimum_remaining_minutes** | Option<**i32**> | Filter for calendar event discovery. | | **upcoming_offset_minutes** | Option<**i32**> | Filter for calendar event discovery. | | diff --git a/docs/CalendarEvent.md b/docs/CalendarEvent.md index c45882e..9b3238f 100644 --- a/docs/CalendarEvent.md +++ b/docs/CalendarEvent.md @@ -32,7 +32,7 @@ Name | Type | Description | Notes **title** | **String** | | **r#type** | Option<**String**> | | [optional] **updated_at** | Option<**String**> | | [optional] -**user_interest** | Option<[**models::CalendarEventUserInterest**](CalendarEvent_userInterest.md)> | | [optional] +**user_interest** | Option<[**models::CalendarEventUserInterest**](CalendarEventUserInterest.md)> | | [optional] **uses_instance_overflow** | Option<**bool**> | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CurrentUser.md b/docs/CurrentUser.md index 0cefdc3..4e8b06a 100644 --- a/docs/CurrentUser.md +++ b/docs/CurrentUser.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **accepted_privacy_version** | Option<**i32**> | | [optional] **accepted_tos_version** | **i32** | | -**account_deletion_date** | Option<[**String**](string.md)> | | [optional] +**account_deletion_date** | Option<[**String**](String.md)> | | [optional] **account_deletion_log** | Option<[**Vec**](AccountDeletionLog.md)> | | [optional] **active_friends** | Option<**Vec**> | | [optional] **age_verification_status** | [**models::AgeVerificationStatus**](AgeVerificationStatus.md) | | @@ -21,7 +21,7 @@ Name | Type | Description | Notes **current_avatar_image_url** | **String** | When profilePicOverride is not empty, use it instead. | **current_avatar_tags** | **Vec** | | **current_avatar_thumbnail_image_url** | **String** | When profilePicOverride is not empty, use it instead. | -**date_joined** | [**String**](string.md) | | +**date_joined** | [**String**](String.md) | | **developer_type** | [**models::DeveloperType**](DeveloperType.md) | | **discord_details** | Option<[**models::DiscordDetails**](DiscordDetails.md)> | | [optional] **discord_id** | Option<**String**> | https://discord.com/developers/docs/reference#snowflakes | [optional] @@ -31,7 +31,7 @@ Name | Type | Description | Notes **friend_group_names** | **Vec** | Always empty array. | **friend_key** | **String** | | **friends** | **Vec** | | -**google_details** | Option<[**serde_json::Value**](.md)> | | [optional] +**google_details** | Option<**serde_json::Value**> | | [optional] **google_id** | Option<**String**> | | [optional] **has_birthday** | **bool** | | **has_email** | **bool** | | @@ -54,7 +54,7 @@ Name | Type | Description | Notes **online_friends** | Option<**Vec**> | | [optional] **past_display_names** | [**Vec**](PastDisplayName.md) | | **pico_id** | Option<**String**> | | [optional] -**platform_history** | Option<[**Vec**](CurrentUser_platform_history_inner.md)> | | [optional] +**platform_history** | Option<[**Vec**](CurrentUserPlatformHistoryInner.md)> | | [optional] **presence** | Option<[**models::CurrentUserPresence**](CurrentUserPresence.md)> | | [optional] **profile_pic_override** | **String** | | **profile_pic_override_thumbnail** | **String** | | @@ -67,7 +67,7 @@ Name | Type | Description | Notes **status_description** | **String** | | **status_first_time** | **bool** | | **status_history** | **Vec** | | -**steam_details** | [**serde_json::Value**](.md) | | +**steam_details** | **serde_json::Value** | | **steam_id** | **String** | | **tags** | **Vec** | | **two_factor_auth_enabled** | **bool** | | diff --git a/docs/EconomyApi.md b/docs/EconomyApi.md index adf65cf..e3a4485 100644 --- a/docs/EconomyApi.md +++ b/docs/EconomyApi.md @@ -347,8 +347,8 @@ Name | Type | Description | Required | Notes **n** | Option<**i32**> | The number of objects to return. | |[default to 60] **offset** | Option<**i32**> | A zero-based offset from the default object sorting from where search results start. | | **most_recent** | Option<**bool**> | | | -**sort** | Option<[**SortOptionProductPurchase**](.md)> | The sort order of the results. | | -**order** | Option<[**OrderOptionShort**](.md)> | Result ordering | | +**sort** | Option<[**SortOptionProductPurchase**](SortOptionProductPurchase.md)> | The sort order of the results. | | +**order** | Option<[**OrderOptionShort**](OrderOptionShort.md)> | Result ordering | | ### Return type @@ -496,7 +496,7 @@ Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **store_id** | **String** | | [required] | **hydrate_listings** | Option<**bool**> | Listings fields will be populated. | | -**fetch** | Option<[**StoreView**](.md)> | | | +**fetch** | Option<[**StoreView**](StoreView.md)> | | | ### Return type diff --git a/docs/File.md b/docs/File.md index 11439be..214fd46 100644 --- a/docs/File.md +++ b/docs/File.md @@ -16,7 +16,7 @@ Name | Type | Description | Notes **name** | **String** | | **owner_id** | **String** | A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. | **tags** | **Vec** | | -**versions** | [**Vec**](FileVersion.md) | | +**versions** | [**HashSet**](FileVersion.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FileData.md b/docs/FileData.md index 28e9b7e..22f17c4 100644 --- a/docs/FileData.md +++ b/docs/FileData.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**category** | **String** | | [default to Queued] +**category** | **Category** | (enum: multipart, queued, simple) | [default to Queued] **file_name** | **String** | | **md5** | Option<**String**> | | [optional] **size_in_bytes** | **i32** | | diff --git a/docs/FileVersionUploadStatus.md b/docs/FileVersionUploadStatus.md index d51c349..6c45453 100644 --- a/docs/FileVersionUploadStatus.md +++ b/docs/FileVersionUploadStatus.md @@ -4,11 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**etags** | [**Vec**](serde_json::Value.md) | Unknown | +**etags** | **Vec** | Unknown | **file_name** | **String** | | **max_parts** | **i32** | | **next_part_number** | **i32** | | -**parts** | [**Vec**](serde_json::Value.md) | | +**parts** | **Vec** | | **upload_id** | **String** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FilesApi.md b/docs/FilesApi.md index eaba62e..46f1b42 100644 --- a/docs/FilesApi.md +++ b/docs/FilesApi.md @@ -256,7 +256,7 @@ Returns the agreement status of the currently authenticated user for the given a Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**agreement_code** | [**AgreementCode**](.md) | The type of agreement (currently content.copyright.owned) | [required] | +**agreement_code** | [**AgreementCode**](AgreementCode.md) | The type of agreement (currently content.copyright.owned) | [required] | **content_id** | **String** | The id of the content being uploaded, such as a WorldID, AvatarID, or PropID | [required] | **version** | **i32** | The version of the agreement (currently 1) | [required] | diff --git a/docs/FinishFileDataUploadRequest.md b/docs/FinishFileDataUploadRequest.md index bcccab5..961cee1 100644 --- a/docs/FinishFileDataUploadRequest.md +++ b/docs/FinishFileDataUploadRequest.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**etags** | Option<**Vec**> | Array of ETags uploaded. | [optional] +**etags** | Option<**HashSet**> | Array of ETags uploaded. | [optional] **max_parts** | **String** | Always a zero in string form, despite how many parts uploaded. | [default to 0] **next_part_number** | **String** | Always a zero in string form, despite how many parts uploaded. | [default to 0] diff --git a/docs/GroupAuditLogEntry.md b/docs/GroupAuditLogEntry.md index ac859bb..dae9534 100644 --- a/docs/GroupAuditLogEntry.md +++ b/docs/GroupAuditLogEntry.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **actor_display_name** | Option<**String**> | | [optional] **actor_id** | Option<**String**> | A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. | [optional] **created_at** | Option<**String**> | | [optional] -**data** | Option<[**serde_json::Value**](.md)> | The data associated with the event. The format of this data is dependent on the event type. | [optional] +**data** | Option<**serde_json::Value**> | The data associated with the event. The format of this data is dependent on the event type. | [optional] **description** | Option<**String**> | A human-readable description of the event. | [optional] **event_type** | Option<**String**> | The type of event that occurred. This is a string that is prefixed with the type of object that the event occurred on. For example, a group role update event would be prefixed with `group.role`. | [optional][default to group.update] **group_id** | Option<**String**> | | [optional] diff --git a/docs/GroupRoleTemplateValues.md b/docs/GroupRoleTemplateValues.md index 5fd2b90..ecb3cca 100644 --- a/docs/GroupRoleTemplateValues.md +++ b/docs/GroupRoleTemplateValues.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **base_permissions** | [**Vec**](GroupPermissions.md) | | **description** | **String** | | **name** | **String** | | -**roles** | [**models::GroupRoleTemplateValuesRoles**](GroupRoleTemplateValues_roles.md) | | +**roles** | [**models::GroupRoleTemplateValuesRoles**](GroupRoleTemplateValuesRoles.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/GroupTransferable.md b/docs/GroupTransferable.md index 1ac831b..5542bfc 100644 --- a/docs/GroupTransferable.md +++ b/docs/GroupTransferable.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**requirements** | [**models::GroupTransferableRequirements**](GroupTransferable_requirements.md) | | +**requirements** | [**models::GroupTransferableRequirements**](GroupTransferableRequirements.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/GroupsApi.md b/docs/GroupsApi.md index 73a5769..87d1948 100644 --- a/docs/GroupsApi.md +++ b/docs/GroupsApi.md @@ -978,7 +978,7 @@ Name | Type | Description | Required | Notes **group_id** | **String** | Must be a valid group ID. | [required] | **n** | Option<**i32**> | The number of objects to return. | |[default to 60] **offset** | Option<**i32**> | A zero-based offset from the default object sorting from where search results start. | | -**sort** | Option<[**GroupSearchSort**](.md)> | The sort order of Group Member results | | +**sort** | Option<[**GroupSearchSort**](GroupSearchSort.md)> | The sort order of Group Member results | | **role_id** | Option<**String**> | Only returns members with a specific groupRoleId | | ### Return type diff --git a/docs/InfoPushDataClickable.md b/docs/InfoPushDataClickable.md index dd5d12c..77300b5 100644 --- a/docs/InfoPushDataClickable.md +++ b/docs/InfoPushDataClickable.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **parameters** | Option<**Vec**> | In case of OpenURL, this would contain the link. | [optional] -**command** | **String** | | +**command** | **Command** | (enum: CannedWorldSearch, OpenSafetyMenu, OpenURL, OpenVRCPlusMenu) | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/InventoryApi.md b/docs/InventoryApi.md index af07dc1..f2f198b 100644 --- a/docs/InventoryApi.md +++ b/docs/InventoryApi.md @@ -127,13 +127,13 @@ Name | Type | Description | Required | Notes **n** | Option<**i32**> | The number of objects to return. | |[default to 60] **offset** | Option<**i32**> | A zero-based offset from the default object sorting from where search results start. | | **holder_id** | Option<**String**> | The UserID of the owner of the inventory; defaults to the currently authenticated user. | | -**equip_slot** | Option<[**InventoryEquipSlot**](.md)> | Filter for inventory retrieval. | | +**equip_slot** | Option<[**InventoryEquipSlot**](InventoryEquipSlot.md)> | Filter for inventory retrieval. | | **order** | Option<**String**> | Sort order for inventory retrieval. | | **tags** | Option<**String**> | Filter tags for inventory retrieval (comma-separated). | | -**types** | Option<[**InventoryItemType**](.md)> | Filter for inventory retrieval. | | -**flags** | Option<[**InventoryFlag**](.md)> | Filter flags for inventory retrieval (comma-separated). | | -**not_types** | Option<[**InventoryItemType**](.md)> | Filter out types for inventory retrieval (comma-separated). | | -**not_flags** | Option<[**InventoryFlag**](.md)> | Filter out flags for inventory retrieval (comma-separated). | | +**types** | Option<[**InventoryItemType**](InventoryItemType.md)> | Filter for inventory retrieval. | | +**flags** | Option<[**InventoryFlag**](InventoryFlag.md)> | Filter flags for inventory retrieval (comma-separated). | | +**not_types** | Option<[**InventoryItemType**](InventoryItemType.md)> | Filter out types for inventory retrieval (comma-separated). | | +**not_flags** | Option<[**InventoryFlag**](InventoryFlag.md)> | Filter out flags for inventory retrieval (comma-separated). | | **archived** | Option<**bool**> | Filter archived status for inventory retrieval. | | ### Return type @@ -405,7 +405,7 @@ Unequips the InventoryItem in the given slot of the inventory of the currently l Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**inventory_item_id** | [**InventoryEquipSlot**](.md) | Selector for inventory slot management. | [required] | +**inventory_item_id** | [**InventoryEquipSlot**](InventoryEquipSlot.md) | Selector for inventory slot management. | [required] | ### Return type diff --git a/docs/InventoryConsumptionResults.md b/docs/InventoryConsumptionResults.md index 9d59a49..cc85961 100644 --- a/docs/InventoryConsumptionResults.md +++ b/docs/InventoryConsumptionResults.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**errors** | [**Vec**](serde_json::Value.md) | | +**errors** | **Vec** | | **inventory_items** | [**Vec**](InventoryItem.md) | | **inventory_items_created** | **i32** | | diff --git a/docs/InventoryDefaultAttributesValue.md b/docs/InventoryDefaultAttributesValue.md index ee8156b..e588aaf 100644 --- a/docs/InventoryDefaultAttributesValue.md +++ b/docs/InventoryDefaultAttributesValue.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **default_value** | Option<**String**> | | [optional] -**validator** | Option<[**models::InventoryDefaultAttributesValueValidator**](InventoryDefaultAttributes_value_validator.md)> | | [optional] +**validator** | Option<[**models::InventoryDefaultAttributesValueValidator**](InventoryDefaultAttributesValueValidator.md)> | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/InventoryItem.md b/docs/InventoryItem.md index 429edaf..172ce87 100644 --- a/docs/InventoryItem.md +++ b/docs/InventoryItem.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **collections** | **Vec** | | **created_at** | **String** | | -**default_attributes** | [**std::collections::HashMap**](InventoryDefaultAttributes_value.md) | | +**default_attributes** | [**std::collections::HashMap**](InventoryDefaultAttributesValue.md) | | **description** | **String** | | **equip_slot** | Option<[**models::InventoryEquipSlot**](InventoryEquipSlot.md)> | | [optional] **equip_slots** | Option<[**Vec**](InventoryEquipSlot.md)> | | [optional] diff --git a/docs/InventoryTemplate.md b/docs/InventoryTemplate.md index a97111b..b01d2d9 100644 --- a/docs/InventoryTemplate.md +++ b/docs/InventoryTemplate.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **author_id** | **String** | A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. | **collections** | **Vec** | | **created_at** | **String** | | -**default_attributes** | [**serde_json::Value**](.md) | | +**default_attributes** | **serde_json::Value** | | **description** | **String** | | **equip_slots** | **Vec** | | **flags** | **Vec** | | diff --git a/docs/InviteApi.md b/docs/InviteApi.md index 1d945aa..1000a0f 100644 --- a/docs/InviteApi.md +++ b/docs/InviteApi.md @@ -31,7 +31,7 @@ Returns a single Invite Message. This returns the exact same information but les Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **user_id** | **String** | Must be a valid user ID. | [required] | -**message_type** | [**InviteMessageType**](.md) | The type of message to fetch, must be a valid InviteMessageType. | [required] | +**message_type** | [**InviteMessageType**](InviteMessageType.md) | The type of message to fetch, must be a valid InviteMessageType. | [required] | **slot** | **i32** | The message slot to fetch of a given message type. | [required] | ### Return type @@ -63,7 +63,7 @@ Returns a list of all the users Invite Messages. Admin Credentials are required Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **user_id** | **String** | Must be a valid user ID. | [required] | -**message_type** | [**InviteMessageType**](.md) | The type of message to fetch, must be a valid InviteMessageType. | [required] | +**message_type** | [**InviteMessageType**](InviteMessageType.md) | The type of message to fetch, must be a valid InviteMessageType. | [required] | ### Return type @@ -251,7 +251,7 @@ Resets a single Invite Message back to its original message, and then returns a Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **user_id** | **String** | Must be a valid user ID. | [required] | -**message_type** | [**InviteMessageType**](.md) | The type of message to fetch, must be a valid InviteMessageType. | [required] | +**message_type** | [**InviteMessageType**](InviteMessageType.md) | The type of message to fetch, must be a valid InviteMessageType. | [required] | **slot** | **i32** | The message slot to fetch of a given message type. | [required] | ### Return type @@ -346,7 +346,7 @@ Updates a single Invite Message and then returns a list of all of them. Admin Cr Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **user_id** | **String** | Must be a valid user ID. | [required] | -**message_type** | [**InviteMessageType**](.md) | The type of message to fetch, must be a valid InviteMessageType. | [required] | +**message_type** | [**InviteMessageType**](InviteMessageType.md) | The type of message to fetch, must be a valid InviteMessageType. | [required] | **slot** | **i32** | The message slot to fetch of a given message type. | [required] | **update_invite_message_request** | Option<[**UpdateInviteMessageRequest**](UpdateInviteMessageRequest.md)> | Message of what to set the invite message to. | | diff --git a/docs/Jam.md b/docs/Jam.md index 95898f5..f532ad5 100644 --- a/docs/Jam.md +++ b/docs/Jam.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **is_visible** | **bool** | | **more_info** | **String** | | **state** | **String** | One of: - submissions_open - closed | -**state_change_dates** | [**models::JamStateChangeDates**](Jam_stateChangeDates.md) | | +**state_change_dates** | [**models::JamStateChangeDates**](JamStateChangeDates.md) | | **submission_content_gate_date** | Option<**String**> | | **submission_content_gated** | **bool** | | **title** | **String** | | diff --git a/docs/NotificationV2.md b/docs/NotificationV2.md index ec226b5..f57a4e4 100644 --- a/docs/NotificationV2.md +++ b/docs/NotificationV2.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **can_delete** | **bool** | | **category** | **String** | | **created_at** | **String** | | -**data** | [**models::NotificationV2Data**](NotificationV2_data.md) | | +**data** | [**models::NotificationV2Data**](NotificationV2Data.md) | | **details** | Option<[**models::NotificationV2DetailsBoop**](NotificationV2DetailsBoop.md)> | | [optional] **expires_at** | **String** | | **expiry_after_seen** | Option<**i32**> | | diff --git a/docs/Permission.md b/docs/Permission.md index a87be11..72327c9 100644 --- a/docs/Permission.md +++ b/docs/Permission.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | Option<[**models::PermissionData**](Permission_data.md)> | | [optional] +**data** | Option<[**models::PermissionData**](PermissionData.md)> | | [optional] **description** | Option<**String**> | | [optional] **display_name** | Option<**String**> | | [optional] **id** | **String** | | diff --git a/docs/PlayermoderationApi.md b/docs/PlayermoderationApi.md index 6a02211..aa0d701 100644 --- a/docs/PlayermoderationApi.md +++ b/docs/PlayermoderationApi.md @@ -50,7 +50,7 @@ Returns a list of all player moderations made by **you**. This endpoint does no Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**r#type** | Option<[**PlayerModerationType**](.md)> | Must be one of PlayerModerationType. | | +**r#type** | Option<[**PlayerModerationType**](PlayerModerationType.md)> | Must be one of PlayerModerationType. | | **target_user_id** | Option<**String**> | Must be valid UserID. | | ### Return type diff --git a/docs/Print.md b/docs/Print.md index 4863a0b..bad2ed7 100644 --- a/docs/Print.md +++ b/docs/Print.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **author_id** | **String** | A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. | **author_name** | **String** | | **created_at** | **String** | | -**files** | [**models::PrintFiles**](Print_files.md) | | +**files** | [**models::PrintFiles**](PrintFiles.md) | | **id** | **String** | | **note** | **String** | | **owner_id** | Option<**String**> | A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. | [optional] diff --git a/docs/ProductListing.md b/docs/ProductListing.md index 5e0452d..725ed15 100644 --- a/docs/ProductListing.md +++ b/docs/ProductListing.md @@ -25,7 +25,7 @@ Name | Type | Description | Notes **price_tokens** | **i32** | | **product_ids** | **Vec** | | **product_type** | [**models::ProductType**](ProductType.md) | | -**products** | [**Vec**](serde_json::Value.md) | | +**products** | **Vec** | | **quantifiable** | Option<**bool**> | | [optional] **recurrable** | **bool** | | **refundable** | **bool** | | diff --git a/docs/ProductPurchase.md b/docs/ProductPurchase.md index a885ac5..5176496 100644 --- a/docs/ProductPurchase.md +++ b/docs/ProductPurchase.md @@ -17,9 +17,9 @@ Name | Type | Description | Notes **listing_image_id** | **String** | | **listing_subtitle** | **String** | | **listing_type** | [**models::ProductListingType**](ProductListingType.md) | | -**products** | [**Vec**](serde_json::Value.md) | | +**products** | **Vec** | | **purchase_active** | **bool** | | -**purchase_context** | [**models::ProductPurchasePurchaseContext**](ProductPurchase_purchaseContext.md) | | +**purchase_context** | [**models::ProductPurchasePurchaseContext**](ProductPurchasePurchaseContext.md) | | **purchase_current_status** | **String** | | **purchase_date** | **String** | | **purchase_duration** | Option<**i32**> | | [optional] @@ -30,7 +30,7 @@ Name | Type | Description | Notes **purchase_price** | **i32** | | **purchase_quantity** | **i32** | | **purchase_start_date** | **String** | | -**purchase_token** | Option<[**serde_json::Value**](.md)> | | +**purchase_token** | Option<**serde_json::Value**> | | **purchase_type** | **String** | | **purchase_unit_price** | **i32** | | **receiver_display_name** | **String** | | diff --git a/docs/Prop.md b/docs/Prop.md index fadfdcf..fa31d0c 100644 --- a/docs/Prop.md +++ b/docs/Prop.md @@ -18,7 +18,7 @@ Name | Type | Description | Notes **tags** | **Vec** | | **thumbnail_image_url** | **String** | | **unity_package_url** | Option<**String**> | | -**unity_packages** | [**Vec**](PropUnityPackage.md) | | +**unity_packages** | [**HashSet**](PropUnityPackage.md) | | **world_placement_mask** | **i32** | Bitmask for restrictions on what world surfaces a prop may be summoned. 0: no restrictions 1: floors 2: walls 4: ceilings | [default to 1] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/SentNotification.md b/docs/SentNotification.md index 14bd8fd..2594ccd 100644 --- a/docs/SentNotification.md +++ b/docs/SentNotification.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **created_at** | **String** | | -**details** | [**models::SentNotificationDetails**](SentNotification_details.md) | | +**details** | [**models::SentNotificationDetails**](SentNotificationDetails.md) | | **id** | **String** | | **message** | **String** | | **receiver_user_id** | **String** | A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. | diff --git a/docs/ServiceStatus.md b/docs/ServiceStatus.md index 3b9d29e..4914322 100644 --- a/docs/ServiceStatus.md +++ b/docs/ServiceStatus.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **created_at** | **String** | | **id** | **String** | The id of this service, NOT the id of the thing this service was requested for. | -**progress** | [**Vec**](serde_json::Value.md) | | +**progress** | **Vec** | | **requester_user_id** | **String** | A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. | **state** | **String** | | **subject_id** | **String** | The id of the thing this service was requested for. | diff --git a/docs/SubmitModerationReportRequest.md b/docs/SubmitModerationReportRequest.md index 04e92f0..6adef12 100644 --- a/docs/SubmitModerationReportRequest.md +++ b/docs/SubmitModerationReportRequest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **category** | **String** | Valid values are the keys of the object `$.reportOptions[type]` from `GET /config`. Descriptions of these are found at `$.reportCategories[type]`. | **content_id** | **String** | The id of the user, group, world, avatar, inventory item, print, etc. being reported. | **description** | Option<**String**> | The subjective reason for the report | [optional] -**details** | Option<[**models::SubmitModerationReportRequestDetails**](SubmitModerationReportRequest_details.md)> | | [optional] +**details** | Option<[**models::SubmitModerationReportRequestDetails**](SubmitModerationReportRequestDetails.md)> | | [optional] **reason** | **String** | Valid values are the strings in the array `$.reportOptions[type][category]` from `GET /config`. Descriptions of these are found at `$.reportReasons[type]`. | **r#type** | **String** | Valid values are the keys of the object `$.reportOptions` from `GET /config`. | diff --git a/docs/TwoFactorRecoveryCodes.md b/docs/TwoFactorRecoveryCodes.md index e680f7b..2c85fb4 100644 --- a/docs/TwoFactorRecoveryCodes.md +++ b/docs/TwoFactorRecoveryCodes.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**otp** | Option<[**Vec**](TwoFactorRecoveryCodes_otp_inner.md)> | | [optional] +**otp** | Option<[**Vec**](TwoFactorRecoveryCodesOtpInner.md)> | | [optional] **requires_two_factor_auth** | Option<**Vec**> | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UnityPackage.md b/docs/UnityPackage.md index 5880fcf..fa5cb26 100644 --- a/docs/UnityPackage.md +++ b/docs/UnityPackage.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **asset_url** | Option<**String**> | | [optional] -**asset_url_object** | Option<[**serde_json::Value**](.md)> | | [optional] +**asset_url_object** | Option<**serde_json::Value**> | | [optional] **asset_version** | **i32** | | **created_at** | Option<**String**> | | [optional] **id** | **String** | | @@ -14,7 +14,7 @@ Name | Type | Description | Notes **performance_rating** | Option<[**models::PerformanceRatings**](PerformanceRatings.md)> | | [optional] **platform** | **String** | This is normally `android`, `ios`, `standalonewindows`, `web`, or the empty value ``, but also supposedly can be any random Unity version such as `2019.2.4-801-Release` or `2019.2.2-772-Release` or even `unknownplatform`. | **plugin_url** | Option<**String**> | | [optional] -**plugin_url_object** | Option<[**serde_json::Value**](.md)> | | [optional] +**plugin_url_object** | Option<**serde_json::Value**> | | [optional] **scan_status** | Option<**String**> | | [optional] **unity_sort_number** | Option<**i64**> | | [optional] **unity_version** | **String** | | [default to 5.3.4p1] diff --git a/docs/UpdateUserRequest.md b/docs/UpdateUserRequest.md index 1c3af8a..319dc7a 100644 --- a/docs/UpdateUserRequest.md +++ b/docs/UpdateUserRequest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **accepted_tos_version** | Option<**i32**> | | [optional] **bio** | Option<**String**> | | [optional] **bio_links** | Option<**Vec**> | | [optional] -**birthday** | Option<[**String**](string.md)> | | [optional] +**birthday** | Option<[**String**](String.md)> | | [optional] **content_filters** | Option<[**Vec**](ContentFilter.md)> | These tags begin with `content_` and control content gating | [optional] **current_password** | Option<**String**> | | [optional] **display_name** | Option<**String**> | MUST specify currentPassword as well to change display name | [optional] diff --git a/docs/User.md b/docs/User.md index f87c34c..a6fa20e 100644 --- a/docs/User.md +++ b/docs/User.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes **current_avatar_image_url** | **String** | When profilePicOverride is not empty, use it instead. | **current_avatar_tags** | **Vec** | | **current_avatar_thumbnail_image_url** | **String** | When profilePicOverride is not empty, use it instead. | -**date_joined** | [**String**](string.md) | | +**date_joined** | [**String**](String.md) | | **developer_type** | [**models::DeveloperType**](DeveloperType.md) | | **display_name** | **String** | A users visual display name. This is what shows up in-game, and can different from their `username`. Changing display name is restricted to a cooldown period. | **friend_key** | **String** | | diff --git a/docs/UserNote.md b/docs/UserNote.md index e485f65..dac6020 100644 --- a/docs/UserNote.md +++ b/docs/UserNote.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **created_at** | **String** | | **id** | **String** | | **note** | **String** | | -**target_user** | Option<[**models::UserNoteTargetUser**](UserNote_targetUser.md)> | | [optional] +**target_user** | Option<[**models::UserNoteTargetUser**](UserNoteTargetUser.md)> | | [optional] **target_user_id** | **String** | A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. | **user_id** | **String** | A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. | diff --git a/docs/WorldMetadata.md b/docs/WorldMetadata.md index 19c48bb..e225d02 100644 --- a/docs/WorldMetadata.md +++ b/docs/WorldMetadata.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **String** | WorldID be \"offline\" on User profiles if you are not friends with that user. | -**metadata** | [**serde_json::Value**](.md) | | +**metadata** | **serde_json::Value** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/WorldsApi.md b/docs/WorldsApi.md index 02b977e..abec04f 100644 --- a/docs/WorldsApi.md +++ b/docs/WorldsApi.md @@ -188,14 +188,14 @@ Search and list currently Active worlds by query filters. Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **featured** | Option<**bool**> | Filters on featured results. | | -**sort** | Option<[**SortOption**](.md)> | The sort order of the results. | | +**sort** | Option<[**SortOption**](SortOption.md)> | The sort order of the results. | | **n** | Option<**i32**> | The number of objects to return. | |[default to 60] -**order** | Option<[**OrderOption**](.md)> | Result ordering | | +**order** | Option<[**OrderOption**](OrderOption.md)> | Result ordering | | **offset** | Option<**i32**> | A zero-based offset from the default object sorting from where search results start. | | **search** | Option<**String**> | Filters by world name. | | **tag** | Option<**String**> | Tags to include (comma-separated). Any of the tags needs to be present. | | **notag** | Option<**String**> | Tags to exclude (comma-separated). | | -**release_status** | Option<[**ReleaseStatus**](.md)> | Filter by ReleaseStatus. | | +**release_status** | Option<[**ReleaseStatus**](ReleaseStatus.md)> | Filter by ReleaseStatus. | | **max_unity_version** | Option<**String**> | The maximum Unity version supported by the asset. | | **min_unity_version** | Option<**String**> | The minimum Unity version supported by the asset. | | **platform** | Option<**String**> | The platform the asset supports. | | @@ -230,14 +230,14 @@ Search and list favorited worlds by query filters. Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **featured** | Option<**bool**> | Filters on featured results. | | -**sort** | Option<[**SortOption**](.md)> | The sort order of the results. | | +**sort** | Option<[**SortOption**](SortOption.md)> | The sort order of the results. | | **n** | Option<**i32**> | The number of objects to return. | |[default to 60] -**order** | Option<[**OrderOption**](.md)> | Result ordering | | +**order** | Option<[**OrderOption**](OrderOption.md)> | Result ordering | | **offset** | Option<**i32**> | A zero-based offset from the default object sorting from where search results start. | | **search** | Option<**String**> | Filters by world name. | | **tag** | Option<**String**> | Tags to include (comma-separated). Any of the tags needs to be present. | | **notag** | Option<**String**> | Tags to exclude (comma-separated). | | -**release_status** | Option<[**ReleaseStatus**](.md)> | Filter by ReleaseStatus. | | +**release_status** | Option<[**ReleaseStatus**](ReleaseStatus.md)> | Filter by ReleaseStatus. | | **max_unity_version** | Option<**String**> | The maximum Unity version supported by the asset. | | **min_unity_version** | Option<**String**> | The minimum Unity version supported by the asset. | | **platform** | Option<**String**> | The platform the asset supports. | | @@ -272,14 +272,14 @@ Search and list recently visited worlds by query filters. Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **featured** | Option<**bool**> | Filters on featured results. | | -**sort** | Option<[**SortOption**](.md)> | The sort order of the results. | | +**sort** | Option<[**SortOption**](SortOption.md)> | The sort order of the results. | | **n** | Option<**i32**> | The number of objects to return. | |[default to 60] -**order** | Option<[**OrderOption**](.md)> | Result ordering | | +**order** | Option<[**OrderOption**](OrderOption.md)> | Result ordering | | **offset** | Option<**i32**> | A zero-based offset from the default object sorting from where search results start. | | **search** | Option<**String**> | Filters by world name. | | **tag** | Option<**String**> | Tags to include (comma-separated). Any of the tags needs to be present. | | **notag** | Option<**String**> | Tags to exclude (comma-separated). | | -**release_status** | Option<[**ReleaseStatus**](.md)> | Filter by ReleaseStatus. | | +**release_status** | Option<[**ReleaseStatus**](ReleaseStatus.md)> | Filter by ReleaseStatus. | | **max_unity_version** | Option<**String**> | The maximum Unity version supported by the asset. | | **min_unity_version** | Option<**String**> | The minimum Unity version supported by the asset. | | **platform** | Option<**String**> | The platform the asset supports. | | @@ -465,16 +465,16 @@ Search and list any worlds by query filters. Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **featured** | Option<**bool**> | Filters on featured results. | | -**sort** | Option<[**SortOption**](.md)> | The sort order of the results. | | +**sort** | Option<[**SortOption**](SortOption.md)> | The sort order of the results. | | **user** | Option<**String**> | Set to `me` for searching own worlds. | | **user_id** | Option<**String**> | Filter by UserID. | | **n** | Option<**i32**> | The number of objects to return. | |[default to 60] -**order** | Option<[**OrderOption**](.md)> | Result ordering | | +**order** | Option<[**OrderOption**](OrderOption.md)> | Result ordering | | **offset** | Option<**i32**> | A zero-based offset from the default object sorting from where search results start. | | **search** | Option<**String**> | Filters by world name. | | **tag** | Option<**String**> | Tags to include (comma-separated). Any of the tags needs to be present. | | **notag** | Option<**String**> | Tags to exclude (comma-separated). | | -**release_status** | Option<[**ReleaseStatus**](.md)> | Filter by ReleaseStatus. | | +**release_status** | Option<[**ReleaseStatus**](ReleaseStatus.md)> | Filter by ReleaseStatus. | | **max_unity_version** | Option<**String**> | The maximum Unity version supported by the asset. | | **min_unity_version** | Option<**String**> | The minimum Unity version supported by the asset. | | **platform** | Option<**String**> | The platform the asset supports. | | diff --git a/examples/example.rs b/examples/example.rs index ee3f96d..0eacae3 100644 --- a/examples/example.rs +++ b/examples/example.rs @@ -7,7 +7,7 @@ async fn main() { .await .unwrap() { - ::vrchatapi::models::EitherUserOrTwoFactor::CurrentUser(me) => { + ::vrchatapi::models::RegisterUserAccount200Response::CurrentUser(me) => { println!("Username: {}", me.username.unwrap()) } ::vrchatapi::models::RegisterUserAccount200Response::RequiresTwoFactorAuth( diff --git a/generate.sh b/generate.sh index 3d11ae4..41a1291 100755 --- a/generate.sh +++ b/generate.sh @@ -12,7 +12,8 @@ rm src/apis src/models docs -rf ./node_modules/\@openapitools/openapi-generator-cli/main.js generate \ -g rust \ ---additional-properties=packageName=vrchatapi,supportAsync=true,avoidBoxedModels=true,library=reqwest,reqwestDefaultFeatures=reqwest/cookies,supportMiddleware=true \ +-t ./templates \ +'--additional-properties=packageName=vrchatapi,supportAsync=true,avoidBoxedModels=true,library=reqwest,reqwestDefaultFeatures=reqwest/cookies,supportMiddleware=true,repositoryUrl="https://github.com/vrchatapi/vrchatapi-rust",description="VRChat API Client for Rust",infoEmail="vrchatapi.lpv0t@aries.fyi"' \ --git-user-id=vrchatapi \ --git-repo-id=vrchatapi-rust \ -o . \ @@ -22,41 +23,19 @@ rm src/apis src/models docs -rf # Update entire description (replace entire line, match the random data there) line in Cargo.toml sed -i 's/^description = ".*"/description = "VRChat API Client for Rust"/' Cargo.toml -# Add repository link to Cargo.toml -sed -i 's|\[package\]|[package]\nrepository="https://github.com/vrchatapi/vrchatapi-rust"|' Cargo.toml -# Remove messily pasted markdown at top of every file -find src -type f -exec sed -i '/VRChat API Banner/d' {} \; -# Remove openapi version in every file -find src -type f -exec sed -i '/The version of the OpenAPI document/d' {} \; # Remove empty doc comments find src -type f -exec sed -i '/^\s*\/\/\/\s*$/d' {} \; -# Cookie storage -sed -i 's/Client::new()/Client::builder().cookie_store(true).build().unwrap()/g' src/apis/configuration.rs -#sed -i 's/, features = \["json", "multipart"\]/, features = \["json", "cookies", "multipart"\]/g' Cargo.toml - #Fix example printf "\n[dev-dependencies]\ntokio = { version = '1', features = ['macros', 'rt-multi-thread'] }" >> Cargo.toml -#Transition help from old EitherUserOrTwoFactor -cat patches/2fa-reexport.rs >> src/models/mod.rs - -# https://github.com/vrchatapi/vrchatapi-rust/pull/29 -sed -i "s/local_var_req_builder = local_var_req_builder.json(&\(.*\));/if let Some(\1) = \1 { \0 }/g" src/apis/files_api.rs - -#https://github.com/vrchatapi/vrchatapi-rust/pull/30 -#perl -0pi -e 's|(fn\s+[^(]*\([^)]*)file:\s+:?:?std::path::PathBuf,?([^)]*)((?:(?!\/\/ TODO: support file upload for '\''file'\'' parameter)[\s\S])*)\/\/ TODO: support file upload for '\''file'\'' parameter|\1file: impl Into<::std::borrow::Cow<'\''static, [u8]>>,\n\tfilename: impl Into<::std::borrow::Cow<'\''static, str>>,\n\tmime_type: &str,\2\3let part = reqwest::multipart::Part::bytes(p_form_file).file_name(filename).mime_str(mime_type)?;\n\tmultipart_form = multipart_form.part("file", part);|g' src/apis/files_api.rs -#perl -0pi -e 's|(fn\s+[^(]*\([^)]*)image:\s+:?:?std::path::PathBuf,?([^)]*)((?:(?!\/\/ TODO: support file upload for '\''image'\'' parameter)[\s\S])*)\/\/ TODO: support file upload for '\''image'\'' parameter|\1image: impl Into<::std::borrow::Cow<'\''static, [u8]>>,\n\tfilename: impl Into<::std::borrow::Cow<'\''static, str>>,\n\tmime_type: &str,\2\3let part = reqwest::multipart::Part::bytes(p_form_image).file_name(filename).mime_str(mime_type)?;\n\tmultipart_form = multipart_form.part("image", part);|g' src/apis/invite_api.rs -#This is basically the multipart handling from above, except put in one regex replace -perl -0pi -e 's|(fn\s+[^(]*\([^)]*)([,\s])([\w]+):\s+(?:::)?std::path::PathBuf,?([^)]*)((?:(?!\/\/ TODO: support file upload for '\''\3'\'' parameter)[\s\S])*)\/\/ TODO: support file upload for '\''\3'\'' parameter|\1\2\3: impl Into<::std::borrow::Cow<'\''static, [u8]>>,\n\tfilename: impl Into<::std::borrow::Cow<'\''static, str>>,\n\tmime_type: &str,\4\5let part = reqwest::multipart::Part::bytes(p_form_\3).file_name(filename).mime_str(mime_type)?;\n\tmultipart_form = multipart_form.part("\3", part);|g' src/apis/files_api.rs src/apis/invite_api.rs src/apis/prints_api.rs - find src/ -type f -name "*.rs" -exec sed -i 's/models::models/models/g' {} + +find src/ -type f -name "*.rs" -exec sed -i -E "s/(::)?std::path::PathBuf/crate::patches::better_file_upload::File<'_>/g" {} + -find src/ -type f -name "*.rs" -exec sed -i 's/multipart_form\.text("data", p_form_data\.to_string())/multipart_form.text("data", serde_json::to_string_pretty(\&p_form_data)?)/g' {} + - -#Hide warnings about unused variables and non-rusty type names -sed -i 's/#!\[allow(unused_imports)\]/#![allow(unused_imports)]\n#![allow(non_camel_case_types)]/' src/lib.rs +rm -r src/patches +cp -r patches src/patches +printf "\npub mod patches;" >> src/lib.rs cargo fmt cargo build diff --git a/openapitools.json b/openapitools.json index 354feb9..29399d3 100644 --- a/openapitools.json +++ b/openapitools.json @@ -2,6 +2,6 @@ "$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json", "spaces": 2, "generator-cli": { - "version": "7.17.0" + "version": "7.20.0" } } diff --git a/patches/2fa-reexport.rs b/patches/2fa-reexport.rs deleted file mode 100644 index 3785ce0..0000000 --- a/patches/2fa-reexport.rs +++ /dev/null @@ -1,2 +0,0 @@ -#[deprecated(since= "1.20.7-nightly.28", note= "Use RegisterUserAccount200Response directly. This re-export is only provided as a transition-help!")] -pub use self::RegisterUserAccount200Response as EitherUserOrTwoFactor; \ No newline at end of file diff --git a/patches/better_file_upload.rs b/patches/better_file_upload.rs new file mode 100644 index 0000000..8b9f907 --- /dev/null +++ b/patches/better_file_upload.rs @@ -0,0 +1,33 @@ +#[derive(Debug)] +#[non_exhaustive] +pub enum File<'a> { + Path(::std::path::PathBuf), + Buf{filename: ::std::borrow::Cow<'static, str>, file: reqwest::Body, length: Option, mime_type: ::std::borrow::Cow<'a, str>} +} + +impl File<'_> { + pub(crate) async fn get_multipart(self) -> Result<::reqwest::multipart::Part, crate::apis::Error> { + match self { + //The generator likes to generate this in 7.20.0. Why? Let's not? + // let file = TokioFile::open(&p_form_file).await?; + // let stream = FramedRead::new(file, BytesCodec::new()); + // let file_name = p_form_file + // .file_name() + // .map(|n| n.to_string_lossy().to_string()) + // .unwrap_or_default(); + // let file_part = + // reqwest::multipart::Part::stream(reqwest::Body::wrap_stream(stream)).file_name(file_name); + File::Path(path) => Ok(reqwest::multipart::Part::file(path).await?), + File::Buf{filename, file, length, mime_type} => { + let part = if let Some(length) = length { + reqwest::multipart::Part::stream_with_length(file, length) + } else { + reqwest::multipart::Part::stream(file) + } + .file_name(filename) + .mime_str(&*mime_type)?; + Ok(part) + } + } + } +} diff --git a/patches/mod.rs b/patches/mod.rs new file mode 100644 index 0000000..da60617 --- /dev/null +++ b/patches/mod.rs @@ -0,0 +1 @@ +pub mod better_file_upload; \ No newline at end of file diff --git a/src/apis/authentication_api.rs b/src/apis/authentication_api.rs index f42aaf7..16b0ea6 100644 --- a/src/apis/authentication_api.rs +++ b/src/apis/authentication_api.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use super::{configuration, ContentType, Error}; use crate::{apis::ResponseContent, models}; use reqwest; diff --git a/src/apis/avatars_api.rs b/src/apis/avatars_api.rs index 1c03957..0435386 100644 --- a/src/apis/avatars_api.rs +++ b/src/apis/avatars_api.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use super::{configuration, ContentType, Error}; use crate::{apis::ResponseContent, models}; use reqwest; diff --git a/src/apis/calendar_api.rs b/src/apis/calendar_api.rs index 3f5f878..df0794f 100644 --- a/src/apis/calendar_api.rs +++ b/src/apis/calendar_api.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use super::{configuration, ContentType, Error}; use crate::{apis::ResponseContent, models}; use reqwest; diff --git a/src/apis/configuration.rs b/src/apis/configuration.rs index 9470d57..7f47feb 100644 --- a/src/apis/configuration.rs +++ b/src/apis/configuration.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - #[derive(Debug, Clone)] pub struct Configuration { pub base_path: String, diff --git a/src/apis/economy_api.rs b/src/apis/economy_api.rs index 06ce203..10a7661 100644 --- a/src/apis/economy_api.rs +++ b/src/apis/economy_api.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use super::{configuration, ContentType, Error}; use crate::{apis::ResponseContent, models}; use reqwest; diff --git a/src/apis/favorites_api.rs b/src/apis/favorites_api.rs index 911a5ee..b1ac5fe 100644 --- a/src/apis/favorites_api.rs +++ b/src/apis/favorites_api.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use super::{configuration, ContentType, Error}; use crate::{apis::ResponseContent, models}; use reqwest; diff --git a/src/apis/files_api.rs b/src/apis/files_api.rs index b22fd5c..90d56eb 100644 --- a/src/apis/files_api.rs +++ b/src/apis/files_api.rs @@ -1,15 +1,9 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use super::{configuration, ContentType, Error}; use crate::{apis::ResponseContent, models}; use reqwest; use serde::{de::Error as _, Deserialize, Serialize}; +use tokio::fs::File as TokioFile; +use tokio_util::codec::{BytesCodec, FramedRead}; /// struct for typed errors of method [`create_file`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -1081,9 +1075,7 @@ pub async fn update_asset_review_notes( /// Upload a gallery image pub async fn upload_gallery_image( configuration: &configuration::Configuration, - file: impl Into<::std::borrow::Cow<'static, [u8]>>, - filename: impl Into<::std::borrow::Cow<'static, str>>, - mime_type: &str, + file: crate::patches::better_file_upload::File<'_>, ) -> Result> { // add a prefix to parameters to efficiently prevent name collisions let p_form_file = file; @@ -1097,10 +1089,7 @@ pub async fn upload_gallery_image( req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } let mut multipart_form = reqwest::multipart::Form::new(); - let part = reqwest::multipart::Part::bytes(p_form_file) - .file_name(filename) - .mime_str(mime_type)?; - multipart_form = multipart_form.part("file", part); + multipart_form = multipart_form.part("file", p_form_file.get_multipart().await?); req_builder = req_builder.multipart(multipart_form); let req = req_builder.build()?; @@ -1135,9 +1124,7 @@ pub async fn upload_gallery_image( /// Upload an icon pub async fn upload_icon( configuration: &configuration::Configuration, - file: impl Into<::std::borrow::Cow<'static, [u8]>>, - filename: impl Into<::std::borrow::Cow<'static, str>>, - mime_type: &str, + file: crate::patches::better_file_upload::File<'_>, ) -> Result> { // add a prefix to parameters to efficiently prevent name collisions let p_form_file = file; @@ -1151,10 +1138,7 @@ pub async fn upload_icon( req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } let mut multipart_form = reqwest::multipart::Form::new(); - let part = reqwest::multipart::Part::bytes(p_form_file) - .file_name(filename) - .mime_str(mime_type)?; - multipart_form = multipart_form.part("file", part); + multipart_form = multipart_form.part("file", p_form_file.get_multipart().await?); req_builder = req_builder.multipart(multipart_form); let req = req_builder.build()?; @@ -1189,9 +1173,7 @@ pub async fn upload_icon( /// Upload an image, which can be an icon, gallery image, sticker or emoji pub async fn upload_image( configuration: &configuration::Configuration, - file: impl Into<::std::borrow::Cow<'static, [u8]>>, - filename: impl Into<::std::borrow::Cow<'static, str>>, - mime_type: &str, + file: crate::patches::better_file_upload::File<'_>, tag: models::ImagePurpose, animation_style: Option, frames: Option, @@ -1218,12 +1200,10 @@ pub async fn upload_image( } let mut multipart_form = reqwest::multipart::Form::new(); if let Some(param_value) = p_form_animation_style { - multipart_form = multipart_form.text("animationStyle", param_value.to_string()); + multipart_form = + multipart_form.text("animationStyle", serde_json::to_string(¶m_value)?); } - let part = reqwest::multipart::Part::bytes(p_form_file) - .file_name(filename) - .mime_str(mime_type)?; - multipart_form = multipart_form.part("file", part); + multipart_form = multipart_form.part("file", p_form_file.get_multipart().await?); if let Some(param_value) = p_form_frames { multipart_form = multipart_form.text("frames", param_value.to_string()); } @@ -1231,12 +1211,20 @@ pub async fn upload_image( multipart_form = multipart_form.text("framesOverTime", param_value.to_string()); } if let Some(param_value) = p_form_loop_style { - multipart_form = multipart_form.text("loopStyle", param_value.to_string()); + multipart_form = multipart_form.text("loopStyle", serde_json::to_string(¶m_value)?); } if let Some(param_value) = p_form_mask_tag { - multipart_form = multipart_form.text("maskTag", param_value.to_string()); + multipart_form = multipart_form.text("maskTag", serde_json::to_string(¶m_value)?); + } + macro_rules! serialize { + ($form:ident, data, $data:ident) => { + $form = $form.text("data", serde_json::to_string(&$data)?); + }; + ($form:ident, $tag:ident, $data:ident) => { + $form = $form.text(stringify!($tag), $data.to_string()); + }; } - multipart_form = multipart_form.text("tag", p_form_tag.to_string()); + serialize!(multipart_form, tag, p_form_tag); req_builder = req_builder.multipart(multipart_form); let req = req_builder.build()?; diff --git a/src/apis/friends_api.rs b/src/apis/friends_api.rs index a48da40..e768535 100644 --- a/src/apis/friends_api.rs +++ b/src/apis/friends_api.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use super::{configuration, ContentType, Error}; use crate::{apis::ResponseContent, models}; use reqwest; diff --git a/src/apis/groups_api.rs b/src/apis/groups_api.rs index 8f64246..72a0f5d 100644 --- a/src/apis/groups_api.rs +++ b/src/apis/groups_api.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use super::{configuration, ContentType, Error}; use crate::{apis::ResponseContent, models}; use reqwest; diff --git a/src/apis/instances_api.rs b/src/apis/instances_api.rs index de73691..7c71ddf 100644 --- a/src/apis/instances_api.rs +++ b/src/apis/instances_api.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use super::{configuration, ContentType, Error}; use crate::{apis::ResponseContent, models}; use reqwest; diff --git a/src/apis/inventory_api.rs b/src/apis/inventory_api.rs index 5b943a8..1d07246 100644 --- a/src/apis/inventory_api.rs +++ b/src/apis/inventory_api.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use super::{configuration, ContentType, Error}; use crate::{apis::ResponseContent, models}; use reqwest; diff --git a/src/apis/invite_api.rs b/src/apis/invite_api.rs index 53376e1..819dcc8 100644 --- a/src/apis/invite_api.rs +++ b/src/apis/invite_api.rs @@ -1,15 +1,9 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use super::{configuration, ContentType, Error}; use crate::{apis::ResponseContent, models}; use reqwest; use serde::{de::Error as _, Deserialize, Serialize}; +use tokio::fs::File as TokioFile; +use tokio_util::codec::{BytesCodec, FramedRead}; /// struct for typed errors of method [`get_invite_message`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -324,9 +318,7 @@ pub async fn invite_user_with_photo( configuration: &configuration::Configuration, user_id: &str, data: models::InviteRequest, - image: impl Into<::std::borrow::Cow<'static, [u8]>>, - filename: impl Into<::std::borrow::Cow<'static, str>>, - mime_type: &str, + image: crate::patches::better_file_upload::File<'_>, ) -> Result> { // add a prefix to parameters to efficiently prevent name collisions let p_path_user_id = user_id; @@ -346,11 +338,16 @@ pub async fn invite_user_with_photo( req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } let mut multipart_form = reqwest::multipart::Form::new(); - multipart_form = multipart_form.text("data", serde_json::to_string_pretty(&p_form_data)?); - let part = reqwest::multipart::Part::bytes(p_form_image) - .file_name(filename) - .mime_str(mime_type)?; - multipart_form = multipart_form.part("image", part); + macro_rules! serialize { + ($form:ident, data, $data:ident) => { + $form = $form.text("data", serde_json::to_string(&$data)?); + }; + ($form:ident, $tag:ident, $data:ident) => { + $form = $form.text(stringify!($tag), $data.to_string()); + }; + } + serialize!(multipart_form, data, p_form_data); + multipart_form = multipart_form.part("image", p_form_image.get_multipart().await?); req_builder = req_builder.multipart(multipart_form); let req = req_builder.build()?; @@ -440,9 +437,7 @@ pub async fn request_invite_with_photo( configuration: &configuration::Configuration, user_id: &str, data: models::RequestInviteRequest, - image: impl Into<::std::borrow::Cow<'static, [u8]>>, - filename: impl Into<::std::borrow::Cow<'static, str>>, - mime_type: &str, + image: crate::patches::better_file_upload::File<'_>, ) -> Result> { // add a prefix to parameters to efficiently prevent name collisions let p_path_user_id = user_id; @@ -462,11 +457,16 @@ pub async fn request_invite_with_photo( req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } let mut multipart_form = reqwest::multipart::Form::new(); - multipart_form = multipart_form.text("data", serde_json::to_string_pretty(&p_form_data)?); - let part = reqwest::multipart::Part::bytes(p_form_image) - .file_name(filename) - .mime_str(mime_type)?; - multipart_form = multipart_form.part("image", part); + macro_rules! serialize { + ($form:ident, data, $data:ident) => { + $form = $form.text("data", serde_json::to_string(&$data)?); + }; + ($form:ident, $tag:ident, $data:ident) => { + $form = $form.text(stringify!($tag), $data.to_string()); + }; + } + serialize!(multipart_form, data, p_form_data); + multipart_form = multipart_form.part("image", p_form_image.get_multipart().await?); req_builder = req_builder.multipart(multipart_form); let req = req_builder.build()?; @@ -612,9 +612,7 @@ pub async fn respond_invite_with_photo( configuration: &configuration::Configuration, notification_id: &str, data: models::InviteResponse, - image: impl Into<::std::borrow::Cow<'static, [u8]>>, - filename: impl Into<::std::borrow::Cow<'static, str>>, - mime_type: &str, + image: crate::patches::better_file_upload::File<'_>, ) -> Result> { // add a prefix to parameters to efficiently prevent name collisions let p_path_notification_id = notification_id; @@ -634,11 +632,16 @@ pub async fn respond_invite_with_photo( req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } let mut multipart_form = reqwest::multipart::Form::new(); - multipart_form = multipart_form.text("data", serde_json::to_string_pretty(&p_form_data)?); - let part = reqwest::multipart::Part::bytes(p_form_image) - .file_name(filename) - .mime_str(mime_type)?; - multipart_form = multipart_form.part("image", part); + macro_rules! serialize { + ($form:ident, data, $data:ident) => { + $form = $form.text("data", serde_json::to_string(&$data)?); + }; + ($form:ident, $tag:ident, $data:ident) => { + $form = $form.text(stringify!($tag), $data.to_string()); + }; + } + serialize!(multipart_form, data, p_form_data); + multipart_form = multipart_form.part("image", p_form_image.get_multipart().await?); req_builder = req_builder.multipart(multipart_form); let req = req_builder.build()?; diff --git a/src/apis/jams_api.rs b/src/apis/jams_api.rs index aee65dc..75621ba 100644 --- a/src/apis/jams_api.rs +++ b/src/apis/jams_api.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use super::{configuration, ContentType, Error}; use crate::{apis::ResponseContent, models}; use reqwest; diff --git a/src/apis/miscellaneous_api.rs b/src/apis/miscellaneous_api.rs index db54a8e..654aa64 100644 --- a/src/apis/miscellaneous_api.rs +++ b/src/apis/miscellaneous_api.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use super::{configuration, ContentType, Error}; use crate::{apis::ResponseContent, models}; use reqwest; diff --git a/src/apis/notifications_api.rs b/src/apis/notifications_api.rs index e7a9acf..3de3bc9 100644 --- a/src/apis/notifications_api.rs +++ b/src/apis/notifications_api.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use super::{configuration, ContentType, Error}; use crate::{apis::ResponseContent, models}; use reqwest; diff --git a/src/apis/playermoderation_api.rs b/src/apis/playermoderation_api.rs index b506fcb..c29dc64 100644 --- a/src/apis/playermoderation_api.rs +++ b/src/apis/playermoderation_api.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use super::{configuration, ContentType, Error}; use crate::{apis::ResponseContent, models}; use reqwest; diff --git a/src/apis/prints_api.rs b/src/apis/prints_api.rs index 1fbe0b0..690d853 100644 --- a/src/apis/prints_api.rs +++ b/src/apis/prints_api.rs @@ -1,15 +1,9 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use super::{configuration, ContentType, Error}; use crate::{apis::ResponseContent, models}; use reqwest; use serde::{de::Error as _, Deserialize, Serialize}; +use tokio::fs::File as TokioFile; +use tokio_util::codec::{BytesCodec, FramedRead}; /// struct for typed errors of method [`delete_print`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -95,9 +89,7 @@ pub async fn delete_print( pub async fn edit_print( configuration: &configuration::Configuration, print_id: &str, - image: impl Into<::std::borrow::Cow<'static, [u8]>>, - filename: impl Into<::std::borrow::Cow<'static, str>>, - mime_type: &str, + image: crate::patches::better_file_upload::File<'_>, note: Option<&str>, ) -> Result> { // add a prefix to parameters to efficiently prevent name collisions @@ -118,10 +110,7 @@ pub async fn edit_print( req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } let mut multipart_form = reqwest::multipart::Form::new(); - let part = reqwest::multipart::Part::bytes(p_form_image) - .file_name(filename) - .mime_str(mime_type)?; - multipart_form = multipart_form.part("image", part); + multipart_form = multipart_form.part("image", p_form_image.get_multipart().await?); if let Some(param_value) = p_form_note { multipart_form = multipart_form.text("note", param_value.to_string()); } @@ -255,9 +244,7 @@ pub async fn get_user_prints( /// Uploads and creates a print. pub async fn upload_print( configuration: &configuration::Configuration, - image: impl Into<::std::borrow::Cow<'static, [u8]>>, - filename: impl Into<::std::borrow::Cow<'static, str>>, - mime_type: &str, + image: crate::patches::better_file_upload::File<'_>, timestamp: String, note: Option<&str>, world_id: Option<&str>, @@ -279,14 +266,19 @@ pub async fn upload_print( req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } let mut multipart_form = reqwest::multipart::Form::new(); - let part = reqwest::multipart::Part::bytes(p_form_image) - .file_name(filename) - .mime_str(mime_type)?; - multipart_form = multipart_form.part("image", part); + multipart_form = multipart_form.part("image", p_form_image.get_multipart().await?); if let Some(param_value) = p_form_note { multipart_form = multipart_form.text("note", param_value.to_string()); } - multipart_form = multipart_form.text("timestamp", p_form_timestamp.to_string()); + macro_rules! serialize { + ($form:ident, data, $data:ident) => { + $form = $form.text("data", serde_json::to_string(&$data)?); + }; + ($form:ident, $tag:ident, $data:ident) => { + $form = $form.text(stringify!($tag), $data.to_string()); + }; + } + serialize!(multipart_form, timestamp, p_form_timestamp); if let Some(param_value) = p_form_world_id { multipart_form = multipart_form.text("worldId", param_value.to_string()); } diff --git a/src/apis/props_api.rs b/src/apis/props_api.rs index bf96eb6..fbdcaad 100644 --- a/src/apis/props_api.rs +++ b/src/apis/props_api.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use super::{configuration, ContentType, Error}; use crate::{apis::ResponseContent, models}; use reqwest; diff --git a/src/apis/users_api.rs b/src/apis/users_api.rs index 9f265b5..802f78c 100644 --- a/src/apis/users_api.rs +++ b/src/apis/users_api.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use super::{configuration, ContentType, Error}; use crate::{apis::ResponseContent, models}; use reqwest; diff --git a/src/apis/worlds_api.rs b/src/apis/worlds_api.rs index 7151b81..07deaf6 100644 --- a/src/apis/worlds_api.rs +++ b/src/apis/worlds_api.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use super::{configuration, ContentType, Error}; use crate::{apis::ResponseContent, models}; use reqwest; diff --git a/src/lib.rs b/src/lib.rs index 5dfd2fe..98f25cf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -10,3 +10,5 @@ extern crate url; pub mod apis; pub mod models; + +pub mod patches; diff --git a/src/models/account_deletion_log.rs b/src/models/account_deletion_log.rs index bde0169..b3dc17e 100644 --- a/src/models/account_deletion_log.rs +++ b/src/models/account_deletion_log.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/add_favorite_request.rs b/src/models/add_favorite_request.rs index 36bc628..1f053bc 100644 --- a/src/models/add_favorite_request.rs +++ b/src/models/add_favorite_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/add_group_gallery_image_request.rs b/src/models/add_group_gallery_image_request.rs index 0718b56..8ba81d4 100644 --- a/src/models/add_group_gallery_image_request.rs +++ b/src/models/add_group_gallery_image_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/admin_asset_bundle.rs b/src/models/admin_asset_bundle.rs index 41e4c58..362feef 100644 --- a/src/models/admin_asset_bundle.rs +++ b/src/models/admin_asset_bundle.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/admin_unity_package.rs b/src/models/admin_unity_package.rs index 3cf734e..03c02c8 100644 --- a/src/models/admin_unity_package.rs +++ b/src/models/admin_unity_package.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/age_verification_status.rs b/src/models/age_verification_status.rs index 0a82f66..bf2d726 100644 --- a/src/models/age_verification_status.rs +++ b/src/models/age_verification_status.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/agreement.rs b/src/models/agreement.rs index 14960a8..87e738b 100644 --- a/src/models/agreement.rs +++ b/src/models/agreement.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/agreement_code.rs b/src/models/agreement_code.rs index 4103d6c..97e7853 100644 --- a/src/models/agreement_code.rs +++ b/src/models/agreement_code.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/agreement_request.rs b/src/models/agreement_request.rs index 3c9d96f..772092a 100644 --- a/src/models/agreement_request.rs +++ b/src/models/agreement_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/agreement_status.rs b/src/models/agreement_status.rs index 1893ccd..70ba974 100644 --- a/src/models/agreement_status.rs +++ b/src/models/agreement_status.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/api_config.rs b/src/models/api_config.rs index 78ce759..88e3ec4 100644 --- a/src/models/api_config.rs +++ b/src/models/api_config.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/api_config_access_logs_urls.rs b/src/models/api_config_access_logs_urls.rs index c723c1c..00a2a61 100644 --- a/src/models/api_config_access_logs_urls.rs +++ b/src/models/api_config_access_logs_urls.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/api_config_announcement.rs b/src/models/api_config_announcement.rs index 084aa04..fc912f8 100644 --- a/src/models/api_config_announcement.rs +++ b/src/models/api_config_announcement.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/api_config_audio_config.rs b/src/models/api_config_audio_config.rs index 1dcf8a3..2df869a 100644 --- a/src/models/api_config_audio_config.rs +++ b/src/models/api_config_audio_config.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/api_config_avatar_perf_limiter.rs b/src/models/api_config_avatar_perf_limiter.rs index b95341e..3b21a02 100644 --- a/src/models/api_config_avatar_perf_limiter.rs +++ b/src/models/api_config_avatar_perf_limiter.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/api_config_constants.rs b/src/models/api_config_constants.rs index 1bcc3fb..613ed58 100644 --- a/src/models/api_config_constants.rs +++ b/src/models/api_config_constants.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/api_config_constants_groups.rs b/src/models/api_config_constants_groups.rs index 75ca2d8..55c3738 100644 --- a/src/models/api_config_constants_groups.rs +++ b/src/models/api_config_constants_groups.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/api_config_constants_instance.rs b/src/models/api_config_constants_instance.rs index 9c696d3..407caa9 100644 --- a/src/models/api_config_constants_instance.rs +++ b/src/models/api_config_constants_instance.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/api_config_constants_instance_population_brackets.rs b/src/models/api_config_constants_instance_population_brackets.rs index 6723308..02c248f 100644 --- a/src/models/api_config_constants_instance_population_brackets.rs +++ b/src/models/api_config_constants_instance_population_brackets.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/api_config_constants_instance_population_brackets_crowded.rs b/src/models/api_config_constants_instance_population_brackets_crowded.rs index 718e152..8221343 100644 --- a/src/models/api_config_constants_instance_population_brackets_crowded.rs +++ b/src/models/api_config_constants_instance_population_brackets_crowded.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/api_config_constants_instance_population_brackets_few.rs b/src/models/api_config_constants_instance_population_brackets_few.rs index 844ba45..59767d4 100644 --- a/src/models/api_config_constants_instance_population_brackets_few.rs +++ b/src/models/api_config_constants_instance_population_brackets_few.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/api_config_constants_instance_population_brackets_many.rs b/src/models/api_config_constants_instance_population_brackets_many.rs index 7bb217b..c0fe58b 100644 --- a/src/models/api_config_constants_instance_population_brackets_many.rs +++ b/src/models/api_config_constants_instance_population_brackets_many.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/api_config_constants_language.rs b/src/models/api_config_constants_language.rs index 936156b..a339fbb 100644 --- a/src/models/api_config_constants_language.rs +++ b/src/models/api_config_constants_language.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/api_config_download_url_list.rs b/src/models/api_config_download_url_list.rs index 3824853..c892449 100644 --- a/src/models/api_config_download_url_list.rs +++ b/src/models/api_config_download_url_list.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/api_config_events.rs b/src/models/api_config_events.rs index ae06dd6..96fea44 100644 --- a/src/models/api_config_events.rs +++ b/src/models/api_config_events.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/api_config_ios_version.rs b/src/models/api_config_ios_version.rs index 24f8ee3..c11f027 100644 --- a/src/models/api_config_ios_version.rs +++ b/src/models/api_config_ios_version.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/api_config_min_supported_client_build_number.rs b/src/models/api_config_min_supported_client_build_number.rs index ebb6311..9ddd624 100644 --- a/src/models/api_config_min_supported_client_build_number.rs +++ b/src/models/api_config_min_supported_client_build_number.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/api_config_offline_analysis.rs b/src/models/api_config_offline_analysis.rs index 159a398..ec5577b 100644 --- a/src/models/api_config_offline_analysis.rs +++ b/src/models/api_config_offline_analysis.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/api_health.rs b/src/models/api_health.rs index 2da174d..2273023 100644 --- a/src/models/api_health.rs +++ b/src/models/api_health.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/avatar.rs b/src/models/avatar.rs index 5fb9ea0..a7291c7 100644 --- a/src/models/avatar.rs +++ b/src/models/avatar.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/avatar_moderation.rs b/src/models/avatar_moderation.rs index ceb94c2..a437722 100644 --- a/src/models/avatar_moderation.rs +++ b/src/models/avatar_moderation.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/avatar_moderation_created.rs b/src/models/avatar_moderation_created.rs index 4d60b6d..1573dc3 100644 --- a/src/models/avatar_moderation_created.rs +++ b/src/models/avatar_moderation_created.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/avatar_moderation_type.rs b/src/models/avatar_moderation_type.rs index 5aa9cb7..00feb6f 100644 --- a/src/models/avatar_moderation_type.rs +++ b/src/models/avatar_moderation_type.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/avatar_performance.rs b/src/models/avatar_performance.rs index 1c8916c..39e8216 100644 --- a/src/models/avatar_performance.rs +++ b/src/models/avatar_performance.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/avatar_published_listings_inner.rs b/src/models/avatar_published_listings_inner.rs index b459a3c..e7c08b2 100644 --- a/src/models/avatar_published_listings_inner.rs +++ b/src/models/avatar_published_listings_inner.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/avatar_style.rs b/src/models/avatar_style.rs index 2d4c0ba..7192ff0 100644 --- a/src/models/avatar_style.rs +++ b/src/models/avatar_style.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/avatar_styles.rs b/src/models/avatar_styles.rs index 464a437..0104f9e 100644 --- a/src/models/avatar_styles.rs +++ b/src/models/avatar_styles.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/avatar_unity_package_url_object.rs b/src/models/avatar_unity_package_url_object.rs index 83ec97d..c9399c9 100644 --- a/src/models/avatar_unity_package_url_object.rs +++ b/src/models/avatar_unity_package_url_object.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/badge.rs b/src/models/badge.rs index 0c30d0e..8ba092b 100644 --- a/src/models/badge.rs +++ b/src/models/badge.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/balance.rs b/src/models/balance.rs index 0ddf5cd..ce4f5cf 100644 --- a/src/models/balance.rs +++ b/src/models/balance.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/ban_group_member_request.rs b/src/models/ban_group_member_request.rs index d2e8630..1708700 100644 --- a/src/models/ban_group_member_request.rs +++ b/src/models/ban_group_member_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/boop_request.rs b/src/models/boop_request.rs index 8d4d365..3cfcf24 100644 --- a/src/models/boop_request.rs +++ b/src/models/boop_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/calendar_event.rs b/src/models/calendar_event.rs index 5224995..17f8900 100644 --- a/src/models/calendar_event.rs +++ b/src/models/calendar_event.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/calendar_event_access.rs b/src/models/calendar_event_access.rs index 1ab2abb..74c92f4 100644 --- a/src/models/calendar_event_access.rs +++ b/src/models/calendar_event_access.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/calendar_event_category.rs b/src/models/calendar_event_category.rs index da30854..c2f3c1a 100644 --- a/src/models/calendar_event_category.rs +++ b/src/models/calendar_event_category.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/calendar_event_discovery.rs b/src/models/calendar_event_discovery.rs index 614f153..1a146ae 100644 --- a/src/models/calendar_event_discovery.rs +++ b/src/models/calendar_event_discovery.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/calendar_event_discovery_inclusion.rs b/src/models/calendar_event_discovery_inclusion.rs index b44e4fb..72e566b 100644 --- a/src/models/calendar_event_discovery_inclusion.rs +++ b/src/models/calendar_event_discovery_inclusion.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/calendar_event_discovery_scope.rs b/src/models/calendar_event_discovery_scope.rs index bfbe372..35dcd41 100644 --- a/src/models/calendar_event_discovery_scope.rs +++ b/src/models/calendar_event_discovery_scope.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/calendar_event_platform.rs b/src/models/calendar_event_platform.rs index b19541f..988121f 100644 --- a/src/models/calendar_event_platform.rs +++ b/src/models/calendar_event_platform.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/calendar_event_user_interest.rs b/src/models/calendar_event_user_interest.rs index 3f04090..43f7230 100644 --- a/src/models/calendar_event_user_interest.rs +++ b/src/models/calendar_event_user_interest.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/change_user_tags_request.rs b/src/models/change_user_tags_request.rs index d042817..933372f 100644 --- a/src/models/change_user_tags_request.rs +++ b/src/models/change_user_tags_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/content_filter.rs b/src/models/content_filter.rs index 73c3b49..58e6075 100644 --- a/src/models/content_filter.rs +++ b/src/models/content_filter.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/create_avatar_moderation_request.rs b/src/models/create_avatar_moderation_request.rs index fc9e480..171e159 100644 --- a/src/models/create_avatar_moderation_request.rs +++ b/src/models/create_avatar_moderation_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/create_avatar_request.rs b/src/models/create_avatar_request.rs index ba3c597..41c6b8b 100644 --- a/src/models/create_avatar_request.rs +++ b/src/models/create_avatar_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/create_calendar_event_request.rs b/src/models/create_calendar_event_request.rs index 0d1e484..fcc821a 100644 --- a/src/models/create_calendar_event_request.rs +++ b/src/models/create_calendar_event_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/create_file_request.rs b/src/models/create_file_request.rs index f051a3d..0264194 100644 --- a/src/models/create_file_request.rs +++ b/src/models/create_file_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/create_file_version_request.rs b/src/models/create_file_version_request.rs index c63cf47..c8e5c55 100644 --- a/src/models/create_file_version_request.rs +++ b/src/models/create_file_version_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/create_group_announcement_request.rs b/src/models/create_group_announcement_request.rs index 0d4485d..6b7f95e 100644 --- a/src/models/create_group_announcement_request.rs +++ b/src/models/create_group_announcement_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/create_group_gallery_request.rs b/src/models/create_group_gallery_request.rs index 4293315..29e9e88 100644 --- a/src/models/create_group_gallery_request.rs +++ b/src/models/create_group_gallery_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/create_group_invite_request.rs b/src/models/create_group_invite_request.rs index 6cc1e61..0f541b0 100644 --- a/src/models/create_group_invite_request.rs +++ b/src/models/create_group_invite_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/create_group_post_request.rs b/src/models/create_group_post_request.rs index 5a1a076..56d820b 100644 --- a/src/models/create_group_post_request.rs +++ b/src/models/create_group_post_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/create_group_request.rs b/src/models/create_group_request.rs index d165ae2..5a0c3fb 100644 --- a/src/models/create_group_request.rs +++ b/src/models/create_group_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/create_group_role_request.rs b/src/models/create_group_role_request.rs index 4c8257f..5d0fab3 100644 --- a/src/models/create_group_role_request.rs +++ b/src/models/create_group_role_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/create_instance_request.rs b/src/models/create_instance_request.rs index 960d423..870d794 100644 --- a/src/models/create_instance_request.rs +++ b/src/models/create_instance_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/create_prop_request.rs b/src/models/create_prop_request.rs index 108820d..1069891 100644 --- a/src/models/create_prop_request.rs +++ b/src/models/create_prop_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/create_world_request.rs b/src/models/create_world_request.rs index 150ef18..6bdeee9 100644 --- a/src/models/create_world_request.rs +++ b/src/models/create_world_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/current_user.rs b/src/models/current_user.rs index 2e3a116..4d2efee 100644 --- a/src/models/current_user.rs +++ b/src/models/current_user.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/current_user_platform_history_inner.rs b/src/models/current_user_platform_history_inner.rs index 2109311..cbdd07f 100644 --- a/src/models/current_user_platform_history_inner.rs +++ b/src/models/current_user_platform_history_inner.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/current_user_presence.rs b/src/models/current_user_presence.rs index 4f36104..1a107d3 100644 --- a/src/models/current_user_presence.rs +++ b/src/models/current_user_presence.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/decline_group_invite_request.rs b/src/models/decline_group_invite_request.rs index 2a9a6fa..835e3ac 100644 --- a/src/models/decline_group_invite_request.rs +++ b/src/models/decline_group_invite_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/developer_type.rs b/src/models/developer_type.rs index e74ceee..6cd7b36 100644 --- a/src/models/developer_type.rs +++ b/src/models/developer_type.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/disable2_fa_result.rs b/src/models/disable2_fa_result.rs index 30c1a45..6337d70 100644 --- a/src/models/disable2_fa_result.rs +++ b/src/models/disable2_fa_result.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/discord_details.rs b/src/models/discord_details.rs index f2d7140..ecad28c 100644 --- a/src/models/discord_details.rs +++ b/src/models/discord_details.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/dynamic_content_row.rs b/src/models/dynamic_content_row.rs index 8349fbf..f6487e6 100644 --- a/src/models/dynamic_content_row.rs +++ b/src/models/dynamic_content_row.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/economy_account.rs b/src/models/economy_account.rs index f370630..198fb64 100644 --- a/src/models/economy_account.rs +++ b/src/models/economy_account.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/equip_inventory_item_request.rs b/src/models/equip_inventory_item_request.rs index 9823d29..c833220 100644 --- a/src/models/equip_inventory_item_request.rs +++ b/src/models/equip_inventory_item_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/error.rs b/src/models/error.rs index 34cdb5b..a05083f 100644 --- a/src/models/error.rs +++ b/src/models/error.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/favorite.rs b/src/models/favorite.rs index a28e2aa..7cdcbc0 100644 --- a/src/models/favorite.rs +++ b/src/models/favorite.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/favorite_group.rs b/src/models/favorite_group.rs index 728674f..2333282 100644 --- a/src/models/favorite_group.rs +++ b/src/models/favorite_group.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/favorite_group_limits.rs b/src/models/favorite_group_limits.rs index af5a4b2..6ae357e 100644 --- a/src/models/favorite_group_limits.rs +++ b/src/models/favorite_group_limits.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/favorite_group_visibility.rs b/src/models/favorite_group_visibility.rs index 1d75477..54f3878 100644 --- a/src/models/favorite_group_visibility.rs +++ b/src/models/favorite_group_visibility.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/favorite_limits.rs b/src/models/favorite_limits.rs index dfc57ad..27de8c6 100644 --- a/src/models/favorite_limits.rs +++ b/src/models/favorite_limits.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/favorite_type.rs b/src/models/favorite_type.rs index 65b5340..df15c62 100644 --- a/src/models/favorite_type.rs +++ b/src/models/favorite_type.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/favorited_world.rs b/src/models/favorited_world.rs index f505244..3ded8a2 100644 --- a/src/models/favorited_world.rs +++ b/src/models/favorited_world.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/feedback.rs b/src/models/feedback.rs index eb16bdb..f1b44ea 100644 --- a/src/models/feedback.rs +++ b/src/models/feedback.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/file.rs b/src/models/file.rs index 013d825..74f73ca 100644 --- a/src/models/file.rs +++ b/src/models/file.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/file_analysis.rs b/src/models/file_analysis.rs index ffb08de..2d5dda8 100644 --- a/src/models/file_analysis.rs +++ b/src/models/file_analysis.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/file_analysis_avatar_stats.rs b/src/models/file_analysis_avatar_stats.rs index 5741c87..67cd5dc 100644 --- a/src/models/file_analysis_avatar_stats.rs +++ b/src/models/file_analysis_avatar_stats.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/file_data.rs b/src/models/file_data.rs index 3a80655..4630009 100644 --- a/src/models/file_data.rs +++ b/src/models/file_data.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/file_status.rs b/src/models/file_status.rs index d80d8f7..c42744a 100644 --- a/src/models/file_status.rs +++ b/src/models/file_status.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/file_upload_url.rs b/src/models/file_upload_url.rs index 5085bca..d257f70 100644 --- a/src/models/file_upload_url.rs +++ b/src/models/file_upload_url.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/file_version.rs b/src/models/file_version.rs index 742426c..da467df 100644 --- a/src/models/file_version.rs +++ b/src/models/file_version.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/file_version_upload_status.rs b/src/models/file_version_upload_status.rs index f44fe65..f8a5953 100644 --- a/src/models/file_version_upload_status.rs +++ b/src/models/file_version_upload_status.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/finish_file_data_upload_request.rs b/src/models/finish_file_data_upload_request.rs index 8d3b017..240a5b0 100644 --- a/src/models/finish_file_data_upload_request.rs +++ b/src/models/finish_file_data_upload_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/follow_calendar_event_request.rs b/src/models/follow_calendar_event_request.rs index a44a1ef..a2136b1 100644 --- a/src/models/follow_calendar_event_request.rs +++ b/src/models/follow_calendar_event_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/friend_status.rs b/src/models/friend_status.rs index 0f8a6e4..11b8d34 100644 --- a/src/models/friend_status.rs +++ b/src/models/friend_status.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/get_group_posts_200_response.rs b/src/models/get_group_posts_200_response.rs index fb67316..f701833 100644 --- a/src/models/get_group_posts_200_response.rs +++ b/src/models/get_group_posts_200_response.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/get_user_group_instances_200_response.rs b/src/models/get_user_group_instances_200_response.rs index 50fdcae..bf01080 100644 --- a/src/models/get_user_group_instances_200_response.rs +++ b/src/models/get_user_group_instances_200_response.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/group.rs b/src/models/group.rs index be22385..4fab7bf 100644 --- a/src/models/group.rs +++ b/src/models/group.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/group_access_type.rs b/src/models/group_access_type.rs index f482659..0ff6679 100644 --- a/src/models/group_access_type.rs +++ b/src/models/group_access_type.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/group_announcement.rs b/src/models/group_announcement.rs index 2c55f87..cf38136 100644 --- a/src/models/group_announcement.rs +++ b/src/models/group_announcement.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/group_audit_log_entry.rs b/src/models/group_audit_log_entry.rs index 95d8098..c8547c6 100644 --- a/src/models/group_audit_log_entry.rs +++ b/src/models/group_audit_log_entry.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/group_gallery.rs b/src/models/group_gallery.rs index 2d1bcfc..1ca85e2 100644 --- a/src/models/group_gallery.rs +++ b/src/models/group_gallery.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/group_gallery_file_order.rs b/src/models/group_gallery_file_order.rs index cb4c309..86374b0 100644 --- a/src/models/group_gallery_file_order.rs +++ b/src/models/group_gallery_file_order.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/group_gallery_file_order_request.rs b/src/models/group_gallery_file_order_request.rs index 9f8c929..364d588 100644 --- a/src/models/group_gallery_file_order_request.rs +++ b/src/models/group_gallery_file_order_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/group_gallery_image.rs b/src/models/group_gallery_image.rs index fa37f85..a06baf5 100644 --- a/src/models/group_gallery_image.rs +++ b/src/models/group_gallery_image.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/group_instance.rs b/src/models/group_instance.rs index 6561985..2943fab 100644 --- a/src/models/group_instance.rs +++ b/src/models/group_instance.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/group_join_request_action.rs b/src/models/group_join_request_action.rs index 755c9ae..9d5beeb 100644 --- a/src/models/group_join_request_action.rs +++ b/src/models/group_join_request_action.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/group_join_state.rs b/src/models/group_join_state.rs index 73b2816..387fe00 100644 --- a/src/models/group_join_state.rs +++ b/src/models/group_join_state.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/group_member.rs b/src/models/group_member.rs index e0abaa5..d2175ef 100644 --- a/src/models/group_member.rs +++ b/src/models/group_member.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/group_member_limited_user.rs b/src/models/group_member_limited_user.rs index e9ca01e..6245323 100644 --- a/src/models/group_member_limited_user.rs +++ b/src/models/group_member_limited_user.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/group_member_status.rs b/src/models/group_member_status.rs index da04989..592427a 100644 --- a/src/models/group_member_status.rs +++ b/src/models/group_member_status.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/group_my_member.rs b/src/models/group_my_member.rs index 3729c6b..57599d7 100644 --- a/src/models/group_my_member.rs +++ b/src/models/group_my_member.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/group_permission.rs b/src/models/group_permission.rs index 711e642..7e5549e 100644 --- a/src/models/group_permission.rs +++ b/src/models/group_permission.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/group_permissions.rs b/src/models/group_permissions.rs index 6815d1e..9783b27 100644 --- a/src/models/group_permissions.rs +++ b/src/models/group_permissions.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/group_post.rs b/src/models/group_post.rs index 7e432a7..919e360 100644 --- a/src/models/group_post.rs +++ b/src/models/group_post.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/group_post_visibility.rs b/src/models/group_post_visibility.rs index f8238a8..28ea299 100644 --- a/src/models/group_post_visibility.rs +++ b/src/models/group_post_visibility.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/group_privacy.rs b/src/models/group_privacy.rs index 2ea289d..f678261 100644 --- a/src/models/group_privacy.rs +++ b/src/models/group_privacy.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/group_role.rs b/src/models/group_role.rs index fbf0c71..de8c3de 100644 --- a/src/models/group_role.rs +++ b/src/models/group_role.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/group_role_template.rs b/src/models/group_role_template.rs index 51279a0..03356a4 100644 --- a/src/models/group_role_template.rs +++ b/src/models/group_role_template.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/group_role_template_values.rs b/src/models/group_role_template_values.rs index e8a9487..b736360 100644 --- a/src/models/group_role_template_values.rs +++ b/src/models/group_role_template_values.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/group_role_template_values_roles.rs b/src/models/group_role_template_values_roles.rs index 7c25edc..fcaa90c 100644 --- a/src/models/group_role_template_values_roles.rs +++ b/src/models/group_role_template_values_roles.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/group_search_sort.rs b/src/models/group_search_sort.rs index b3c4761..7c88bde 100644 --- a/src/models/group_search_sort.rs +++ b/src/models/group_search_sort.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/group_transferable.rs b/src/models/group_transferable.rs index 6d2bede..81b9b61 100644 --- a/src/models/group_transferable.rs +++ b/src/models/group_transferable.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/group_transferable_requirements.rs b/src/models/group_transferable_requirements.rs index f533bdf..5ef2b8c 100644 --- a/src/models/group_transferable_requirements.rs +++ b/src/models/group_transferable_requirements.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/group_user_visibility.rs b/src/models/group_user_visibility.rs index c64d478..bb226b9 100644 --- a/src/models/group_user_visibility.rs +++ b/src/models/group_user_visibility.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/image_animation_style.rs b/src/models/image_animation_style.rs index 1ad3757..8197e57 100644 --- a/src/models/image_animation_style.rs +++ b/src/models/image_animation_style.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/image_loop_style.rs b/src/models/image_loop_style.rs index 4c27e9d..ffbab92 100644 --- a/src/models/image_loop_style.rs +++ b/src/models/image_loop_style.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/image_mask.rs b/src/models/image_mask.rs index 0d779ba..e112b84 100644 --- a/src/models/image_mask.rs +++ b/src/models/image_mask.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/image_purpose.rs b/src/models/image_purpose.rs index 6d5b295..c8b37c7 100644 --- a/src/models/image_purpose.rs +++ b/src/models/image_purpose.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/info_push.rs b/src/models/info_push.rs index c338fb4..5ba47ee 100644 --- a/src/models/info_push.rs +++ b/src/models/info_push.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/info_push_data.rs b/src/models/info_push_data.rs index 189fb30..8c7fdbb 100644 --- a/src/models/info_push_data.rs +++ b/src/models/info_push_data.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/info_push_data_article.rs b/src/models/info_push_data_article.rs index 4550dff..b054826 100644 --- a/src/models/info_push_data_article.rs +++ b/src/models/info_push_data_article.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/info_push_data_article_content.rs b/src/models/info_push_data_article_content.rs index fd3fe1e..e1ee7df 100644 --- a/src/models/info_push_data_article_content.rs +++ b/src/models/info_push_data_article_content.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/info_push_data_clickable.rs b/src/models/info_push_data_clickable.rs index 7b6eb36..89a50da 100644 --- a/src/models/info_push_data_clickable.rs +++ b/src/models/info_push_data_clickable.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/instance.rs b/src/models/instance.rs index 9e58ac5..83fd6f8 100644 --- a/src/models/instance.rs +++ b/src/models/instance.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/instance_content_settings.rs b/src/models/instance_content_settings.rs index ddfc3eb..8b11ed3 100644 --- a/src/models/instance_content_settings.rs +++ b/src/models/instance_content_settings.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/instance_platforms.rs b/src/models/instance_platforms.rs index 261ae07..a66475c 100644 --- a/src/models/instance_platforms.rs +++ b/src/models/instance_platforms.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/instance_region.rs b/src/models/instance_region.rs index e5f82e8..89932b0 100644 --- a/src/models/instance_region.rs +++ b/src/models/instance_region.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/instance_short_name_response.rs b/src/models/instance_short_name_response.rs index c83e5bc..bdff305 100644 --- a/src/models/instance_short_name_response.rs +++ b/src/models/instance_short_name_response.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/instance_type.rs b/src/models/instance_type.rs index 78deb72..026c103 100644 --- a/src/models/instance_type.rs +++ b/src/models/instance_type.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/inventory.rs b/src/models/inventory.rs index 0e4d021..327bc2e 100644 --- a/src/models/inventory.rs +++ b/src/models/inventory.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/inventory_consumption_results.rs b/src/models/inventory_consumption_results.rs index 41b6c7e..028f36d 100644 --- a/src/models/inventory_consumption_results.rs +++ b/src/models/inventory_consumption_results.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/inventory_default_attributes_value.rs b/src/models/inventory_default_attributes_value.rs index 648f56e..3285779 100644 --- a/src/models/inventory_default_attributes_value.rs +++ b/src/models/inventory_default_attributes_value.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/inventory_default_attributes_value_validator.rs b/src/models/inventory_default_attributes_value_validator.rs index 21758a5..2a97551 100644 --- a/src/models/inventory_default_attributes_value_validator.rs +++ b/src/models/inventory_default_attributes_value_validator.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/inventory_drop.rs b/src/models/inventory_drop.rs index 8b8de06..ae70758 100644 --- a/src/models/inventory_drop.rs +++ b/src/models/inventory_drop.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/inventory_equip_slot.rs b/src/models/inventory_equip_slot.rs index 6373ddd..496e62c 100644 --- a/src/models/inventory_equip_slot.rs +++ b/src/models/inventory_equip_slot.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/inventory_flag.rs b/src/models/inventory_flag.rs index 0590e6e..c37f551 100644 --- a/src/models/inventory_flag.rs +++ b/src/models/inventory_flag.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/inventory_item.rs b/src/models/inventory_item.rs index 61a577c..bf20f56 100644 --- a/src/models/inventory_item.rs +++ b/src/models/inventory_item.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/inventory_item_type.rs b/src/models/inventory_item_type.rs index c9dc709..803af7c 100644 --- a/src/models/inventory_item_type.rs +++ b/src/models/inventory_item_type.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/inventory_metadata.rs b/src/models/inventory_metadata.rs index 30c348c..d6286e7 100644 --- a/src/models/inventory_metadata.rs +++ b/src/models/inventory_metadata.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/inventory_notification_details.rs b/src/models/inventory_notification_details.rs index 676a5fc..5713b6c 100644 --- a/src/models/inventory_notification_details.rs +++ b/src/models/inventory_notification_details.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/inventory_spawn.rs b/src/models/inventory_spawn.rs index a7b2fff..70ba10e 100644 --- a/src/models/inventory_spawn.rs +++ b/src/models/inventory_spawn.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/inventory_template.rs b/src/models/inventory_template.rs index 212bf11..58bd591 100644 --- a/src/models/inventory_template.rs +++ b/src/models/inventory_template.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/inventory_user_attributes.rs b/src/models/inventory_user_attributes.rs index 519a112..3618057 100644 --- a/src/models/inventory_user_attributes.rs +++ b/src/models/inventory_user_attributes.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/invite_message.rs b/src/models/invite_message.rs index 6b271d7..df372fe 100644 --- a/src/models/invite_message.rs +++ b/src/models/invite_message.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/invite_message_type.rs b/src/models/invite_message_type.rs index ae1e0d0..1a7d347 100644 --- a/src/models/invite_message_type.rs +++ b/src/models/invite_message_type.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/invite_request.rs b/src/models/invite_request.rs index 37a060c..9724af3 100644 --- a/src/models/invite_request.rs +++ b/src/models/invite_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/invite_response.rs b/src/models/invite_response.rs index 659c009..3d41917 100644 --- a/src/models/invite_response.rs +++ b/src/models/invite_response.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/jam.rs b/src/models/jam.rs index 9601153..16a7327 100644 --- a/src/models/jam.rs +++ b/src/models/jam.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/jam_state_change_dates.rs b/src/models/jam_state_change_dates.rs index 971d890..e42fa06 100644 --- a/src/models/jam_state_change_dates.rs +++ b/src/models/jam_state_change_dates.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/join_group_request.rs b/src/models/join_group_request.rs index 69e1728..2fc49d1 100644 --- a/src/models/join_group_request.rs +++ b/src/models/join_group_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/license.rs b/src/models/license.rs index d1ec88e..b6ef17c 100644 --- a/src/models/license.rs +++ b/src/models/license.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/license_action.rs b/src/models/license_action.rs index c294dfa..ad68e75 100644 --- a/src/models/license_action.rs +++ b/src/models/license_action.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/license_group.rs b/src/models/license_group.rs index 26745e9..d6d1ea0 100644 --- a/src/models/license_group.rs +++ b/src/models/license_group.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/license_type.rs b/src/models/license_type.rs index 718cc2a..6fd5e4f 100644 --- a/src/models/license_type.rs +++ b/src/models/license_type.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/limited_group.rs b/src/models/limited_group.rs index 0953e60..7491804 100644 --- a/src/models/limited_group.rs +++ b/src/models/limited_group.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/limited_unity_package.rs b/src/models/limited_unity_package.rs index 2ec6967..023c5da 100644 --- a/src/models/limited_unity_package.rs +++ b/src/models/limited_unity_package.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/limited_user_friend.rs b/src/models/limited_user_friend.rs index f539c21..e4c6a03 100644 --- a/src/models/limited_user_friend.rs +++ b/src/models/limited_user_friend.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/limited_user_groups.rs b/src/models/limited_user_groups.rs index ffdca65..3703e1f 100644 --- a/src/models/limited_user_groups.rs +++ b/src/models/limited_user_groups.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/limited_user_instance.rs b/src/models/limited_user_instance.rs index 9324c41..fbb8477 100644 --- a/src/models/limited_user_instance.rs +++ b/src/models/limited_user_instance.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/limited_user_search.rs b/src/models/limited_user_search.rs index 4b8ad2d..af752e1 100644 --- a/src/models/limited_user_search.rs +++ b/src/models/limited_user_search.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/limited_world.rs b/src/models/limited_world.rs index 17f06f8..94da818 100644 --- a/src/models/limited_world.rs +++ b/src/models/limited_world.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/mime_type.rs b/src/models/mime_type.rs index fc8542b..c0b6731 100644 --- a/src/models/mime_type.rs +++ b/src/models/mime_type.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/mod.rs b/src/models/mod.rs index 0399368..b74153f 100644 --- a/src/models/mod.rs +++ b/src/models/mod.rs @@ -606,8 +606,3 @@ pub mod world_metadata; pub use self::world_metadata::WorldMetadata; pub mod world_publish_status; pub use self::world_publish_status::WorldPublishStatus; -#[deprecated( - since = "1.20.7-nightly.28", - note = "Use RegisterUserAccount200Response directly. This re-export is only provided as a transition-help!" -)] -pub use self::RegisterUserAccount200Response as EitherUserOrTwoFactor; diff --git a/src/models/moderate_user_request.rs b/src/models/moderate_user_request.rs index 90afe6c..7b41126 100644 --- a/src/models/moderate_user_request.rs +++ b/src/models/moderate_user_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/moderation_report.rs b/src/models/moderation_report.rs index 66ec4bb..b99f7dd 100644 --- a/src/models/moderation_report.rs +++ b/src/models/moderation_report.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/mutual_friend.rs b/src/models/mutual_friend.rs index 4ebad9a..17ead41 100644 --- a/src/models/mutual_friend.rs +++ b/src/models/mutual_friend.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/mutuals.rs b/src/models/mutuals.rs index 9cd4725..502fd78 100644 --- a/src/models/mutuals.rs +++ b/src/models/mutuals.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/notification.rs b/src/models/notification.rs index 1aa43e6..f1fcce5 100644 --- a/src/models/notification.rs +++ b/src/models/notification.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/notification_detail_boop.rs b/src/models/notification_detail_boop.rs index 869f44a..ae859a5 100644 --- a/src/models/notification_detail_boop.rs +++ b/src/models/notification_detail_boop.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/notification_detail_invite.rs b/src/models/notification_detail_invite.rs index 80e41e9..032b6c7 100644 --- a/src/models/notification_detail_invite.rs +++ b/src/models/notification_detail_invite.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/notification_detail_invite_response.rs b/src/models/notification_detail_invite_response.rs index 783aff9..e47a0c2 100644 --- a/src/models/notification_detail_invite_response.rs +++ b/src/models/notification_detail_invite_response.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/notification_detail_request_invite.rs b/src/models/notification_detail_request_invite.rs index bcfca63..fd852aa 100644 --- a/src/models/notification_detail_request_invite.rs +++ b/src/models/notification_detail_request_invite.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/notification_detail_request_invite_response.rs b/src/models/notification_detail_request_invite_response.rs index 36e99b6..92d438d 100644 --- a/src/models/notification_detail_request_invite_response.rs +++ b/src/models/notification_detail_request_invite_response.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/notification_detail_vote_to_kick.rs b/src/models/notification_detail_vote_to_kick.rs index f417254..34a5412 100644 --- a/src/models/notification_detail_vote_to_kick.rs +++ b/src/models/notification_detail_vote_to_kick.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/notification_type.rs b/src/models/notification_type.rs index 67453ea..51399aa 100644 --- a/src/models/notification_type.rs +++ b/src/models/notification_type.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/notification_v2.rs b/src/models/notification_v2.rs index 2455a96..d51c8ee 100644 --- a/src/models/notification_v2.rs +++ b/src/models/notification_v2.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/notification_v2_data.rs b/src/models/notification_v2_data.rs index e88dc44..45f61ec 100644 --- a/src/models/notification_v2_data.rs +++ b/src/models/notification_v2_data.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/notification_v2_data_badge_earned.rs b/src/models/notification_v2_data_badge_earned.rs index dedf72a..df4235e 100644 --- a/src/models/notification_v2_data_badge_earned.rs +++ b/src/models/notification_v2_data_badge_earned.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/notification_v2_data_boop.rs b/src/models/notification_v2_data_boop.rs index 4b7f7a1..ee73d78 100644 --- a/src/models/notification_v2_data_boop.rs +++ b/src/models/notification_v2_data_boop.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/notification_v2_data_event_announcement.rs b/src/models/notification_v2_data_event_announcement.rs index 53fb2c3..2983f73 100644 --- a/src/models/notification_v2_data_event_announcement.rs +++ b/src/models/notification_v2_data_event_announcement.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/notification_v2_data_group_announcement.rs b/src/models/notification_v2_data_group_announcement.rs index 1f8ce1e..45778ab 100644 --- a/src/models/notification_v2_data_group_announcement.rs +++ b/src/models/notification_v2_data_group_announcement.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/notification_v2_data_group_informative.rs b/src/models/notification_v2_data_group_informative.rs index 9924a29..811dc11 100644 --- a/src/models/notification_v2_data_group_informative.rs +++ b/src/models/notification_v2_data_group_informative.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/notification_v2_data_group_transfer.rs b/src/models/notification_v2_data_group_transfer.rs index edbfcae..822716f 100644 --- a/src/models/notification_v2_data_group_transfer.rs +++ b/src/models/notification_v2_data_group_transfer.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/notification_v2_details_boop.rs b/src/models/notification_v2_details_boop.rs index 67f34ba..db0d9eb 100644 --- a/src/models/notification_v2_details_boop.rs +++ b/src/models/notification_v2_details_boop.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/notification_v2_response.rs b/src/models/notification_v2_response.rs index 1f231ab..9434daa 100644 --- a/src/models/notification_v2_response.rs +++ b/src/models/notification_v2_response.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/notification_v2_type.rs b/src/models/notification_v2_type.rs index 0ae36ac..7a2395b 100644 --- a/src/models/notification_v2_type.rs +++ b/src/models/notification_v2_type.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/ok_status.rs b/src/models/ok_status.rs index 1e112c6..8d91b1c 100644 --- a/src/models/ok_status.rs +++ b/src/models/ok_status.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/ok_status2.rs b/src/models/ok_status2.rs index 3919f30..871379b 100644 --- a/src/models/ok_status2.rs +++ b/src/models/ok_status2.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/order_option.rs b/src/models/order_option.rs index 7ea5c5c..b876817 100644 --- a/src/models/order_option.rs +++ b/src/models/order_option.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/order_option_short.rs b/src/models/order_option_short.rs index c2c8ccc..476da9d 100644 --- a/src/models/order_option_short.rs +++ b/src/models/order_option_short.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/paginated_calendar_event_list.rs b/src/models/paginated_calendar_event_list.rs index 04f3a74..a46d608 100644 --- a/src/models/paginated_calendar_event_list.rs +++ b/src/models/paginated_calendar_event_list.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/paginated_group_audit_log_entry_list.rs b/src/models/paginated_group_audit_log_entry_list.rs index 6343a50..b22897e 100644 --- a/src/models/paginated_group_audit_log_entry_list.rs +++ b/src/models/paginated_group_audit_log_entry_list.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/paginated_moderation_report_list.rs b/src/models/paginated_moderation_report_list.rs index 9d19243..d9b20c4 100644 --- a/src/models/paginated_moderation_report_list.rs +++ b/src/models/paginated_moderation_report_list.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/past_display_name.rs b/src/models/past_display_name.rs index f9e7340..af5020f 100644 --- a/src/models/past_display_name.rs +++ b/src/models/past_display_name.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/pending2_fa_result.rs b/src/models/pending2_fa_result.rs index 88b168c..42391ac 100644 --- a/src/models/pending2_fa_result.rs +++ b/src/models/pending2_fa_result.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/performance_limiter_info.rs b/src/models/performance_limiter_info.rs index 5be1878..ac7890a 100644 --- a/src/models/performance_limiter_info.rs +++ b/src/models/performance_limiter_info.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/performance_ratings.rs b/src/models/performance_ratings.rs index 82554a7..c68a2e8 100644 --- a/src/models/performance_ratings.rs +++ b/src/models/performance_ratings.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/permission.rs b/src/models/permission.rs index 6e75e81..2ca4ab1 100644 --- a/src/models/permission.rs +++ b/src/models/permission.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/permission_data.rs b/src/models/permission_data.rs index 7ff6f9d..7627ffc 100644 --- a/src/models/permission_data.rs +++ b/src/models/permission_data.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/platform_build_info.rs b/src/models/platform_build_info.rs index 8d2c7c1..67ad434 100644 --- a/src/models/platform_build_info.rs +++ b/src/models/platform_build_info.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/player_moderation.rs b/src/models/player_moderation.rs index 377cd26..d1401e8 100644 --- a/src/models/player_moderation.rs +++ b/src/models/player_moderation.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/player_moderation_type.rs b/src/models/player_moderation_type.rs index 8d57a46..0a2cfb9 100644 --- a/src/models/player_moderation_type.rs +++ b/src/models/player_moderation_type.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/print.rs b/src/models/print.rs index a1f27d6..9ab821a 100644 --- a/src/models/print.rs +++ b/src/models/print.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/print_files.rs b/src/models/print_files.rs index 3e80bcf..8778638 100644 --- a/src/models/print_files.rs +++ b/src/models/print_files.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/product.rs b/src/models/product.rs index b4ab696..c4df2a5 100644 --- a/src/models/product.rs +++ b/src/models/product.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/product_listing.rs b/src/models/product_listing.rs index f37fb9d..4356fde 100644 --- a/src/models/product_listing.rs +++ b/src/models/product_listing.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/product_listing_type.rs b/src/models/product_listing_type.rs index 9215538..e944b8c 100644 --- a/src/models/product_listing_type.rs +++ b/src/models/product_listing_type.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/product_listing_variant.rs b/src/models/product_listing_variant.rs index 0212390..1153e11 100644 --- a/src/models/product_listing_variant.rs +++ b/src/models/product_listing_variant.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/product_purchase.rs b/src/models/product_purchase.rs index ba4a589..fb8e908 100644 --- a/src/models/product_purchase.rs +++ b/src/models/product_purchase.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/product_purchase_purchase_context.rs b/src/models/product_purchase_purchase_context.rs index c0c40b2..84a04e4 100644 --- a/src/models/product_purchase_purchase_context.rs +++ b/src/models/product_purchase_purchase_context.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/product_type.rs b/src/models/product_type.rs index 759531e..ab7a03f 100644 --- a/src/models/product_type.rs +++ b/src/models/product_type.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/prop.rs b/src/models/prop.rs index 2a14c68..455d594 100644 --- a/src/models/prop.rs +++ b/src/models/prop.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/prop_publish_status.rs b/src/models/prop_publish_status.rs index cb905fa..ae1ed09 100644 --- a/src/models/prop_publish_status.rs +++ b/src/models/prop_publish_status.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/prop_unity_package.rs b/src/models/prop_unity_package.rs index 0e7be6a..bb59350 100644 --- a/src/models/prop_unity_package.rs +++ b/src/models/prop_unity_package.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/purchase_product_listing_request.rs b/src/models/purchase_product_listing_request.rs index ab28330..9e9e66c 100644 --- a/src/models/purchase_product_listing_request.rs +++ b/src/models/purchase_product_listing_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/region.rs b/src/models/region.rs index 1aa57e6..16f50ac 100644 --- a/src/models/region.rs +++ b/src/models/region.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/register_user_account_200_response.rs b/src/models/register_user_account_200_response.rs index d52faeb..308506b 100644 --- a/src/models/register_user_account_200_response.rs +++ b/src/models/register_user_account_200_response.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/register_user_account_request.rs b/src/models/register_user_account_request.rs index d91630d..4f37aa9 100644 --- a/src/models/register_user_account_request.rs +++ b/src/models/register_user_account_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/release_status.rs b/src/models/release_status.rs index 26a7067..6a06455 100644 --- a/src/models/release_status.rs +++ b/src/models/release_status.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/report_category.rs b/src/models/report_category.rs index 7312f0e..6571c50 100644 --- a/src/models/report_category.rs +++ b/src/models/report_category.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/report_reason.rs b/src/models/report_reason.rs index bd8eeac..7ca0f80 100644 --- a/src/models/report_reason.rs +++ b/src/models/report_reason.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/represented_group.rs b/src/models/represented_group.rs index 049bc01..dba5fa5 100644 --- a/src/models/represented_group.rs +++ b/src/models/represented_group.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/request_invite_request.rs b/src/models/request_invite_request.rs index e12a7dd..be3dd15 100644 --- a/src/models/request_invite_request.rs +++ b/src/models/request_invite_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/requires_two_factor_auth.rs b/src/models/requires_two_factor_auth.rs index 341223e..f11fc41 100644 --- a/src/models/requires_two_factor_auth.rs +++ b/src/models/requires_two_factor_auth.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/respond_group_join_request.rs b/src/models/respond_group_join_request.rs index 094900c..799be5c 100644 --- a/src/models/respond_group_join_request.rs +++ b/src/models/respond_group_join_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/respond_notification_v2_request.rs b/src/models/respond_notification_v2_request.rs index 939d865..e6183ae 100644 --- a/src/models/respond_notification_v2_request.rs +++ b/src/models/respond_notification_v2_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/response.rs b/src/models/response.rs index 7e8fdab..d451f18 100644 --- a/src/models/response.rs +++ b/src/models/response.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/search_group_members_200_response.rs b/src/models/search_group_members_200_response.rs index 86cfb3e..1cb6b26 100644 --- a/src/models/search_group_members_200_response.rs +++ b/src/models/search_group_members_200_response.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/sent_notification.rs b/src/models/sent_notification.rs index d411813..7f29e3e 100644 --- a/src/models/sent_notification.rs +++ b/src/models/sent_notification.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/sent_notification_details.rs b/src/models/sent_notification_details.rs index 5f927da..5b88482 100644 --- a/src/models/sent_notification_details.rs +++ b/src/models/sent_notification_details.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/service_queue_stats.rs b/src/models/service_queue_stats.rs index a34b9ff..03038ee 100644 --- a/src/models/service_queue_stats.rs +++ b/src/models/service_queue_stats.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/service_status.rs b/src/models/service_status.rs index 70797e7..7109b8d 100644 --- a/src/models/service_status.rs +++ b/src/models/service_status.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/share_inventory_item_direct_request.rs b/src/models/share_inventory_item_direct_request.rs index 612e925..678881b 100644 --- a/src/models/share_inventory_item_direct_request.rs +++ b/src/models/share_inventory_item_direct_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/sort_option.rs b/src/models/sort_option.rs index e384eef..8c0d6e7 100644 --- a/src/models/sort_option.rs +++ b/src/models/sort_option.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/sort_option_product_purchase.rs b/src/models/sort_option_product_purchase.rs index 6c9f37d..015c3b7 100644 --- a/src/models/sort_option_product_purchase.rs +++ b/src/models/sort_option_product_purchase.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/store.rs b/src/models/store.rs index 5ea0835..7358ab9 100644 --- a/src/models/store.rs +++ b/src/models/store.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/store_shelf.rs b/src/models/store_shelf.rs index 68348a1..d31fd4a 100644 --- a/src/models/store_shelf.rs +++ b/src/models/store_shelf.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/store_type.rs b/src/models/store_type.rs index 0da719b..314ea4c 100644 --- a/src/models/store_type.rs +++ b/src/models/store_type.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/store_view.rs b/src/models/store_view.rs index 358daed..84c64c3 100644 --- a/src/models/store_view.rs +++ b/src/models/store_view.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/submission.rs b/src/models/submission.rs index 2d371b0..a34fc1d 100644 --- a/src/models/submission.rs +++ b/src/models/submission.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/submit_moderation_report_request.rs b/src/models/submit_moderation_report_request.rs index 702fb6c..3c5f918 100644 --- a/src/models/submit_moderation_report_request.rs +++ b/src/models/submit_moderation_report_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/submit_moderation_report_request_details.rs b/src/models/submit_moderation_report_request_details.rs index 7c8a639..6fc1647 100644 --- a/src/models/submit_moderation_report_request_details.rs +++ b/src/models/submit_moderation_report_request_details.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/subscription.rs b/src/models/subscription.rs index 3fedb4c..292bbe5 100644 --- a/src/models/subscription.rs +++ b/src/models/subscription.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/subscription_period.rs b/src/models/subscription_period.rs index 7277f8a..812dade 100644 --- a/src/models/subscription_period.rs +++ b/src/models/subscription_period.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/success.rs b/src/models/success.rs index 96d2091..ed93bca 100644 --- a/src/models/success.rs +++ b/src/models/success.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/success_flag.rs b/src/models/success_flag.rs index 57c4bae..f30e2df 100644 --- a/src/models/success_flag.rs +++ b/src/models/success_flag.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/tilia_status.rs b/src/models/tilia_status.rs index c2e8f22..cea0c5e 100644 --- a/src/models/tilia_status.rs +++ b/src/models/tilia_status.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/tilia_tos.rs b/src/models/tilia_tos.rs index 5eebb43..a4864e5 100644 --- a/src/models/tilia_tos.rs +++ b/src/models/tilia_tos.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/token_bundle.rs b/src/models/token_bundle.rs index d1332bb..4fb216e 100644 --- a/src/models/token_bundle.rs +++ b/src/models/token_bundle.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/transaction.rs b/src/models/transaction.rs index fc985b3..09f83b6 100644 --- a/src/models/transaction.rs +++ b/src/models/transaction.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/transaction_agreement.rs b/src/models/transaction_agreement.rs index d6f46c9..40970af 100644 --- a/src/models/transaction_agreement.rs +++ b/src/models/transaction_agreement.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/transaction_status.rs b/src/models/transaction_status.rs index afbd87f..3648606 100644 --- a/src/models/transaction_status.rs +++ b/src/models/transaction_status.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/transaction_steam_info.rs b/src/models/transaction_steam_info.rs index d8d83ff..e67025d 100644 --- a/src/models/transaction_steam_info.rs +++ b/src/models/transaction_steam_info.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/transaction_steam_wallet_info.rs b/src/models/transaction_steam_wallet_info.rs index 66e1ef3..ebd7631 100644 --- a/src/models/transaction_steam_wallet_info.rs +++ b/src/models/transaction_steam_wallet_info.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/transfer_group_request.rs b/src/models/transfer_group_request.rs index 2d9ff59..72cb7d8 100644 --- a/src/models/transfer_group_request.rs +++ b/src/models/transfer_group_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/two_factor_auth_code.rs b/src/models/two_factor_auth_code.rs index b44d0ac..7adbae6 100644 --- a/src/models/two_factor_auth_code.rs +++ b/src/models/two_factor_auth_code.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/two_factor_auth_type.rs b/src/models/two_factor_auth_type.rs index 84f71aa..38702c6 100644 --- a/src/models/two_factor_auth_type.rs +++ b/src/models/two_factor_auth_type.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/two_factor_email_code.rs b/src/models/two_factor_email_code.rs index 9c20b96..f2d72c5 100644 --- a/src/models/two_factor_email_code.rs +++ b/src/models/two_factor_email_code.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/two_factor_recovery_codes.rs b/src/models/two_factor_recovery_codes.rs index fb2b1e2..b8c8191 100644 --- a/src/models/two_factor_recovery_codes.rs +++ b/src/models/two_factor_recovery_codes.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/two_factor_recovery_codes_otp_inner.rs b/src/models/two_factor_recovery_codes_otp_inner.rs index 3fa10c9..ae3045b 100644 --- a/src/models/two_factor_recovery_codes_otp_inner.rs +++ b/src/models/two_factor_recovery_codes_otp_inner.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/unity_package.rs b/src/models/unity_package.rs index eed159a..50ae229 100644 --- a/src/models/unity_package.rs +++ b/src/models/unity_package.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/update_asset_review_notes_request.rs b/src/models/update_asset_review_notes_request.rs index ba2b447..4ed032b 100644 --- a/src/models/update_asset_review_notes_request.rs +++ b/src/models/update_asset_review_notes_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/update_avatar_request.rs b/src/models/update_avatar_request.rs index acfabd1..8af4f46 100644 --- a/src/models/update_avatar_request.rs +++ b/src/models/update_avatar_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/update_calendar_event_request.rs b/src/models/update_calendar_event_request.rs index c855da7..6406477 100644 --- a/src/models/update_calendar_event_request.rs +++ b/src/models/update_calendar_event_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/update_favorite_group_request.rs b/src/models/update_favorite_group_request.rs index 440ee00..0252383 100644 --- a/src/models/update_favorite_group_request.rs +++ b/src/models/update_favorite_group_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/update_group_gallery_request.rs b/src/models/update_group_gallery_request.rs index d177138..6e1384e 100644 --- a/src/models/update_group_gallery_request.rs +++ b/src/models/update_group_gallery_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/update_group_member_request.rs b/src/models/update_group_member_request.rs index efe5fbb..ca597ec 100644 --- a/src/models/update_group_member_request.rs +++ b/src/models/update_group_member_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/update_group_representation_request.rs b/src/models/update_group_representation_request.rs index d59e537..672a4d9 100644 --- a/src/models/update_group_representation_request.rs +++ b/src/models/update_group_representation_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/update_group_request.rs b/src/models/update_group_request.rs index b159a87..15f93a2 100644 --- a/src/models/update_group_request.rs +++ b/src/models/update_group_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/update_group_role_request.rs b/src/models/update_group_role_request.rs index ea34d45..68ef1f0 100644 --- a/src/models/update_group_role_request.rs +++ b/src/models/update_group_role_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/update_inventory_item_request.rs b/src/models/update_inventory_item_request.rs index 7dbb99a..539e68e 100644 --- a/src/models/update_inventory_item_request.rs +++ b/src/models/update_inventory_item_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/update_invite_message_request.rs b/src/models/update_invite_message_request.rs index 6bc2d8a..1b17520 100644 --- a/src/models/update_invite_message_request.rs +++ b/src/models/update_invite_message_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/update_prop_request.rs b/src/models/update_prop_request.rs index 5bc97d0..aef0b3b 100644 --- a/src/models/update_prop_request.rs +++ b/src/models/update_prop_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/update_tilia_tos_request.rs b/src/models/update_tilia_tos_request.rs index 8130fe4..a1efed2 100644 --- a/src/models/update_tilia_tos_request.rs +++ b/src/models/update_tilia_tos_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/update_user_badge_request.rs b/src/models/update_user_badge_request.rs index 8479c59..a3c3414 100644 --- a/src/models/update_user_badge_request.rs +++ b/src/models/update_user_badge_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/update_user_note_request.rs b/src/models/update_user_note_request.rs index 8d25bb1..656b38e 100644 --- a/src/models/update_user_note_request.rs +++ b/src/models/update_user_note_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/update_user_request.rs b/src/models/update_user_request.rs index b37e497..ac48326 100644 --- a/src/models/update_user_request.rs +++ b/src/models/update_user_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/update_world_request.rs b/src/models/update_world_request.rs index d83571e..4a9d5da 100644 --- a/src/models/update_world_request.rs +++ b/src/models/update_world_request.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/user.rs b/src/models/user.rs index 28edd0a..3430248 100644 --- a/src/models/user.rs +++ b/src/models/user.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/user_credits_eligible.rs b/src/models/user_credits_eligible.rs index b2ec9f7..abd7f93 100644 --- a/src/models/user_credits_eligible.rs +++ b/src/models/user_credits_eligible.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/user_exists.rs b/src/models/user_exists.rs index 879efa3..9421be7 100644 --- a/src/models/user_exists.rs +++ b/src/models/user_exists.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/user_note.rs b/src/models/user_note.rs index 0aa4b90..ded7d52 100644 --- a/src/models/user_note.rs +++ b/src/models/user_note.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/user_note_target_user.rs b/src/models/user_note_target_user.rs index 0cb6e12..80ec476 100644 --- a/src/models/user_note_target_user.rs +++ b/src/models/user_note_target_user.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/user_state.rs b/src/models/user_state.rs index 89da0d8..4e82539 100644 --- a/src/models/user_state.rs +++ b/src/models/user_state.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/user_status.rs b/src/models/user_status.rs index 3da672d..33676d6 100644 --- a/src/models/user_status.rs +++ b/src/models/user_status.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/user_subscription.rs b/src/models/user_subscription.rs index dd9bdf9..5ad01ab 100644 --- a/src/models/user_subscription.rs +++ b/src/models/user_subscription.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/user_subscription_eligible.rs b/src/models/user_subscription_eligible.rs index c9d031a..cc08a9c 100644 --- a/src/models/user_subscription_eligible.rs +++ b/src/models/user_subscription_eligible.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/verify2_fa_email_code_result.rs b/src/models/verify2_fa_email_code_result.rs index 1ac94ab..0d8dd47 100644 --- a/src/models/verify2_fa_email_code_result.rs +++ b/src/models/verify2_fa_email_code_result.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/verify2_fa_result.rs b/src/models/verify2_fa_result.rs index 21b4952..c119aae 100644 --- a/src/models/verify2_fa_result.rs +++ b/src/models/verify2_fa_result.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/verify_auth_token_result.rs b/src/models/verify_auth_token_result.rs index 7e942b4..c9172b1 100644 --- a/src/models/verify_auth_token_result.rs +++ b/src/models/verify_auth_token_result.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/world.rs b/src/models/world.rs index 9eb9955..2353971 100644 --- a/src/models/world.rs +++ b/src/models/world.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/world_metadata.rs b/src/models/world_metadata.rs index 88531a1..e4932e6 100644 --- a/src/models/world_metadata.rs +++ b/src/models/world_metadata.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/models/world_publish_status.rs b/src/models/world_publish_status.rs index 0947c1b..acfed68 100644 --- a/src/models/world_publish_status.rs +++ b/src/models/world_publish_status.rs @@ -1,11 +1,3 @@ -/* - * VRChat API Documentation - * - * - * Contact: vrchatapi.lpv0t@aries.fyi - * Generated by: https://openapi-generator.tech - */ - use crate::models; use serde::{Deserialize, Serialize}; diff --git a/src/patches/better_file_upload.rs b/src/patches/better_file_upload.rs new file mode 100644 index 0000000..2a4688e --- /dev/null +++ b/src/patches/better_file_upload.rs @@ -0,0 +1,45 @@ +#[derive(Debug)] +#[non_exhaustive] +pub enum File<'a> { + Path(::std::path::PathBuf), + Buf { + filename: ::std::borrow::Cow<'static, str>, + file: reqwest::Body, + length: Option, + mime_type: ::std::borrow::Cow<'a, str>, + }, +} + +impl File<'_> { + pub(crate) async fn get_multipart( + self, + ) -> Result<::reqwest::multipart::Part, crate::apis::Error> { + match self { + //The generator likes to generate this in 7.20.0. Why? Let's not? + // let file = TokioFile::open(&p_form_file).await?; + // let stream = FramedRead::new(file, BytesCodec::new()); + // let file_name = p_form_file + // .file_name() + // .map(|n| n.to_string_lossy().to_string()) + // .unwrap_or_default(); + // let file_part = + // reqwest::multipart::Part::stream(reqwest::Body::wrap_stream(stream)).file_name(file_name); + File::Path(path) => Ok(reqwest::multipart::Part::file(path).await?), + File::Buf { + filename, + file, + length, + mime_type, + } => { + let part = if let Some(length) = length { + reqwest::multipart::Part::stream_with_length(file, length) + } else { + reqwest::multipart::Part::stream(file) + } + .file_name(filename) + .mime_str(&*mime_type)?; + Ok(part) + } + } + } +} diff --git a/src/patches/mod.rs b/src/patches/mod.rs new file mode 100644 index 0000000..f0448c3 --- /dev/null +++ b/src/patches/mod.rs @@ -0,0 +1 @@ +pub mod better_file_upload; diff --git a/templates/.travis.yml b/templates/.travis.yml new file mode 100644 index 0000000..22761ba --- /dev/null +++ b/templates/.travis.yml @@ -0,0 +1 @@ +language: rust diff --git a/templates/Cargo.mustache b/templates/Cargo.mustache new file mode 100644 index 0000000..553781c --- /dev/null +++ b/templates/Cargo.mustache @@ -0,0 +1,124 @@ +[package] +name = "{{{packageName}}}" +version = "{{#lambdaVersion}}{{{packageVersion}}}{{/lambdaVersion}}" +{{#infoEmail}} +authors = ["{{{.}}}"] +{{/infoEmail}} +{{^infoEmail}} +authors = ["OpenAPI Generator team and contributors"] +{{/infoEmail}} +{{#appDescription}} +description = "{{{.}}}" +{{/appDescription}} +{{#licenseInfo}} +license = "{{.}}" +{{/licenseInfo}} +{{^licenseInfo}} +# Override this license by providing a License Object in the OpenAPI. +license = "Unlicense" +{{/licenseInfo}} +edition = "2021" +{{#publishRustRegistry}} +publish = ["{{.}}"] +{{/publishRustRegistry}} +{{#repositoryUrl}} +repository = "{{.}}" +{{/repositoryUrl}} +{{#documentationUrl}} +documentation = "{{.}}" +{{/documentationUrl}} +{{#homePageUrl}} +homepage = "{{.}}" +{{/homePageUrl}} + +[dependencies] +serde = { version = "^1.0", features = ["derive"] } +{{#serdeWith}} +serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } +{{/serdeWith}} +serde_json = "^1.0" +serde_repr = "^0.1" +{{#useSerdePathToError}} +serde_path_to_error = "^0.1" +{{/useSerdePathToError}} +url = "^2.5" +{{#hasUUIDs}} +uuid = { version = "^1.8", features = ["serde", "v4"] } +{{/hasUUIDs}} +{{#hyper}} +{{#hyper0x}} +hyper = { version = "~0.14", features = ["full"] } +hyper-tls = "~0.5" +{{/hyper0x}} +{{^hyper0x}} +hyper = { version = "^1.3.1", features = ["full"] } +hyper-util = { version = "0.1.5", features = ["client", "client-legacy", "http1", "http2"] } +http-body-util = { version = "0.1.2" } +{{/hyper0x}} +http = "~0.2" +base64 = "~0.7.0" +futures = "^0.3" +{{/hyper}} +{{#withAWSV4Signature}} +aws-sigv4 = "0.3.0" +http = "0.2.5" +secrecy = "0.8.0" +{{/withAWSV4Signature}} +{{#reqwest}} +{{^supportAsync}} +reqwest = { version = "^0.13", default-features = false, features = ["json", "blocking", "multipart", "cookies", "query", "form"] } +{{#supportMiddleware}} +reqwest-middleware = { version = "^0.5", features = ["json", "multipart", "query", "form"] } +{{/supportMiddleware}} +{{/supportAsync}} +{{#supportAsync}} +{{#useAsyncFileStream}} +tokio = { version = "^1.46.0", features = ["fs"] } +tokio-util = { version = "^0.7", features = ["codec"] } +reqwest = { version = "^0.13", default-features = false, features = ["json", "multipart", "cookies", "stream", "query", "form"] } +{{/useAsyncFileStream}} +{{^useAsyncFileStream}} +reqwest = { version = "^0.13", default-features = false, features = ["json", "multipart", "cookies", "query", "form"] } +{{/useAsyncFileStream}} +{{#supportMiddleware}} +reqwest-middleware = { version = "^0.5", features = ["json", "multipart", "query", "form"] } +{{/supportMiddleware}} +{{#supportTokenSource}} +async-trait = "^0.1" +# TODO: propose to Yoshidan to externalize this as non google related crate, so that it can easily be extended for other cloud providers. +google-cloud-token = "^0.1" +{{/supportTokenSource}} +{{/supportAsync}} + +[features] +default = [{{#reqwestDefaultFeatures}}"{{.}}"{{^-last}}, {{/-last}}{{/reqwestDefaultFeatures}}] +native-tls = ["reqwest/native-tls"] +rustls = ["reqwest/rustls"] +{{/reqwest}} +{{#reqwestTrait}} +async-trait = "^0.1" +reqwest = { version = "^0.13", default-features = false, features = ["json", "multipart", "cookies", "stream", "query", "form"] } +{{#supportMiddleware}} +reqwest-middleware = { version = "^0.5", features = ["json", "multipart", "query", "form"] } +{{/supportMiddleware}} +{{#supportTokenSource}} +# TODO: propose to Yoshidan to externalize this as non google related crate, so that it can easily be extended for other cloud providers. +google-cloud-token = "^0.1" +{{/supportTokenSource}} +{{#mockall}} +mockall = { version = "^0.13", optional = true} +{{/mockall}} +{{#useBonBuilder}} +bon = { version = "2.3", optional = true } +{{/useBonBuilder}} +[features] +default = [{{#reqwestDefaultFeatures}}"{{.}}"{{^-last}}, {{/-last}}{{/reqwestDefaultFeatures}}] +native-tls = ["reqwest/native-tls"] +rustls = ["reqwest/rustls"] +{{#mockall}} +mockall = ["dep:mockall"] +{{/mockall}} +{{#useBonBuilder}} +bon = ["dep:bon"] +{{/useBonBuilder}} +{{/reqwestTrait}} diff --git a/templates/README.mustache b/templates/README.mustache new file mode 100644 index 0000000..0e8bfb3 --- /dev/null +++ b/templates/README.mustache @@ -0,0 +1,54 @@ +# Rust API client for {{{packageName}}} + +{{#appDescriptionWithNewLines}} +{{{.}}} +{{/appDescriptionWithNewLines}} + +{{#infoUrl}} +For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/infoUrl}} + +## Overview + +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: {{{appVersion}}} +- Package version: {{{packageVersion}}} +{{^hideGenerationTimestamp}} +- Build date: {{{generatedDate}}} +{{/hideGenerationTimestamp}} +- Generator version: {{generatorVersion}} +- Build package: `{{{generatorClass}}}` + +## Installation + +Put the package under your project folder in a directory named `{{packageName}}` and add the following to `Cargo.toml` under `[dependencies]`: + +``` +{{{packageName}}} = { path = "./{{{packageName}}}" } +``` + +## Documentation for API Endpoints + +All URIs are relative to *{{{basePath}}}* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{{classname}}}* | [**{{{operationId}}}**]({{{apiDocPath}}}{{classname}}.md#{{{operationIdLowerCase}}}) | **{{{httpMethod}}}** {{{path}}} | {{{summary}}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} + +## Documentation For Models + +{{#models}}{{#model}} - [{{{classname}}}]({{{modelDocPath}}}{{{classname}}}.md) +{{/model}}{{/models}} + +To get access to the crate's generated documentation, use: + +``` +cargo doc --open +``` + +## Author + +{{#apiInfo}}{{#apis}}{{#-last}}{{{infoEmail}}} +{{/-last}}{{/apis}}{{/apiInfo}} diff --git a/templates/api_doc.mustache b/templates/api_doc.mustache new file mode 100644 index 0000000..0088937 --- /dev/null +++ b/templates/api_doc.mustache @@ -0,0 +1,45 @@ +# {{{invokerPackage}}}\{{{classname}}} + +All URIs are relative to *{{{basePath}}}* + +Method | HTTP request | Description +------------- | ------------- | ------------- +{{#operations}}{{#operation}}[**{{{operationId}}}**]({{{classname}}}.md#{{{operationId}}}) | **{{{httpMethod}}}** {{{path}}} | {{{summary}}} +{{/operation}}{{/operations}} + +{{#operations}} +{{#operation}} + +## {{{operationId}}} + +> {{#returnType}}{{{.}}} {{/returnType}}{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) +{{{summary}}}{{#notes}} + +{{{.}}}{{/notes}} + +### Parameters + +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} +{{#allParams}} +**{{{paramName}}}** | {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#complexType}}[**{{{dataType}}}**]({{#lambda.pascalcase}}{{{complexType}}}{{/lambda.pascalcase}}.md){{/complexType}}{{^complexType}}[**{{{dataType}}}**]({{#lambda.pascalcase}}{{{dataType}}}{{/lambda.pascalcase}}.md){{/complexType}}{{/isPrimitiveType}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}} | {{{description}}}{{#isInnerEnum}} (enum: {{#allowableValues}}{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}){{/isInnerEnum}} | {{#required}}[required]{{/required}} |{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} +{{/allParams}} + +### Return type + +{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**]({{{returnBaseType}}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}} (empty response body){{/returnType}} + +### Authorization + +{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}} + +### HTTP request headers + +- **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} +- **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +{{/operation}} +{{/operations}} diff --git a/templates/git_push.sh.mustache b/templates/git_push.sh.mustache new file mode 100644 index 0000000..0e3776a --- /dev/null +++ b/templates/git_push.sh.mustache @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="{{{gitUserId}}}" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="{{{gitRepoId}}}" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="{{{releaseNote}}}" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/templates/gitignore.mustache b/templates/gitignore.mustache new file mode 100644 index 0000000..6aa1064 --- /dev/null +++ b/templates/gitignore.mustache @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/templates/hyper/api.mustache b/templates/hyper/api.mustache new file mode 100644 index 0000000..7a810e1 --- /dev/null +++ b/templates/hyper/api.mustache @@ -0,0 +1,197 @@ +{{>partial_header}} +use std::sync::Arc; +use std::borrow::Borrow; +use std::pin::Pin; +#[allow(unused_imports)] +use std::option::Option; + +use hyper; +use hyper_util::client::legacy::connect::Connect; +use futures::Future; + +use crate::models; +use super::{Error, configuration}; +use super::request as __internal_request; + +pub struct {{{classname}}}Client + where C: Clone + std::marker::Send + Sync + 'static { + configuration: Arc>, +} + +impl {{{classname}}}Client + where C: Clone + std::marker::Send + Sync { + pub fn new(configuration: Arc>) -> {{{classname}}}Client { + {{{classname}}}Client { + configuration, + } + } +} + +pub trait {{{classname}}}: Send + Sync { +{{#operations}} +{{#operation}} + fn {{{operationId}}}(&self, {{#allParams}}{{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}{{^isUuid}}&str{{/isUuid}}{{/isString}}{{#isUuid}}&str{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Pin> + Send>>; +{{/operation}} +{{/operations}} +} + +impl{{{classname}}} for {{{classname}}}Client + where C: Clone + std::marker::Send + Sync { + {{#operations}} + {{#operation}} + #[allow(unused_mut)] + fn {{{operationId}}}(&self, {{#allParams}}{{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}{{^isUuid}}&str{{/isUuid}}{{/isString}}{{#isUuid}}&str{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Pin> + Send>> { + let mut req = __internal_request::Request::new(hyper::Method::{{{httpMethod.toUpperCase}}}, "{{{path}}}".to_string()) + {{#hasAuthMethods}} + {{#authMethods}} + {{#isApiKey}} + .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ + in_header: {{#isKeyInHeader}}true{{/isKeyInHeader}}{{^isKeyInHeader}}false{{/isKeyInHeader}}, + in_query: {{#isKeyInQuery}}true{{/isKeyInQuery}}{{^isKeyInQuery}}false{{/isKeyInQuery}}, + param_name: "{{{keyParamName}}}".to_owned(), + })) + {{/isApiKey}} + {{#isBasicBasic}} + .with_auth(__internal_request::Auth::Basic) + {{/isBasicBasic}} + {{#isOAuth}} + .with_auth(__internal_request::Auth::Oauth) + {{/isOAuth}} + {{/authMethods}} + {{/hasAuthMethods}} + ; + {{#queryParams}} + {{#required}} + {{^isNullable}} + req = req.with_query_param("{{{baseName}}}".to_string(), {{{paramName}}}{{#isArray}}.join(","){{/isArray}}.to_string()); + {{/isNullable}} + {{#isNullable}} + match {{{paramName}}} { + Some(param_value) => { req = req.with_query_param("{{{baseName}}}".to_string(), param_value{{#isArray}}.join(","){{/isArray}}.to_string()); }, + None => { req = req.with_query_param("{{{baseName}}}".to_string(), "".to_string()); }, + } + {{/isNullable}} + {{/required}} + {{^required}} + if let Some(ref s) = {{{paramName}}} { + {{#isArray}} + let query_value = s.iter().map(|s| s.to_string()).collect::>().join(","); + {{/isArray}} + {{^isArray}} + {{#isPrimitiveType}} + let query_value = s.to_string(); + {{/isPrimitiveType}} + {{^isPrimitiveType}} + {{#isEnum}} + let query_value = s.to_string(); + {{/isEnum}} + {{^isEnum}} + {{#isEnumRef}} + let query_value = s.to_string(); + {{/isEnumRef}} + {{^isEnumRef}} + let query_value = match serde_json::to_string(s) { + Ok(value) => value, + Err(e) => return Box::pin(futures::future::err(Error::Serde(e))), + }; + {{/isEnumRef}} + {{/isEnum}} + {{/isPrimitiveType}} + {{/isArray}} + req = req.with_query_param("{{{baseName}}}".to_string(), query_value); + } + {{/required}} + {{/queryParams}} + {{#pathParams}} + {{#required}} + {{^isNullable}} + req = req.with_path_param("{{{baseName}}}".to_string(), {{{paramName}}}{{#isArray}}.join(","){{/isArray}}.to_string()); + {{/isNullable}} + {{#isNullable}} + match {{{paramName}}} { + Some(param_value) => { req = req.with_path_param("{{{baseName}}}".to_string(), param_value{{#isArray}}.join(","){{/isArray}}.to_string()); }, + None => { req = req.with_path_param("{{{baseName}}}".to_string(), "".to_string()); }, + } + {{/isNullable}} + {{/required}} + {{^required}} + if let Some(param_value) = {{{paramName}}} { + req = req.with_path_param("{{{baseName}}}".to_string(), param_value{{#isArray}}.join(","){{/isArray}}.to_string()); + } + {{/required}} + {{/pathParams}} + {{#hasHeaderParams}} + {{#headerParams}} + {{#required}} + {{^isNullable}} + req = req.with_header_param("{{{baseName}}}".to_string(), {{{paramName}}}{{#isArray}}.join(","){{/isArray}}.to_string()); + {{/isNullable}} + {{#isNullable}} + match {{{paramName}}} { + Some(param_value) => { req = req.with_header_param("{{{baseName}}}".to_string(), param_value{{#isArray}}.join(","){{/isArray}}.to_string()); }, + None => { req = req.with_header_param("{{{baseName}}}".to_string(), "".to_string()); }, + } + {{/isNullable}} + {{/required}} + {{^required}} + if let Some(param_value) = {{{paramName}}} { + req = req.with_header_param("{{{baseName}}}".to_string(), param_value{{#isArray}}.join(","){{/isArray}}.to_string()); + } + {{/required}} + {{/headerParams}} + {{/hasHeaderParams}} + {{#hasFormParams}} + {{#formParams}} + {{#isFile}} + {{#required}} + {{^isNullable}} + req = req.with_form_param("{{{baseName}}}".to_string(), unimplemented!()); + {{/isNullable}} + {{#isNullable}} + match {{{paramName}}} { + Some(param_value) => { req = req.with_form_param("{{{baseName}}}".to_string(), unimplemented!()); }, + None => { req = req.with_form_param("{{{baseName}}}".to_string(), unimplemented!()); }, + } + {{/isNullable}} + {{/required}} + {{^required}} + if let Some(param_value) = {{{paramName}}} { + req = req.with_form_param("{{{baseName}}}".to_string(), unimplemented!()); + } + {{/required}} + {{/isFile}} + {{^isFile}} + {{#required}} + {{^isNullable}} + req = req.with_form_param("{{{baseName}}}".to_string(), {{{paramName}}}{{#isArray}}.join(","){{/isArray}}.to_string()); + {{/isNullable}} + {{#isNullable}} + match {{{paramName}}} { + Some(param_value) => { req = req.with_form_param("{{{baseName}}}".to_string(), param_value{{#isArray}}.join(","){{/isArray}}.to_string()); }, + None => { req = req.with_form_param("{{{baseName}}}".to_string(), "".to_string()); }, + } + {{/isNullable}} + {{/required}} + {{^required}} + if let Some(param_value) = {{{paramName}}} { + req = req.with_form_param("{{{baseName}}}".to_string(), param_value{{#isArray}}.join(","){{/isArray}}.to_string()); + } + {{/required}} + {{/isFile}} + {{/formParams}} + {{/hasFormParams}} + {{#hasBodyParam}} + {{#bodyParams}} + req = req.with_body_param({{{paramName}}}); + {{/bodyParams}} + {{/hasBodyParam}} + {{^returnType}} + req = req.returns_nothing(); + {{/returnType}} + + req.execute(self.configuration.borrow()) + } + +{{/operation}} +{{/operations}} +} diff --git a/templates/hyper/api_mod.mustache b/templates/hyper/api_mod.mustache new file mode 100644 index 0000000..67baa44 --- /dev/null +++ b/templates/hyper/api_mod.mustache @@ -0,0 +1,83 @@ +use std::fmt; +use std::fmt::Debug; + +use hyper; +use hyper::http; +use hyper_util::client::legacy::connect::Connect; +use serde_json; + +#[derive(Debug)] +pub enum Error { + Api(ApiError), + Header(http::header::InvalidHeaderValue), + Http(http::Error), + Hyper(hyper::Error), + HyperClient(hyper_util::client::legacy::Error), + Serde(serde_json::Error), + UriError(http::uri::InvalidUri), +} + +pub struct ApiError { + pub code: hyper::StatusCode, + pub body: hyper::body::Incoming, +} + +impl Debug for ApiError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("ApiError") + .field("code", &self.code) + .field("body", &"hyper::body::Incoming") + .finish() + } +} + +impl From<(hyper::StatusCode, hyper::body::Incoming)> for Error { + fn from(e: (hyper::StatusCode, hyper::body::Incoming)) -> Self { + Error::Api(ApiError { + code: e.0, + body: e.1, + }) + } +} + +impl From for Error { + fn from(e: http::Error) -> Self { + Error::Http(e) + } +} + +impl From for Error { + fn from(e: hyper_util::client::legacy::Error) -> Self { + Error::HyperClient(e) + } +} + +impl From for Error { + fn from(e: hyper::Error) -> Self { + Error::Hyper(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +mod request; + +{{#apiInfo}} +{{#apis}} +mod {{{classFilename}}}; +{{#operations}} +{{#operation}} +{{#-last}} +pub use self::{{{classFilename}}}::{ {{{classname}}}, {{{classname}}}Client }; +{{/-last}} +{{/operation}} +{{/operations}} +{{/apis}} +{{/apiInfo}} + +pub mod configuration; +pub mod client; diff --git a/templates/hyper/client.mustache b/templates/hyper/client.mustache new file mode 100644 index 0000000..d54e334 --- /dev/null +++ b/templates/hyper/client.mustache @@ -0,0 +1,55 @@ +use std::sync::Arc; + +use hyper; +use hyper_util::client::legacy::connect::Connect; +use super::configuration::Configuration; + +pub struct APIClient { +{{#apiInfo}} +{{#apis}} +{{#operations}} +{{#operation}} + {{#-last}} + {{{classFilename}}}: Box, + {{/-last}} +{{/operation}} +{{/operations}} +{{/apis}} +{{/apiInfo}} +} + +impl APIClient { + pub fn new(configuration: Configuration) -> APIClient + where C: Clone + std::marker::Send + Sync + 'static { + let rc = Arc::new(configuration); + + APIClient { +{{#apiInfo}} +{{#apis}} +{{#operations}} +{{#operation}} + {{#-last}} + {{{classFilename}}}: Box::new(crate::apis::{{{classname}}}Client::new(rc.clone())), + {{/-last}} +{{/operation}} +{{/operations}} +{{/apis}} +{{/apiInfo}} + } + } + +{{#apiInfo}} +{{#apis}} +{{#operations}} +{{#operation}} +{{#-last}} + pub fn {{{classFilename}}}(&self) -> &dyn crate::apis::{{{classname}}}{ + self.{{{classFilename}}}.as_ref() + } + +{{/-last}} +{{/operation}} +{{/operations}} +{{/apis}} +{{/apiInfo}} +} diff --git a/templates/hyper/configuration.mustache b/templates/hyper/configuration.mustache new file mode 100644 index 0000000..43a48ff --- /dev/null +++ b/templates/hyper/configuration.mustache @@ -0,0 +1,83 @@ +{{>partial_header}} +use hyper; +use hyper_util::client::legacy::Client; +use hyper_util::client::legacy::connect::Connect; +use hyper_util::client::legacy::connect::HttpConnector; +use hyper_util::rt::TokioExecutor; + +pub struct Configuration + where C: Clone + std::marker::Send + Sync + 'static { + pub base_path: String, + pub user_agent: Option, + pub client: Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub api_key: Option, + // TODO: take an oauth2 token source, similar to the go one +} + +pub type BasicAuth = (String, Option); + +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + +impl Configuration { + /// Construct a default [`Configuration`](Self) with a hyper client using a default + /// [`HttpConnector`](hyper_util::client::legacy::connect::HttpConnector). + /// + /// Use [`with_client`](Configuration::with_client) to construct a Configuration with a + /// custom hyper client. + /// + /// # Example + /// + /// ``` + /// # use {{externCrateName}}::apis::configuration::Configuration; + /// let api_config = Configuration { + /// basic_auth: Some(("user".into(), None)), + /// ..Configuration::new() + /// }; + /// ``` + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Configuration + where C: Clone + std::marker::Send + Sync { + + /// Construct a new Configuration with a custom hyper client. + /// + /// # Example + /// + /// ``` + /// # use core::time::Duration; + /// # use {{externCrateName}}::apis::configuration::Configuration; + /// use hyper_util::client::legacy::Client; + /// use hyper_util::rt::TokioExecutor; + /// + /// let client = Client::builder(TokioExecutor::new()) + /// .pool_idle_timeout(Duration::from_secs(30)) + /// .build_http(); + /// + /// let api_config = Configuration::with_client(client); + /// ``` + pub fn with_client(client: Client) -> Configuration { + Configuration { + base_path: "{{{basePath}}}".to_owned(), + user_agent: {{#httpUserAgent}}Some("{{{.}}}".to_owned()){{/httpUserAgent}}{{^httpUserAgent}}Some("OpenAPI-Generator/{{{version}}}/rust".to_owned()){{/httpUserAgent}}, + client, + basic_auth: None, + oauth_access_token: None, + api_key: None, + } + } +} + +impl Default for Configuration { + fn default() -> Self { + let client = Client::builder(TokioExecutor::new()).build_http(); + Configuration::with_client(client) + } +} diff --git a/templates/hyper0x/api.mustache b/templates/hyper0x/api.mustache new file mode 100644 index 0000000..7d59394 --- /dev/null +++ b/templates/hyper0x/api.mustache @@ -0,0 +1,196 @@ +{{>partial_header}} +use std::rc::Rc; +use std::borrow::Borrow; +use std::pin::Pin; +#[allow(unused_imports)] +use std::option::Option; + +use hyper; +use futures::Future; + +use crate::models; +use super::{Error, configuration}; +use super::request as __internal_request; + +pub struct {{{classname}}}Client + where C: Clone + std::marker::Send + Sync + 'static { + configuration: Rc>, +} + +impl {{{classname}}}Client + where C: Clone + std::marker::Send + Sync { + pub fn new(configuration: Rc>) -> {{{classname}}}Client { + {{{classname}}}Client { + configuration, + } + } +} + +pub trait {{{classname}}} { +{{#operations}} +{{#operation}} + fn {{{operationId}}}(&self, {{#allParams}}{{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}{{^isUuid}}&str{{/isUuid}}{{/isString}}{{#isUuid}}&str{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Pin>>>; +{{/operation}} +{{/operations}} +} + +impl{{{classname}}} for {{{classname}}}Client + where C: Clone + std::marker::Send + Sync { + {{#operations}} + {{#operation}} + #[allow(unused_mut)] + fn {{{operationId}}}(&self, {{#allParams}}{{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}{{^isUuid}}&str{{/isUuid}}{{/isString}}{{#isUuid}}&str{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::{{{httpMethod.toUpperCase}}}, "{{{path}}}".to_string()) + {{#hasAuthMethods}} + {{#authMethods}} + {{#isApiKey}} + .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ + in_header: {{#isKeyInHeader}}true{{/isKeyInHeader}}{{^isKeyInHeader}}false{{/isKeyInHeader}}, + in_query: {{#isKeyInQuery}}true{{/isKeyInQuery}}{{^isKeyInQuery}}false{{/isKeyInQuery}}, + param_name: "{{{keyParamName}}}".to_owned(), + })) + {{/isApiKey}} + {{#isBasicBasic}} + .with_auth(__internal_request::Auth::Basic) + {{/isBasicBasic}} + {{#isOAuth}} + .with_auth(__internal_request::Auth::Oauth) + {{/isOAuth}} + {{/authMethods}} + {{/hasAuthMethods}} + ; + {{#queryParams}} + {{#required}} + {{^isNullable}} + req = req.with_query_param("{{{baseName}}}".to_string(), {{{paramName}}}{{#isArray}}.join(","){{/isArray}}.to_string()); + {{/isNullable}} + {{#isNullable}} + match {{{paramName}}} { + Some(param_value) => { req = req.with_query_param("{{{baseName}}}".to_string(), param_value{{#isArray}}.join(","){{/isArray}}.to_string()); }, + None => { req = req.with_query_param("{{{baseName}}}".to_string(), "".to_string()); }, + } + {{/isNullable}} + {{/required}} + {{^required}} + if let Some(ref s) = {{{paramName}}} { + {{#isArray}} + let query_value = s.iter().map(|s| s.to_string()).collect::>().join(","); + {{/isArray}} + {{^isArray}} + {{#isPrimitiveType}} + let query_value = s.to_string(); + {{/isPrimitiveType}} + {{^isPrimitiveType}} + {{#isEnum}} + let query_value = s.to_string(); + {{/isEnum}} + {{^isEnum}} + {{#isEnumRef}} + let query_value = s.to_string(); + {{/isEnumRef}} + {{^isEnumRef}} + let query_value = match serde_json::to_string(s) { + Ok(value) => value, + Err(e) => return Box::pin(futures::future::err(Error::Serde(e))), + }; + {{/isEnumRef}} + {{/isEnum}} + {{/isPrimitiveType}} + {{/isArray}} + req = req.with_query_param("{{{baseName}}}".to_string(), query_value); + } + {{/required}} + {{/queryParams}} + {{#pathParams}} + {{#required}} + {{^isNullable}} + req = req.with_path_param("{{{baseName}}}".to_string(), {{{paramName}}}{{#isArray}}.join(","){{/isArray}}.to_string()); + {{/isNullable}} + {{#isNullable}} + match {{{paramName}}} { + Some(param_value) => { req = req.with_path_param("{{{baseName}}}".to_string(), param_value{{#isArray}}.join(","){{/isArray}}.to_string()); }, + None => { req = req.with_path_param("{{{baseName}}}".to_string(), "".to_string()); }, + } + {{/isNullable}} + {{/required}} + {{^required}} + if let Some(param_value) = {{{paramName}}} { + req = req.with_path_param("{{{baseName}}}".to_string(), param_value{{#isArray}}.join(","){{/isArray}}.to_string()); + } + {{/required}} + {{/pathParams}} + {{#hasHeaderParams}} + {{#headerParams}} + {{#required}} + {{^isNullable}} + req = req.with_header_param("{{{baseName}}}".to_string(), {{{paramName}}}{{#isArray}}.join(","){{/isArray}}.to_string()); + {{/isNullable}} + {{#isNullable}} + match {{{paramName}}} { + Some(param_value) => { req = req.with_header_param("{{{baseName}}}".to_string(), param_value{{#isArray}}.join(","){{/isArray}}.to_string()); }, + None => { req = req.with_header_param("{{{baseName}}}".to_string(), "".to_string()); }, + } + {{/isNullable}} + {{/required}} + {{^required}} + if let Some(param_value) = {{{paramName}}} { + req = req.with_header_param("{{{baseName}}}".to_string(), param_value{{#isArray}}.join(","){{/isArray}}.to_string()); + } + {{/required}} + {{/headerParams}} + {{/hasHeaderParams}} + {{#hasFormParams}} + {{#formParams}} + {{#isFile}} + {{#required}} + {{^isNullable}} + req = req.with_form_param("{{{baseName}}}".to_string(), unimplemented!()); + {{/isNullable}} + {{#isNullable}} + match {{{paramName}}} { + Some(param_value) => { req = req.with_form_param("{{{baseName}}}".to_string(), unimplemented!()); }, + None => { req = req.with_form_param("{{{baseName}}}".to_string(), unimplemented!()); }, + } + {{/isNullable}} + {{/required}} + {{^required}} + if let Some(param_value) = {{{paramName}}} { + req = req.with_form_param("{{{baseName}}}".to_string(), unimplemented!()); + } + {{/required}} + {{/isFile}} + {{^isFile}} + {{#required}} + {{^isNullable}} + req = req.with_form_param("{{{baseName}}}".to_string(), {{{paramName}}}{{#isArray}}.join(","){{/isArray}}.to_string()); + {{/isNullable}} + {{#isNullable}} + match {{{paramName}}} { + Some(param_value) => { req = req.with_form_param("{{{baseName}}}".to_string(), param_value{{#isArray}}.join(","){{/isArray}}.to_string()); }, + None => { req = req.with_form_param("{{{baseName}}}".to_string(), "".to_string()); }, + } + {{/isNullable}} + {{/required}} + {{^required}} + if let Some(param_value) = {{{paramName}}} { + req = req.with_form_param("{{{baseName}}}".to_string(), param_value{{#isArray}}.join(","){{/isArray}}.to_string()); + } + {{/required}} + {{/isFile}} + {{/formParams}} + {{/hasFormParams}} + {{#hasBodyParam}} + {{#bodyParams}} + req = req.with_body_param({{{paramName}}}); + {{/bodyParams}} + {{/hasBodyParam}} + {{^returnType}} + req = req.returns_nothing(); + {{/returnType}} + + req.execute(self.configuration.borrow()) + } + +{{/operation}} +{{/operations}} +} diff --git a/templates/hyper0x/api_mod.mustache b/templates/hyper0x/api_mod.mustache new file mode 100644 index 0000000..51a42ef --- /dev/null +++ b/templates/hyper0x/api_mod.mustache @@ -0,0 +1,64 @@ +use http; +use hyper; +use serde_json; + +#[derive(Debug)] +pub enum Error { + Api(ApiError), + Header(hyper::http::header::InvalidHeaderValue), + Http(http::Error), + Hyper(hyper::Error), + Serde(serde_json::Error), + UriError(http::uri::InvalidUri), +} + +#[derive(Debug)] +pub struct ApiError { + pub code: hyper::StatusCode, + pub body: hyper::body::Body, +} + +impl From<(hyper::StatusCode, hyper::body::Body)> for Error { + fn from(e: (hyper::StatusCode, hyper::body::Body)) -> Self { + Error::Api(ApiError { + code: e.0, + body: e.1, + }) + } +} + +impl From for Error { + fn from(e: http::Error) -> Self { + Error::Http(e) + } +} + +impl From for Error { + fn from(e: hyper::Error) -> Self { + Error::Hyper(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +mod request; + +{{#apiInfo}} +{{#apis}} +mod {{{classFilename}}}; +{{#operations}} +{{#operation}} +{{#-last}} +pub use self::{{{classFilename}}}::{ {{{classname}}}, {{{classname}}}Client }; +{{/-last}} +{{/operation}} +{{/operations}} +{{/apis}} +{{/apiInfo}} + +pub mod configuration; +pub mod client; diff --git a/templates/hyper0x/client.mustache b/templates/hyper0x/client.mustache new file mode 100644 index 0000000..25124d9 --- /dev/null +++ b/templates/hyper0x/client.mustache @@ -0,0 +1,54 @@ +use std::rc::Rc; + +use hyper; +use super::configuration::Configuration; + +pub struct APIClient { +{{#apiInfo}} +{{#apis}} +{{#operations}} +{{#operation}} + {{#-last}} + {{{classFilename}}}: Box, + {{/-last}} +{{/operation}} +{{/operations}} +{{/apis}} +{{/apiInfo}} +} + +impl APIClient { + pub fn new(configuration: Configuration) -> APIClient + where C: Clone + std::marker::Send + Sync + 'static { + let rc = Rc::new(configuration); + + APIClient { +{{#apiInfo}} +{{#apis}} +{{#operations}} +{{#operation}} + {{#-last}} + {{{classFilename}}}: Box::new(crate::apis::{{{classname}}}Client::new(rc.clone())), + {{/-last}} +{{/operation}} +{{/operations}} +{{/apis}} +{{/apiInfo}} + } + } + +{{#apiInfo}} +{{#apis}} +{{#operations}} +{{#operation}} +{{#-last}} + pub fn {{{classFilename}}}(&self) -> &dyn crate::apis::{{{classname}}}{ + self.{{{classFilename}}}.as_ref() + } + +{{/-last}} +{{/operation}} +{{/operations}} +{{/apis}} +{{/apiInfo}} +} diff --git a/templates/hyper0x/configuration.mustache b/templates/hyper0x/configuration.mustache new file mode 100644 index 0000000..ee6f407 --- /dev/null +++ b/templates/hyper0x/configuration.mustache @@ -0,0 +1,34 @@ +{{>partial_header}} +use hyper; + +pub struct Configuration + where C: Clone + std::marker::Send + Sync + 'static { + pub base_path: String, + pub user_agent: Option, + pub client: hyper::client::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub api_key: Option, + // TODO: take an oauth2 token source, similar to the go one +} + +pub type BasicAuth = (String, Option); + +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + +impl Configuration + where C: Clone + std::marker::Send + Sync { + pub fn new(client: hyper::client::Client) -> Configuration { + Configuration { + base_path: "{{{basePath}}}".to_owned(), + user_agent: {{#httpUserAgent}}Some("{{{.}}}".to_owned()){{/httpUserAgent}}{{^httpUserAgent}}Some("OpenAPI-Generator/{{{version}}}/rust".to_owned()){{/httpUserAgent}}, + client, + basic_auth: None, + oauth_access_token: None, + api_key: None, + } + } +} diff --git a/templates/lib.mustache b/templates/lib.mustache new file mode 100644 index 0000000..13943af --- /dev/null +++ b/templates/lib.mustache @@ -0,0 +1,18 @@ +#![allow(unused_imports)] +#![allow(non_camel_case_types)] +#![allow(clippy::too_many_arguments)] + +extern crate serde_repr; +extern crate serde; +extern crate serde_json; +extern crate url; +{{#hyper}} +extern crate hyper; +extern crate futures; +{{/hyper}} +{{#reqwest}} +extern crate reqwest; +{{/reqwest}} + +pub mod apis; +pub mod models; diff --git a/templates/model.mustache b/templates/model.mustache new file mode 100644 index 0000000..ab1630e --- /dev/null +++ b/templates/model.mustache @@ -0,0 +1,219 @@ +{{>partial_header}} +use crate::models; +use serde::{Deserialize, Serialize}; +{{#models}} +{{#model}} +{{^isEnum}}{{#vendorExtensions.x-rust-has-byte-array}} +use serde_with::serde_as; +{{/vendorExtensions.x-rust-has-byte-array}}{{/isEnum}} +{{#isEnum}} +{{#isInteger}} +use serde_repr::{Serialize_repr,Deserialize_repr}; +{{/isInteger}} +{{/isEnum}} +{{#description}} +/// {{{classname}}} : {{{description}}} +{{/description}} +{{!-- for repr(int) enum schemas --}} +{{#isEnum}} +{{#isInteger}} +/// {{{description}}} +#[repr(i64)] +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr)] +pub enum {{{classname}}} { +{{#allowableValues}} +{{#enumVars}} + {{{name}}} = {{{value}}}, +{{/enumVars}}{{/allowableValues}} +} + +impl std::fmt::Display for {{{classname}}} { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", match self { + {{#allowableValues}} + {{#enumVars}} + Self::{{{name}}} => "{{{value}}}", + {{/enumVars}} + {{/allowableValues}} + }) + } +} +{{/isInteger}} +{{/isEnum}} +{{!-- for enum schemas --}} +{{#isEnum}} +{{^isInteger}} +/// {{{description}}} +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum {{{classname}}} { +{{#allowableValues}} +{{#enumVars}} + #[serde(rename = "{{{value}}}")] + {{{name}}}, +{{/enumVars}}{{/allowableValues}} +} + +impl std::fmt::Display for {{{classname}}} { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + {{#allowableValues}} + {{#enumVars}} + Self::{{{name}}} => write!(f, "{{{value}}}"), + {{/enumVars}} + {{/allowableValues}} + } + } +} + +{{/isInteger}} +impl Default for {{{classname}}} { + fn default() -> {{{classname}}} { + {{#allowableValues}} + Self::{{ enumVars.0.name }} + {{/allowableValues}} + } +} +{{/isEnum}} +{{!-- for schemas that have a discriminator --}} +{{#discriminator}} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(tag = "{{{propertyBaseName}}}")] +pub enum {{{classname}}} { + {{^oneOf}} + {{#mappedModels}} + #[serde(rename="{{mappingName}}")] + {{{modelName}}} { + {{#vars}} + {{#description}} + /// {{{.}}} + {{/description}} + #[serde(rename = "{{{baseName}}}"{{^required}}, skip_serializing_if = "Option::is_none"{{/required}})] + {{{name}}}: {{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{^required}}Option<{{/required}}{{#isEnum}}{{{enumName}}}{{/isEnum}}{{^isEnum}}{{#isModel}}{{^avoidBoxedModels}}Box<{{/avoidBoxedModels}}{{{dataType}}}{{^avoidBoxedModels}}>{{/avoidBoxedModels}}{{/isModel}}{{^isModel}}{{{dataType}}}{{/isModel}}{{/isEnum}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^required}}>{{/required}}, + {{/vars}} + }, + {{/mappedModels}} + {{/oneOf}} + {{^oneOf.isEmpty}} + {{#composedSchemas.oneOf}} + {{#description}} + /// {{{.}}} + {{/description}} + {{#baseName}} + #[serde(rename="{{{.}}}")] + {{/baseName}} + {{{name}}}({{#isModel}}{{^avoidBoxedModels}}Box<{{/avoidBoxedModels}}{{/isModel}}{{{dataType}}}{{#isModel}}{{^avoidBoxedModels}}>{{/avoidBoxedModels}}{{/isModel}}), + {{/composedSchemas.oneOf}} + {{/oneOf.isEmpty}} +} + +impl Default for {{classname}} { + fn default() -> Self { + {{^oneOf}}{{#mappedModels}}{{#-first}}Self::{{modelName}} { + {{#vars}} + {{{name}}}: Default::default(), + {{/vars}} + }{{/-first}}{{/mappedModels}} + {{/oneOf}}{{^oneOf.isEmpty}}{{#composedSchemas.oneOf}}{{#-first}}Self::{{{name}}}(Default::default()){{/-first}}{{/composedSchemas.oneOf}}{{/oneOf.isEmpty}} + } +} + +{{/discriminator}} +{{!-- for non-enum schemas --}} +{{^isEnum}} +{{^discriminator}} +{{#vendorExtensions.x-rust-has-byte-array}}#[serde_as] +{{/vendorExtensions.x-rust-has-byte-array}}{{#oneOf.isEmpty}}#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct {{{classname}}} { +{{#vars}} + {{#description}} + /// {{{.}}} + {{/description}} + {{#isByteArray}} + {{#vendorExtensions.isMandatory}}#[serde_as(as = "serde_with::base64::Base64")]{{/vendorExtensions.isMandatory}}{{^vendorExtensions.isMandatory}}#[serde_as(as = "{{^serdeAsDoubleOption}}Option{{/serdeAsDoubleOption}}{{#serdeAsDoubleOption}}super::DoubleOption{{/serdeAsDoubleOption}}")]{{/vendorExtensions.isMandatory}} + {{/isByteArray}} + #[serde(rename = "{{{baseName}}}"{{^required}}{{#isNullable}}, default{{^isByteArray}}, with = "::serde_with::rust::double_option"{{/isByteArray}}{{/isNullable}}{{/required}}{{^required}}, skip_serializing_if = "Option::is_none"{{/required}}{{#required}}{{#isNullable}}, deserialize_with = "Option::deserialize"{{/isNullable}}{{/required}})] + pub {{{name}}}: {{! + ### Option Start + }}{{#isNullable}}Option<{{/isNullable}}{{^required}}Option<{{/required}}{{! + ### Enums + }}{{#isEnum}}{{#isArray}}{{#uniqueItems}}std::collections::HashSet<{{/uniqueItems}}{{^uniqueItems}}Vec<{{/uniqueItems}}{{/isArray}}{{{enumName}}}{{#isArray}}>{{/isArray}}{{/isEnum}}{{! + ### Non-Enums Start + }}{{^isEnum}}{{! + ### Models + }}{{#isModel}}{{^avoidBoxedModels}}Box<{{/avoidBoxedModels}}{{{dataType}}}{{^avoidBoxedModels}}>{{/avoidBoxedModels}}{{/isModel}}{{! + ### Primative datatypes + }}{{^isModel}}{{#isByteArray}}Vec{{/isByteArray}}{{^isByteArray}}{{{dataType}}}{{/isByteArray}}{{/isModel}}{{! + ### Non-Enums End + }}{{/isEnum}}{{! + ### Option End (and trailing comma) + }}{{#isNullable}}>{{/isNullable}}{{^required}}>{{/required}}, +{{/vars}} +} + +impl {{{classname}}} { + {{#description}} + /// {{{.}}} + {{/description}} + pub fn new({{#requiredVars}}{{{name}}}: {{! + ### Option Start + }}{{#isNullable}}Option<{{/isNullable}}{{! + ### Enums + }}{{#isEnum}}{{#isArray}}{{#uniqueItems}}std::collections::HashSet<{{/uniqueItems}}{{^uniqueItems}}Vec<{{/uniqueItems}}{{/isArray}}{{{enumName}}}{{#isArray}}>{{/isArray}}{{/isEnum}}{{! + ### Non-Enums + }}{{^isEnum}}{{#isByteArray}}Vec{{/isByteArray}}{{^isByteArray}}{{{dataType}}}{{/isByteArray}}{{/isEnum}}{{! + ### Option End + }}{{#isNullable}}>{{/isNullable}}{{! + ### Comma for next arguement + }}{{^-last}}, {{/-last}}{{/requiredVars}}) -> {{{classname}}} { + {{{classname}}} { + {{#vars}} + {{{name}}}{{^required}}: None{{/required}}{{#required}}{{^isEnum}}{{#isModel}}{{^avoidBoxedModels}}: {{^isNullable}}Box::new({{{name}}}){{/isNullable}}{{#isNullable}}if let Some(x) = {{{name}}} {Some(Box::new(x))} else {None}{{/isNullable}}{{/avoidBoxedModels}}{{/isModel}}{{/isEnum}}{{/required}}, + {{/vars}} + } + } +} +{{/oneOf.isEmpty}} +{{^oneOf.isEmpty}} +{{! TODO: add other vars that are not part of the oneOf}} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum {{classname}} { +{{#composedSchemas.oneOf}} + {{{name}}}({{#isModel}}{{^avoidBoxedModels}}Box<{{/avoidBoxedModels}}{{/isModel}}{{{dataType}}}{{#isModel}}{{^avoidBoxedModels}}>{{/avoidBoxedModels}}{{/isModel}}), +{{/composedSchemas.oneOf}} +} + +impl Default for {{classname}} { + fn default() -> Self { + {{#composedSchemas.oneOf}}{{#-first}}Self::{{{name}}}(Default::default()){{/-first}}{{/composedSchemas.oneOf}} + } +} +{{/oneOf.isEmpty}} +{{/discriminator}} +{{/isEnum}} +{{!-- for properties that are of enum type --}} +{{#vars}} +{{#isEnum}} +/// {{{description}}} +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum {{{enumName}}} { +{{#allowableValues}} +{{#enumVars}} + #[serde(rename = "{{{value}}}")] + {{{name}}}, +{{/enumVars}} +{{/allowableValues}} +} + +impl Default for {{{enumName}}} { + fn default() -> {{{enumName}}} { + {{#allowableValues}} + Self::{{ enumVars.0.name }} + {{/allowableValues}} + } +} +{{/isEnum}} +{{/vars}} + +{{/model}} +{{/models}} diff --git a/templates/model_doc.mustache b/templates/model_doc.mustache new file mode 100644 index 0000000..9c64e59 --- /dev/null +++ b/templates/model_doc.mustache @@ -0,0 +1,54 @@ +{{#models}}{{#model}}# {{{classname}}} +{{#isEnum}} + +## Enum Variants + +| Name | Value | +|---- | -----|{{#allowableValues}}{{#enumVars}} +| {{name}} | {{value}} |{{/enumVars}}{{/allowableValues}} + +{{/isEnum}} +{{#discriminator}} + +## Enum Variants + +| Name | Value | +|---- | -----|{{#vendorExtensions}}{{#x-mapped-models}} +| {{modelName}} | {{mappingName}} |{{/x-mapped-models}}{{/vendorExtensions}} +{{#vendorExtensions}} +{{#x-mapped-models}} + +## {{modelName}} + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +{{#vars}}**{{{name}}}** | {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#vendorExtensions.x-should-link}}[**{{{vendorExtensions.x-doc-type}}}**]({{#lambda.pascalcase}}{{{complexType}}}{{/lambda.pascalcase}}.md){{/vendorExtensions.x-should-link}}{{^vendorExtensions.x-should-link}}**{{{vendorExtensions.x-doc-type}}}**{{/vendorExtensions.x-should-link}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}} | {{{description}}}{{#isInnerEnum}} (enum: {{#allowableValues}}{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}){{/isInnerEnum}} | {{^required}}[optional]{{/required}}{{#isReadOnly}}[readonly]{{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} +{{/vars}} +{{/x-mapped-models}} +{{/vendorExtensions}} +{{/discriminator}} +{{^discriminator}} +{{^isEnum}} +{{#oneOf.isEmpty}} + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +{{#vars}}**{{{name}}}** | {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#vendorExtensions.x-should-link}}[**{{{vendorExtensions.x-doc-type}}}**]({{#lambda.pascalcase}}{{{complexType}}}{{/lambda.pascalcase}}.md){{/vendorExtensions.x-should-link}}{{^vendorExtensions.x-should-link}}**{{{vendorExtensions.x-doc-type}}}**{{/vendorExtensions.x-should-link}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}} | {{{description}}}{{#isInnerEnum}} (enum: {{#allowableValues}}{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}){{/isInnerEnum}} | {{^required}}[optional]{{/required}}{{#isReadOnly}}[readonly]{{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} +{{/vars}} +{{/oneOf.isEmpty}} +{{^oneOf.isEmpty}} + +## Enum Variants + +| Name | Description | +|---- | -----|{{#oneOf}} +| {{{.}}} | {{description}} |{{/oneOf}} +{{/oneOf.isEmpty}} +{{/isEnum}} +{{/discriminator}} + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +{{/model}}{{/models}} diff --git a/templates/model_mod.mustache b/templates/model_mod.mustache new file mode 100644 index 0000000..bdb080f --- /dev/null +++ b/templates/model_mod.mustache @@ -0,0 +1,45 @@ +{{#models}} +{{#model}} +pub mod {{{classFilename}}}; +pub use self::{{{classFilename}}}::{{{classname}}}; +{{/model}} +{{/models}} +{{#serdeAsDoubleOption}} +use serde::{Deserialize, Deserializer, Serializer}; +use serde_with::{de::DeserializeAsWrap, ser::SerializeAsWrap, DeserializeAs, SerializeAs}; +use std::marker::PhantomData; + +pub(crate) struct DoubleOption(PhantomData); + +impl SerializeAs>> for DoubleOption +where + TAs: SerializeAs, +{ + fn serialize_as(values: &Option>, serializer: S) -> Result + where + S: Serializer, + { + match values { + None => serializer.serialize_unit(), + Some(None) => serializer.serialize_none(), + Some(Some(v)) => serializer.serialize_some(&SerializeAsWrap::::new(v)), + } + } +} + +impl<'de, T, TAs> DeserializeAs<'de, Option>> for DoubleOption +where + TAs: DeserializeAs<'de, T>, + T: std::fmt::Debug, +{ + fn deserialize_as(deserializer: D) -> Result>, D::Error> + where + D: Deserializer<'de>, + { + Ok(Some( + DeserializeAsWrap::, Option>::deserialize(deserializer)? + .into_inner(), + )) + } +} +{{/serdeAsDoubleOption}} \ No newline at end of file diff --git a/templates/partial_header.mustache b/templates/partial_header.mustache new file mode 100644 index 0000000..e69de29 diff --git a/templates/request.rs b/templates/request.rs new file mode 100644 index 0000000..a6f7b74 --- /dev/null +++ b/templates/request.rs @@ -0,0 +1,247 @@ +use std::collections::HashMap; +use std::pin::Pin; + +use futures; +use futures::Future; +use futures::future::*; +use http_body_util::BodyExt; +use hyper; +use hyper_util::client::legacy::connect::Connect; +use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, HeaderValue, USER_AGENT}; +use serde; +use serde_json; + +use super::{configuration, Error}; + +pub(crate) struct ApiKey { + pub in_header: bool, + pub in_query: bool, + pub param_name: String, +} + +impl ApiKey { + fn key(&self, prefix: &Option, key: &str) -> String { + match prefix { + None => key.to_owned(), + Some(ref prefix) => format!("{} {}", prefix, key), + } + } +} + +#[allow(dead_code)] +pub(crate) enum Auth { + None, + ApiKey(ApiKey), + Basic, + Oauth, +} + +/// If the authorization type is unspecified then it will be automatically detected based +/// on the configuration. This functionality is useful when the OpenAPI definition does not +/// include an authorization scheme. +pub(crate) struct Request { + auth: Option, + method: hyper::Method, + path: String, + query_params: HashMap, + no_return_type: bool, + path_params: HashMap, + form_params: HashMap, + header_params: HashMap, + // TODO: multiple body params are possible technically, but not supported here. + serialized_body: Option, +} + +#[allow(dead_code)] +impl Request { + pub fn new(method: hyper::Method, path: String) -> Self { + Request { + auth: None, + method, + path, + query_params: HashMap::new(), + path_params: HashMap::new(), + form_params: HashMap::new(), + header_params: HashMap::new(), + serialized_body: None, + no_return_type: false, + } + } + + pub fn with_body_param(mut self, param: T) -> Self { + self.serialized_body = Some(serde_json::to_string(¶m).unwrap()); + self + } + + pub fn with_header_param(mut self, basename: String, param: String) -> Self { + self.header_params.insert(basename, param); + self + } + + #[allow(unused)] + pub fn with_query_param(mut self, basename: String, param: String) -> Self { + self.query_params.insert(basename, param); + self + } + + #[allow(unused)] + pub fn with_path_param(mut self, basename: String, param: String) -> Self { + self.path_params.insert(basename, param); + self + } + + #[allow(unused)] + pub fn with_form_param(mut self, basename: String, param: String) -> Self { + self.form_params.insert(basename, param); + self + } + + pub fn returns_nothing(mut self) -> Self { + self.no_return_type = true; + self + } + + pub fn with_auth(mut self, auth: Auth) -> Self { + self.auth = Some(auth); + self + } + + pub fn execute<'a, C, U>( + self, + conf: &configuration::Configuration, + ) -> Pin> + 'a + Send>> + where + C: Connect + Clone + std::marker::Send + Sync, + U: Sized + std::marker::Send + 'a, + for<'de> U: serde::Deserialize<'de>, + { + let mut query_string = ::url::form_urlencoded::Serializer::new("".to_owned()); + + let mut path = self.path; + for (k, v) in self.path_params { + // replace {id} with the value of the id path param + path = path.replace(&format!("{{{}}}", k), &v); + } + + for (key, val) in self.query_params { + query_string.append_pair(&key, &val); + } + + let mut uri_str = format!("{}{}", conf.base_path, path); + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri_str += "?"; + uri_str += &query_string_str; + } + let uri: hyper::Uri = match uri_str.parse() { + Err(e) => return Box::pin(futures::future::err(Error::UriError(e))), + Ok(u) => u, + }; + + let mut req_builder = hyper::Request::builder() + .uri(uri) + .method(self.method); + + // Detect the authorization type if it hasn't been set. + let auth = self.auth.unwrap_or_else(|| + if conf.api_key.is_some() { + panic!("Cannot automatically set the API key from the configuration, it must be specified in the OpenAPI definition") + } else if conf.oauth_access_token.is_some() { + Auth::Oauth + } else if conf.basic_auth.is_some() { + Auth::Basic + } else { + Auth::None + } + ); + match auth { + Auth::ApiKey(apikey) => { + if let Some(ref key) = conf.api_key { + let val = apikey.key(&key.prefix, &key.key); + if apikey.in_query { + query_string.append_pair(&apikey.param_name, &val); + } + if apikey.in_header { + req_builder = req_builder.header(&apikey.param_name, val); + } + } + } + Auth::Basic => { + if let Some(ref auth_conf) = conf.basic_auth { + let mut text = auth_conf.0.clone(); + text.push(':'); + if let Some(ref pass) = auth_conf.1 { + text.push_str(&pass[..]); + } + let encoded = base64::encode(&text); + req_builder = req_builder.header(AUTHORIZATION, encoded); + } + } + Auth::Oauth => { + if let Some(ref token) = conf.oauth_access_token { + let text = "Bearer ".to_owned() + token; + req_builder = req_builder.header(AUTHORIZATION, text); + } + } + Auth::None => {} + } + + if let Some(ref user_agent) = conf.user_agent { + req_builder = req_builder.header(USER_AGENT, match HeaderValue::from_str(user_agent) { + Ok(header_value) => header_value, + Err(e) => return Box::pin(futures::future::err(super::Error::Header(e))) + }); + } + + for (k, v) in self.header_params { + req_builder = req_builder.header(&k, v); + } + + let req_headers = req_builder.headers_mut().unwrap(); + let request_result = if self.form_params.len() > 0 { + req_headers.insert(CONTENT_TYPE, HeaderValue::from_static("application/x-www-form-urlencoded")); + let mut enc = ::url::form_urlencoded::Serializer::new("".to_owned()); + for (k, v) in self.form_params { + enc.append_pair(&k, &v); + } + req_builder.body(enc.finish()) + } else if let Some(body) = self.serialized_body { + req_headers.insert(CONTENT_TYPE, HeaderValue::from_static("application/json")); + req_headers.insert(CONTENT_LENGTH, body.len().into()); + req_builder.body(body) + } else { + req_builder.body(String::new()) + }; + let request = match request_result { + Ok(request) => request, + Err(e) => return Box::pin(futures::future::err(Error::from(e))) + }; + + let no_return_type = self.no_return_type; + Box::pin(conf.client + .request(request) + .map_err(|e| Error::from(e)) + .and_then(move |response| { + let status = response.status(); + if !status.is_success() { + futures::future::err::(Error::from((status, response.into_body()))).boxed() + } else if no_return_type { + // This is a hack; if there's no_ret_type, U is (), but serde_json gives an + // error when deserializing "" into (), so deserialize 'null' into it + // instead. + // An alternate option would be to require U: Default, and then return + // U::default() here instead since () implements that, but then we'd + // need to impl default for all models. + futures::future::ok::(serde_json::from_str("null").expect("serde null value")).boxed() + } else { + let collect = response.into_body().collect().map_err(Error::from); + collect.map(|collected| { + collected.and_then(|collected| { + serde_json::from_slice(&collected.to_bytes()).map_err(Error::from) + }) + }).boxed() + } + })) + } +} diff --git a/templates/reqwest-trait/api.mustache b/templates/reqwest-trait/api.mustache new file mode 100644 index 0000000..6de964d --- /dev/null +++ b/templates/reqwest-trait/api.mustache @@ -0,0 +1,572 @@ +{{>partial_header}} + +use async_trait::async_trait; +{{#mockall}} +#[cfg(feature = "mockall")] +use mockall::automock; +{{/mockall}} +use reqwest; +use std::sync::Arc; +use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; +use crate::apis::ContentType; + +{{#mockall}} +#[cfg_attr(feature = "mockall", automock)] +{{/mockall}} +#[async_trait] +pub trait {{{classname}}}: Send + Sync { +{{#operations}} +{{#operation}} + + /// {{{httpMethod}}} {{{path}}} + {{^notes.empty}} + /// + /// {{{notes}}} + {{/notes.empty}} +{{#vendorExtensions.x-group-parameters}} + async fn {{{operationId}}}(&self, {{#allParams}}{{#-first}} params: {{{operationIdCamelCase}}}Params {{/-first}}{{/allParams}}{{! + ### Function return type + }}) -> Result<{{! + ### Multi response support + }}{{#supportMultipleResponses}}ResponseContent<{{{operationIdCamelCase}}}Success>{{/supportMultipleResponses}}{{! + ### Regular return type + }}{{^supportMultipleResponses}}{{^returnType}}(){{/returnType}}{{{returnType}}}{{/supportMultipleResponses}}{{! + ### Error Type + }}, Error<{{{operationIdCamelCase}}}Error>>; +{{/vendorExtensions.x-group-parameters}} +{{^vendorExtensions.x-group-parameters}} + async fn {{{operationId}}}{{! + ### Lifetimes + }}<{{#allParams}}'{{#lambda.lifetimeName}}{{{paramName}}}{{/lambda.lifetimeName}}{{^-last}}, {{/-last}}{{/allParams}}>{{! + ### Function parameter names + }}(&self, {{#allParams}}{{{paramName}}}: {{! + ### Option Start + }}{{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{! + ### &str and Vec<&str> + }}{{#isString}}{{#isArray}}Vec<{{/isArray}}{{^isUuid}}&'{{#lambda.lifetimeName}}{{{paramName}}}{{/lambda.lifetimeName}} str{{/isUuid}}{{#isArray}}>{{/isArray}}{{/isString}}{{! + ### UUIDs + }}{{#isUuid}}{{#isArray}}Vec<{{/isArray}}&str{{#isArray}}>{{/isArray}}{{/isUuid}}{{! + ### Models and primative types + }}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{! + ### Option End + }}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{! + ### Comma for next arguement + }}{{^-last}}, {{/-last}}{{/allParams}}{{! + ### Function return type + }}) -> Result<{{! + ### Multi response support + }}{{#supportMultipleResponses}}ResponseContent<{{{operationIdCamelCase}}}Success>{{/supportMultipleResponses}}{{! + ### Regular return type + }}{{^supportMultipleResponses}}{{^returnType}}(){{/returnType}}{{{returnType}}}{{/supportMultipleResponses}}{{! + ### Error Type + }}, Error<{{{operationIdCamelCase}}}Error>>; +{{/vendorExtensions.x-group-parameters}} +{{/operation}} +{{/operations}} +} + +pub struct {{{classname}}}Client { + configuration: Arc +} + +impl {{classname}}Client { + pub fn new(configuration: Arc) -> Self { + Self { configuration } + } +} + + +{{#operations}} +{{#operation}} +{{#vendorExtensions.x-group-parameters}} +{{#allParams}} +{{#-first}} +/// struct for passing parameters to the method [`{{{classname}}}::{{operationId}}`] +#[derive(Clone, Debug)] +{{#useBonBuilder}} +#[cfg_attr(feature = "bon", derive(::bon::Builder))] +{{/useBonBuilder}} +pub struct {{{operationIdCamelCase}}}Params { +{{/-first}} + pub {{{paramName}}}: {{! + ### Option Start + }}{{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{! + ### &str and Vec<&str> + }}{{^isUuid}}{{#isString}}{{#isArray}}Vec<{{/isArray}}String{{#isArray}}>{{/isArray}}{{/isString}}{{/isUuid}}{{! + ### UUIDs + }}{{#isUuid}}{{#isArray}}Vec<{{/isArray}}String{{#isArray}}>{{/isArray}}{{/isUuid}}{{! + ### Models and primative types + }}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{! + ### Option End + }}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{! + ### Comma for next field + }}{{^-last}},{{/-last}} +{{#-last}} +} + +{{/-last}} +{{/allParams}} +{{/vendorExtensions.x-group-parameters}} +{{/operation}} +{{/operations}} + +#[async_trait] +impl {{classname}} for {{classname}}Client { + {{#operations}} + {{#operation}} + {{#notes}} + /// {{{.}}} + {{/notes}} + {{#vendorExtensions.x-group-parameters}} + async fn {{{operationId}}}(&self, {{#allParams}}{{#-first}} params: {{{operationIdCamelCase}}}Params {{/-first}}{{/allParams}}{{! + ### Function return type + }}) -> Result<{{! + ### Multi response support + }}{{#supportMultipleResponses}}ResponseContent<{{{operationIdCamelCase}}}Success>{{/supportMultipleResponses}}{{! + ### Regular return type + }}{{^supportMultipleResponses}}{{^returnType}}(){{/returnType}}{{{returnType}}}{{/supportMultipleResponses}}{{! + ### Error Type + }}, Error<{{{operationIdCamelCase}}}Error>> { + {{#allParams}}{{#-first}} + let {{{operationIdCamelCase}}}Params { + {{#allParams}} + {{{paramName}}}, + {{/allParams}} + } = params; + {{/-first}}{{/allParams}} + + {{/vendorExtensions.x-group-parameters}} + {{^vendorExtensions.x-group-parameters}} + async fn {{{operationId}}}{{! + ### Lifetimes + }}<{{#allParams}}'{{#lambda.lifetimeName}}{{{paramName}}}{{/lambda.lifetimeName}}{{^-last}}, {{/-last}}{{/allParams}}>{{! + ### Function parameter names + }}(&self, {{#allParams}}{{{paramName}}}: {{! + ### Option Start + }}{{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{! + ### &str and Vec<&str> + }}{{#isString}}{{#isArray}}Vec<{{/isArray}}{{^isUuid}}&'{{#lambda.lifetimeName}}{{{paramName}}}{{/lambda.lifetimeName}} str{{/isUuid}}{{#isArray}}>{{/isArray}}{{/isString}}{{! + ### UUIDs + }}{{#isUuid}}{{#isArray}}Vec<{{/isArray}}&str{{#isArray}}>{{/isArray}}{{/isUuid}}{{! + ### Models and primative types + }}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{! + ### Option End + }}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{! + ### Comma for next arguement + }}{{^-last}}, {{/-last}}{{/allParams}}{{! + ### Function return type + }}) -> Result<{{! + ### Multi response support + }}{{#supportMultipleResponses}}ResponseContent<{{{operationIdCamelCase}}}Success>{{/supportMultipleResponses}}{{! + ### Regular return type + }}{{^supportMultipleResponses}}{{^returnType}}(){{/returnType}}{{{returnType}}}{{/supportMultipleResponses}}{{! + ### Regular return type + }}, Error<{{{operationIdCamelCase}}}Error>> { + {{/vendorExtensions.x-group-parameters}} + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}{{{path}}}", local_var_configuration.base_path{{#pathParams}}, {{{baseName}}}={{#isString}}crate::apis::urlencode({{/isString}}{{{paramName}}}{{^required}}.unwrap(){{/required}}{{#required}}{{#isNullable}}.unwrap(){{/isNullable}}{{/required}}{{#isArray}}.join(",").as_ref(){{/isArray}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}.to_string(){{/isContainer}}{{/isPrimitiveType}}{{/isUuid}}{{/isString}}{{#isString}}){{/isString}}{{/pathParams}}); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::{{{httpMethod}}}, local_var_uri_str.as_str()); + + {{#queryParams}} + {{#required}} + {{#isArray}} + local_var_req_builder = match "{{collectionFormat}}" { + "multi" => local_var_req_builder.query(&{{{paramName}}}.into_iter().map(|p| ("{{{baseName}}}".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("{{{baseName}}}", &{{{paramName}}}.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + {{/isArray}} + {{^isArray}} + {{^isNullable}} + local_var_req_builder = local_var_req_builder.query(&[("{{{baseName}}}", &{{{paramName}}}.to_string())]); + {{/isNullable}} + {{#isNullable}} + {{#isDeepObject}} + {{^isExplode}} + if let Some(ref param_value) = {{{paramName}}} { + let params = crate::apis::parse_deep_object("{{{baseName}}}", &serde_json::to_value(param_value)?); + local_var_req_builder = local_var_req_builder.query(¶ms); + } + {{/isExplode}} + {{#isExplode}} + {{#isModel}} + if let Some(ref param_value) = {{{paramName}}} { + local_var_req_builder = local_var_req_builder.query(¶m_value); + } + {{/isModel}} + {{#isMap}} + if let Some(ref param_value) = {{{paramName}}} { + let mut query_params = Vec::with_capacity(param_value.len()); + for (key, value) in param_value.iter() { + query_params.push((key.to_string(), serde_json::to_string(value)?)); + } + local_var_req_builder = local_var_req_builder.query(&query_params); + } + {{/isMap}} + {{/isExplode}} + {{/isDeepObject}} + {{^isDeepObject}} + {{#isObject}} + if let Some(ref param_value) = {{{paramName}}} { + local_var_req_builder = local_var_req_builder.query(&[("{{{baseName}}}", &serde_json::to_value(param_value)?)]); + }; + {{/isObject}} + {{#isModel}} + if let Some(ref param_value) = {{{paramName}}} { + local_var_req_builder = local_var_req_builder.query(&[("{{{baseName}}}", &serde_json::to_value(param_value)?)]); + }; + {{/isModel}} + {{^isObject}} + {{^isModel}} + if let Some(ref param_value) = {{{paramName}}} { + local_var_req_builder = local_var_req_builder.query(&[("{{{baseName}}}", ¶m_value.to_string())]); + }; + {{/isModel}} + {{/isObject}} + {{/isDeepObject}} + {{/isNullable}} + {{/isArray}} + {{/required}} + {{^required}} + if let Some(ref param_value) = {{{paramName}}} { + {{#isArray}} + local_var_req_builder = match "{{collectionFormat}}" { + "multi" => local_var_req_builder.query(¶m_value.into_iter().map(|p| ("{{{baseName}}}".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("{{{baseName}}}", ¶m_value.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + {{/isArray}} + {{^isArray}} + {{#isDeepObject}} + {{^isExplode}} + let params = crate::apis::parse_deep_object("{{{baseName}}}", &serde_json::to_value(param_value)?); + local_var_req_builder = local_var_req_builder.query(¶ms); + {{/isExplode}} + {{#isExplode}} + {{#isModel}} + local_var_req_builder = local_var_req_builder.query(¶m_value); + {{/isModel}} + {{#isMap}} + let mut query_params = Vec::with_capacity(param_value.len()); + for (key, value) in param_value.iter() { + query_params.push((key.to_string(), serde_json::to_string(value)?)); + } + local_var_req_builder = local_var_req_builder.query(&query_params); + {{/isMap}} + {{/isExplode}} + {{/isDeepObject}} + {{^isDeepObject}} + {{#isObject}} + local_var_req_builder = local_var_req_builder.query(&[("{{{baseName}}}", &serde_json::to_value(param_value)?)]); + {{/isObject}} + {{#isModel}} + local_var_req_builder = local_var_req_builder.query(&[("{{{baseName}}}", &serde_json::to_value(param_value)?)]); + {{/isModel}} + {{^isObject}} + {{^isModel}} + local_var_req_builder = local_var_req_builder.query(&[("{{{baseName}}}", ¶m_value.to_string())]); + {{/isModel}} + {{/isObject}} + {{/isDeepObject}} + {{/isArray}} + } + {{/required}} + {{/queryParams}} + {{#hasAuthMethods}} + {{#authMethods}} + {{#isApiKey}} + {{#isKeyInQuery}} + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("{{{keyParamName}}}", local_var_value)]); + } + {{/isKeyInQuery}} + {{/isApiKey}} + {{/authMethods}} + {{/hasAuthMethods}} + {{#hasAuthMethods}} + {{#withAWSV4Signature}} + if let Some(ref local_var_aws_v4_key) = local_var_configuration.aws_v4_key { + let local_var_new_headers = match local_var_aws_v4_key.sign( + &local_var_uri_str, + "{{{httpMethod}}}", + {{#hasBodyParam}} + {{#bodyParams}} + &serde_json::to_string(&{{{paramName}}}).expect("param should serialize to string"), + {{/bodyParams}} + {{/hasBodyParam}} + {{^hasBodyParam}} + "", + {{/hasBodyParam}} + ) { + Ok(new_headers) => new_headers, + Err(err) => return Err(Error::AWSV4SignatureError(err)), + }; + for (local_var_name, local_var_value) in local_var_new_headers.iter() { + local_var_req_builder = local_var_req_builder.header(local_var_name.as_str(), local_var_value.as_str()); + } + } + {{/withAWSV4Signature}} + {{/hasAuthMethods}} + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + {{#hasHeaderParams}} + {{#headerParams}} + {{#required}} + {{^isNullable}} + local_var_req_builder = local_var_req_builder.header("{{{baseName}}}", {{{paramName}}}{{#isArray}}.join(","){{/isArray}}.to_string()); + {{/isNullable}} + {{#isNullable}} + match {{{paramName}}} { + Some(local_var_param_value) => { local_var_req_builder = local_var_req_builder.header("{{{baseName}}}", local_var_param_value{{#isArray}}.join(","){{/isArray}}.to_string()); }, + None => { local_var_req_builder = local_var_req_builder.header("{{{baseName}}}", ""); }, + } + {{/isNullable}} + {{/required}} + {{^required}} + if let Some(local_var_param_value) = {{{paramName}}} { + local_var_req_builder = local_var_req_builder.header("{{{baseName}}}", local_var_param_value{{#isArray}}.join(","){{/isArray}}.to_string()); + } + {{/required}} + {{/headerParams}} + {{/hasHeaderParams}} + {{#hasAuthMethods}} + {{#authMethods}} + {{#supportTokenSource}} + // Obtain a token from source provider. + // Tokens can be Id or access tokens depending on the provider type and configuration. + let token = local_var_configuration.token_source.token().await.map_err(Error::TokenSource)?; + // The token format is the responsibility of the provider, thus we just set the authorization header with whatever is given. + local_var_req_builder = local_var_req_builder.header(reqwest::header::AUTHORIZATION, token); + {{/supportTokenSource}} + {{^supportTokenSource}} + {{#isApiKey}} + {{#isKeyInHeader}} + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("{{{keyParamName}}}", local_var_value); + }; + {{/isKeyInHeader}} + {{/isApiKey}} + {{#isBasic}} + {{#isBasicBasic}} + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + {{/isBasicBasic}} + {{#isBasicBearer}} + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + {{/isBasicBearer}} + {{/isBasic}} + {{#isOAuth}} + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + {{/isOAuth}} + {{/supportTokenSource}} + {{/authMethods}} + {{/hasAuthMethods}} + {{#isMultipart}} + {{#hasFormParams}} + let mut local_var_form = reqwest::multipart::Form::new(); + {{#formParams}} + {{#isFile}} + {{^isRequired}} + if let Some(ref path) = {{{baseName}}} { + local_var_form = local_var_form.file("{{{baseName}}}", path.as_os_str()).await?; + } + {{/isRequired}} + {{#isRequired}} + local_var_form = local_var_form.file("{{{baseName}}}", {{{baseName}}}.as_os_str()).await?; + {{/isRequired}} + {{/isFile}} + {{^isFile}} + {{#required}} + {{^isNullable}} + local_var_form = local_var_form.text("{{{baseName}}}", {{{paramName}}}{{#isArray}}.into_iter().map(|p| p.to_string()).collect::>().join(","){{/isArray}}.to_string()); + {{/isNullable}} + {{#isNullable}} + match {{{paramName}}} { + Some(local_var_param_value) => { local_var_form = local_var_form.text("{{{baseName}}}", local_var_param_value{{#isArray}}.into_iter().map(|p| p.to_string()).collect::>().join(","){{/isArray}}.to_string()); }, + None => { local_var_form = local_var_form.text("{{{baseName}}}", ""); }, + } + {{/isNullable}} + {{/required}} + {{^required}} + if let Some(local_var_param_value) = {{{paramName}}} { + local_var_form = local_var_form.text("{{{baseName}}}", local_var_param_value{{#isArray}}.into_iter().map(|p| p.to_string()).collect::>().join(","){{/isArray}}.to_string()); + } + {{/required}} + {{/isFile}} + {{/formParams}} + local_var_req_builder = local_var_req_builder.multipart(local_var_form); + {{/hasFormParams}} + {{/isMultipart}} + {{^isMultipart}} + {{#hasFormParams}} + let mut local_var_form_params = std::collections::HashMap::new(); + {{#formParams}} + {{#isFile}} + {{#required}} + {{^isNullable}} + local_var_form_params.insert("{{{baseName}}}", unimplemented!("File form param not supported with x-www-form-urlencoded content")); + {{/isNullable}} + {{#isNullable}} + match {{{paramName}}} { + Some(local_var_param_value) => { local_var_form_params.insert("{{{baseName}}}", unimplemented!("File form param not supported with x-www-form-urlencoded content")); }, + None => { unimplemented!("Required nullable file form param not supported with x-www-form-urlencoded content"); }, + } + {{/isNullable}} + {{/required}} + {{^required}} + if let Some(local_var_param_value) = {{{paramName}}} { + local_var_form_params.insert("{{{baseName}}}", unimplemented!("File form param not supported with x-www-form-urlencoded content")); + } + {{/required}} + {{/isFile}} + {{^isFile}} + {{#required}} + {{^isNullable}} + local_var_form_params.insert("{{{baseName}}}", {{{paramName}}}{{#isArray}}.into_iter().map(|p| p.to_string()).collect::>().join(","){{/isArray}}.to_string()); + {{/isNullable}} + {{#isNullable}} + match {{{paramName}}} { + Some(local_var_param_value) => { local_var_form_params.insert("{{{baseName}}}", local_var_param_value{{#isArray}}.into_iter().map(|p| p.to_string()).collect::>().join(","){{/isArray}}.to_string()); }, + None => { local_var_form_params.insert("{{{baseName}}}", ""); }, + } + {{/isNullable}} + {{/required}} + {{^required}} + if let Some(local_var_param_value) = {{{paramName}}} { + local_var_form_params.insert("{{{baseName}}}", local_var_param_value{{#isArray}}.into_iter().map(|p| p.to_string()).collect::>().join(","){{/isArray}}.to_string()); + } + {{/required}} + {{/isFile}} + {{/formParams}} + local_var_req_builder = local_var_req_builder.form(&local_var_form_params); + {{/hasFormParams}} + {{/isMultipart}} + {{#hasBodyParam}} + {{#bodyParams}} + {{^required}} + if let Some({{{paramName}}}) = {{{paramName}}} { + {{/required}} + local_var_req_builder = local_var_req_builder.json(&{{{paramName}}}); + {{/bodyParams}} + {{^required}} + } + {{/required}} + {{/hasBodyParam}} + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + {{^supportMultipleResponses}} + {{#returnType}} + let local_var_content_type = local_var_resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let local_var_content_type = super::ContentType::from(local_var_content_type); + {{/returnType}} + {{/supportMultipleResponses}} + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + {{^supportMultipleResponses}} + {{^returnType}} + Ok(()) + {{/returnType}} + {{#returnType}} + match local_var_content_type { + {{^useSerdePathToError}} + ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), + {{/useSerdePathToError}} + {{#useSerdePathToError}} + ContentType::Json => serde_path_to_error::deserialize(&mut serde_json::Deserializer::from_str(&local_var_content)).map_err(Error::from), + {{/useSerdePathToError}} + {{#vendorExtensions.x-supports-plain-text}} + ContentType::Text => return Ok(local_var_content), + {{/vendorExtensions.x-supports-plain-text}} + {{^vendorExtensions.x-supports-plain-text}} + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `{{returnType}}`"))), + {{/vendorExtensions.x-supports-plain-text}} + ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `{{returnType}}`")))), + } + {{/returnType}} + {{/supportMultipleResponses}} + {{#supportMultipleResponses}} + let local_var_entity: Option<{{{operationIdCamelCase}}}Success> = serde_json::from_str(&local_var_content).ok(); + let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Ok(local_var_result) + {{/supportMultipleResponses}} + } else { + let local_var_entity: Option<{{{operationIdCamelCase}}}Error> = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } + } + + {{/operation}} + {{/operations}} +} + +{{#supportMultipleResponses}} +{{#operations}} +{{#operation}} +/// struct for typed successes of method [`{{{classname}}}::{{operationId}}`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum {{{operationIdCamelCase}}}Success { + {{#responses}} + {{#is2xx}} + Status{{code}}({{#isEnum}}{{{enumName}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}), + {{/is2xx}} + {{#is3xx}} + Status{{code}}({{#isEnum}}{{{enumName}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}), + {{/is3xx}} + {{/responses}} + UnknownValue(serde_json::Value), +} + +{{/operation}} +{{/operations}} +{{/supportMultipleResponses}} +{{#operations}} +{{#operation}} +/// struct for typed errors of method [`{{{classname}}}::{{operationId}}`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum {{{operationIdCamelCase}}}Error { + {{#responses}} + {{#is4xx}} + Status{{code}}({{#isEnum}}{{{enumName}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}), + {{/is4xx}} + {{#is5xx}} + Status{{code}}({{#isEnum}}{{{enumName}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}), + {{/is5xx}} + {{#isDefault}} + DefaultResponse({{#isEnum}}{{{enumName}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}), + {{/isDefault}} + {{/responses}} + UnknownValue(serde_json::Value), +} + +{{/operation}} +{{/operations}} diff --git a/templates/reqwest-trait/api_mod.mustache b/templates/reqwest-trait/api_mod.mustache new file mode 100644 index 0000000..41a4ba0 --- /dev/null +++ b/templates/reqwest-trait/api_mod.mustache @@ -0,0 +1,236 @@ +use std::error; +use std::fmt; +{{#withAWSV4Signature}} +use aws_sigv4; +{{/withAWSV4Signature}} + +#[derive(Debug, Clone)] +pub struct ResponseContent { + pub status: reqwest::StatusCode, + pub content: String, + pub entity: Option, +} + +#[derive(Debug)] +pub enum Error { + Reqwest(reqwest::Error), + {{#supportMiddleware}} + ReqwestMiddleware(reqwest_middleware::Error), + {{/supportMiddleware}} + Serde(serde_json::Error), + Io(std::io::Error), + ResponseError(ResponseContent), + {{#withAWSV4Signature}} + AWSV4SignatureError(aws_sigv4::http_request::Error), + {{/withAWSV4Signature}} + {{#supportTokenSource}} + TokenSource(Box), + {{/supportTokenSource}} +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let (module, e) = match self { + Error::Reqwest(e) => ("reqwest", e.to_string()), + {{#supportMiddleware}} + Error::ReqwestMiddleware(e) => ("reqwest-middleware", e.to_string()), + {{/supportMiddleware}} + Error::Serde(e) => ("serde", e.to_string()), + Error::Io(e) => ("IO", e.to_string()), + Error::ResponseError(e) => ("response", format!("status code {}", e.status)), + {{#withAWSV4Signature}} + Error::AWSV4SignatureError(e) => ("aws v4 signature", e.to_string()), + {{/withAWSV4Signature}} + {{#supportTokenSource}} + Error::TokenSource(e) => ("token source failure", e.to_string()), + {{/supportTokenSource}} + }; + write!(f, "error in {}: {}", module, e) + } +} + +impl error::Error for Error { + fn source(&self) -> Option<&(dyn error::Error + 'static)> { + Some(match self { + Error::Reqwest(e) => e, + {{#supportMiddleware}} + Error::ReqwestMiddleware(e) => e, + {{/supportMiddleware}} + Error::Serde(e) => e, + Error::Io(e) => e, + Error::ResponseError(_) => return None, + {{#withAWSV4Signature}} + Error::AWSV4SignatureError(_) => return None, + {{/withAWSV4Signature}} + {{#supportTokenSource}} + Error::TokenSource(e) => &**e, + {{/supportTokenSource}} + }) + } +} + +impl From for Error { + fn from(e: reqwest::Error) -> Self { + Error::Reqwest(e) + } +} + +{{#supportMiddleware}} +impl From for Error { + fn from(e: reqwest_middleware::Error) -> Self { + Error::ReqwestMiddleware(e) + } +} + +{{/supportMiddleware}} +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +impl From for Error { + fn from(e: std::io::Error) -> Self { + Error::Io(e) + } +} + +pub fn urlencode>(s: T) -> String { + ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() +} + +pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { + if let serde_json::Value::Object(object) = value { + let mut params = vec![]; + + for (key, value) in object { + match value { + serde_json::Value::Object(_) => params.append(&mut parse_deep_object( + &format!("{}[{}]", prefix, key), + value, + )), + serde_json::Value::Array(array) => { + for (i, value) in array.iter().enumerate() { + params.append(&mut parse_deep_object( + &format!("{}[{}][{}]", prefix, key, i), + value, + )); + } + }, + serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), + _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), + } + } + + return params; + } + + unimplemented!("Only objects are supported with style=deepObject") +} + +/// Internal use only +/// A content type supported by this client. +#[allow(dead_code)] +enum ContentType { + Json, + Text, + Unsupported(String) +} + +impl From<&str> for ContentType { + fn from(content_type: &str) -> Self { + if content_type.starts_with("application") && content_type.contains("json") { + return Self::Json; + } else if content_type.starts_with("text/plain") { + return Self::Text; + } else { + return Self::Unsupported(content_type.to_string()); + } + } +} + +{{#apiInfo}} +{{#apis}} +pub mod {{{classFilename}}}; +{{/apis}} +{{/apiInfo}} + +pub mod configuration; + +{{#topLevelApiClient}} +use std::sync::Arc; + +pub trait Api { + {{#apiInfo}} + {{#apis}} + fn {{{classFilename}}}(&self) -> &dyn {{{classFilename}}}::{{classname}}; + {{/apis}} + {{/apiInfo}} +} + +pub struct ApiClient { + {{#apiInfo}} + {{#apis}} + {{{classFilename}}}: Box, + {{/apis}} + {{/apiInfo}} +} + +impl ApiClient { + pub fn new(configuration: Arc) -> Self { + Self { + {{#apiInfo}} + {{#apis}} + {{{classFilename}}}: Box::new({{{classFilename}}}::{{classname}}Client::new(configuration.clone())), + {{/apis}} + {{/apiInfo}} + } + } +} + +impl Api for ApiClient { + {{#apiInfo}} + {{#apis}} + fn {{{classFilename}}}(&self) -> &dyn {{{classFilename}}}::{{classname}} { + self.{{{classFilename}}}.as_ref() + } + {{/apis}} + {{/apiInfo}} +} + +{{#mockall}} +#[cfg(feature = "mockall")] +pub struct MockApiClient { + {{#apiInfo}} + {{#apis}} + pub {{{classFilename}}}_mock: {{{classFilename}}}::Mock{{classname}}, + {{/apis}} + {{/apiInfo}} +} + +#[cfg(feature = "mockall")] +impl MockApiClient { + pub fn new() -> Self { + Self { + {{#apiInfo}} + {{#apis}} + {{{classFilename}}}_mock: {{{classFilename}}}::Mock{{classname}}::new(), + {{/apis}} + {{/apiInfo}} + } + } +} + +#[cfg(feature = "mockall")] +impl Api for MockApiClient { + {{#apiInfo}} + {{#apis}} + fn {{{classFilename}}}(&self) -> &dyn {{{classFilename}}}::{{classname}} { + &self.{{{classFilename}}}_mock + } + {{/apis}} + {{/apiInfo}} +} +{{/mockall}} + +{{/topLevelApiClient}} diff --git a/templates/reqwest-trait/configuration.mustache b/templates/reqwest-trait/configuration.mustache new file mode 100644 index 0000000..2536069 --- /dev/null +++ b/templates/reqwest-trait/configuration.mustache @@ -0,0 +1,120 @@ +{{>partial_header}} + +{{#withAWSV4Signature}} +use std::time::SystemTime; +use aws_sigv4::http_request::{sign, SigningSettings, SigningParams, SignableRequest}; +use http; +use secrecy::{SecretString, ExposeSecret}; +{{/withAWSV4Signature}} +{{#supportTokenSource}} +use std::sync::Arc; +use google_cloud_token::TokenSource; +use async_trait::async_trait; +{{/supportTokenSource}} + +#[derive(Debug, Clone)] +pub struct Configuration { + pub base_path: String, + pub user_agent: Option, + pub client: {{#supportMiddleware}}reqwest_middleware::ClientWithMiddleware{{/supportMiddleware}}{{^supportMiddleware}}reqwest::Client{{/supportMiddleware}}, + {{^supportTokenSource}} + pub basic_auth: Option, + pub oauth_access_token: Option, + pub bearer_access_token: Option, + pub api_key: Option, + {{/supportTokenSource}} + {{#withAWSV4Signature}} + pub aws_v4_key: Option, + {{/withAWSV4Signature}} + {{#supportTokenSource}} + pub token_source: Arc, + {{/supportTokenSource}} +} +{{^supportTokenSource}} + +pub type BasicAuth = (String, Option); + +#[derive(Debug, Clone)] +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} +{{/supportTokenSource}} + +{{#withAWSV4Signature}} +#[derive(Debug, Clone)] +pub struct AWSv4Key { + pub access_key: String, + pub secret_key: SecretString, + pub region: String, + pub service: String, +} + +impl AWSv4Key { + pub fn sign(&self, uri: &str, method: &str, body: &str) -> Result, aws_sigv4::http_request::Error> { + let request = http::Request::builder() + .uri(uri) + .method(method) + .body(body).unwrap(); + let signing_settings = SigningSettings::default(); + let signing_params = SigningParams::builder() + .access_key(self.access_key.as_str()) + .secret_key(self.secret_key.expose_secret().as_str()) + .region(self.region.as_str()) + .service_name(self.service.as_str()) + .time(SystemTime::now()) + .settings(signing_settings) + .build() + .unwrap(); + let signable_request = SignableRequest::from(&request); + let (mut signing_instructions, _signature) = sign(signable_request, &signing_params)?.into_parts(); + let mut additional_headers = Vec::<(String, String)>::new(); + if let Some(new_headers) = signing_instructions.take_headers() { + for (name, value) in new_headers.into_iter() { + additional_headers.push((name.expect("header should have name").to_string(), + value.to_str().expect("header value should be a string").to_string())); + } + } + Ok(additional_headers) + } +} +{{/withAWSV4Signature}} + +impl Configuration { + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Default for Configuration { + fn default() -> Self { + Configuration { + base_path: "{{{basePath}}}".to_owned(), + user_agent: {{#httpUserAgent}}Some("{{{.}}}".to_owned()){{/httpUserAgent}}{{^httpUserAgent}}Some("OpenAPI-Generator/{{{version}}}/rust".to_owned()){{/httpUserAgent}}, + client: {{#supportMiddleware}}reqwest_middleware::ClientBuilder::new(reqwest::Client::new()).build(){{/supportMiddleware}}{{^supportMiddleware}}reqwest::Client::new(){{/supportMiddleware}}, + {{^supportTokenSource}} + basic_auth: None, + oauth_access_token: None, + bearer_access_token: None, + api_key: None, + {{/supportTokenSource}} + {{#withAWSV4Signature}} + aws_v4_key: None, + {{/withAWSV4Signature}} + {{#supportTokenSource}} + token_source: Arc::new(NoopTokenSource{}), + {{/supportTokenSource}} + } + } +} +{{#supportTokenSource}} +#[derive(Debug)] +struct NoopTokenSource{} + +#[async_trait] +impl TokenSource for NoopTokenSource { + async fn token(&self) -> Result> { + panic!("This is dummy token source. You can use TokenSourceProvider from 'google_cloud_auth' crate, or any other compatible crate.") + } +} +{{/supportTokenSource}} diff --git a/templates/reqwest/api.mustache b/templates/reqwest/api.mustache new file mode 100644 index 0000000..3b545d5 --- /dev/null +++ b/templates/reqwest/api.mustache @@ -0,0 +1,637 @@ +{{>partial_header}} + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; +{{#operations}} +{{#operation}} +{{#vendorExtensions.useAsyncFileStream}} +use tokio::fs::File as TokioFile; +use tokio_util::codec::{BytesCodec, FramedRead}; +{{/vendorExtensions.useAsyncFileStream}} +{{/operation}} +{{/operations}} + +{{#operations}} +{{#operation}} +{{#vendorExtensions.x-group-parameters}} +{{#allParams}} +{{#-first}} +/// struct for passing parameters to the method [`{{operationId}}`] +#[derive(Clone, Debug)] +pub struct {{{operationIdCamelCase}}}Params { +{{/-first}} + pub {{{paramName}}}: {{! + ### Option Start + }}{{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{! + ### &str and Vec<&str> + }}{{^isUuid}}{{#isString}}{{#isArray}}Vec<{{/isArray}}String{{#isArray}}>{{/isArray}}{{/isString}}{{/isUuid}}{{! + ### UUIDs + }}{{#isUuid}}{{#isArray}}Vec<{{/isArray}}String{{#isArray}}>{{/isArray}}{{/isUuid}}{{! + ### Models and primative types + }}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{! + ### Option End + }}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{! + ### Comma for next arguement + }}{{^-last}},{{/-last}} +{{#-last}} +} + +{{/-last}} +{{/allParams}} +{{/vendorExtensions.x-group-parameters}} +{{/operation}} +{{/operations}} + +{{#supportMultipleResponses}} +{{#operations}} +{{#operation}} +/// struct for typed successes of method [`{{operationId}}`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum {{{operationIdCamelCase}}}Success { + {{#responses}} + {{#is2xx}} + Status{{code}}({{#isEnum}}{{{enumName}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}), + {{/is2xx}} + {{#is3xx}} + Status{{code}}({{#isEnum}}{{{enumName}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}), + {{/is3xx}} + {{/responses}} + UnknownValue(serde_json::Value), +} + +{{/operation}} +{{/operations}} +{{/supportMultipleResponses}} +{{#operations}} +{{#operation}} +/// struct for typed errors of method [`{{operationId}}`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum {{{operationIdCamelCase}}}Error { + {{#responses}} + {{#is4xx}} + Status{{code}}({{#isEnum}}{{{enumName}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}), + {{/is4xx}} + {{#is5xx}} + Status{{code}}({{#isEnum}}{{{enumName}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}), + {{/is5xx}} + {{#isDefault}} + DefaultResponse({{#isEnum}}{{{enumName}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}), + {{/isDefault}} + {{/responses}} + UnknownValue(serde_json::Value), +} + +{{/operation}} +{{/operations}} + +{{#operations}} +{{#operation}} +{{#notes}} +/// {{{.}}} +{{/notes}} +{{#isDeprecated}} +#[deprecated] +{{/isDeprecated}} +{{#vendorExtensions.x-group-parameters}} +pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration: &configuration::Configuration{{#allParams}}{{#-first}}, {{! +### Params +}}params: {{{operationIdCamelCase}}}Params{{/-first}}{{/allParams}}{{! +### Function return type +}}) -> Result<{{! +### Response File Support +}}{{#isResponseFile}}{{#supportAsync}}reqwest::Response{{/supportAsync}}{{^supportAsync}}reqwest::blocking::Response{{/supportAsync}}{{/isResponseFile}}{{! +### Regular Responses +}}{{^isResponseFile}}{{! +### Multi response support +}}{{#supportMultipleResponses}}ResponseContent<{{{operationIdCamelCase}}}Success>{{/supportMultipleResponses}}{{! +### Regular return type +}}{{^supportMultipleResponses}}{{^returnType}}(){{/returnType}}{{{returnType}}}{{/supportMultipleResponses}}{{/isResponseFile}}{{! +### Error Type +}}, Error<{{{operationIdCamelCase}}}Error>> { +{{/vendorExtensions.x-group-parameters}} +{{^vendorExtensions.x-group-parameters}} +pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration: &configuration::Configuration, {{#allParams}}{{{paramName}}}: {{! +### Option Start +}}{{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{! +### &str and Vec<&str> +}}{{#isString}}{{#isArray}}Vec<{{/isArray}}{{^isUuid}}&str{{/isUuid}}{{#isArray}}>{{/isArray}}{{/isString}}{{! +### UUIDs +}}{{#isUuid}}{{#isArray}}Vec<{{/isArray}}&str{{#isArray}}>{{/isArray}}{{/isUuid}}{{! +### Models and primative types +}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{! +### Option End +}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{! +### Comma for next arguement +}}{{^-last}}, {{/-last}}{{/allParams}}{{! +### Function return type +}}) -> Result<{{! +### Response File Support +}}{{#isResponseFile}}{{#supportAsync}}reqwest::Response{{/supportAsync}}{{^supportAsync}}reqwest::blocking::Response{{/supportAsync}}{{/isResponseFile}}{{! +### Regular Responses +}}{{^isResponseFile}}{{! +### Multi response support +}}{{#supportMultipleResponses}}ResponseContent<{{{operationIdCamelCase}}}Success>{{/supportMultipleResponses}}{{! +### Regular return type +}}{{^supportMultipleResponses}}{{^returnType}}(){{/returnType}}{{{returnType}}}{{/supportMultipleResponses}}{{/isResponseFile}}{{! +### Error Type +}}, Error<{{{operationIdCamelCase}}}Error>> { + {{#allParams.0}} + // add a prefix to parameters to efficiently prevent name collisions + {{/allParams.0}} + {{#allParams}} + let {{{vendorExtensions.x-rust-param-identifier}}} = {{{paramName}}}; + {{/allParams}} +{{/vendorExtensions.x-group-parameters}} + + let uri_str = format!("{}{{{path}}}", configuration.base_path{{#pathParams}}, {{{baseName}}}={{#isString}}crate::apis::urlencode({{/isString}}{{{vendorExtensions.x-rust-param-identifier}}}{{^required}}.unwrap(){{/required}}{{#required}}{{#isNullable}}.unwrap(){{/isNullable}}{{/required}}{{#isArray}}.join(",").as_ref(){{/isArray}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}.to_string(){{/isContainer}}{{/isPrimitiveType}}{{/isUuid}}{{/isString}}{{#isString}}){{/isString}}{{/pathParams}}); + let mut req_builder = configuration.client.request(reqwest::Method::{{{httpMethod}}}, &uri_str); + + {{#queryParams}} + {{#required}} + {{#isArray}} + req_builder = match "{{collectionFormat}}" { + "multi" => req_builder.query(&{{{vendorExtensions.x-rust-param-identifier}}}.into_iter().map(|p| ("{{{baseName}}}".to_owned(), p.to_string())).collect::>()), + _ => req_builder.query(&[("{{{baseName}}}", &{{{vendorExtensions.x-rust-param-identifier}}}.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + {{/isArray}} + {{^isArray}} + {{^isNullable}} + req_builder = req_builder.query(&[("{{{baseName}}}", &{{{vendorExtensions.x-rust-param-identifier}}}.to_string())]); + {{/isNullable}} + {{#isNullable}} + {{#isDeepObject}} + if let Some(ref param_value) = {{{vendorExtensions.x-rust-param-identifier}}} { + {{^isExplode}} + let params = crate::apis::parse_deep_object("{{{baseName}}}", &serde_json::to_value(param_value)?); + req_builder = req_builder.query(¶ms); + {{/isExplode}} + {{#isExplode}} + {{#isModel}} + req_builder = req_builder.query(¶m_value); + {{/isModel}} + {{#isMap}} + let mut query_params = Vec::with_capacity(param_value.len()); + for (key, value) in param_value.iter() { + query_params.push((key.to_string(), serde_json::to_string(value)?)); + } + req_builder = req_builder.query(&query_params); + {{/isMap}} + {{/isExplode}} + }; + {{/isDeepObject}} + {{^isDeepObject}} + {{#isObject}} + if let Some(ref param_value) = {{{vendorExtensions.x-rust-param-identifier}}} { + req_builder = req_builder.query(&[("{{{baseName}}}", &serde_json::to_string(param_value)?)]); + }; + {{/isObject}} + {{#isModel}} + if let Some(ref param_value) = {{{vendorExtensions.x-rust-param-identifier}}} { + req_builder = req_builder.query(&[("{{{baseName}}}", &serde_json::to_string(param_value)?)]); + }; + {{/isModel}} + {{/isDeepObject}} + {{^isObject}} + {{^isModel}} + {{^isEnum}} + {{^isEnumRef}} + {{#isPrimitiveType}} + if let Some(ref param_value) = {{{vendorExtensions.x-rust-param-identifier}}} { + req_builder = req_builder.query(&[("{{{baseName}}}", ¶m_value.to_string())]); + }; + {{/isPrimitiveType}} + {{^isPrimitiveType}} + if let Some(ref param_value) = {{{vendorExtensions.x-rust-param-identifier}}} { + req_builder = req_builder.query(&[("{{{baseName}}}", &serde_json::to_string(param_value)?)]); + }; + {{/isPrimitiveType}} + {{/isEnumRef}} + {{/isEnum}} + {{#isEnum}} + if let Some(ref param_value) = {{{vendorExtensions.x-rust-param-identifier}}} { + req_builder = req_builder.query(&[("{{{baseName}}}", ¶m_value.to_string())]); + }; + {{/isEnum}} + {{#isEnumRef}} + if let Some(ref param_value) = {{{vendorExtensions.x-rust-param-identifier}}} { + req_builder = req_builder.query(&[("{{{baseName}}}", ¶m_value.to_string())]); + }; + {{/isEnumRef}} + {{/isModel}} + {{/isObject}} + {{/isNullable}} + {{/isArray}} + {{/required}} + {{^required}} + if let Some(ref param_value) = {{{vendorExtensions.x-rust-param-identifier}}} { + {{#isArray}} + req_builder = match "{{collectionFormat}}" { + "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("{{{baseName}}}".to_owned(), p.to_string())).collect::>()), + _ => req_builder.query(&[("{{{baseName}}}", ¶m_value.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + {{/isArray}} + {{^isArray}} + {{#isDeepObject}} + {{^isExplode}} + let params = crate::apis::parse_deep_object("{{{baseName}}}", &serde_json::to_value(param_value)?); + req_builder = req_builder.query(¶ms); + {{/isExplode}} + {{#isExplode}} + {{#isModel}} + req_builder = req_builder.query(¶m_value); + {{/isModel}} + {{#isMap}} + let mut query_params = Vec::with_capacity(param_value.len()); + for (key, value) in param_value.iter() { + query_params.push((key.to_string(), serde_json::to_string(value)?)); + } + req_builder = req_builder.query(&query_params); + {{/isMap}} + {{/isExplode}} + {{/isDeepObject}} + {{^isDeepObject}} + {{#isObject}} + req_builder = req_builder.query(&[("{{{baseName}}}", &serde_json::to_string(param_value)?)]); + {{/isObject}} + {{#isModel}} + req_builder = req_builder.query(&[("{{{baseName}}}", &serde_json::to_string(param_value)?)]); + {{/isModel}} + {{#isEnum}} + req_builder = req_builder.query(&[("{{{baseName}}}", ¶m_value.to_string())]); + {{/isEnum}} + {{#isEnumRef}} + req_builder = req_builder.query(&[("{{{baseName}}}", ¶m_value.to_string())]); + {{/isEnumRef}} + {{^isObject}} + {{^isModel}} + {{^isEnum}} + {{^isEnumRef}} + {{#isPrimitiveType}} + req_builder = req_builder.query(&[("{{{baseName}}}", ¶m_value.to_string())]); + {{/isPrimitiveType}} + {{^isPrimitiveType}} + req_builder = req_builder.query(&[("{{{baseName}}}", &serde_json::to_string(param_value)?)]); + {{/isPrimitiveType}} + {{/isEnumRef}} + {{/isEnum}} + {{/isModel}} + {{/isObject}} + {{/isDeepObject}} + {{/isArray}} + } + {{/required}} + {{/queryParams}} + {{#hasAuthMethods}} + {{#authMethods}} + {{#isApiKey}} + {{#isKeyInQuery}} + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let value = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + req_builder = req_builder.query(&[("{{{keyParamName}}}", value)]); + } + {{/isKeyInQuery}} + {{/isApiKey}} + {{/authMethods}} + {{/hasAuthMethods}} + {{#hasAuthMethods}} + {{#withAWSV4Signature}} + if let Some(ref aws_v4_key) = configuration.aws_v4_key { + let new_headers = match aws_v4_key.sign( + &uri_str, + "{{{httpMethod}}}", + {{#hasBodyParam}} + {{#bodyParams}} + &serde_json::to_string(&{{{vendorExtensions.x-rust-param-identifier}}}).expect("param should serialize to string"), + {{/bodyParams}} + {{/hasBodyParam}} + {{^hasBodyParam}} + "", + {{/hasBodyParam}} + ) { + Ok(new_headers) => new_headers, + Err(err) => return Err(Error::AWSV4SignatureError(err)), + }; + for (name, value) in new_headers.iter() { + req_builder = req_builder.header(name.as_str(), value.as_str()); + } + } + {{/withAWSV4Signature}} + {{/hasAuthMethods}} + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + {{#hasHeaderParams}} + {{#headerParams}} + {{#required}} + {{^isNullable}} + req_builder = req_builder.header("{{{baseName}}}", {{{vendorExtensions.x-rust-param-identifier}}}{{#isArray}}.join(","){{/isArray}}.to_string()); + {{/isNullable}} + {{#isNullable}} + match {{{vendorExtensions.x-rust-param-identifier}}} { + Some(param_value) => { req_builder = req_builder.header("{{{baseName}}}", param_value{{#isArray}}.join(","){{/isArray}}.to_string()); }, + None => { req_builder = req_builder.header("{{{baseName}}}", ""); }, + } + {{/isNullable}} + {{/required}} + {{^required}} + if let Some(param_value) = {{{vendorExtensions.x-rust-param-identifier}}} { + req_builder = req_builder.header("{{{baseName}}}", param_value{{#isArray}}.join(","){{/isArray}}.to_string()); + } + {{/required}} + {{/headerParams}} + {{/hasHeaderParams}} + {{#hasAuthMethods}} + {{#authMethods}} + {{#supportTokenSource}} + // Obtain a token from source provider. + // Tokens can be Id or access tokens depending on the provider type and configuration. + let token = configuration.token_source.token().await.map_err(Error::TokenSource)?; + // The token format is the responsibility of the provider, thus we just set the authorization header with whatever is given. + req_builder = req_builder.header(reqwest::header::AUTHORIZATION, token); + {{/supportTokenSource}} + {{^supportTokenSource}} + {{#isApiKey}} + {{#isKeyInHeader}} + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let value = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + req_builder = req_builder.header("{{{keyParamName}}}", value); + }; + {{/isKeyInHeader}} + {{/isApiKey}} + {{#isBasic}} + {{#isBasicBasic}} + if let Some(ref auth_conf) = configuration.basic_auth { + req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); + }; + {{/isBasicBasic}} + {{#isBasicBearer}} + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + {{/isBasicBearer}} + {{/isBasic}} + {{#isOAuth}} + if let Some(ref token) = configuration.oauth_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + {{/isOAuth}} + {{/supportTokenSource}} + {{/authMethods}} + {{/hasAuthMethods}} + {{#isMultipart}} + {{#hasFormParams}} + let mut multipart_form = reqwest{{^supportAsync}}::blocking{{/supportAsync}}::multipart::Form::new(); + {{#formParams}} + {{#isFile}} + {{^supportAsync}} + {{#required}} + {{^isNullable}} + {{#isArray}} + for value in &{{{vendorExtensions.x-rust-param-identifier}}} { + multipart_form = multipart_form.file("{{{baseName}}}", value)?; + } + {{/isArray}} + {{^isArray}} + multipart_form = multipart_form.file("{{{baseName}}}", {{{vendorExtensions.x-rust-param-identifier}}})?; + {{/isArray}} + {{/isNullable}} + {{#isNullable}} + {{#isArray}} + match {{{vendorExtensions.x-rust-param-identifier}}} { + Some(param_value) => { + for value in param_value { + multipart_form = multipart_form.file("{{{baseName}}}", value)?; + } + }, + None => { unimplemented!("Required nullable form file param not supported"); }, + } + {{/isArray}} + {{^isArray}} + match {{{vendorExtensions.x-rust-param-identifier}}} { + Some(param_value) => { multipart_form = multipart_form.file("{{{baseName}}}", param_value)?; }, + None => { unimplemented!("Required nullable form file param not supported"); }, + } + {{/isArray}} + {{/isNullable}} + {{/required}} + {{^required}} + if let Some(ref param_value) = {{{vendorExtensions.x-rust-param-identifier}}} { + {{#isArray}} + for value in param_value { + multipart_form = multipart_form.file("{{{baseName}}}", value)?; + } + {{/isArray}} + {{^isArray}} + multipart_form = multipart_form.file("{{{baseName}}}", param_value)?; + {{/isArray}} + } + {{/required}} + {{/supportAsync}} + {{#supportAsync}} + {{^required}} + if let Some(ref param_value) = {{{vendorExtensions.x-rust-param-identifier}}} { + {{#isArray}} + for value in param_value { + multipart_form = multipart_form.part("{{{baseName}}}", value.get_multipart().await?); + } + {{/isArray}} + {{^isArray}} + multipart_form = multipart_form.part("{{{baseName}}}", param_value.get_multipart().await?); + {{/isArray}} + } + {{/required}} + {{#required}} + {{#isArray}} + for value in {{{vendorExtensions.x-rust-param-identifier}}} { + multipart_form = multipart_form.part("{{{baseName}}}", value.get_multipart().await?); + } + {{/isArray}} + {{^isArray}} + multipart_form = multipart_form.part("{{{baseName}}}", {{{vendorExtensions.x-rust-param-identifier}}}.get_multipart().await?); + {{/isArray}} + {{/required}} + {{/supportAsync}} + {{/isFile}} + {{^isFile}} + {{#required}} + {{^isNullable}} + macro_rules! serialize { + ($form:ident, data, $data:ident) => { + $form = $form.text("data", serde_json::to_string(&$data)?); + }; + ($form:ident, $tag:ident, $data:ident) => { + $form = $form.text(stringify!($tag), $data{{#isArray}}.into_iter().map(|p| p.to_string()).collect::>().join(","){{/isArray}}.to_string()); + }; + } + serialize!(multipart_form, {{{baseName}}}, {{{vendorExtensions.x-rust-param-identifier}}}); + {{/isNullable}} + {{#isNullable}} + match {{{vendorExtensions.x-rust-param-identifier}}} { + Some(param_value) => { multipart_form = multipart_form.text("{{{baseName}}}", param_value{{#isArray}}.into_iter().map(|p| p.to_string()).collect::>().join(","){{/isArray}}.to_string()); }, + None => { multipart_form = multipart_form.text("{{{baseName}}}", ""); }, + } + {{/isNullable}} + {{/required}} + {{^required}} + if let Some(param_value) = {{{vendorExtensions.x-rust-param-identifier}}} { + {{#isPrimitiveType}} + multipart_form = multipart_form.text("{{{baseName}}}", param_value.to_string()); + {{/isPrimitiveType}} + {{^isPrimitiveType}} + multipart_form = multipart_form.text("{{{baseName}}}", serde_json::to_string(¶m_value)?); + {{/isPrimitiveType}} + } + {{/required}} + {{/isFile}} + {{/formParams}} + req_builder = req_builder.multipart(multipart_form); + {{/hasFormParams}} + {{/isMultipart}} + {{^isMultipart}} + {{#hasFormParams}} + let mut multipart_form_params = std::collections::HashMap::new(); + {{#formParams}} + {{#isFile}} + {{#required}} + {{^isNullable}} + multipart_form_params.insert("{{{baseName}}}", unimplemented!("File form param not supported with x-www-form-urlencoded content")); + {{/isNullable}} + {{#isNullable}} + match {{{vendorExtensions.x-rust-param-identifier}}} { + Some(param_value) => { multipart_form_params.insert("{{{baseName}}}", unimplemented!("File form param not supported with x-www-form-urlencoded content")); }, + None => { unimplemented!("Required nullable file form param not supported with x-www-form-urlencoded content"); }, + } + {{/isNullable}} + {{/required}} + {{^required}} + if let Some(param_value) = {{{vendorExtensions.x-rust-param-identifier}}} { + multipart_form_params.insert("{{{baseName}}}", unimplemented!("File form param not supported with x-www-form-urlencoded content")); + } + {{/required}} + {{/isFile}} + {{^isFile}} + {{#required}} + {{^isNullable}} + multipart_form_params.insert("{{{baseName}}}", {{{vendorExtensions.x-rust-param-identifier}}}{{#isArray}}.into_iter().map(|p| p.to_string()).collect::>().join(","){{/isArray}}.to_string()); + {{/isNullable}} + {{#isNullable}} + match {{{vendorExtensions.x-rust-param-identifier}}} { + Some(param_value) => { multipart_form_params.insert("{{{baseName}}}", param_value{{#isArray}}.into_iter().map(|p| p.to_string()).collect::>().join(","){{/isArray}}.to_string()); }, + None => { multipart_form_params.insert("{{{baseName}}}", ""); }, + } + {{/isNullable}} + {{/required}} + {{^required}} + if let Some(param_value) = {{{vendorExtensions.x-rust-param-identifier}}} { + multipart_form_params.insert("{{{baseName}}}", param_value{{#isArray}}.into_iter().map(|p| p.to_string()).collect::>().join(","){{/isArray}}.to_string()); + } + {{/required}} + {{/isFile}} + {{/formParams}} + req_builder = req_builder.form(&multipart_form_params); + {{/hasFormParams}} + {{/isMultipart}} + {{#hasBodyParam}} + {{#bodyParams}} + {{#isFile}} + {{#supportAsync}} + {{#required}} + let file = TokioFile::open({{{vendorExtensions.x-rust-param-identifier}}}).await?; + let stream = FramedRead::new(file, BytesCodec::new()); + req_builder = req_builder.body(reqwest::Body::wrap_stream(stream)); + {{/required}} + {{^required}} + if let Some(param_value) = {{{vendorExtensions.x-rust-param-identifier}}} { + let file = TokioFile::open(param_value).await?; + let stream = FramedRead::new(file, BytesCodec::new()); + req_builder = req_builder.body(reqwest::Body::wrap_stream(stream)); + } + {{/required}} + {{/supportAsync}} + {{^supportAsync}} + req_builder = req_builder.body({{{vendorExtensions.x-rust-param-identifier}}}); + {{/supportAsync}} + {{/isFile}} + {{^isFile}} + req_builder = req_builder.json(&{{{vendorExtensions.x-rust-param-identifier}}}); + {{/isFile}} + {{/bodyParams}} + {{/hasBodyParam}} + + let req = req_builder.build()?; + let resp = configuration.client.execute(req){{#supportAsync}}.await{{/supportAsync}}?; + + let status = resp.status(); + {{^supportMultipleResponses}} + {{^isResponseFile}} + {{#returnType}} + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + {{/returnType}} + {{/isResponseFile}} + {{/supportMultipleResponses}} + + if !status.is_client_error() && !status.is_server_error() { + {{^supportMultipleResponses}} + {{#isResponseFile}} + Ok(resp) + {{/isResponseFile}} + {{^isResponseFile}} + {{^returnType}} + Ok(()) + {{/returnType}} + {{#returnType}} + let content = resp.text(){{#supportAsync}}.await{{/supportAsync}}?; + match content_type { + {{^useSerdePathToError}} + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + {{/useSerdePathToError}} + {{#useSerdePathToError}} + ContentType::Json => serde_path_to_error::deserialize(&mut serde_json::Deserializer::from_str(&content)).map_err(Error::from), + {{/useSerdePathToError}} + {{#vendorExtensions.x-supports-plain-text}} + ContentType::Text => return Ok(content), + {{/vendorExtensions.x-supports-plain-text}} + {{^vendorExtensions.x-supports-plain-text}} + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `{{returnType}}`"))), + {{/vendorExtensions.x-supports-plain-text}} + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `{{returnType}}`")))), + } + {{/returnType}} + {{/isResponseFile}} + {{/supportMultipleResponses}} + {{#supportMultipleResponses}} + {{#isResponseFile}} + Ok(resp) + {{/isResponseFile}} + {{^isResponseFile}} + let content = resp.text(){{#supportAsync}}.await{{/supportAsync}}?; + let entity: Option<{{{operationIdCamelCase}}}Success> = serde_json::from_str(&content).ok(); + Ok(ResponseContent { status, content, entity }) + {{/isResponseFile}} + {{/supportMultipleResponses}} + } else { + let content = resp.text(){{#supportAsync}}.await{{/supportAsync}}?; + let entity: Option<{{{operationIdCamelCase}}}Error> = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +{{/operation}} +{{/operations}} diff --git a/templates/reqwest/api_mod.mustache b/templates/reqwest/api_mod.mustache new file mode 100644 index 0000000..ada95b7 --- /dev/null +++ b/templates/reqwest/api_mod.mustache @@ -0,0 +1,181 @@ +use std::error; +use std::fmt; +{{#withAWSV4Signature}} +use aws_sigv4; +{{/withAWSV4Signature}} + +#[derive(Debug, Clone)] +pub struct ResponseContent { + pub status: reqwest::StatusCode, + pub content: String, + pub entity: Option, +} + +#[derive(Debug)] +pub enum Error { + Reqwest(reqwest::Error), + {{#supportMiddleware}} + ReqwestMiddleware(reqwest_middleware::Error), + {{/supportMiddleware}} + Serde(serde_json::Error), + {{#useSerdePathToError}} + SerdePathToError(serde_path_to_error::Error), + {{/useSerdePathToError}} + Io(std::io::Error), + ResponseError(ResponseContent), + {{#withAWSV4Signature}} + AWSV4SignatureError(aws_sigv4::http_request::Error), + {{/withAWSV4Signature}} + {{#supportAsync}} + {{#supportTokenSource}} + TokenSource(Box), + {{/supportTokenSource}} + {{/supportAsync}} +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let (module, e) = match self { + Error::Reqwest(e) => ("reqwest", e.to_string()), + {{#supportMiddleware}} + Error::ReqwestMiddleware(e) => ("reqwest-middleware", e.to_string()), + {{/supportMiddleware}} + Error::Serde(e) => ("serde", e.to_string()), + {{#useSerdePathToError}} + Error::SerdePathToError(e) => ("serde", format!("{}: {}", e.path().to_string(), e.inner().to_string())), + {{/useSerdePathToError}} + Error::Io(e) => ("IO", e.to_string()), + Error::ResponseError(e) => ("response", format!("status code {}", e.status)), + {{#withAWSV4Signature}} + Error::AWSV4SignatureError(e) => ("aws v4 signature", e.to_string()), + {{/withAWSV4Signature}} + {{#supportAsync}} + {{#supportTokenSource}} + Error::TokenSource(e) => ("token source failure", e.to_string()), + {{/supportTokenSource}} + {{/supportAsync}} + }; + write!(f, "error in {}: {}", module, e) + } +} + +impl error::Error for Error { + fn source(&self) -> Option<&(dyn error::Error + 'static)> { + Some(match self { + Error::Reqwest(e) => e, + {{#supportMiddleware}} + Error::ReqwestMiddleware(e) => e, + {{/supportMiddleware}} + Error::Serde(e) => e, + {{#useSerdePathToError}} + Error::SerdePathToError(e) => e, + {{/useSerdePathToError}} + Error::Io(e) => e, + Error::ResponseError(_) => return None, + {{#withAWSV4Signature}} + Error::AWSV4SignatureError(_) => return None, + {{/withAWSV4Signature}} + {{#supportAsync}} + {{#supportTokenSource}} + Error::TokenSource(e) => &**e, + {{/supportTokenSource}} + {{/supportAsync}} + }) + } +} + +impl From for Error { + fn from(e: reqwest::Error) -> Self { + Error::Reqwest(e) + } +} + +{{#supportMiddleware}} +impl From for Error { + fn from(e: reqwest_middleware::Error) -> Self { + Error::ReqwestMiddleware(e) + } +} + +{{/supportMiddleware}} +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +{{#useSerdePathToError}} +impl From> for Error { + fn from(e: serde_path_to_error::Error) -> Self { + Error::SerdePathToError(e) + } +} + +{{/useSerdePathToError}} +impl From for Error { + fn from(e: std::io::Error) -> Self { + Error::Io(e) + } +} + +pub fn urlencode>(s: T) -> String { + ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() +} + +pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { + if let serde_json::Value::Object(object) = value { + let mut params = vec![]; + + for (key, value) in object { + match value { + serde_json::Value::Object(_) => params.append(&mut parse_deep_object( + &format!("{}[{}]", prefix, key), + value, + )), + serde_json::Value::Array(array) => { + for (i, value) in array.iter().enumerate() { + params.append(&mut parse_deep_object( + &format!("{}[{}][{}]", prefix, key, i), + value, + )); + } + }, + serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), + _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), + } + } + + return params; + } + + unimplemented!("Only objects are supported with style=deepObject") +} + +/// Internal use only +/// A content type supported by this client. +#[allow(dead_code)] +enum ContentType { + Json, + Text, + Unsupported(String) +} + +impl From<&str> for ContentType { + fn from(content_type: &str) -> Self { + if content_type.starts_with("application") && content_type.contains("json") { + return Self::Json; + } else if content_type.starts_with("text/plain") { + return Self::Text; + } else { + return Self::Unsupported(content_type.to_string()); + } + } +} + +{{#apiInfo}} +{{#apis}} +pub mod {{{classFilename}}}; +{{/apis}} +{{/apiInfo}} + +pub mod configuration; diff --git a/templates/reqwest/configuration.mustache b/templates/reqwest/configuration.mustache new file mode 100644 index 0000000..afb40ab --- /dev/null +++ b/templates/reqwest/configuration.mustache @@ -0,0 +1,122 @@ +{{>partial_header}} + +{{#withAWSV4Signature}} +use std::time::SystemTime; +use aws_sigv4::http_request::{sign, SigningSettings, SigningParams, SignableRequest}; +use http; +use secrecy::{SecretString, ExposeSecret}; +{{/withAWSV4Signature}} +{{#supportTokenSource}} +use std::sync::Arc; +use google_cloud_token::TokenSource; +use async_trait::async_trait; +{{/supportTokenSource}} + +#[derive(Debug, Clone)] +pub struct Configuration { + pub base_path: String, + pub user_agent: Option, + pub client: {{#supportMiddleware}}reqwest_middleware::ClientWithMiddleware{{/supportMiddleware}}{{^supportMiddleware}}reqwest{{^supportAsync}}::blocking{{/supportAsync}}::Client{{/supportMiddleware}}, + {{^supportTokenSource}} + pub basic_auth: Option, + pub oauth_access_token: Option, + pub bearer_access_token: Option, + pub api_key: Option, + {{/supportTokenSource}} + {{#withAWSV4Signature}} + pub aws_v4_key: Option, + {{/withAWSV4Signature}} + {{#supportAsync}} + {{#supportTokenSource}} + pub token_source: Arc, + {{/supportTokenSource}} + {{/supportAsync}} +} +{{^supportTokenSource}} + +pub type BasicAuth = (String, Option); + +#[derive(Debug, Clone)] +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} +{{/supportTokenSource}} + +{{#withAWSV4Signature}} +#[derive(Debug, Clone)] +pub struct AWSv4Key { + pub access_key: String, + pub secret_key: SecretString, + pub region: String, + pub service: String, +} + +impl AWSv4Key { + pub fn sign(&self, uri: &str, method: &str, body: &str) -> Result, aws_sigv4::http_request::Error> { + let request = http::Request::builder() + .uri(uri) + .method(method) + .body(body).unwrap(); + let signing_settings = SigningSettings::default(); + let signing_params = SigningParams::builder() + .access_key(self.access_key.as_str()) + .secret_key(self.secret_key.expose_secret().as_str()) + .region(self.region.as_str()) + .service_name(self.service.as_str()) + .time(SystemTime::now()) + .settings(signing_settings) + .build() + .unwrap(); + let signable_request = SignableRequest::from(&request); + let (mut signing_instructions, _signature) = sign(signable_request, &signing_params)?.into_parts(); + let mut additional_headers = Vec::<(String, String)>::new(); + if let Some(new_headers) = signing_instructions.take_headers() { + for (name, value) in new_headers.into_iter() { + additional_headers.push((name.expect("header should have name").to_string(), + value.to_str().expect("header value should be a string").to_string())); + } + } + Ok(additional_headers) + } +} +{{/withAWSV4Signature}} + +impl Configuration { + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Default for Configuration { + fn default() -> Self { + Configuration { + base_path: "{{{basePath}}}".to_owned(), + user_agent: {{#httpUserAgent}}Some("{{{.}}}".to_owned()){{/httpUserAgent}}{{^httpUserAgent}}Some("OpenAPI-Generator/{{{version}}}/rust".to_owned()){{/httpUserAgent}}, + client: {{#supportMiddleware}}reqwest_middleware::ClientBuilder::new(reqwest{{^supportAsync}}::blocking{{/supportAsync}}::Client::builder().cookie_store(true).build().unwrap()).build(){{/supportMiddleware}}{{^supportMiddleware}}reqwest{{^supportAsync}}::blocking{{/supportAsync}}::Client::new(){{/supportMiddleware}}, + {{^supportTokenSource}} + basic_auth: None, + oauth_access_token: None, + bearer_access_token: None, + api_key: None, + {{/supportTokenSource}} + {{#withAWSV4Signature}} + aws_v4_key: None, + {{/withAWSV4Signature}} + {{#supportTokenSource}} + token_source: Arc::new(NoopTokenSource{}), + {{/supportTokenSource}} + } + } +} +{{#supportTokenSource}} +#[derive(Debug)] +struct NoopTokenSource{} + +#[async_trait] +impl TokenSource for NoopTokenSource { + async fn token(&self) -> Result> { + panic!("This is dummy token source. You can use TokenSourceProvider from 'google_cloud_auth' crate, or any other compatible crate.") + } +} +{{/supportTokenSource}}